pub struct InMemoryExecutionNonceStore { /* private fields */ }Expand description
In-memory LRU-backed execution nonce store.
Mirrors the shape of dpop::DpopNonceStore but keys on the nonce_id
alone because the full binding lives inside the signed body and is
checked separately by verify_execution_nonce.
Implementations§
Source§impl InMemoryExecutionNonceStore
impl InMemoryExecutionNonceStore
Sourcepub fn new(capacity: usize, ttl: Duration) -> InMemoryExecutionNonceStore
pub fn new(capacity: usize, ttl: Duration) -> InMemoryExecutionNonceStore
Create a new in-memory store.
capacity is the maximum number of recently consumed nonces to
remember. ttl is how long a nonce entry is retained when callers use
the legacy reserve path. reserve_until extends retention to cover
the signed nonce validity window.
Sourcepub fn from_config(config: &ExecutionNonceConfig) -> InMemoryExecutionNonceStore
pub fn from_config(config: &ExecutionNonceConfig) -> InMemoryExecutionNonceStore
Build a store with the TTL and capacity from config.
Trait Implementations§
Source§impl Default for InMemoryExecutionNonceStore
impl Default for InMemoryExecutionNonceStore
Source§fn default() -> InMemoryExecutionNonceStore
fn default() -> InMemoryExecutionNonceStore
Returns the “default value” for a type. Read more
Source§impl ExecutionNonceStore for InMemoryExecutionNonceStore
impl ExecutionNonceStore for InMemoryExecutionNonceStore
Source§fn reserve(&self, nonce_id: &str) -> Result<bool, KernelError>
fn reserve(&self, nonce_id: &str) -> Result<bool, KernelError>
Attempt to reserve (consume) the given nonce identifier. Read more
Source§fn reserve_until(
&self,
nonce_id: &str,
nonce_expires_at: i64,
) -> Result<bool, KernelError>
fn reserve_until( &self, nonce_id: &str, nonce_expires_at: i64, ) -> Result<bool, KernelError>
Reserve a nonce while telling the store when the nonce stops
being cryptographically valid. Durable implementations (SQLite,
remote KV stores) MUST retain the consumed marker until at least
nonce_expires_at so replay protection covers the nonce’s full
validity window. Read morefn is_consumed(&self, nonce_id: &str) -> Result<bool, KernelError>
Auto Trait Implementations§
impl !Freeze for InMemoryExecutionNonceStore
impl RefUnwindSafe for InMemoryExecutionNonceStore
impl Send for InMemoryExecutionNonceStore
impl Sync for InMemoryExecutionNonceStore
impl Unpin for InMemoryExecutionNonceStore
impl UnsafeUnpin for InMemoryExecutionNonceStore
impl UnwindSafe for InMemoryExecutionNonceStore
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> 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