-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Lazy load user providers #23295
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
chalasr
commented
Jun 25, 2017
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | n/a |
License | MIT |
Doc PR | n/a |
067288a
to
183214f
Compare
183214f
to
22a43f6
Compare
build failure with high deps is normal |
/** | ||
* @param iterable $providers | ||
*/ | ||
public function __construct(/* iterable */ $providers) |
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.
the comment should be removed
@@ -44,7 +44,7 @@ class ContextListener implements ListenerInterface | |||
private $registered; | |||
private $trustResolver; | |||
|
|||
public function __construct(TokenStorageInterface $tokenStorage, array $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null) | |||
public function __construct(TokenStorageInterface $tokenStorage, /* iterable */ $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null) |
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.
comment to be removed, that's the job of a docblock, we should not follow this practice IMHO
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.
with minor comments
e52986c
to
70bcfe2
Compare
@nicolas-grekas comments addressed. build failure unrelated (see #23360) |
@@ -47,19 +47,6 @@ public function testItRequiresContextKey() | |||
); | |||
} | |||
|
|||
/** | |||
* @expectedException \InvalidArgumentException | |||
* @expectedExceptionMessage User provider "stdClass" must implement "Symfony\Component\Security\Core\User\UserProviderInterface |
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.
we should still have a test covering this case. You have not removed the exception entirely. You just moved it later in the usage.
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.
test readded
70bcfe2
to
4a98272
Compare
4a98272
to
d7914a6
Compare
ready. |
* @param EventDispatcherInterface|null $dispatcher | ||
* @param AuthenticationTrustResolverInterface|null $trustResolver | ||
*/ | ||
public function __construct(TokenStorageInterface $tokenStorage, $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null) |
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.
full docblock to be removed + iterable
typehint to be added to the $userProviders
arg when merging into master.
/** | ||
* @param iterable|UserProviderInterface[] $providers | ||
*/ | ||
public function __construct($providers) |
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.
same, docblock to typehint when merging into master
Thank you @chalasr. |
This PR was merged into the 3.4 branch. Discussion ---------- [Security] Lazy load user providers | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- d7914a6 [Security] Lazy load user providers