pub struct JwtSessionProvider { /* private fields */ }Expand description
JWT-based session provider
This provider creates and validates JWT tokens without requiring any persistent storage. Sessions are entirely self-contained within the JWT payload.
Implementations§
Trait Implementations§
Source§impl SessionProvider for JwtSessionProvider
impl SessionProvider for JwtSessionProvider
Source§fn create_session<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
user_agent: Option<String>,
ip_address: Option<String>,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<Session, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_session<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
user_agent: Option<String>,
ip_address: Option<String>,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<Session, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new session token for the given user Read more
Source§fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 SessionToken,
) -> Pin<Box<dyn Future<Output = Result<Session, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 SessionToken,
) -> Pin<Box<dyn Future<Output = Result<Session, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate and retrieve session information from a token Read more
Source§fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_token: &'life1 SessionToken,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_token: &'life1 SessionToken,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Invalidate a session token Read more
Source§fn cleanup_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clean up expired sessions Read more
Source§fn delete_sessions_for_user<'life0, 'life1, 'async_trait>(
&'life0 self,
_user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_sessions_for_user<'life0, 'life1, 'async_trait>(
&'life0 self,
_user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Invalidate all sessions for a specific user Read more
Auto Trait Implementations§
impl Freeze for JwtSessionProvider
impl RefUnwindSafe for JwtSessionProvider
impl Send for JwtSessionProvider
impl Sync for JwtSessionProvider
impl Unpin for JwtSessionProvider
impl UnwindSafe for JwtSessionProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more