Add JWT-bearer assertion grant - #6391
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6391 +/- ##
==========================================
- Coverage 77.72% 77.70% -0.02%
==========================================
Files 748 750 +2
Lines 71826 72563 +737
==========================================
+ Hits 55827 56387 +560
- Misses 15994 16171 +177
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4b606e6 to
d34682b
Compare
d34682b to
15a3f77
Compare
15a3f77 to
78939f2
Compare
8670611 to
97a15ef
Compare
97a15ef to
6c3d528
Compare
6c3d528 to
c02553c
Compare
c02553c to
13bcb80
Compare
13bcb80 to
a472668
Compare
samuv
left a comment
There was a problem hiding this comment.
Thanks for the thorough implementation and the unusually clear trust-model documentation. I found six issues worth addressing before merge. The most immediate one is that the operator validation converter drops JWTBearerGrant, which causes grant-only configurations to be rejected. I also left focused comments on supplied Basic credentials, OAuth error classification, replay-store failures, Redis synthetic-client identification, and mixed RFC 7523/RFC 8693 configuration validation.
Checklist
- Tests: CI unit, integration, and E2E checks are currently passing. A reconciliation/status assertion is still needed for the grant-only operator path.
- Docs: Updated and detailed.
- Registry impact: None.
- Security: Client authentication and replay-store error handling need attention.
- Backwards compatibility: The v1beta1 additions are additive, but mixed-mode validation should reject unusable configurations at admission time.
a472668 to
a28562f
Compare
|
Thanks for the thorough review — all six findings confirmed and fixed:
Replied inline on each thread with the specific fix. CI's green again. |
Allow trusted external issuers to exchange signed RFC 7523 assertions directly for bounded ToolHive access tokens, without a registered OAuth client. Validate the issuer, signature, authorization-server audience, assertion age, and exact subject/resource binding. Consume each assertion before issuance to prevent replay, including assertions without a jti claim. Use a synthetic client only to keep the clientless request persistence-safe. Expose issuer policy through MCPExternalAuthConfig, share trusted-issuer validation with RFC 8693 token exchange, and advertise the grant only when configured. Fixes #6336 Fixes #6337
a28562f to
28d33a4
Compare
samuv
left a comment
There was a problem hiding this comment.
Thanks for the follow-up. I rechecked the two remaining items on 28d33a4:
CanSkipClientAuthnow keys offBasicAuth()okalone, including an empty-username header. The test helper no longer injects a password into credential-free cases, and there is an explicit empty-username regression.- Mixed RFC 7523/RFC 8693 validation now treats non-empty
allowedActorsas a delegation signal in both CEL andvalidateDelegationPolicy, with admission and runtime coverage.
The earlier findings (grant conversion, replay-store errors, invalid_grant classification, and the reserved synthetic prefix) still look solid. CI is green. LGTM.
Summary
MCPExternalAuthConfig, publish it in discovery and generated API schemas only when enabled, and share issuer validation/JWKS state with token exchange.Fixes #6336
Fixes #6337
Type of change
Test plan
task test)task test-e2e)task lint-fix)task lintpassed.task test-e2ewas attempted but is blocked before feature setup by the locally installed ToolHive Desktop CLI conflict guard; it fails across the suite, independent of this branch.API Compatibility
v1beta1API, OR theapi-break-allowedlabel is applied and the migration guidance is described above.Changes
pkg/authserver/server/tokenexchange/pkg/authserver/storage/cmd/thv-operator/and CRD artifactsdocs/test/e2e/Does this introduce a user-facing change?
Yes. Administrators can configure trusted external issuers to exchange signed RFC 7523 assertions for short-lived, resource-bound ToolHive access tokens without OAuth client credentials.
Implementation plan
Approved implementation plan
Special notes for reviewers
acceptedAudiencesidentifies authorization-server identities, not resources. Startup rejects an overlap withallowedAudiencesso a resource-scoped upstream access token cannot be used as a clientless assertion.