pub struct ChallengeStore { /* private fields */ }Expand description
In-memory store for pending authentication challenges.
Challenges are created during multi-step authentication (e.g., wallet signing) and consumed on the client’s response. Each challenge is one-time-use and expires after the configured TTL.
Implementations§
Source§impl ChallengeStore
impl ChallengeStore
pub fn new(ttl: Duration) -> Self
Sourcepub fn create(
&self,
identifier: String,
method: String,
payload: HashMap<String, String>,
) -> String
pub fn create( &self, identifier: String, method: String, payload: HashMap<String, String>, ) -> String
Create a new challenge and return its ID.
Sourcepub fn consume(&self, challenge_id: &str) -> Option<ChallengeInfo>
pub fn consume(&self, challenge_id: &str) -> Option<ChallengeInfo>
Consume a challenge by ID. Returns the challenge data if valid and not expired. The challenge is removed after consumption (one-time use).
Sourcepub fn cleanup_expired(&self)
pub fn cleanup_expired(&self)
Remove all expired entries.
Auto Trait Implementations§
impl !Freeze for ChallengeStore
impl RefUnwindSafe for ChallengeStore
impl Send for ChallengeStore
impl Sync for ChallengeStore
impl Unpin for ChallengeStore
impl UnsafeUnpin for ChallengeStore
impl UnwindSafe for ChallengeStore
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> 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