Skip to main content

Module session_token

Module session_token 

Source

Structs§

GrantScope
Admission-grant label carried by restricted session tokens and compound tickets.
PresentationGuard
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.
ResponseGuard
RAII handle returned by SessionTokenRegistry::begin_response. While this guard exists, the registry reports is_session_token_admission_in_flight(connection_id) == true. Drop it only after the response has been fully written to the wire.
RetirementGuard
Exclusive terminal-retirement ownership for one connection. Admission response writers cannot begin until this guard is dropped.
SessionToken
A registered session token.
SessionTokenRegistry
Thread-safe registry of active session tokens.
TokenPayload
Decoded token payload embedded in a compound ticket.
TrustContext

Enums§

AdmissionMechanism
SessionAdmission

Functions§

build_ticket
Build a compound ticket by appending a token suffix bound to the endpoint ticket.
decode_payload
Decode a token payload and reject it if its endpoint-ticket binding does not match the accompanying iroh ticket.
decode_token_payload
Decode a base64url token payload string.
encode_payload
Encode a token payload and bind it to a specific endpoint ticket.
encode_token_payload
Encode a token payload as a base64url (no padding) string.
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.
expiring_ticket
Build a compound ticket with an optional host-enforced absolute expiry.
generate_nonce
generate_token
Generate a cryptographically random 32-character alphanumeric token. Uses the platform’s secure RNG (getrandom on WASM, OsRng on native).
matches_ticket
Check whether a decoded payload is bound to the provided endpoint ticket.
now_unix_ms
split_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).
valid_metadata

Type Aliases§

TrustVerifier