Skip to content

Commit 22509a1

Browse files
committed
docs(extensibility): streamline extension authentication guidance
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 99b7c3c commit 22509a1

2 files changed

Lines changed: 27 additions & 47 deletions

File tree

‎docs/extensibility/isolation-backends.mdx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ or policy model.
1818
## The Interface
1919

2020
Each step returns a new type, so the supervisor can't start an agent on a
21-
boundary that hasn't been confirmed.
21+
boundary that hasn't been confirmed. The traits are defined in
22+
[`contract.rs`](https://github.com/NVIDIA/OpenShell/blob/main/crates/openshell-isolation-interface/src/contract.rs)
23+
in the
24+
[`openshell-isolation-interface`](https://github.com/NVIDIA/OpenShell/tree/main/crates/openshell-isolation-interface)
25+
crate. `OpenShellRuntimeBackend` is implemented in
26+
[`openshell-sandbox-backend`](https://github.com/NVIDIA/OpenShell/tree/main/crates/openshell-sandbox-backend).
2227

2328
| Rust surface | What it does | Returns |
2429
|---|---|---|

‎docs/extensibility/overview.mdx‎

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -44,68 +44,43 @@ and runtime-specific isolation inside the provisioned workload.
4444

4545
## Authentication
4646

47-
When the gateway has JWT signing configured, OpenShell attaches a short-lived bearer token to every call it makes to a [gateway interceptor](/extensibility/gateway-interceptors) or [supervisor middleware](/extensibility/supervisor-middleware) service. Your service validates this token to confirm that the call comes from your gateway or one of its sandboxes.
47+
When the gateway has JWT signing configured, OpenShell sends a short-lived bearer token with every call to a [gateway interceptor](/extensibility/gateway-interceptors) or [supervisor middleware](/extensibility/supervisor-middleware) service. Validate it to confirm the call comes from your gateway or one of its sandboxes.
4848

49-
### Tokens OpenShell Sends
49+
| Claim | Value |
50+
|---|---|
51+
| `iss` | `openshell-gateway:<gateway_id>` |
52+
| `aud` | The registration's `audience`. Defaults to `urn:openshell:extension:interceptor:<name>` or `urn:openshell:extension:middleware:<name>`. |
53+
| `caller_kind` | `gateway`, or `supervisor` for middleware calls from a sandbox. |
54+
| `sandbox_id` | The calling sandbox, when `caller_kind` is `supervisor`. |
5055

51-
Each token is an EdDSA-signed JWT scoped to one service registration:
52-
53-
<ParamField path="iss" type="string">
54-
`openshell-gateway:<gateway_id>`.
55-
</ParamField>
56-
57-
<ParamField path="aud" type="string">
58-
The registration's `audience`. Defaults to `urn:openshell:extension:interceptor:<name>` or `urn:openshell:extension:middleware:<name>`.
59-
</ParamField>
60-
61-
<ParamField path="caller_kind" type="'gateway' | 'supervisor'">
62-
`gateway` for calls from the gateway, or `supervisor` for middleware calls from a sandbox supervisor.
63-
</ParamField>
64-
65-
<ParamField path="sandbox_id" type="string">
66-
The calling sandbox. Present only when `caller_kind` is `supervisor`.
67-
</ParamField>
68-
69-
Authenticated network services use `https://` endpoints. OpenShell verifies the service certificate against platform trust roots, or against the private CA in the registration's `tls_ca_cert_path`, and always checks the hostname.
70-
71-
### Establish Trust in the Gateway
72-
73-
Before your service can validate tokens, configure it with three values from the gateway operator:
74-
75-
- The gateway URL.
76-
- The gateway ID. Tokens use `openshell-gateway:<gateway_id>` as their issuer.
77-
- The gateway's public signing key or JWKS.
78-
79-
Configure these values directly instead of discovering them from the gateway. A key fetched from an unverified source does not prove which gateway it belongs to.
56+
### Validate Each Token
8057

81-
To pick up new keys later, fetch `/.well-known/openid-configuration` from the configured gateway URL over TLS, then fetch the keys from its `jwks_uri`. This document looks like OIDC discovery, but its `issuer` is `openshell-gateway:<gateway_id>` rather than the gateway URL. Compare the token's `iss` with that value, not with the URL.
58+
Get the gateway ID and public signing key (or JWKS) from the gateway operator and configure them in your service. Don't trust a key discovered from an unverified source. To pick up rotated keys, fetch `/.well-known/openid-configuration` from the gateway over TLS and follow its `jwks_uri`.
8259

83-
### Validate Each Token
60+
For each request, check that:
8461

85-
Cache keys by `kid` and check that:
62+
- `typ` is `openshell-ext+jwt` and `alg` is `EdDSA`. Pin the algorithm; don't read it from the token.
63+
- The signature, expiry, and exact audience are valid.
64+
- `iss` is `openshell-gateway:<gateway_id>`, not the gateway URL.
65+
- `caller_kind` and `sandbox_id` match what your service accepts.
8666

87-
- `typ` is exactly `openshell-ext+jwt`.
88-
- `alg` is `EdDSA`. Pin the algorithm instead of reading it from the token.
89-
- The signature, issuer, exact audience, and expiry are valid.
90-
- `caller_kind` is one your service accepts, and `sandbox_id` matches your expectations when your service scopes behavior per sandbox.
67+
OpenShell reuses a token until it rotates, so don't reject a repeated `jti`.
9168

92-
OpenShell reuses a token until it rotates, so do not reject a repeated `jti` as a replay.
69+
Services must use `https://` endpoints. OpenShell verifies the certificate and hostname against platform roots, or against `tls_ca_cert_path` for a private CA.
9370

9471
### Confirm the Audience at Startup
9572

96-
Return the audience your service expects in the `expected_audience` field of its `Describe` manifest. After authentication succeeds, the gateway compares this value with the operator-configured `audience` and refuses to start when they differ. A strict service may reject a token with the wrong audience before returning its manifest, in which case gateway startup reports an authentication failure. Leave the field empty to skip this check.
73+
Return your expected audience in the `expected_audience` field of your `Describe` manifest. The gateway refuses to start if it doesn't match the configured `audience`. Leave it empty to skip the check.
9774

9875
### Run Without Authentication
9976

100-
Set `allow_insecure_transport = true` on a registration to use a plaintext `http://` endpoint. OpenShell then sends no token, and your service cannot distinguish OpenShell from any other client that can reach it. The gateway logs a warning for the registration at every startup.
101-
102-
Use this setting for local development, or on a network that already authenticates callers.
77+
Set `allow_insecure_transport = true` on a registration to use a plaintext `http://` endpoint with no token. Your service then can't tell OpenShell apart from any other client, and the gateway logs a warning at every startup. Use this only for local development or on a network that already authenticates callers.
10378

10479
### Current Limitations
10580

106-
- Tokens are bearer credentials. A captured token remains valid until it expires unless your service adds proof of possession or request binding.
107-
- Extension tokens share a signing key with other tokens the gateway issues, so you cannot rotate or revoke extension credentials independently.
108-
- mTLS client authentication and overlapping signing-key rotation are not available.
81+
- Tokens are bearer credentials: a captured token works until it expires.
82+
- Extension tokens share the gateway's signing key, so you can't rotate or revoke them separately.
83+
- mTLS client authentication and overlapping key rotation aren't available.
10984

11085
## Building Extensions
11186

0 commit comments

Comments
 (0)