Skip to content

E2E verifies injected actor JWTs against the key set ate-idp-server serves - #2606

Open
Max Thompson (thompsonmax) wants to merge 1 commit into
agent-substrate:mainfrom
thompsonmax:actor-jwt-oidc-e2e
Open

Max Thompson (thompsonmax) wants to merge 1 commit into
agent-substrate:mainfrom
thompsonmax:actor-jwt-oidc-e2e

Conversation

@thompsonmax

@thompsonmax Max Thompson (thompsonmax) commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1756.

  • The egresscredinject suite now verifies the actor JWT the egress gateway injects, not just its claims. It reads iss, fetches the discovery document and key set from ate-idp-server, and checks the signature, issuer and audience with oidcjwt, the verifier ate-api-server uses. With E2E checks the actor JWTs the egress gateway injects #2256, now on main, that covers the whole path: the gateway mints and injects the token, and a relying party can verify it against the published keys.
  • e2e.IDPHTTPClient reaches ate-idp-server through a port-forward to the idp Service and checks its certificate against the service-DNS trust bundle.
  • An earlier version minted its own token as the e2e client. Main now enforces authz by default and only the egress gateway may call MintActorJwt, so the test verifies an injected token instead.

For reviewers: the issuer comes from the token's iss, not from install config, so the test also checks that ate-idp-server serves the issuer ate-api-server signs with.

Testing: unit tests, lint and both e2e jobs pass in CI on this head, and the e2e suite verifies the injected token on gVisor and micro-VM. CI's pool is ES256, so RS256 isn't covered.

AI use: AI-assisted draft, reviewed by me.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

@thompsonmax
Max Thompson (thompsonmax) force-pushed the actor-jwt-oidc-e2e branch 4 times, most recently from d1b1773 to 757fb18 Compare October 16, 2026 17:50
@thompsonmax
Max Thompson (thompsonmax) marked this pull request as ready for review October 16, 2026 18:16
@thompsonmax
Max Thompson (thompsonmax) force-pushed the actor-jwt-oidc-e2e branch 3 times, most recently from 77d46c3 to 1399911 Compare October 19, 2026 16:08
@thompsonmax Max Thompson (thompsonmax) changed the title E2E verifies minted actor JWTs against the key set ate-idp-server serves E2E verifies injected actor JWTs against the key set ate-idp-server serves Oct 19, 2026
@bowei Bowei Du (bowei) added area/identity area/network area/tests Enhancing / fixing test coverage. kind/feature An enhancement / feature request or implementation labels Oct 19, 2026
jiayimeow pushed a commit to jiayimeow/substrate that referenced this pull request Oct 19, 2026
…#2256)

Part of agent-substrate#1660.

- The `egresscredinject` suite's echo-origin rules, http and https, now
also replace `X-Actor-Token` with an actor JWT. The test decodes the
token the in-cluster echo server sends back and checks `sub`, `aud`, the
lifetime (`exp - iat`) and the `actor.ate.dev` claim, including the
actor's UID. It also fails if the token is the `worker-for-actor` kind.
- A fetch without the header must reach the echo server without
`X-Actor-Token`, matching the existing check for `Authorization`.
- `assertEchoedAuthorization` is now `assertEchoedHeaders`, so one fetch
checks both headers.

The test doesn't check the JWT's signature. That needs the published key
set, which the OIDC discovery e2e (agent-substrate#2606) covers.

Testing: lint and vet pass. The previous head passed e2e in CI on both
sandbox classes; this rebase only changes an import path for the module
rename.

- [ ] Tests pass
- [ ] Appropriate changes to documentation are included in the PR (the
user guide is agent-substrate#2596)
@thompsonmax
Max Thompson (thompsonmax) force-pushed the actor-jwt-oidc-e2e branch 2 times, most recently from 2d80a01 to b3bdbe6 Compare October 27, 2026 17:22
…rves

The egresscredinject suite checked the claims of the actor JWT the egress
gateway injects, but not its signature. It now verifies the token the way
a relying party does, with the key set discovered from the token's iss.
ate-idp-server serves that key set, and the suite reaches it through a
port-forward that checks the server's service-DNS certificate.

The test verifies an injected token rather than minting its own, because
with authorization enforced only the egress gateway may call
MintActorJwt.

Signed-off-by: Max Thompson <[email protected]>

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

area/identity area/network area/tests Enhancing / fixing test coverage. kind/feature An enhancement / feature request or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants