Skip to content

oidcjwt: fall back to the issuer origin when the advertised jwks_uri … - #3833

Open
ADHDerzzz wants to merge 1 commit into
agent-substrate:mainfrom
ADHDerzzz:personal/zsy/jwks-issuer-origin-fallback
Open

ADHDerzzz wants to merge 1 commit into
agent-substrate:mainfrom
ADHDerzzz:personal/zsy/jwks-issuer-origin-fallback

Conversation

@ADHDerzzz

Copy link
Copy Markdown

…is unreachable

Managed Kubernetes offerings may publish an OIDC discovery document whose jwks_uri points at an API-server load balancer VIP that is unreachable from the pod network (observed on ACK, where the SLB whitelist covers node subnets but not pod CIDRs). Every JWT verification then fails with signing keys unavailable.

The JWKS endpoint is served by the same API server that just served the discovery document, so when fetching the advertised jwks_uri fails and its origin differs from the issuer's, retry once with the same path on the issuer's origin. Issuers whose jwks_uri is same-origin (the common case) see no behavior change.

Why is this needed? (Or link the issue. Open one first for features, API, install or CI changes.)

Fixes #

AI use:

  • Tests pass
  • Docs updated

…is unreachable

Managed Kubernetes offerings may publish an OIDC discovery document whose
jwks_uri points at an API-server load balancer VIP that is unreachable from
the pod network (observed on ACK, where the SLB whitelist covers node
subnets but not pod CIDRs). Every JWT verification then fails with signing
keys unavailable.

The JWKS endpoint is served by the same API server that just served the
discovery document, so when fetching the advertised jwks_uri fails and its
origin differs from the issuer's, retry once with the same path on the
issuer's origin. Issuers whose jwks_uri is same-origin (the common case)
see no behavior change.

Signed-off-by: zhousiyu <zhousiyu@kanzhun.com>

This branch has not been deployed

No deployments
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.

1 participant