-
Notifications
You must be signed in to change notification settings - Fork 17
IBX-8323: Reworked RepositoryAuthenticationProvider and moved its logic to a dedicated subscriber #396
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
Merged
Conversation
This file contains hidden or 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
0c1a674 to
80e3526
Compare
af2f5fe to
bfdf393
Compare
alongosz
approved these changes
Jul 4, 2024
ViniTou
approved these changes
Jul 5, 2024
Steveb-p
reviewed
Jul 5, 2024
...C/Symfony/Security/Authentication/EventSubscriber/RepositoryUserAuthenticationSubscriber.php
Show resolved
Hide resolved
...mfony/Security/Authentication/EventSubscriber/RepositoryUserAuthenticationSubscriberTest.php
Outdated
Show resolved
Hide resolved
...mfony/Security/Authentication/EventSubscriber/RepositoryUserAuthenticationSubscriberTest.php
Show resolved
Hide resolved
…ic to a dedicated subscriber
bfdf393 to
85806bd
Compare
bcaac47 to
bf62516
Compare
|
|
I also dropped |
Steveb-p
approved these changes
Jul 5, 2024
This was referenced Jul 8, 2024
katarzynazawada
approved these changes
Jul 9, 2024
barw4
pushed a commit
that referenced
this pull request
Oct 17, 2024
…ic to a dedicated subscriber (#396) For more details see https://issues.ibexa.co/browse/IBX-8323 and #396 Key changes: * Reworked RepositoryAuthenticationProvider and moved its logic to a dedicated subscriber
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Something isn't working
Doc needed
The changes require some documentation
Feature
New feature request
QA approved
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.



Description:
RememberMeRepositoryAuthenticationProvideris another part of our codebase relying on deprecated security layer. It basically covers some additional checks performed on repository users like "forgot password redirect" being the subject of the underlying bug.In order to replace the deprecated approach I did the following:
SecurityPassas the original class being replaced will be removed in Symfony 6 anyway,ibexa.security.authentication.constant_auth_timesetting from mentioned compiler pass and provided the same default value,RepositoryUserAuthenticationSubscriberthat will take over checks performed in the provider,The choice of
CheckPassportEventis intentional - I wanted to have possibility to stop and resume the authenticator process and according to my research this was the only suitable event for such purpose. Excerpt from Symfony doc:Note
Getting rid of injecting user into our
PermissionResolveris intentional - the entire system got it covered within recently introduced https://github.com/ibexa/core/blob/main/src/lib/MVC/Symfony/Security/Authentication/EventSubscriber/OnAuthenticationTokenCreatedRepositoryUserSubscriber.php#L30.The main part I am concerned about and have little knowledge of is:
I don't think we have any documented use-cases for that part but still believe it should be approached differently if needed. Will discuss that internally but also summon @adamwojs to check if he remembers what it was all about.
Update:
We believe this is already covered by Symfony and was needed long time ago to make sure that user password change performed in another browser tab is effectively caught. Most likely we are fine due to usage of
Symfony\Component\Security\Core\User\EquatableInterfacewhich tends to be used to test if two objects are equal in security and re-authentication context.For QA:
Documentation:
Dropping
RememberMeRepositoryAuthenticationProvidershould be mentioned.