-
Notifications
You must be signed in to change notification settings - Fork 162
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
[1.x] Add forward compat layer for changed logout listener configuration #350
Open
mbabker
wants to merge
1
commit into
markitosgv:master
Choose a base branch
from
mbabker:2.x-logout-listener-config-compat
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We should set it to null here and run a deprecation if the boolean has not been defined in order to activate it by default in 2.0 without BC.
Isn't there a way to get the bundle configuration here or in the
createAuthenticator
in order to activate it by default when the 'logout_firewall' is null ? This would allow us to keep the default value on 'logout_firewall' without creating a BC and to launch a deprecation when it is defined.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'd only do that if we needed the value to actually have a configuration (the same way the deprecation if you don't have the model class set in the bundle config works), because the 1.x branch supports both Symfony 4.4 and 5.4 we can't sanely keep the listener turned on by default for both workflows (which would result in the listener being registered on both the global event dispatcher and the firewall specific event dispatcher, and I have no idea how Symfony deals with merging and de-duping stuff for the firewall specific event dispatcher but I know it does move some stuff around).
We can get to container parameters, but we can't get the processed
$config
array. For 1.x, I'm choosing to default to the listener being off by default with this backport and then restoring the current 1.1 behavior of it being active by default for 2.0 when we only have a single authentication flow to worry about.As for the
logout_firewall
config node, that one's a bit of a pain point to work around. It defaulting to "api" really should've been something added to the Flex recipe for this bundle and not hardcoded into the bundle configuration. So we can't rely on checking if its value matches the current default of "api", we don't know if the user explicitly wanted that or if it was implicitly set to that by way of not configuring it. Changing its default to null gives us a better gauge of whether the node is explicitly configured or not and lets us do stuff with that information at compile time.