pub struct SessionManager { /* private fields */ }
Expand description
Session Management provider
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn new(config: SessionManagementConfig) -> Self
pub fn new(config: SessionManagementConfig) -> Self
Create new session manager
Sourcepub fn create_session(
&mut self,
sub: String,
client_id: String,
metadata: HashMap<String, String>,
) -> Result<OidcSession>
pub fn create_session( &mut self, sub: String, client_id: String, metadata: HashMap<String, String>, ) -> Result<OidcSession>
Create new session
Sourcepub fn get_session(&self, session_id: &str) -> Option<&OidcSession>
pub fn get_session(&self, session_id: &str) -> Option<&OidcSession>
Get session by ID
Sourcepub fn update_session_activity(&mut self, session_id: &str) -> Result<()>
pub fn update_session_activity(&mut self, session_id: &str) -> Result<()>
Update session activity
Sourcepub fn is_session_valid(&self, session_id: &str) -> bool
pub fn is_session_valid(&self, session_id: &str) -> bool
Check if session is valid (not expired)
Sourcepub fn check_session_state(
&self,
request: SessionCheckRequest,
) -> Result<SessionCheckResponse>
pub fn check_session_state( &self, request: SessionCheckRequest, ) -> Result<SessionCheckResponse>
Check session state for iframe polling
Sourcepub fn end_session(&mut self, session_id: &str) -> Result<OidcSession>
pub fn end_session(&mut self, session_id: &str) -> Result<OidcSession>
End session (logout)
Sourcepub fn get_check_session_iframe(&self, client_id: &str) -> String
pub fn get_check_session_iframe(&self, client_id: &str) -> String
Get check session iframe HTML
Sourcepub fn cleanup_expired_sessions(&mut self) -> usize
pub fn cleanup_expired_sessions(&mut self) -> usize
Clean up expired sessions
Sourcepub fn get_sessions_for_subject(&self, sub: &str) -> Vec<&OidcSession>
pub fn get_sessions_for_subject(&self, sub: &str) -> Vec<&OidcSession>
Get all sessions for a subject
Sourcepub fn add_logout_token(
&mut self,
session_id: &str,
logout_token: String,
) -> Result<()>
pub fn add_logout_token( &mut self, session_id: &str, logout_token: String, ) -> Result<()>
Add logout token to session (for backchannel logout)
Sourcepub fn get_discovery_metadata(&self) -> HashMap<String, Value>
pub fn get_discovery_metadata(&self) -> HashMap<String, Value>
Get session management discovery metadata
Trait Implementations§
Source§impl Clone for SessionManager
impl Clone for SessionManager
Source§fn clone(&self) -> SessionManager
fn clone(&self) -> SessionManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SessionManager
impl RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnwindSafe for SessionManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more