-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Add a method in the security helper to ease programmatic login (#40662) #41274
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
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
5da7eb1
to
6158fc2
Compare
6158fc2
to
bd0881d
Compare
Hey! I think @fancyweb has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
Hello @johnkrovitch!
You are assuming that we always will have fourth parameter from \Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension::createFirewall() but please look into this line of code: symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php Line 365 in 2fe4442
This also should be adjusted in your code I think. |
9109437
to
aabf498
Compare
Thanks for your response. It is fixed. |
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.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.
I have a few suggestions regarding backwards compatibility and semantic versioning.
b02ef09
to
1071c90
Compare
1071c90
to
e1961dc
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.
Some comments. A CHANGELOG entry will be needed also
c2878ab
to
87b0044
Compare
The security change log has been updated |
c510d9b
to
5e756a6
Compare
Now with a functional test. Remaining comments addressed. PR ready |
949aa71
to
f31bf35
Compare
2ff2369
to
78eaf86
Compare
78eaf86
to
37efa72
Compare
It took time, but here we go, this is in now. Thank you very much @johnkrovitch. |
Thanks for this. The Shouldn't the |
…to SecurityBundle (chalasr) This PR was merged into the 6.2 branch. Discussion ---------- [Security][SecurityBundle] Move the `Security` helper to SecurityBundle | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Fixes symfony/symfony#46066 (comment) | License | MIT | Doc PR | todo The `Security` helper is a high-level service providing an easy access to commonly-needed features coming from various low-level abstractions. Basically, it's a facade. Based on this, it makes sense to me to make it available only via the full-stack framework, as proposed by Wouter in symfony/symfony#46066 (comment). This unlocks #46066, symfony/symfony#41274 and symfony/symfony#41406. /cc @wouterj @johnkrovitch @Kocal Commits ------- 7b91bcb068 [Security] Move the `Security` helper to SecurityBundle
This PR aims to ease the programmatic login using the Security helper, to fix (#40662).
A simple method has been added to the Security helper. It take a user and an optional Authenticator. If no authenticator is passed, we find all authenticators for the current firewall. Then if only one is matching we use this one. If several authenticators are found, an exception is thrown to avoid any magic (by choosing the first for example), the user HAS to provide an authenticator.
Thanks