Skip to main content

Module token_exchange

Module token_exchange 

Source
Expand description

RFC 8693 OAuth Token Exchange grant handler.

Grant type: urn:ietf:params:oauth:grant-type:token-exchange

Exchanges an existing credential (OIDC ID token, at+jwt, or WIT) for a hyprstream at+jwt. Serves as the HTTP-layer complement to ExchangeWit (ZMQ) and enables the MCP SDK’s CrossAppAccessProvider enterprise flow.

Structs§

AtprotoExchangeRequest
ClaimsSubjectContextResolver
S8 (#574): the concrete SubjectContextResolver that does the real two-input MAC context derivation.
DenyUnlabeledResolver
A no-op resolver that always returns None — the explicit fail-closed choice for a node that has not configured subject-clearance resolution. Production under MAC SHOULD wire ClaimsSubjectContextResolver instead.

Constants§

ATPROTO_EXCHANGE_NSID
ATPROTO_SESSION_EXCHANGE_NSID

Traits§

SubjectContextResolver
Resolve a UCAN audience DID → the S1 [SecurityContext] it presents at grant time (clearance clamped to verified key material).

Functions§

exchange_atproto_ucan
XRPC adapter over the RFC 8693 exchange core.
exchange_token_exchange
POST /oauth/token — token-exchange grant (RFC 8693).
exchange_ucan_grant
POST /oauth/token — UCAN grant (RFC 8693 token-exchange, subject_token_type = urn:hyprstream:token-type:ucan-grant).