Enforce oauth2.plugins.exclude live, with domain-level scoping - #13867
Open
Damans227 wants to merge 1 commit into
Open
Enforce oauth2.plugins.exclude live, with domain-level scoping#13867Damans227 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 #13867 +/- ##
============================================
+ Coverage 3.41% 19.65% +16.23%
- Complexity 0 19801 +19801
============================================
Files 487 6368 +5881
Lines 41867 574916 +533049
Branches 7912 70358 +62446
============================================
+ Hits 1429 112975 +111546
- Misses 40238 449676 +409438
- Partials 200 12265 +12065
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 18842 |
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 #13859. Fixes #13860.
oauth2.plugins.excludewas only checked once, at Spring bean registration time, byExtensionRegistry. A config change didn't take effect without a restart. Even a restart didn't reliably help. The exclude value may not be loaded from the DB yet when the registry beans initialize. The registry also has no concept of domain at all.This replaces that with a live check in
OAuth2AuthManagerImpl. It runs on every login/verify attempt instead of once at boot.isProviderExcluded(providerName, domainId)checks the globaloauth2.plugins.excludelist first. If a domainId is given, it then checks a new domain-scoped override of the same key.oauth2.plugins.excludeis nowConfigKey.Scope.Domain(strict scope, no hierarchy walking). It can be set per domain in addition to globally.getUserOAuth2AuthenticationProvider()gained a(providerName, domainId)overload. BothOAuth2UserAuthenticator.authenticate()andOAuth2AuthManagerImpl.verifySecretCodeAndFetchEmail()use it, since those are the two places that resolve a provider for an actual login attempt. The existing single-arg overload still exists. It delegates withdomainId = null, global scope only.listUserOAuth2AuthenticationProviders()now filters out excluded providers too.listOauthProviderstops reporting an excluded provider as available.Added test coverage for the union logic, the domain-scoped config key, and both call sites.