-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Add an easier way to get the current firewall configuration #46066
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
What's the best way to make the low-deps check passing? |
By requiring However, this does signal the design flaw of the current implementation (which is a flaw with the Please note that this is purely a -1 for the implementation, I think the DX problem highlighted in the issue is worth fixing. @chalasr this is the second time we have a nice DX improvement that introduces lots of coupling through the |
Having the |
Big 👍 for moving the helper to SecurityBundle. |
…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
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 like it, thanks @Kocal!
Thank you @Kocal. |
@Kocal Nice work. Thx for implementing this 👍 |
|
||
$container = $this->createContainer('security.firewall.map', $firewallMap); | ||
|
||
$security = new \Symfony\Component\Security\Core\Security($container); |
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.
Bad rebase :) See #46619
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.
Thx!
…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
Added a new method
Security#getFirewallConfig($request)
to easily get the firewall configuration associated to theRequest
.The firewall name can be accessed through
$security->getFirewallConfig($request)?->getName()
.