Shopify / Shopify/shopify-app-template-php
Enable 'web' Auth Guard, Implement Authenticatable for 'Session' Model, Enable Feature + Unit Testing, and Upgrade to Laravel v10
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 340
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
Overview
- Enabling the
webauth guard - Extending the
Illuminate\Foundation\Auth\User(a.k.aAuthenticatable) class for theSessionmodel - Enabling feature and unit testing
- Upgrading Laravel to version 10 (currently running version 8)
Type
- Changes to existing features
Motivation
What inspired this feature request? What problems were you facing?
-
webAuth Guard Disabled: Thewebauth guard is currently disabled, which makes it impossible to access the currently authenticated session through standard Laravel methods such as$request->user(),Auth::user(), orauth(). This hinders developers' ability to work with the currently authenticated session seamlessly. I have figured out a way to make this work with Shopify sessions and middleware by implementing a customShopifyGuard. -
SessionModel Doesn't extendIlluminate\Foundation\Auth\User: This means that developers cannot use Laravel's built-in authentication features with theSessionmodel, leading to limitations in feature testing and session authentication. This is needed in order to make theShopifyGuardwork. -
Feature and Unit Testing Isn't Configured: Currently, there's no
testsdirectory. This sets a bad precedent, as it communicates that either testing cannot be achieved with the project or it is not considerably important quality for a Shopify app. Well tested apps produce fewer bugs and translate to a better Shopify experience for all merchants and to the Shopify brand's image. I created thetestsdirectory and correspondingTestCase.phpandCreatesApplication.phpclasses that come with every fresh installation of Laravel. And now WithSessionextendingIlluminate\Foundation\Auth\User, we can now do$this->actingAs($session)to run feature tests which was not possible before. -
Outdated Laravel Version: The repository is still running Laravel version 8, which has reached its end of life and is no longer receiving bug and security fixes. Upgrading to Laravel version 10 is essential to ensure the security and stability of the application. I've done this as well.
I've already implemented the necessary code changes to address these issues and would like to contribute them to the repository.
However, I would like to welcome your feedback on this before doing so. Please let me know your thoughts. I believe these changes would be highly desired by the many Laravel developers like myself that enjoy using this project but wished it contained the many out-of-the-box features we've come to love and enjoy from Laravel.
Area
- Add any relevant
Area: <area>labels to this issue
Checklist
- I have described this feature request in a way that is actionable (if possible)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the requested web auth guard, Session model inheritance, tests/TestCase.php, CreatesApplication.php, and Laravel 8-to-10 upgrade described in the issue. Start by checking the existing authentication and dependency configuration, then verify that feature and unit tests can authenticate a Session and the application runs on Laravel 10. Done means the combined scope is agreed and all tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- authentication, backend, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100