Skip to content

feat(providers): add a Gateway-signed alternative to SPIFFE for token_grant - #5479

Draft
freeqaz-openai wants to merge 4 commits into
NVIDIA:mainfrom
freeqaz-openai:feat/5473-grant-header-placeholders/freeqaz-openai
Draft

freeqaz-openai wants to merge 4 commits into
NVIDIA:mainfrom
freeqaz-openai:feat/5473-grant-header-placeholders/freeqaz-openai

Conversation

@freeqaz-openai

@freeqaz-openai freeqaz-openai commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Today a supervisor authenticates a token_grant request with a SPIFFE JWT-SVID. This adds a second option for OAuth client_credentials: the token service can trust a JWT signed by the OpenShell Gateway. SPIFFE remains the default and is still used for token_exchange.

This lets a sandbox start with an opaque handle and use stock Git or an API client on first authorized use, without a SPIFFE installation. The Gateway signs the assertion, the token service issues the access token, and the supervisor places it in the upstream request.

Request flow

sequenceDiagram
    participant C as Sandbox client
    participant S as Supervisor
    participant G as OpenShell Gateway
    participant T as OAuth token service
    participant U as Upstream API
    C->>S: HTTPS request with handle in configured header
    S->>S: Admit route and run configured authorization hooks
    opt No reusable access token
        S->>G: Request assertion for attached provider credential
        G->>G: Check sandbox, provider ID, credential and registered endpoint
        G-->>S: Short-lived JWT addressed to the token endpoint
        S->>T: OAuth client credentials grant with signed JWT
        T-->>S: Scoped access token
    end
    S->>U: Forward admitted request with access token in header
Loading

Design choices

Decision Why
Select assertion_source: openshell_gateway in the grant profile. Deployments that already trust the Gateway can use their existing signer and JWKS. Requiring SPIRE would add another identity system for those operators.
Register the provider ID, credential key, and exact HTTPS token endpoint on the Gateway. A profile author can select an approved recipient. The dedicated assertion identifies the sandbox and provider credential and expires after 60 seconds.
Select auth_style: placeholder when the client supplies the header format. Stock Git puts its handle in a Basic password; an API client can put it in a named header. Both use the supervisor’s existing rewriter. A Git-specific formatter would duplicate that logic for each new client.

Assertion source and placement are independent. Existing automatic Bearer and raw-header injection still work. Placeholder placement is opt-in for one declared header on inspected REST traffic.

Verification

  • Mixed-version profile management: 6/6 checks passed with real CLI and Gateway binaries from bfa68b208 and 4eb83b932. SPIFFE create/update worked in both directions. The old CLI could not overwrite a Gateway-assertion profile on the new Gateway. The new CLI refused to create or update one on the old Gateway. All three refusals preserved stored state. The later d32c9c2 cleanup changed test code and test dependencies only.
  • OpenShell wire tests: Gateway assertion exchange, stock Git over HTTPS, and a named API header. After provider detachment, a fresh object stayed unavailable and the issuer and origin saw no further HTTP requests.
  • Companion test with PostgreSQL, stock Git, a synthetic issuer and a local HTTPS origin: zero startup mints, one mint across discovery and upload-pack, zero further redemptions, mints or origin requests after withdrawal.

Related issue

Closes #5473

…t assertions

Signed-off-by: Free Wortley <freeqaz@openai.com>
Expose a binding-scoped handle to the workload and resolve it only for an admitted, inspected request. Let the existing header rewriter preserve the client-selected authentication format. Exercise the path with stock Git and a custom API header.

Signed-off-by: Free Wortley <freeqaz@openai.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Free Wortley <freeqaz@openai.com>
@freeqaz-openai freeqaz-openai changed the title feat(providers): support Gateway-signed token grants and grant-backed request headers feat(providers): add a Gateway-signed alternative to SPIFFE for token_grant Nov 11, 2026
Share unused unary RPCs across test gateways while keeping the production trait exhaustive. Exercise grant compatibility in existing import, lint, and endpoint tests. Reuse TLS identities and relay setup for the stock Git and named-header cases.

Signed-off-by: Free Wortley <freeqaz@openai.com>
@freeqaz-openai

Copy link
Copy Markdown
Contributor Author

Could an OpenShell maintainer triage #5473 for this opt-in assertion source? The PR issue-acceptance check is waiting for a maintainer decision on that issue. SPIFFE remains the default.

There is now a downstream installed integration test PR for the first Git fetch, withdrawal, and continuation of the same conversation. The local wire test has passed with stock Git and a PostgreSQL-backed token service. The installed qualification is still in progress.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Gateway-authenticated token grants with client-selected header formats

1 participant