Skip to main content

Module session_token

Module session_token 

Source

Structs§

AdmissionPresentationGuard
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.
AdmissionResponseGuard
RAII handle returned by SessionTokenRegistry::begin_admission_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.
AdmissionRetirementGuard
Exclusive terminal-retirement ownership for one connection. Admission response writers cannot begin until this guard is dropped.
GrantScope
Admission-grant label carried by restricted session tokens and compound tickets.
NativeTrustedConnectionContext
SessionToken
A registered session token.
SessionTokenRegistry
Thread-safe registry of active session tokens.
TokenPayload
Decoded token payload embedded in a compound ticket.

Enums§

SessionAdmission
SessionAdmissionMechanism

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

Type Aliases§

NativeTrustedConnectionVerifier