pub struct KeyspaceSessionStore { /* private fields */ }Expand description
Thin newtype around KeyspaceHandle that implements
SessionStore.
Newtype rather than blanket-impl-on-KeyspaceHandle so the
trait surface stays decoupled from the storage type (orphan
rule + future-proofing — a different store would implement
SessionStore on a different newtype).
Implementations§
Source§impl KeyspaceSessionStore
impl KeyspaceSessionStore
pub fn new(inner: KeyspaceHandle) -> Self
pub fn handle(&self) -> &KeyspaceHandle
Trait Implementations§
Source§impl Clone for KeyspaceSessionStore
impl Clone for KeyspaceSessionStore
Source§fn clone(&self) -> KeyspaceSessionStore
fn clone(&self) -> KeyspaceSessionStore
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 SessionStore for KeyspaceSessionStore
impl SessionStore for KeyspaceSessionStore
Source§type Error = AppError
type Error = AppError
Wrapped error type. Conversion to
AuthError::Internal is
the handler’s responsibility (via ? and the backend’s
From<AuthError> impl).Source§fn store_session<'life0, 'life1, 'async_trait>(
&'life0 self,
s: &'life1 Session,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_session<'life0, 'life1, 'async_trait>(
&'life0 self,
s: &'life1 Session,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist a session under its
session_id.Source§fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load a session by
session_id. Ok(None) if missing or expired-and-swept.Source§fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a session and its refresh-token reverse-index.
Source§fn store_refresh_index<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
session_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store_refresh_index<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
session_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persist the
refresh_token → session_id reverse-index.
Implementors choose whether to hash the key (recommended;
vti-common does, did-hosting historically does not) — the
handler treats the token as an opaque bearer.Source§fn take_session_id_by_refresh<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn take_session_id_by_refresh<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Atomically claim-and-delete the
refresh_token → session_id
reverse-index. Cross-replica safe (Redis GETDEL / DynamoDB
DeleteItem ReturnValues=ALL_OLD / fjall mutex). Exactly one
concurrent caller observes Some for any given token.
Used by /auth/refresh to close the rotation TOCTOU.Source§fn count_pending_challenges<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_pending_challenges<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count
ChallengeSent sessions for did. Backends with an
O(1) per-DID tracker (did-hosting) override the default
O(N) prefix-scan implementation by re-implementing this
method. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for KeyspaceSessionStore
impl !UnwindSafe for KeyspaceSessionStore
impl Freeze for KeyspaceSessionStore
impl Send for KeyspaceSessionStore
impl Sync for KeyspaceSessionStore
impl Unpin for KeyspaceSessionStore
impl UnsafeUnpin for KeyspaceSessionStore
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T.