pub struct SessionStore { /* private fields */ }Expand description
In-memory session + authorisation-code store.
Implementations§
Source§impl SessionStore
impl SessionStore
Sourcepub fn create_session(&self, account_id: impl Into<String>) -> SessionId
pub fn create_session(&self, account_id: impl Into<String>) -> SessionId
Create a fresh session for account_id and return its id.
Sourcepub fn lookup(&self, id: &SessionId) -> Result<SessionRecord, SessionError>
pub fn lookup(&self, id: &SessionId) -> Result<SessionRecord, SessionError>
Look up a session by id. Extends last_access on hit.
Sourcepub fn issue_code(
&self,
client_id: impl Into<String>,
account_id: impl Into<String>,
redirect_uri: impl Into<String>,
code_challenge: Option<String>,
requested_scope: Option<String>,
) -> AuthCodeRecord
pub fn issue_code( &self, client_id: impl Into<String>, account_id: impl Into<String>, redirect_uri: impl Into<String>, code_challenge: Option<String>, requested_scope: Option<String>, ) -> AuthCodeRecord
Issue an opaque authorisation code. Returns the new record.
Sourcepub fn take_code(&self, code: &str) -> Option<AuthCodeRecord>
pub fn take_code(&self, code: &str) -> Option<AuthCodeRecord>
Consume (single-use) a previously-issued code. None if the
code doesn’t exist or has expired. JSS’s oidc-provider also
drops a code after a single redemption attempt; we match that.
Trait Implementations§
Source§impl Clone for SessionStore
impl Clone for SessionStore
Source§fn clone(&self) -> SessionStore
fn clone(&self) -> SessionStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for SessionStore
impl Default for SessionStore
Source§fn default() -> SessionStore
fn default() -> SessionStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SessionStore
impl !RefUnwindSafe for SessionStore
impl Send for SessionStore
impl Sync for SessionStore
impl Unpin for SessionStore
impl UnsafeUnpin for SessionStore
impl !UnwindSafe for SessionStore
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