Enforce oauth2.plugins as an allow-list for OAuth2 login providers - #13866
Open
Damans227 wants to merge 1 commit into
Open
Enforce oauth2.plugins as an allow-list for OAuth2 login providers#13866Damans227 wants to merge 1 commit into
Damans227 wants to merge 1 commit into
Conversation
Collaborator
Author
|
@blueorangutan package |
|
@Damans227 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13866 +/- ##
============================================
+ Coverage 19.64% 19.65% +0.01%
- Complexity 19785 19803 +18
============================================
Files 6368 6368
Lines 574889 574905 +16
Branches 70353 70358 +5
============================================
+ Hits 112935 112996 +61
+ Misses 449683 449635 -48
- Partials 12271 12274 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18841 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #13862.
oauth2.plugins(defaultgoogle,github, described as "List of OAuth plugins") was declared as aConfigKeybut never read anywhere. Actual provider availability was determined entirely by which Spring beans exist plusoauth2.plugins.exclude, so changingoauth2.pluginswas a complete no-op, an admin could set it togithub,keycloakandgooglewould remain fully functional.This wires it up as an allow-list: a provider must be named in
oauth2.pluginsto be usable.OAuth2AuthManagerImpl.getUserOAuth2AuthenticationProvider()now rejects any provider not in the configured list (covers both theoauthloginandverifyOAuthCodeAndGetUserpaths, since both resolve the provider through this method).OAuth2AuthManagerImpl.listUserOAuth2AuthenticationProviders()filters the same way, solistOauthProviderno longer reports a disallowed provider as enabled.Added test coverage for the allow-list check itself and for both call sites.