Skip to main content

SessionResolver

Trait SessionResolver 

Source
pub trait SessionResolver: Send + Sync {
    // Required method
    fn resolve(&self, cookie_header: Option<&str>) -> Option<User>;
}
Expand description

Pluggable session resolution. Sync because cookie verification needs no I/O; a network-backed resolver (OAuth introspection) would add its own runtime.

Required Methods§

Source

fn resolve(&self, cookie_header: Option<&str>) -> Option<User>

Resolve identity from a raw Cookie header value (or None if absent). Returns None for any unauthenticated outcome (missing / bad / expired).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§