1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! # modo::auth::session
//!
//! Unified session management for cookie and JWT transports, backed by a single
//! `authenticated_sessions` SQLite table and one shared [`Session`] data type.
//!
//! Two independent transports live side-by-side and populate the same
//! transport-agnostic [`Session`] into request extensions. Handlers read
//! session data the same way regardless of which transport authenticated
//! the request.
//!
//! ## Transports
//!
//! | Transport | Module | Entry point |
//! |-----------|--------|-------------|
//! | Cookie | [`cookie`] | [`cookie::CookieSessionService`] |
//! | JWT | [`jwt`] | [`jwt::JwtSessionService`] |
//!
//! ## Provides
//!
//! Submodules:
//!
//! - [`cookie`] — cookie-backed session transport ([`cookie::CookieSession`],
//! [`cookie::CookieSessionService`], [`cookie::CookieSessionLayer`],
//! [`cookie::CookieSessionsConfig`]).
//! - [`jwt`] — JWT-backed session transport ([`jwt::JwtSession`],
//! [`jwt::JwtSessionService`], [`jwt::JwtLayer`], [`jwt::JwtSessionsConfig`]).
//! - [`token`] — [`SessionToken`] implementation (also re-exported here).
//!
//! Client-context types ([`ClientInfo`](crate::client::ClientInfo), device
//! parsers, fingerprint hashing) live in [`crate::client`] and are the input
//! type for session creation on both transports.
//!
//! Direct re-exports:
//!
//! - [`Session`] — transport-agnostic session data extractor (read-only
//! snapshot). Populated into request extensions by either transport's layer.
//! - [`SessionToken`] — opaque 32-byte random token; redacted in
//! `Debug`/`Display`.
//! - [`CookieSession`], [`CookieSessionService`], [`CookieSessionLayer`],
//! [`CookieSessionsConfig`] — cookie transport types re-exported for
//! convenience.
//!
//! Back-compat aliases:
//!
//! - `SessionData` — alias for [`Session`].
//! - `SessionExtractor` — alias for [`cookie::CookieSession`].
//! - `SessionConfig` — alias for [`cookie::CookieSessionsConfig`].
//! - `SessionLayer` — alias for [`cookie::CookieSessionLayer`].
//!
//! ## Configuration
//!
//! Durations are `u64` seconds — see [`cookie::CookieSessionsConfig`]
//! (`session_ttl_secs`, `touch_interval_secs`, `max_sessions_per_user`) and
//! [`jwt::JwtSessionsConfig`] for the JWT transport.
pub
// Primary public data type — transport-agnostic session snapshot.
pub use Session;
pub use Session as SessionData; // alias for back-compat
pub use SessionToken;
// Re-exports from cookie for back-compat during refactor.
pub use SessionState;
pub use ;
// Back-compat: old callers using `auth::session::Session` as the cookie extractor.
// Maps to CookieSession so existing handler signatures keep compiling.
pub use CookieSession as SessionExtractor;
// SessionStore and layer exposed for integration tests only.
pub use layer;
pub use SessionStore;