Repository navigation
Conversation
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>
This branch has not been deployed
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.
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
subject_token.source: jwt_svidandclient_authentication: client_assertion | noneto token grants (ProviderCredentialTokenGrantClientAuthentication, field 11).UNSPECIFIEDkeeps today'sclient_assertionbehavior.nonerequirestoken_exchangewith ajwt_svidsubject and cannot be combined withclient_assertion_type. Ajwt_svidsubject must not name a storedcredential, and unknown sources or authentication values are rejected.jwt_svid_audience) attoken_endpointwithout a gateway call. They send noclient_assertionwhenclient_authentication: none.FailedPrecondition. Grant-flow resolution moved toopenshell-core::oauth::TokenGrantFlowso the supervisor and gateway share it.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/how-it-works/providers/profiles.mdx, theopenshell-serverandopenshell-supervisor-networkREADMEs, andexamples/spiffe-gcp-sts-demo.storage_proto.rsfor 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). Withgce_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 --checkandcargo clippy -D warningsonopenshell-core,openshell-providers,openshell-server, andopenshell-supervisor-networkcargo test -p openshell-core -p openshell-providerscargo test -p openshell-server --tests --binscargo test -p openshell-supervisor-network --lib: the token grant tests pass. 8proxy::testsfailures on macOS also fail onmainunchanged.mise run markdown:lint,proto:lint,buf breakingagainstmain,license:check,docs:nav,docs:build:strictNot run: a live Google STS / SPIRE end-to-end call with an unmodified Google SDK. A local run of
e2e:kubernetes:shared-supervisor-spiffeon Colima couldn't reach the host-side test fixtures, so it didn't get as far as token grants.Checklist