Restore legacy default for OAuth2 upstream auth method - #6648
Merged
Merged
Conversation
jhrozek
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
aponcedeleonch,
blkt,
jerm-dro,
rdimitrov,
reyortiz3 and
tgrunnagle
as code owners
September 11, 2026 17:10
jerm-dro
previously approved these changes
Sep 11, 2026
reyortiz3
previously approved these changes
Sep 11, 2026
PR #6543 added token_endpoint_auth_method to OAuth2UpstreamRunConfig but also made an unset field silently default to client_secret_basic whenever a secret was configured, flipping existing pre-registered upstream clients from POST-body credentials to HTTP Basic auth with no opt-in. Remove the implicit default so an unset field keeps the historical POST-body behavior; operators now opt in to client_secret_basic explicitly. Field, validation, and CRD exposure from #6543 are kept.
jhrozek
force-pushed
the
worktree-6543-revert
branch
from
September 11, 2026 17:34
00cc612 to
9f0f0d1
Compare
reyortiz3
approved these changes
Sep 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6648 +/- ##
==========================================
- Coverage 78.98% 78.97% -0.01%
==========================================
Files 782 782
Lines 78067 78065 -2
==========================================
- Hits 61660 61653 -7
- Misses 16402 16407 +5
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1 task
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.
Summary
#6543 added
token_endpoint_auth_methodtoOAuth2UpstreamRunConfigso pre-registered OAuth2 upstream clients could selectclient_secret_basic, but it also made an unset field silently default toclient_secret_basicwhenever a client secret was configured. That flips every existing pre-registered upstream client with a secret from sending credentials in the token-request POST body (AuthStyleInParams, the historical behavior) to HTTP Basic auth — with no opt-in. This project does not allow backwards-incompatible changes, so rather than reverting #6543 outright, this restores the legacy default while keeping the new capability:buildPureOAuth2Configno longer substitutesclient_secret_basicfor an emptyTokenEndpointAuthMethod— an unset field now stays empty, whichauthStyleFromMethodmaps to the historical POST-body auth style, exactly as before Use Basic auth for OAuth2 upstreams #6543.token_endpoint_auth_methodfield, its validation (validateTokenEndpointAuthMethod,isConfidentialAuthMethod, the empty-secret checks), and the CRD field exposure from Use Basic auth for OAuth2 upstreams #6543 are all kept unchanged — operators can still opt in toclient_secret_basicexplicitly, which was the actual fix for Pre-registered OAuth2 upstream clients never send client_secret_basic #6536.pkg/authserver/config.go,pkg/authserver/upstream/oauth2.go, and the operator CRD type that incorrectly described the removed implicit default, plus the docs/CRD YAML regenerated from those comments (task docs,task crdref-gen,task operator-manifests).TestBuildPureOAuth2Configcases inembeddedauthserver_test.goto assert the restored default and added explicit coverage for bothclient_secret_basicandclient_secret_post.Verified the DCR path (
applyResolutionToOAuth2Config) and the operator config-conversion path don't leak the same implicit-default problem — both were already correct/unaffected.Type of change
Test plan
task test)task testpasses clean across the repo.TestBuildPureOAuth2Configcovers: unset method + configured secret → stays empty (regression test for this fix); unset method + no secret → stays empty; explicitclient_secret_postpreserved; explicitclient_secret_basicpreserved.API Compatibility
v1beta1API (only doc-comment wording changed on the CRD field added by Use Basic auth for OAuth2 upstreams #6543; the field, its type, and its behavior are unchanged from that PR).Does this introduce a user-facing change?
Yes: restores the pre-#6543 behavior for pre-registered OAuth2 upstream clients that don't set
token_endpoint_auth_method— they go back to sending credentials in the token-request POST body by default, instead of #6543's silent switch to HTTP Basic auth. Operators who wantclient_secret_basiccan still set it explicitly viatoken_endpoint_auth_method: client_secret_basic.Special notes for reviewers
An independent Opus review pass confirmed the fix correctly restores the legacy default with no regressions or leaks via the DCR or operator paths, and flagged two doc-comment issues (a stale comment in
config.gothat still described the removed defaulting, and a duplicated/contradictory sentence inoauth2.go), both fixed here.🤖 Generated with Claude Code