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
//! # Session Layer
//!
//! This module implements the session management subsystem as defined in
//! the protocol specification sections 5 and 13. A **session** represents
//! a logical connection between a client and the server. Unlike transport
//! connections (which may be short-lived and subject to reconnection), a
//! session persists across transport reconnects through the resume mechanism.
//!
//! ## Architecture Overview
//!
//! ```text
//! Session Layer
//! ├── auth -- Pluggable authentication via the AuthProvider trait
//! ├── offset_tracker -- Per-topic offset tracking for resume decisions
//! ├── resume -- Resume orchestration and epoch validation
//! └── session -- Core Session, SessionId, ClientId, and lifecycle state
//! ```
//!
//! ## Key Concepts
//!
//! * **SessionId** -- A globally unique ULID that identifies a single session
//! instance. Generated server-side when the client first connects.
//!
//! * **ClientId** -- A long-lived client identity (e.g., a username or device
//! ID) that survives session expiration. Multiple sessions over time may
//! share the same `ClientId`.
//!
//! * **Epoch** -- A monotonically increasing counter attached to a session.
//! The epoch is bumped on each resume attempt so that stale client
//! connections can be detected and rejected.
//!
//! * **Resume** -- When a transport connection drops and the client
//! reconnects, it presents its `SessionId` and last-known offsets.
//! The server decides whether to resume the session or reject the
//! attempt.
//!
//! ## Session Lifecycle
//!
//! A session transitions through the following states:
//!
//! `Open` -> `Hello` -> `Authenticated` -> `Resuming` -> `Ready` -> `Active` -> `Draining` -> `Closed`
//!
//! See [`SessionState`] for details on each state.
pub use ;
pub use ;
pub use ResumeManager;
pub use ;
pub use SessionStore;