Skip to content

[SecurityBundle] Method to retrieve firewall config by name #20585

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

Closed

Conversation

julienfalque
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

The FirewallMap class allows to retrieve the config for the firewall that matches a given request only. This PR adds a method to retrieve the config of any firewall by its name.

@ogizanagi
Copy link
Contributor

ogizanagi commented Nov 21, 2016

Just wondering if we shouldn't investigate about @ro0NL 's comment about creating something like a FirewallConfigManager/Registry instead:

FirewallConfigRegistry::get(string $name) : FirewallConfig
FirewallConfigRegistry::fromRequest(Request $request) : FirewallConfig
FirewallConfigRegistry::current() : FirewallConfig
FirewallConfigRegistry::all() : FirewallConfig[]
FirewallConfigRegistry::inContext(string $context) : FirewallConfig[]

Maybe we could even remove the config from the FirewallContext and FirewallMap in favor of using the FirewallConfigRegistry as main entrypoint.

@julienfalque
Copy link
Contributor Author

This would definitely be a better approach. Is someone working on it already?

@ogizanagi
Copy link
Contributor

ogizanagi commented Nov 21, 2016

Nobody AFAIK. I'd like to give a look tomorrow if I've got some time.
But if you're pleased by this idea in order to rework your PR (or a new one) differently, feel free to do so!

@ogizanagi
Copy link
Contributor

@julienfalque : See #20591 && #20592

@chalasr
Copy link
Member

chalasr commented Nov 25, 2016

After all, listing available firewalls is not a common need, as well as accessing the firewall configuration (usage being mostly internal at the moment). If some other use cases appear, we could think to reopen this PRs but for now, isn't it doable to decorate the FirewallMap service from user code?

@nicolas-grekas nicolas-grekas added this to the 3.x milestone Dec 6, 2016
@fabpot fabpot closed this Mar 1, 2017
@julienfalque julienfalque deleted the firewall-config-by-name branch March 1, 2017 16:01
@nicolas-grekas nicolas-grekas modified the milestones: 3.x, 3.3 Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants