fix(oauth): propagate postLoginRedirectAllowlist to the OAuth manager#990
Merged
Merged
Conversation
The parsed oauth.mcpClient.postLoginRedirectAllowlist never reached the OAuth proxy handler: both field-by-field config conversions on the way (internal/app building aggregator.OAuthProxyConfig, and the aggregator manager rebuilding config.OAuthMCPClientConfig for oauth.NewManager) dropped the field, so the allowlist was always empty in deployments and every redirect request was rejected.
fiunchinho
marked this pull request as ready for review
July 23, 2026 16:00
fiunchinho
enabled auto-merge (squash)
July 23, 2026 16:02
paurosello
approved these changes
Jul 23, 2026
fiunchinho
added a commit
that referenced
this pull request
Jul 23, 2026
…onfig duplication (#991) * fix(oauth): carry CIMD config to the OAuth manager and collapse the config duplication The CIMD block was dropped in the same field-by-field conversions that lost postLoginRedirectAllowlist (#990): operator-configured cimd.scopes never reached the served CIMD document, and a custom cimd.path could skip CIMD self-hosting or mount it at the wrong path because the client ID was derived with the real path while the OAuth manager recomputed it with the defaulted one. Instead of adding one more hand-copied field, remove the conversion chain: AggregatorConfig now carries the merged config.OAuthMCPClientConfig unconverted (aggregator.OAuthProxyConfig is deleted), and the serve-flag merge starts from the parsed config value and only overrides the flagged fields, so future oauth.mcpClient fields propagate without per-field plumbing. * fix: gofmt alignment in services.go
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.
What
Copies
oauth.mcpClient.postLoginRedirectAllowlistthrough the two field-by-field config conversions that sit between the parsed YAML config andoauth.NewManager:internal/app/services.go— the mergedOAuthMCPClientConfigand theaggregator.OAuthProxyConfigliteral built from it,internal/aggregator/types.go— newPostLoginRedirectAllowlistfield onOAuthProxyConfig,internal/aggregator/manager.go— theOAuthMCPClientConfigrebuilt foroauth.NewManager.Why
The post-login redirect feature (#978) and its chart rendering (#989) are dead in every deployment: the allowlist is parsed from the config file but dropped on the way to the handler, so
Handler.redirectAllowedalways sees an empty list and rejects everyredirectrequest on/oauth/proxy/startwithRejecting post-login redirect target not in allowlist. Connector logins then degrade to the static success page instead of 303-ing back to the caller (e.g. klaus-gateway's/connectors/completelanding, klaus-gateway#175 / #184), so the Slack connector auto-resume never fires.Observed on gazelle with muster v1.3.0:
muster-configcarries the correct allowlist entry (shared-configs#695), but the startup log never showsPost-login redirect allowlist enabled with N entriesand the rejection warning fires on every sign-in. The existing tests constructOAuthMCPClientConfigdirectly and so never cross these mapping sites, which is how the gap survived.Verification
go build ./...andgo test ./internal/aggregator/ ./internal/app/ ./internal/oauth/ ./internal/config/green. After deploy, startup must logPost-login redirect allowlist enabled with 1 entriesand a connector sign-in started from a Slack Connect button must land on the gateway's/connectors/completepage. The allowlist isn't observable through any exported surface, so no propagation unit test is included — happy to add an accessor + test if you'd rather pin this.