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
{{ message }}
Repository navigation
Commit 5cb6ed3
Browse filesBrowse the repository at this point in the historyBrowse files
A hosted Field Worker accepts only Orchard Passes (RFC 9068 at+jwt, ES256)
for one Desk Address, verified locally against the Front Desk JWKS, and
fails closed everywhere:
- Startup refuses unless VGI_JWT_ISSUER, VGI_JWT_AUDIENCE and
VGI_JWT_JWKS_URI are each set to exactly one non-empty value (no comma
splitting), and refuses VGI_BEARER_TOKENS, grant keys (env or
--grant-key), resolve_token/mint_grant overrides, VGI_OAUTH_RESOURCE, proxy
proof, Iroh/peer identity, a custom authenticate callback, --tcp/--unix/
--iroh-raw-upstream, and unrecognised VGI_ORCHARD_HOSTED values.
- Verification: ES256 (VGI_JWT_ALGORITHMS overrides; none/HS* refused),
typ at+jwt, exact iss/aud, exp required, 60 s skew, JWKS max age 600 s
(fails closed, 503), unknown-kid refetch at most every 60 s.
- Every request except HEAD /health and CORS preflights needs a Pass;
otherwise 401 with WWW-Authenticate: Bearer error="invalid_token", the
VGI capability headers and no resource_metadata. Auth runs before the
body is size-checked or decompressed. CORS is *.
- Claims reach function code via AuthContext with their JSON types
(domain "orchard", principal = sub).
Also: VGI_JWT_ALGORITHMS is honoured by ordinary JWT auth when set.
Tests run a real vgi-serve hosted worker against a local ES256 JWKS: valid
Pass and claim types, every rejection case, no Authorization in --debug
logs, and each startup refusal. Documented in docs/authentication.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|`VGI_JWT_AUDIENCE`| JWT audience string, comma-separated for multiple audiences (required when `VGI_JWT_ISSUER` is set) |
29
29
|`VGI_JWT_JWKS_URI`| JWKS endpoint URL (auto-discovered from issuer if omitted) |
30
+
|`VGI_JWT_ALGORITHMS`| Comma-separated allow-list of JWS algorithms (e.g. `ES256`). `none` and `HS*` are refused. Unset keeps joserfc's recommended set (`ES256` only in hosted mode) |
31
+
|`VGI_ORCHARD_HOSTED`|`1` turns on [Orchard hosted mode](#orchard-hosted-mode)|
30
32
|`VGI_OAUTH_RESOURCE`| OAuth resource URL for RFC 9728 metadata |
31
33
|`VGI_OAUTH_AUTH_SERVERS`| Comma-separated authorization server URLs |
0 commit comments