Skip to content

feat(providers): exchange the sandbox JWT-SVID as a token grant subject - #5937

Open
paezba wants to merge 1 commit into
ai-openshell:mainfrom
paezba:feat/5897-jwt-svid-token-grant-subject/paezba
Open

paezba wants to merge 1 commit into
ai-openshell:mainfrom
paezba:feat/5897-jwt-svid-token-grant-subject/paezba

Conversation

@paezba

@paezba paezba commented Nov 24, 2026

Copy link
Copy Markdown

Summary

Let a provider token grant send the sandbox JWT-SVID directly as the RFC 8693 subject_token, optionally without client authentication. This enables keyless Google Cloud access through Workload Identity Federation. A GCE metadata emulator placeholder lets unmodified Google SDKs using Application Default Credentials use the grant.

Related Issue

Closes #5897

Changes

  • Add subject_token.source: jwt_svid and client_authentication: client_assertion | none to token grants (ProviderCredentialTokenGrantClientAuthentication, field 11). UNSPECIFIED keeps today's client_assertion behavior.
  • Validate profiles at load time: none requires token_exchange with a jwt_svid subject and cannot be combined with client_assertion_type. A jwt_svid subject must not name a stored credential, and unknown sources or authentication values are rejected.
  • Supervisor: dedicated supervisors exchange the JWT-SVID (requested with jwt_svid_audience) at token_endpoint without a gateway call. They send no client_assertion when client_authentication: none.
  • Gateway: shared-supervisor token grants support the same flow with the stable sandbox JWT-SVID. Previously the gateway refused them with FailedPrecondition. Grant-flow resolution moved to openshell-core::oauth::TokenGrantFlow so the supervisor and gateway share it.
  • Add gce_metadata_token (field 13): the sandbox GCE metadata emulator serves a non-secret placeholder access token for the credential. The token grant replaces it on the credential's endpoints; requests elsewhere that carry the placeholder are refused.
  • Docs: docs/how-it-works/providers/profiles.mdx, the openshell-server and openshell-supervisor-network READMEs, and examples/spiffe-gcp-sts-demo.
  • Update the storage schema fingerprints in storage_proto.rs for the new proto fields.

Release Notes

Provider token grants can exchange the sandbox SPIFFE JWT-SVID directly at an STS such as Google's (subject_token.source: jwt_svid, client_authentication: none). With gce_metadata_token: true, Google SDKs using Application Default Credentials reach Google Cloud APIs from a sandbox without a stored key.

Testing

  • Checks appropriate to the affected code and behavior pass

  • Unit tests added/updated (if applicable)

  • E2E tests added/updated (if applicable)

  • cargo fmt --check and cargo clippy -D warnings on openshell-core, openshell-providers, openshell-server, and openshell-supervisor-network

  • cargo test -p openshell-core -p openshell-providers

  • cargo test -p openshell-server --tests --bins

  • cargo test -p openshell-supervisor-network --lib: the token grant tests pass. 8 proxy::tests failures on macOS also fail on main unchanged.

  • mise run markdown:lint, proto:lint, buf breaking against main, license:check, docs:nav, docs:build:strict

  • Not run: a live Google STS / SPIRE end-to-end call with an unmodified Google SDK. A local run of e2e:kubernetes:shared-supervisor-spiffe on Colima couldn't reach the host-side test fixtures, so it didn't get as far as token grants.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Add subject_token.source jwt_svid and client_authentication
(client_assertion | none) to provider token grants so the sandbox
JWT-SVID can be sent directly as the RFC 8693 subject_token, for
example to Google STS for Workload Identity Federation. Invalid
combinations are rejected at profile load.

Dedicated supervisors perform the exchange without a gateway call;
gateway-brokered grants for shared supervisors use the stable sandbox
JWT-SVID. Grant flow resolution is shared in openshell-core.

Add gce_metadata_token so the sandbox GCE metadata emulator serves a
placeholder access token that the token grant replaces, letting
unmodified Google SDKs using Application Default Credentials work.

Closes ai-openshell#5897

Signed-off-by: paezba <64277512+paezba@users.noreply.github.com>
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 24, 2026

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

state:accepted A maintainer decided OpenShell should pursue this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(providers): exchange the sandbox JWT-SVID at Google STS (GCP Workload Identity Federation)

1 participant