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 a1d4093
Browse filesBrowse the repository at this point in the historyBrowse files
deps: require vgi-rpc >=0.46.0, migrate to Identity.v1 and named protocols
0.46.0 carries wire-breaking changes, so a >=0.45.1 floor lets a deployment
resolve a 0.45.x client against a 0.46.0 peer and fail at runtime rather than
at install time. Raise the floor and relock.
Two things in this repo broke against the new release:
Identity moved from HTTP to the RPC layer. `vgi_rpc.http.server._introspect`
is gone; `TokenIdentity` now lives in `vgi_rpc.rpc._token_identity` and the
`TokenResolver` alias was dropped upstream. Introspection is no longer the
`POST {prefix}/__introspect_token__` JSON route but the `vgi_rpc.Identity.v1`
protocol hosted on the RpcServer, configured via `RpcServer(identity=...)`
rather than three `make_wsgi_app` kwargs. So:
- vgi.auth re-exports TokenIdentity from the RPC layer and spells out
TokenResolver locally. Neither is gated on the `[http]` extra any more,
because identity now reaches every transport rather than only HTTP.
- serve.create_app builds an IdentityImpl through a new `_build_identity`
helper and hands it to RpcServer. Absent-unless-overridden is preserved:
no hook means `identity=None` means the protocol is not hosted at all,
rather than hosted-and-refusing.
- The fail-closed allowlist and rate-limit startup checks are unchanged;
they still run before IdentityImpl is constructed, so its own ValueError
path stays unreachable and the actionable SystemExit message survives.
The protocol name is now the dispatch routing key. The bad_protocol fixture
subclasses VgiProtocol to vary the version, and the name defaults to the class
name — so subclassing alone renamed the protocol to `BadProtocol`, and the
client's request for `VgiProtocol` raised ProtocolNotSupportedError before
reaching the version gate the fixture exists to test. Pin `protocol_name` so
the version is once again the only thing that varies.
The three TestTokenIntrospection cases that drove the retired HTTP route are
rewritten against the surface that now exists. Two neighbours had become
vacuous — they asserted 404, which is what every path to a removed route
returns — so they now assert on hosted protocols instead. Guard behaviour
(allowlist, uniform rejection, JWS-shape refusal, rate limiting) is vgi-rpc's
and tested there; what is covered here is the wiring this repo owns.
Docs updated to describe the protocol rather than the route.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|`VGI_OAUTH_USE_ID_TOKEN`| When `1`/`true`/`yes`, clients use OIDC `id_token` as Bearer instead of `access_token`|
300
-
|`VGI_INTROSPECT_PRINCIPALS`| Comma-separated principals permitted to call `__introspect_token__`. Required — no permissive default — whenever the worker implements `resolve_token()` (see below) |
300
+
|`VGI_INTROSPECT_PRINCIPALS`| Comma-separated principals permitted to call `vgi_rpc.Identity.v1`'s `introspect_token`. Required — no permissive default — whenever the worker implements `resolve_token()` (see below) |
301
301
|`VGI_INTROSPECT_RATE_LIMIT`| Introspection requests allowed per caller per second (default 20) |
302
302
|`VGI_WORKER_ACCESS_LOG_SAMPLE`| Fraction of *successful* calls to keep in the access log, `0.0`–`1.0`. Errors are always kept; the decision is per call, so every record of one stream shares a fate |
303
303
|`VGI_WORKER_ACCESS_LOG_ASYNC`| When `1`/`true`/`yes`, emit access-log records from a listener thread. Bounded queue; full means drop, and a crash loses whatever is queued |
@@ -420,10 +420,16 @@ Also available on `Worker.main --http` and the fixture server. Under
420
420
421
421
### Token Introspection (`resolve_token`)
422
422
423
-
A worker may optionally expose `POST {prefix}/__introspect_token__`, which
424
-
resolves an opaque bearer credential to a principal — for a reverse proxy that
425
-
terminates the only public listener and must know the caller's identity before
426
-
it can authorize anything.
423
+
A worker may optionally host the `vgi_rpc.Identity.v1` protocol, whose
424
+
`introspect_token` method resolves an opaque bearer credential to a principal —
425
+
for a reverse proxy that terminates the only public listener and must know the
426
+
caller's identity before it can authorize anything.
427
+
428
+
Through vgi-rpc 0.45.x this was an HTTP JSON route, `POST
429
+
{prefix}/__introspect_token__`, which meant it existed on exactly one
430
+
transport. As of **vgi-rpc 0.46.0** identity lives at the RPC layer, so it
431
+
reaches every transport, and a client discovers it through ordinary reflection
432
+
(`list_protocols`) rather than by calling and reading an error.
427
433
428
434
```python
429
435
from vgi.auth import AuthUnavailableError, TokenIdentity
0 commit comments