Skip to content

Simplify authserver's upstream provider interface#3638

Open
jhrozek wants to merge 1 commit intomainfrom
auth-proxy-pr-14-upstream-iface
Open

Simplify authserver's upstream provider interface#3638
jhrozek wants to merge 1 commit intomainfrom
auth-proxy-pr-14-upstream-iface

Conversation

@jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Feb 5, 2026

Follow-up to an earlier discussion in a previous PR: #3580 (comment)

Combine ExchangeCode and ResolveIdentity into atomic ExchangeCodeForIdentity

Merge the two-step exchange+identity flow into a single interface method to prevent OIDC nonce validation from being accidentally skipped. This ensures replay protection is always enforced when exchanging authorization codes with OIDC providers.

The OAuth2Provider interface shrinks from 6 to 4 methods by removing ExchangeCode, ResolveIdentity, and FetchUserInfo (now package-private). The UserInfo struct is also made private and moved to oauth2.go.

Large PR Justification

  • renames and simplifies an interface implemented by 2 modules along with tests and mocks. There are no logical changes here.

@github-actions github-actions bot added the size/XL Extra large PR: 1000+ lines changed label Feb 5, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large PR Detected

This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.

How to unblock this PR:

Add a section to your PR description with the following format:

## Large PR Justification

[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformation

Alternative:

Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.

See our Contributing Guidelines for more details.


This review will be automatically dismissed once you add the justification section.

@jhrozek jhrozek force-pushed the auth-proxy-pr-14-upstream-iface branch from 12f5e82 to a28c0f4 Compare February 5, 2026 23:44
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Feb 5, 2026
@github-actions github-actions bot dismissed their stale review February 5, 2026 23:45

Large PR justification has been provided. Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review.

Follow-up to an earlier discussion in a previous PR:
#3580 (comment)

Combine ExchangeCode and ResolveIdentity into atomic ExchangeCodeForIdentity

Merge the two-step exchange+identity flow into a single interface method
to prevent OIDC nonce validation from being accidentally skipped. This
ensures replay protection is always enforced when exchanging authorization
codes with OIDC providers.

The OAuth2Provider interface shrinks from 6 to 4 methods by removing
ExchangeCode, ResolveIdentity, and FetchUserInfo (now package-private).
The UserInfo struct is also made private and moved to oauth2.go.
@jhrozek jhrozek force-pushed the auth-proxy-pr-14-upstream-iface branch from a28c0f4 to a7b2fb6 Compare February 6, 2026 09:26
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Feb 6, 2026
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 89.18919% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.96%. Comparing base (788057b) to head (a7b2fb6).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pkg/authserver/upstream/oauth2.go 87.50% 1 Missing and 1 partial ⚠️
pkg/authserver/upstream/oidc.go 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3638      +/-   ##
==========================================
+ Coverage   65.75%   65.96%   +0.20%     
==========================================
  Files         411      413       +2     
  Lines       40805    41062     +257     
==========================================
+ Hits        26833    27086     +253     
+ Misses      11882    11881       -1     
- Partials     2090     2095       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra large PR: 1000+ lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants