Repository navigation
Conversation
…way stand-in, and AS-2 trust test seam The identity harness's AS-1 issues per-call ID-JAGs, checking actor tokens through a test-supplied ActorValidator; FaultTransport fails, drops, or intercepts requests to any authorization server; and a minimal gateway stand-in needs a bearer token. ToolHiveConfig.AS2Trust, built only through mcpbrokertest, lets tests make the real AS-2 trust the harness's AS-1. Co-authored-by: Mecatl <noreply@mecatl.dev>
…before a grant AuthorizeCallRequest carries the run, method, server, tool, arguments hash, and rejected attempt; Authorization adds the expiry and attempt ID. The broker checks the session, a rejection report, the grant (no_grant), the credential, and the gateway's servers in design order, recording each refusal; a call passing every check is still denied until steps (7) and (8). Co-authored-by: Mecatl <noreply@mecatl.dev>
…and gateway token A call that passes the checks exchanges the session's refresh token at AS-1 for an ID-JAG (IDJAGIssuer), records it, and redeems it at the gateway's AS-2 (GatewayAuthServer) for a token used by that call alone, retrying once per design rule. AS-2 is bound late with BindGatewayAS2; authserverclient implements both ports. Co-authored-by: Mecatl <noreply@mecatl.dev>
…ID-JAG and gateway token Co-Authored-By: mecatl <noreply@mecatl.dev>
…ID-JAG and gateway token Co-Authored-By: mecatl <noreply@mecatl.dev>
…checks before a grant Co-Authored-By: mecatl <noreply@mecatl.dev>
ChrisJBurns
force-pushed
the
split/2535-3-per-call-flow
branch
2 times, most recently
from
November 16, 2026 12:00
be15152 to
352a4d3
Compare
ChrisJBurns
pushed a commit
that referenced
this pull request
Nov 16, 2026
gatewayTokenExpiry read the gateway token's exp through readJWTRef, which gives up when the token has no jti, so ExpiresAt could outlast the token. readJWTExp reads exp on its own. Originally #2792, by Jakub Hrozek; folded into the #2535 follow-up after (cherry picked from commit f437b4e) Co-authored-by: Mecatl <noreply@mecatl.dev>
ChrisJBurns
pushed a commit
that referenced
this pull request
Nov 16, 2026
The rejected-token retry test changed only the tool; it now checks a report that differs in each field of the attempt key, including a second agent in the same session. Originally #2792, by Jakub Hrozek; folded into the #2535 follow-up after (cherry picked from commit 385ef77) Co-authored-by: Mecatl <noreply@mecatl.dev>
ChrisJBurns
pushed a commit
that referenced
this pull request
Nov 16, 2026
…be ExpiresAt The ledger test now checks each call-key field on its own, and the ExpiresAt comment says it is the broker's use-before deadline, not the token's own expiry. Originally #2792, by Jakub Hrozek; folded into the #2535 follow-up after (cherry picked from commit b41ccf2) Co-authored-by: Mecatl <noreply@mecatl.dev>
Contributor
|
Thanks @jhrozek. #2785 and #2786 merged before these could be autosquashed, so all three commits are now in #2794 with you as their author and
Each original patch is present in #2794's branch, and its tests pass. Closing this in favour of #2794. |
ChrisJBurns
pushed a commit
that referenced
this pull request
Nov 16, 2026
gatewayTokenExpiry read the gateway token's exp through readJWTRef, which gives up when the token has no jti, so ExpiresAt could outlast the token. readJWTExp reads exp on its own. Originally #2792, by Jakub Hrozek; folded into the #2535 follow-up after (cherry picked from commit f437b4e) Co-authored-by: Mecatl <noreply@mecatl.dev>
ChrisJBurns
pushed a commit
that referenced
this pull request
Nov 16, 2026
The rejected-token retry test changed only the tool; it now checks a report that differs in each field of the attempt key, including a second agent in the same session. Originally #2792, by Jakub Hrozek; folded into the #2535 follow-up after (cherry picked from commit 385ef77) Co-authored-by: Mecatl <noreply@mecatl.dev>
ChrisJBurns
pushed a commit
that referenced
this pull request
Nov 16, 2026
…be ExpiresAt The ledger test now checks each call-key field on its own, and the ExpiresAt comment says it is the broker's use-before deadline, not the token's own expiry. Originally #2792, by Jakub Hrozek; folded into the #2535 follow-up after (cherry picked from commit b41ccf2) Co-authored-by: Mecatl <noreply@mecatl.dev>
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.
Review fixes for the lower commits of the per-call authorization stack (#2784 → #2785 → #2786 → #2783), found while reviewing #2783. Each commit is a
fixup!for the stack commit that introduced the lines it changes, sogit rebase --autosquashfolds it into the right place.f437b4e4fe0a48c57833(#2786)expwhen it has nojti385ef77c2a0a48c57833(#2786)b41ccf2423e903f3e09e(#2785)ExpiresAtcommentThe gateway token's
expwas ignored without ajtigatewayTokenExpirylimitsAuthorization.ExpiresAtby the gateway token's ownexp. It read thatexpthroughreadJWTRef, which returnsfalseas soon asjtiis missing, before it readsexp. Take a gateway JWT withexpone minute away, nojtiand noexpires_in, redeemed from an ID-JAG that expires in two minutes.ExpiresAtcame out at two minutes, so a caller could send a token the gateway already considers expired, and use up its one rejection retry on it.The new
readJWTExpreadsexpwithout needing ajti.readJWTRefandreadIDJAGstill require ajtiwhere a record reference is made.TestAuthorizeCallGatewayTokenExpiryWithoutJTIfailed before the fix (09:02, want 09:01) and passes after. ToolHive's AS-2 sends both ajtiandexpires_intoday, so this matters only for another AS-2.Attempt-mismatch tests only changed the tool
TestAuthorizeCallRejectedTokenRetryandTestMemoryAttemptsMatchTheCallchecked that a rejection report for a different call is refused, but the only field they changed wasTool. If the operation ID, method, server, argument hash or agent were dropped from the attempt key, the tests would still pass, and an attempt could be reused for a different call. Both tests now run once percallKeyfield:AuthorizeCallmakes no further AS-1 or AS-2 exchange.methodcan't be changed on its own throughAuthorizeCall: atools/listrequest must not carry a tool or argument hash. So the method case there changes all three, and the ledger test coversmethodon its own.ExpiresAtcommentThe comment said
ExpiresAtis when the gateway token expires. It's the broker's use-before deadline: the earliest of the ID-JAG'sexp, AS-2'sexpires_inand the token's ownexp. The authorization server may keep the token valid longer. Comment only.Testing
Focused runs on
internal/identitybroker: the touched tests pass, andgo vet,gofmtandgolangci-lintreport nothing. I didn't run the full suite. An independent check traced the old code path and confirmed that each new test case depends on the field it changes.Landing
This branch is cut from
split/2535-3-per-call-flow. Theb41ccf2423fixup targets #2785's commit, so if #2785 is merged on its own, that commit needs to go tosplit/2535-2-contracttoo. After squashing, rebase #2783 onto the result.API compatibility
No wire change.
AuthorizeCallis an in-process Go contract. This changes the computedExpiresAtvalue only for gateway JWTs without ajti.🤖 Generated with Claude Code