Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:6.2fromKocal:feat/GH-46015
Jun 7, 2022
Merged

[Security] Add an easier way to get the current firewall configuration#46066

fabpot merged 1 commit intosymfony:6.2fromKocal:feat/GH-46015
Jun 7, 2022

Conversation

Kocal
Copy link
Member

@KocalKocal commentedApr 16, 2022
edited
Loading

QA
Branch?6.1
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#46015
LicenseMIT
Doc PRsymfony/symfony-docs#...

Added a new methodSecurity#getFirewallConfig($request) to easily get the firewall configuration associated to theRequest.

The firewall name can be accessed through$security->getFirewallConfig($request)?->getName().

alexander-schranz and novotnicek reacted with heart emoji
@Kocal
Copy link
MemberAuthor

What's the best way to make the low-deps check passing?

@KocalKocal requested a review fromchalasrApril 16, 2022 21:03
@wouterj
Copy link
Member

wouterj commentedApr 16, 2022
edited
Loading

What's the best way to make the low-deps check passing?

By requiring^6.2 in the composer.json (or skipping the test on lower versions).

However, this does signal the design flaw of the current implementation (which is a flaw with theSecurity class as a whole, but highlighted more by this change): We now have a class inSecurity\Core that depends on aFirewallMap andFirewallConfig class fromSecurityBundle, which depend on aFirewallMap fromSecurity\Http. Imho, that sadly is a no go, so 👎 for the moment.

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 theSecurity helper class (ref#41274 (comment)). What do you think about deprecating this helper class inSecurity\Core and moving it completely to the SecurityBundle? That directly resolves coupling issues, and only reduces DX for standalone users (all methods in the class are little helpers to retrieve information more easily, none add missing functionality), which - to be honest - already suffer from a bad DX. And given the currently coupling to SecurityBundle service names in the class, I don't expect standalone users are using the class at the moment.

Kocal and chalasr reacted with thumbs up emoji

@Kocal
Copy link
MemberAuthor

Kocal commentedApr 16, 2022
edited
Loading

Having theSecurity class in theSecurityBundle makes more sense to me, I was dubitative when working on the feature.

@chalasr
Copy link
Member

Big 👍 for moving the helper to SecurityBundle.

@chalasrchalasr modified the milestones:6.1,6.2Apr 17, 2022
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull requestJun 5, 2022
…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       |Fixessymfony/symfony#46066 (comment)| License       | MIT| Doc PR        | todoThe `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 insymfony/symfony#46066 (comment).This unlocks #46066,symfony/symfony#41274 andsymfony/symfony#41406./cc@wouterj@johnkrovitch@KocalCommits-------7b91bcb068 [Security] Move the `Security` helper to SecurityBundle
@wouterjwouterj reopened thisJun 5, 2022
@wouterj
Copy link
Member

The merge tool was a bit trigger happy closing this PR when#46094 got merged, reopening.

@Kocal do you have time to rebash and finish this PR for 6.2, now the helper is moved to the security bundle?

@Kocal
Copy link
MemberAuthor

Kocal commentedJun 5, 2022
edited
Loading

I'm glad that#46094 has been merged, nice work@chalasr :)

@wouterj the PR has been rebased and modified in consequence.

alexander-schranz reacted with thumbs up emojichalasr reacted with heart emoji

Copy link
Member

@wouterjwouterj left a 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!

@fabpot
Copy link
Member

Thank you@Kocal.

@alexander-schranz
Copy link
Contributor

@Kocal Nice work. Thx for implementing this 👍


$container = $this->createContainer('security.firewall.map', $firewallMap);

$security = new \Symfony\Component\Security\Core\Security($container);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Bad rebase :) See#46619

Kocal reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thx!

@KocalKocal deleted the feat/GH-46015 branchJune 8, 2022 09:11
@fabpotfabpot mentioned this pull requestOct 24, 2022
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull requestJul 28, 2023
…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       |Fixessymfony/symfony#46066 (comment)| License       | MIT| Doc PR        | todoThe `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 insymfony/symfony#46066 (comment).This unlocks #46066,symfony/symfony#41274 andsymfony/symfony#41406./cc@wouterj@johnkrovitch@KocalCommits-------7b91bcb068 [Security] Move the `Security` helper to SecurityBundle
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@chalasrchalasrchalasr left review comments

@fabpotfabpotfabpot approved these changes

@wouterjwouterjwouterj approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
6.2
Development

Successfully merging this pull request may close these issues.

[Security] Add an easier way to get the current firewall name
6 participants
@Kocal@wouterj@chalasr@fabpot@alexander-schranz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp