Repository navigation
feat(identitybroker): issue the gateway's ID-JAGs at the hosted AS-1 - #2856
Merged
Merged
Conversation
jhrozek
approved these changes
Nov 18, 2026
ChrisJBurns
force-pushed
the
feat/identitybroker-as1-issues-idjags
branch
from
November 18, 2026 15:06
3dd0c4b to
3d56093
Compare
Base automatically changed from
feat/identitybroker-as1-actor-validator
to
main
November 18, 2026 15:28
When the test-only gateway servers are set, the app derives the AS-2 the bundled MCP broker will set up and gives the hosted AS-1's delegate client ID-JAG issuance for it, with act.iss the broker's agent trust domain. After the broker is built, AS-1's actor-token check is bound to its CredentialVerifier through IdentityBrokerAS1.ActorTokens, which replaces the test-only hook; a failed bind, or an AS-2 other than the target, fails startup. Production still configures no target. The per-call tests move from the harness AS-1 to the real AS-1, and a mecak8s test shows an expired credential refused by AS-1, renewed, and the call retried once. Only the revocation-reason tests stay on the harness, until #2568. Closes #2654. Co-authored-by: Mecatl <noreply@mecatl.dev>
The production test now asks the hosted AS-1 whether it issues ID-JAGs, which a call refused before AS-1 could not show, and derives the target from the config it builds with. The gateway variant checks the opposite. The second-bind test fails unless the bind itself refused the build. Co-authored-by: Mecatl <noreply@mecatl.dev>
ChrisJBurns
force-pushed
the
feat/identitybroker-as1-issues-idjags
branch
from
November 18, 2026 15:33
c278e0d to
677245e
Compare
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.
Third and last PR of #2654: the hosted AS-1 issues the gateway's per-call ID-JAGs, checked by the identity broker's verifier, and the per-call tests move off the harness AS-1. Stacked on #2840.
What
Wiring (
internal/app):IdentityBrokerGatewayServersis set, the app derives the AS-2 the bundled MCP broker will set up (mcpbroker.AS2Endpoints, from the callback URL, using the same functions AS-2 construction uses) before building the identity broker. The hosted AS-1's delegate client then gets ID-JAG issuance for that target, withact.iss = identitybroker.ActorIssuer(<the broker's trust domain>).IdentityBrokerAS1.ActorTokens.UseCredentialVerifier(broker)binds AS-1's actor-token check. A failed bind fails startup.ActorTokensreplaces the test-onlyUseCredentialVerifierhook, so tests with an external real AS-1 bind the same way production does.Broker core:
identitybroker.ActorIssuer(trustDomain)buildsact.iss(spiffe://<trust domain>) in one place;VerifiedAgent.ActorIDuses it.Tests moved to the real AS-1 (
as1servertest.StartwithIssueIDJAGs, users signed in before the build so AS-2's test trust can name theirsub):internal/appgateway tests;actis now{iss: spiffe://<td>, sub: spiffe://<td>/agent/<ag_>}.TestIdentityBrokerGatewayCallAgainstRealAS1,TestIdentityBrokerSessionToolCallThroughGateway): ID-JAGs are observed on the wire (claims, per-call operation, count) instead of through the harness.internal/identitybrokerauthorize integration tests,authserverclientID-JAG and AS-2 redemption tests.New tests:
TestIdentityBrokerGatewayCallRenewsAnExpiredCredential(mecak8s): the real AS-1 refuses an expired agent credential withactor_token_expired, the broker renews it, and the call is retried once and reaches the vMCP.TestHostedAS1IssuesTheGatewaysIDJAGs: the hosted AS-1 issues an ID-JAG naming the agent (act,aud,resource,client_id,expno later than the credential).TestHostedAS1IssuesNoIDJAGsInProduction,TestDeriveGatewayIDJAGTarget,TestBuildFailsWhenAS1sActorTokenCheckCannotBind,TestBuildMCPBrokerRefusesAS2OtherThanTheIDJAGTarget.Kept on the harness AS-1 (Shortcut, removed by #2568): the two
TestAuthorizeCallRevokedRulesAtAS1subtests that need real revocation reasons, andTestIdentityBrokerAgainstOfflineHarness, which mints another client's token and moves AS-1's clock.Shortcut
sub, which the hosted AS-1 creates only at first sign-in. The hosted AS-1 is proved up to ID-JAG issuance.Effect on other tickets
Assessed against every open phase 1 and phase 2 ticket. No scope changes; wording only:
#2527, #2741, #2551, #2553 and #2555 change because of #2834's opaque IDs, not this PR.
Checks
task lint: 0 issues.go test -raceforinternal/identitybroker/...,internal/testutil/identityharness/...,internal/adapter/mcpbroker/..., and the identity and gateway tests ininternal/appandcmd/mecak8s: pass.GOWORK=off -mod=readonly -race ./...): every package passes exceptdeploy/helm/mecatl-executionanddeploy/mecatl-execution-kind, whose six failing tests fail identically onmainin this environment (local Helm and shell tooling).act.iss, and the new expiry test (no renewal, oractor_token_expiredmapped todenied).Issue relationship
Closes #2654
API compatibility
None: internal packages only, no wire or public API change.