Repository navigation
fix(authserver): bind stored upstream tokens to provider issuer - #7344
Open
aloneangel45 wants to merge 3 commits into
Open
aloneangel45 wants to merge 3 commits into
aloneangel45 wants to merge 3 commits into
Conversation
Contributor
|
Please follow CONTRIBUTING.md - ask to be assigned to an issue before working on it. This ensures the work is actually important for the project at the moment and that maintainers have the capacity to review. |
Contributor
Author
Contributor
Author
|
Resolved merge conflicts with
Verified locally:
|
…issuer-binding # Conflicts: # pkg/authserver/server/handlers/handler.go # pkg/authserver/server_impl.go
This branch has not been deployed
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
storage.UpstreamTokens(Issuer) across both memory and Redis storage backends (json:"issuer,omitempty").upstreamTokenRefresher, refresh-grant validation inupstreamRefreshGuard, refresh-token carry-forward inmaybeCarryForwardRefreshToken, and chain satisfaction innextMissingUpstreamwhen a stored row's recordedIssuerdoes not match the upstream's currently configured authority—preventing stale IdP A refresh tokens from being disclosed to a repointed IdP B.Issuer(refreshes against the current provider and stamps its issuer onto the stored row).invalid_grantrefusal, callback/device carry-forward refusal, unexpired chain-leg invalidation, and Redis persistence.Fixes #7333
Type of change
Test plan
go test ./pkg/authserver/server/handlers ./pkg/authserver/storage ./pkg/authserver/upstream ./pkg/auth/upstreamtokenandgo test -count=1 ./pkg/authserver -run "TestUpstreamTokenRefresher|TestUpstreamRefreshGuard|TestRefreshGrant|TestProviderIssuer|TestRejectedRefreshes|TestNewServer|TestUpdateUpstreamClientCredentials|TestIntegration")task test-e2e— not run)gofmt -won changed files,go vet ./pkg/authserver/... ./pkg/auth/...;golangci-lintnot installed locally)Changes
pkg/authserver/storage/types.goIssuertoUpstreamTokens,ErrIssuerMismatch, andUpstreamIssuerMatchespkg/authserver/storage/memory.go,redis.goUpstreamTokens.Issuer(backwards-compatibleomitempty)pkg/authserver/upstream/oauth2.go,oidc.goIssuerIdentifiercapability andProviderIssuerhelper without wideningOAuth2Providerpkg/authserver/server_impl.go,server/handlers/handler.goNamedUpstreaminto refresher, guard, and chain evaluationpkg/authserver/server/handlers/callback.go,device_verification.goIssueron initial write and enforceUpstreamIssuerMatchesinmaybeCarryForwardRefreshTokenpkg/authserver/refresher.go,refresh_grant_guard.goErrIssuerMismatchas non-transient refusal, and stamp legacy rows on first matchpkg/authserver/*issuer*_test.goSpecial notes for reviewers
upstream.OAuth2Providerinterface is untouched;IssuerIdentifieris an optional capability mirroringIdleConnectionCloser.pkg/authserver/...andpkg/auth/upstreamtokensuites pass after final edits; in the unfilteredpkg/authserverrun, only pre-existing Windows clock-resolution testTestDelegatedAgentFlowfailed on reused client-assertionjti.