pub struct OidcStateStore { /* private fields */ }Expand description
TTL cache for OIDC auth state (PKCE verifiers + nonces) during the authorization flow. Entries expire after 5 minutes and are single-use (removed on retrieval).
Implementations§
Source§impl OidcStateStore
impl OidcStateStore
pub fn new() -> Self
Sourcepub async fn insert(&self, state: String, session: OidcAuthSession)
pub async fn insert(&self, state: String, session: OidcAuthSession)
Store a new auth session keyed by the OAuth2 state parameter.
Sourcepub async fn take(&self, state: &str) -> Option<OidcAuthSession>
pub async fn take(&self, state: &str) -> Option<OidcAuthSession>
Retrieve and remove an auth session (single-use). Returns None if expired or not found.
Uses remove which returns the value and removes it in a single operation.
Sourcepub async fn contains(&self, state: &str) -> bool
pub async fn contains(&self, state: &str) -> bool
Check if a state key exists (without consuming it).
Sourcepub async fn insert_logout(&self, token: String, session: OidcLogoutSession)
pub async fn insert_logout(&self, token: String, session: OidcLogoutSession)
Store a new one-time logout session keyed by an opaque logout token.
Sourcepub async fn take_logout(&self, token: &str) -> Option<OidcLogoutSession>
pub async fn take_logout(&self, token: &str) -> Option<OidcLogoutSession>
Retrieve and remove a logout session (single-use). Returns None if expired or not found.
Sourcepub async fn contains_logout(&self, token: &str) -> bool
pub async fn contains_logout(&self, token: &str) -> bool
Check if a logout token exists (without consuming it).
Trait Implementations§
Source§impl Clone for OidcStateStore
impl Clone for OidcStateStore
Auto Trait Implementations§
impl !RefUnwindSafe for OidcStateStore
impl !UnwindSafe for OidcStateStore
impl Forget for OidcStateStore
impl Freeze for OidcStateStorewhere
*const ArcInner<Inner<String, OidcAuthSession, RandomState>> is !null: Freeze,
PhantomData<ArcInner<Inner<String, OidcAuthSession, RandomState>>>: Freeze,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: Freeze,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: Freeze,
*const ArcInner<Channel> is !null: Freeze,
PhantomData<ArcInner<Channel>>: Freeze,
*const ArcInner<Channel> is !null: Freeze,
PhantomData<ArcInner<Channel>>: Freeze,
PhantomData<InterruptedOp<String, OidcAuthSession>>: Freeze,
*const ArcInner<Housekeeper> is !null: Freeze,
PhantomData<ArcInner<Housekeeper>>: Freeze,
*const ArcInner<ValueInitializer<String, OidcAuthSession, RandomState>> is !null: Freeze,
PhantomData<ArcInner<ValueInitializer<String, OidcAuthSession, RandomState>>>: Freeze,
*const ArcInner<Inner<String, OidcLogoutSession, RandomState>> is !null: Freeze,
PhantomData<ArcInner<Inner<String, OidcLogoutSession, RandomState>>>: Freeze,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: Freeze,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: Freeze,
PhantomData<InterruptedOp<String, OidcLogoutSession>>: Freeze,
*const ArcInner<ValueInitializer<String, OidcLogoutSession, RandomState>> is !null: Freeze,
PhantomData<ArcInner<ValueInitializer<String, OidcLogoutSession, RandomState>>>: Freeze,
*const ArcInner<Atomic<u64>> is !null: Freeze,
PhantomData<ArcInner<Atomic<u64>>>: Freeze,
impl Move for OidcStateStore
impl Send for OidcStateStore
impl Sync for OidcStateStore
impl Unpin for OidcStateStorewhere
Arc<Inner<String, OidcAuthSession, RandomState>>: Unpin,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: Unpin,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: Unpin,
Arc<Channel>: Unpin,
Arc<Channel>: Unpin,
Arc<Inner<Pin<Box<dyn Future<Output = ()> + Send>>>>: Unpin,
Arc<String>: Unpin,
*const ArcData<ValueEntry<String, OidcAuthSession>> is !null: Unpin,
Arc<Housekeeper>: Unpin,
Arc<ValueInitializer<String, OidcAuthSession, RandomState>>: Unpin,
Arc<Inner<String, OidcLogoutSession, RandomState>>: Unpin,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: Unpin,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: Unpin,
*const ArcData<ValueEntry<String, OidcLogoutSession>> is !null: Unpin,
Arc<ValueInitializer<String, OidcLogoutSession, RandomState>>: Unpin,
Arc<Atomic<u64>>: Unpin,
impl UnsafeUnpin for OidcStateStorewhere
*const ArcInner<Inner<String, OidcAuthSession, RandomState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner<String, OidcAuthSession, RandomState>>>: UnsafeUnpin,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<ReadOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<WriteOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: UnsafeUnpin,
*mut Counter<Channel<InterruptedOp<String, OidcAuthSession>>>: UnsafeUnpin,
*const ArcInner<Channel> is !null: UnsafeUnpin,
PhantomData<ArcInner<Channel>>: UnsafeUnpin,
*const ArcInner<Channel> is !null: UnsafeUnpin,
PhantomData<ArcInner<Channel>>: UnsafeUnpin,
PhantomData<InterruptedOp<String, OidcAuthSession>>: UnsafeUnpin,
*const ArcInner<Housekeeper> is !null: UnsafeUnpin,
PhantomData<ArcInner<Housekeeper>>: UnsafeUnpin,
*const ArcInner<ValueInitializer<String, OidcAuthSession, RandomState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<ValueInitializer<String, OidcAuthSession, RandomState>>>: UnsafeUnpin,
*const ArcInner<Inner<String, OidcLogoutSession, RandomState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner<String, OidcLogoutSession, RandomState>>>: UnsafeUnpin,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<ReadOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<WriteOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: UnsafeUnpin,
*mut Counter<Channel<InterruptedOp<String, OidcLogoutSession>>>: UnsafeUnpin,
PhantomData<InterruptedOp<String, OidcLogoutSession>>: UnsafeUnpin,
*const ArcInner<ValueInitializer<String, OidcLogoutSession, RandomState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<ValueInitializer<String, OidcLogoutSession, RandomState>>>: UnsafeUnpin,
*const ArcInner<Atomic<u64>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<u64>>>: UnsafeUnpin,
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
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.