pub trait Session:
Send
+ Sync
+ Debug {
// Required methods
fn session_id(&self) -> &str;
fn principal(&self) -> &str;
fn is_expired(&self) -> bool;
fn client_ip(&self) -> &str;
}Expand description
Unified session trait for all authentication mechanisms.
Provides a common interface for session handling across:
AuthSession(RBAC/ACL with SASL authentication)ServiceSession(API keys, mTLS, OIDC client credentials)
This enables handler code to work with any authenticated session without knowing the specific authentication mechanism.
Required Methods§
Sourcefn session_id(&self) -> &str
fn session_id(&self) -> &str
Unique session identifier
Sourcefn is_expired(&self) -> bool
fn is_expired(&self) -> bool
Whether this session has expired