feat(a2a): honor auth.oidcDiscoveryUrl for in-cluster JWKS fetch - #99
Merged
Conversation
The A2A server now consumes the optional auth.oidcDiscoveryUrl field frozen in values-interface.schema.json (FuzeFront#364 "Option B"): when set, signing keys are fetched from that in-cluster discovery URL's jwks_uri, while the token `iss` claim is STILL validated against the public oidcIssuerUrl. When unset, discovery is derived from oidcIssuerUrl exactly as before (purely additive). - config: parse oidcDiscoveryUrl into AuthConfig.oidc_discovery_url (default None) - runtime._build_verifier: injectable discovery-fetch / JWKS-client / decoder; _resolve_jwks_url picks the override vs the unchanged issuer-derived path; explicit iss anchoring to oidcIssuerUrl regardless of key source - unit tests: override used for key fetch when set; falls back when unset; iss rejected when != oidcIssuerUrl even with the override; config parsing Consumes the frozen contract; does not modify contracts/a2a/v1/**. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session-Id: 17fb89fd-3579-433b-a6c4-9c9e7f3ec549
izzywdev
marked this pull request as ready for review
July 23, 2026 23:02
izzywdev
added a commit
that referenced
this pull request
Jul 23, 2026
…etch (#102) Semgrep OSS (dynamic-urllib-use-detected) flagged the urllib fetch of the config-supplied oidcDiscoveryUrl: urllib also honours file://, so a dynamic discovery URL could read local files. oidcDiscoveryUrl is trusted operator config, but guarding the scheme up front is cheap, correct hardening. - runtime._require_http_url: reject any URL whose scheme is not in {http, https} (file://, ftp://, schemeless) with the existing discovery-config-error path. - _resolve_jwks_url guards oidcDiscoveryUrl BEFORE the fetch (fetch never happens for a bad scheme) and constrains the discovery doc's jwks_uri to http(s) too. - _http_get_json guards the URL before urllib.urlopen (defense in depth). - Behavior identical for valid http/https URLs. Unit tests: file://ftp://schemeless oidcDiscoveryUrl raises the config error and the fetch/JWKS-client never runs; a file:// jwks_uri from discovery is rejected. Follow-up to #99. Consumes the frozen contract; contracts/a2a/v1/** untouched. Claude-Session-Id: 17fb89fd-3579-433b-a6c4-9c9e7f3ec549 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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
Makes the A2A server honor the optional
auth.oidcDiscoveryUrlfield (frozen invalues-interface.schema.json, #96) so it can fetch OIDC discovery + JWKS from an in-cluster URL while still anchoring trust to the public issuer — FuzeFront#364 "Option B".Behavior (matches the field's normative description)
oidcDiscoveryUrlset → fetch the discovery document at that URL, use itsjwks_urifor keys (typicallyhttp://authentik-server.<ns>.svc.cluster.local:9000/.../.well-known/openid-configuration).oidcIssuerUrlexactly as before (unchanged default path; purely additive).issis validated againstoidcIssuerUrl(NOT the discovery host),audagainstaudience, caller read fromcallerClaim. Keys come from in-cluster; trust stays anchored to the public issuer string.Changes
config.py: parseoidcDiscoveryUrl→AuthConfig.oidc_discovery_url(defaultNone).runtime.py:_resolve_jwks_urlselects override-vs-issuer-derived;_build_verifiertakes injectable discovery-fetch / JWKS-client / decoder and enforces explicitiss == oidcIssuerUrlregardless of key source.tests/test_runtime_verifier.py,tests/test_config.py): override used for key fetch when set; falls back when unset;issrejected when != issuer even with the override; config parsing.Scope
Consumes the frozen contract — does not touch
contracts/a2a/v1/**. Out of scope: #93 values wiring (devops), prod SealedSecrets (human), registration/token-decode.🤖 Generated with Claude Code