Skip to main content

Module session

Module session 

Source
Expand description

Session state machine for the access connector.

authenticating → active → expired → authenticating  (refresh cycle)
                        → revoked  (terminal: rejected credential)
                        → closed   (terminal: explicit shutdown)

Entering Revoked or Closed drops the bearer and clears the key store.

Structs§

SessionManager 🔒
Manages the connector session lifecycle. All mutable state sits behind one async Mutex, so at most one renewal is in flight. Debug is hand-written to avoid leaking the token or bearer.
SessionState 🔒

Enums§

SessionError 🔒
Errors returned by SessionManager::bearer and SessionManager::force_refresh.
SessionLost 🔒
Terminal session-loss variants exposed to callers.
SessionPhase 🔒
Observable phases of the connector session.

Constants§

BACKOFF_BASE 🔒
BACKOFF_CAP 🔒
NO_DEADLINE_MAX_TRIES 🔒
Renewal attempt count for a None deadline.
TOKEN_RENEW_MARGIN_SECS 🔒
Proactive renewal margin, matching bitwarden-auth’s TOKEN_RENEW_MARGIN_SECONDS.