Expand description
hyperlane-plugin-session
High-concurrency sharded session plugin for Hyperlane with pluggable async
SessionStore traits, optional HMAC-SHA256 signed cookies, dirty-tracked
zero-write reads, and session-fixation ID regeneration.
Structs§
- InMemory
Session Store - High-concurrency 64-way sharded bounded in-memory
SessionStore. - Session
Config - Configuration controlling cookie attributes, signing, TTL, and capacity for
SessionPlugin. - Session
Handle - Thread-safe handle stored in Hyperlane
Contextallowing handlers to read and mutate the active session. - Session
Plugin - Process-wide
SessionPluginsingleton storingSessionConfigand a pluggableSessionStore. - Session
Request Hook - Opt-in request middleware loading the incoming session cookie into
SessionHandle. - Session
Response Hook - Opt-in response middleware persisting modified/regenerated/destroyed sessions and emitting
Set-Cookie.
Constants§
- ATTR_
SESSION_ HANDLE - Context attribute key storing the per-request
crate::SessionHandle. - DEFAULT_
MAX_ SESSIONS - Default maximum active sessions stored in memory.
- DEFAULT_
SESSION_ COOKIE_ NAME - Default HTTP session cookie name.
- DEFAULT_
SESSION_ COOKIE_ PATH - Default cookie
Pathattribute. - DEFAULT_
SESSION_ SAME_ SITE - Default cookie
SameSitepolicy. - DEFAULT_
SESSION_ TTL_ SECS - Default session idle TTL in seconds (1 hour).
Traits§
- Session
Store - Pluggable asynchronous session backend (in-memory sharded, Redis, PostgreSQL, etc.).
Functions§
- generate_
session_ id - Generates an unpredictable 128-bit lowercase hexadecimal session identifier.
- sign_
session_ cookie - Signs
session_idwithsecretinto"<session_id>.<hex_hmac>". - verify_
session_ cookie - Verifies a signed session cookie value in constant time and returns the underlying session ID.
Type Aliases§
- Session
Future - Boxed
Sendfuture returned by asyncSessionStoretrait methods.