-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-8138: Refactored deprecated loadUserByUsername
method in custom providers
#400
Merged
alongosz
merged 9 commits into
main
from
ibx-8138/refactor-deprecated-loadUserByUsername
Jul 23, 2024
Merged
IBX-8138: Refactored deprecated loadUserByUsername
method in custom providers
#400
alongosz
merged 9 commits into
main
from
ibx-8138/refactor-deprecated-loadUserByUsername
Jul 23, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alongosz
force-pushed
the
ibx-8138/refactor-deprecated-loadUserByUsername
branch
from
July 5, 2024 08:50
f3108e5
to
5c5f441
Compare
Steveb-p
approved these changes
Jul 5, 2024
Co-authored-by: Paweł Niedzielski <[email protected]>
Quality Gate passedIssues Measures |
konradoboza
approved these changes
Jul 5, 2024
mikadamczyk
approved these changes
Jul 9, 2024
tomaszszopinski
approved these changes
Jul 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA approved on IbexaDXP commerce 5.0
barw4
pushed a commit
that referenced
this pull request
Oct 17, 2024
For more details see https://issues.ibexa.co/browse/IBX-8138 and #400 Key changes: * Implemented `loadUserByIdentifier` in custom User providers * Aligned Username and Email providers with Symfony interface * [Tests] Dropped usage of deprecated `loadUserByUsername` method * [Tests] Dropped redundancy in EmailProvider and UsernameProvider tests * [PHPDoc] Added missing throw annotations to `UserService::loadUserBy*` methods * [PHPStan] Aligned baseline with the changes --------- Co-Authored-By: Paweł Niedzielski <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related PRs:
Description:
Seems Symfony deprecated
\Symfony\Component\Security\Core\User\UserProviderInterface::loadUserByUsername
method in favor of loadUserByIdentifier.A fix for that is not a straightforward rector (though there's one for that in Symfony 6.0 sets) because we have our own custom providers which would need to implement that method.
Added it here. Also seems there was custom handling of anonymous user which I beliveve changed and should be already fixed. I needed to drop that code because of Symfony interface parameter type mismatch on
loadUserByUsername
method (it cannot be an object).I've also fixed some redundant WET (not DRY ;-) ) test cases.
Changelog:
loadUserByUsername
methodFor QA:
Probably the same approach as in case of other security layers PRs.
These providers can be configured via:
config/packages/security.yaml
By default it's
ibexa.security.user_provider.username
, but you can useibexa.security.user_provider.email
to test the second provider.Regression run: ibexa/commerce#911
Documentation:
Seems no changes are required. Those are exposed as service names configurable via Symfony security bundle and documented by us here https://doc.ibexa.co/en/master/users/login_methods/. This behavior doesn't change.