-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle] Deprecate auto picking the first provider #24378
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
[SecurityBundle] Deprecate auto picking the first provider #24378
Conversation
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.
👍
@@ -358,6 +358,10 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a | |||
} | |||
$defaultProvider = $providerIds[$normalizedName]; | |||
} else { | |||
if (count($providerIds) > 1) { | |||
@trigger_error(sprintf('Not configuring explicitly the provider on "%s" firewall is ambiguous as there is more than one registered provider. Using the first configured provider is deprecated since 3.4 and it will throw an exception on 4.0 instead.', $id), E_USER_DEPRECATED); |
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 suggest
Firewall "$id" has no "provider" set but multiple providers exist. Using the first configured provider ($defaultProvider) is deprecated since 3.4 and will throw an exception in 4.0, set the "provider" key on the firewall instead.
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.
Perfect, thanks 👍
when no provider is explicitly configured on a firewall
Thank you @ogizanagi. |
…ider (ogizanagi) This PR was merged into the 3.4 branch. Discussion ---------- [SecurityBundle] Deprecate auto picking the first provider when no provider is explicitly configured on a firewall | Q | A | ------------- | --- | Branch? | 3.4 <!-- see comment below --> | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | yes <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | https://symfony-devs.slack.com/archives/C3A2XAQ20/p1506626210000345 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A From @Pierstoval on Slack: > Hey, guys, I learnt a few days ago that if you don't specify a user provider in a firewall configuration, the security will use the first one in the list. Don't anyone think specifying the user provider should be mandatory ? Or at least mandatory if we have more than one provider registered? - [x] UPGRADE files - [x] CHANGELOG - [x] Fix other tests - [x] Removal PR #24380 Commits ------- 2d1e334 [SecurityBundle] Deprecate auto picking the first provider
…r (ogizanagi) This PR was merged into the 4.0-dev branch. Discussion ---------- [SecurityBundle] Remove auto picking the first provider when no provider is explicitly configured on a firewall | Q | A | ------------- | --- | Branch? | master <!-- see comment below --> | Bug fix? | no | New feature? | yes <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | yes | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #24378 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A After #24378 Commits ------- aeb57ab [SecurityBundle] Remove auto picking the first provider
when no provider is explicitly configured on a firewall
From @Pierstoval on Slack: