-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Rename User to InMemoryUser #40443
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
Conversation
3614510
to
5228300
Compare
56b2a0c
to
8773b6b
Compare
The travis failure with deps=high is expected. This is ready |
5a42ae2
to
f24f084
Compare
Thanks for the review @rosier, all comments have been addressed. |
src/Symfony/Component/Security/Core/User/InMemoryUserChecker.php
Outdated
Show resolved
Hide resolved
throw $ex; | ||
} | ||
|
||
// @deprecated since Symfony 5.3 |
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.
What about NOT supporting the deprecated stuff in the new class?
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.
Given this makes the security.user_checker
service use the new class, not supporting those checks would be a behavior change. As this is about security and all is done via configuration (you don't need to manipulate those classes to use them), I think it's worth keeping those checks until 6.0
...onent/Routing/Tests/Fixtures/AttributesFixtures/AttributesClassParamAfterCommaController.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Core/Tests/Authentication/Token/SwitchUserTokenTest.php
Outdated
Show resolved
Hide resolved
883cd52
to
1c6cdd3
Compare
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.
Thanks Robin!
Am I missing something, or are the 2 src/Symfony/Component/Security/Core/Tests/Authentication/Token/Fixtures/switch-user-token-*.txt
files not used?
src/Symfony/Component/Security/Core/Tests/User/InMemoryUserTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Core/Tests/User/InMemoryUserCheckerTest.php
Outdated
Show resolved
Hide resolved
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.
Sorry, I selected the wrong choice 🤦
Only one of two, actually! It's used in SwitchUserListenerTest. Thanks for the review Wouter, all fixed. |
Are the broken tests related to the changes here? |
@fabpot yes but only deps=high fails, I think it will be fixed once merged. |
Thank you @chalasr. |
This PR aims to clarify that the
User
class should only be used by theInMemoryUserProvider
, as documented:symfony/src/Symfony/Component/Security/Core/User/User.php
Lines 15 to 17 in c06a76c
It also renames
UserChecker
toInMemoryUserChecker
because it only works with the in-memory user class:symfony/src/Symfony/Component/Security/Core/User/UserChecker.php
Lines 31 to 32 in c06a76c