Skip to content

fix(oauth): propagate postLoginRedirectAllowlist to the OAuth manager#990

Merged
fiunchinho merged 1 commit into
mainfrom
fix-post-login-redirect-allowlist-propagation
Jul 23, 2026
Merged

fix(oauth): propagate postLoginRedirectAllowlist to the OAuth manager#990
fiunchinho merged 1 commit into
mainfrom
fix-post-login-redirect-allowlist-propagation

Conversation

@fiunchinho

Copy link
Copy Markdown
Member

What

Copies oauth.mcpClient.postLoginRedirectAllowlist through the two field-by-field config conversions that sit between the parsed YAML config and oauth.NewManager:

  • internal/app/services.go — the merged OAuthMCPClientConfig and the aggregator.OAuthProxyConfig literal built from it,
  • internal/aggregator/types.go — new PostLoginRedirectAllowlist field on OAuthProxyConfig,
  • internal/aggregator/manager.go — the OAuthMCPClientConfig rebuilt for oauth.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.redirectAllowed always sees an empty list and rejects every redirect request on /oauth/proxy/start with Rejecting 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/complete landing, klaus-gateway#175 / #184), so the Slack connector auto-resume never fires.

Observed on gazelle with muster v1.3.0: muster-config carries the correct allowlist entry (shared-configs#695), but the startup log never shows Post-login redirect allowlist enabled with N entries and the rejection warning fires on every sign-in. The existing tests construct OAuthMCPClientConfig directly and so never cross these mapping sites, which is how the gap survived.

Verification

go build ./... and go test ./internal/aggregator/ ./internal/app/ ./internal/oauth/ ./internal/config/ green. After deploy, startup must log Post-login redirect allowlist enabled with 1 entries and a connector sign-in started from a Slack Connect button must land on the gateway's /connectors/complete page. 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.

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 fiunchinho self-assigned this Jul 23, 2026
@fiunchinho
fiunchinho marked this pull request as ready for review July 23, 2026 16:00
@fiunchinho
fiunchinho requested a review from a team as a code owner July 23, 2026 16:00
@fiunchinho
fiunchinho enabled auto-merge (squash) July 23, 2026 16:02
@fiunchinho
fiunchinho merged commit 7690a2c into main Jul 23, 2026
14 checks passed
@fiunchinho
fiunchinho deleted the fix-post-login-redirect-allowlist-propagation branch July 23, 2026 16:09
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants