You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extensibility/overview.mdx
+21-46Lines changed: 21 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,68 +44,43 @@ and runtime-specific isolation inside the provisioned workload.
44
44
45
45
## Authentication
46
46
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.
48
48
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`. |
50
55
51
-
Each token is an EdDSA-signed JWT scoped to one service registration:
52
-
53
-
<ParamFieldpath="iss"type="string">
54
-
`openshell-gateway:<gateway_id>`.
55
-
</ParamField>
56
-
57
-
<ParamFieldpath="aud"type="string">
58
-
The registration's `audience`. Defaults to `urn:openshell:extension:interceptor:<name>` or `urn:openshell:extension:middleware:<name>`.
`gateway` for calls from the gateway, or `supervisor` for middleware calls from a sandbox supervisor.
63
-
</ParamField>
64
-
65
-
<ParamFieldpath="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
80
57
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`.
82
59
83
-
### Validate Each Token
60
+
For each request, check that:
84
61
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.
86
66
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`.
91
68
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.
93
70
94
71
### Confirm the Audience at Startup
95
72
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.
97
74
98
75
### Run Without Authentication
99
76
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.
103
78
104
79
### Current Limitations
105
80
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.
0 commit comments