Structs§
- Admission
Presentation Guard - Exclusive outbound session-token presenter for one logical connection. Duplicate auto-connect passes may observe the same transport concurrently, but only this guard’s owner may open an admission request stream.
- Admission
Response Guard - RAII handle returned by
SessionTokenRegistry::begin_admission_response. While this guard exists, the registry reportsis_session_token_admission_in_flight(connection_id) == true. Drop it only after the response has been fully written to the wire. - Admission
Retirement Guard - Exclusive terminal-retirement ownership for one connection. Admission response writers cannot begin until this guard is dropped.
- Grant
Scope - Admission-grant label carried by restricted session tokens and compound tickets.
- Native
Trusted Connection Context - Session
Token - A registered session token.
- Session
Token Registry - Thread-safe registry of active session tokens.
- Token
Payload - Decoded token payload embedded in a compound ticket.
Enums§
Constants§
- DEFAULT_
RESTRICTED_ SESSION_ TOKEN_ TTL_ MS - Default TTL for newly minted restricted endpoint-ticket grants.
- TOKEN_
PAYLOAD_ ENDPOINT_ TICKET_ AUDIENCE
Functions§
- build_
compound_ ticket - Build a compound ticket by appending a token suffix bound to the endpoint ticket.
- build_
compound_ ticket_ with_ expiry - Build a compound ticket with an optional host-enforced absolute expiry.
- decode_
token_ payload - Decode a base64url token payload string.
- decode_
token_ payload_ for_ ticket - Decode a token payload and reject it if its endpoint-ticket binding does not match the accompanying iroh ticket.
- encode_
token_ payload - Encode a token payload as a base64url (no padding) string.
- encode_
token_ payload_ for_ ticket - Encode a token payload and bind it to a specific endpoint ticket.
- encode_
token_ payload_ for_ ticket_ with_ expiry - Encode a token payload, bind it to a specific endpoint ticket, and optionally include the absolute expiry enforced by the host registry.
- endpoint_
ticket_ hash - Stable hash that binds a compact token payload to the endpoint ticket it grants access to. The full SHA-256 digest is kept because this value is carried inside bearer material rather than used only for logs.
- generate_
payload_ nonce - generate_
token - Generate a cryptographically random 32-character alphanumeric token. Uses the platform’s secure RNG (getrandom on WASM, OsRng on native).
- now_
unix_ ms - split_
compound_ ticket - Split a (possibly compound) ticket string into
(iroh_ticket, Option<token_payload>). - token_
fingerprint - Stable, low-cardinality fingerprint of a token value, used to correlate duplicate presentations of the same token on the same connection (the Phase 1 idempotency case) vs. presentations of a different token on the same connection (e.g. a token rotation, which must re-validate).
- token_
payload_ matches_ ticket - Check whether a decoded payload is bound to the provided endpoint ticket.
- token_
payload_ metadata_ is_ valid