Skip to main content

Module session

Module session 

Source

Structs§

SessionRecord
A session record stored in the vault (only the HMAC of the token is stored, not the token itself).

Functions§

generate_session_id
Generate a short unique session ID.
generate_token
Generate a session token and its HMAC. Returns (token_string, hmac_bytes).
parse_ttl
Parse a duration string like “1h”, “30m”, “7d”.
validate_token
Validate a token against stored session records. Returns the matching session record if valid.