pub struct SqliteExecutionNonceStore { /* private fields */ }Expand description
SQLite-backed replay-prevention store for execution nonces.
Implementations§
Source§impl SqliteExecutionNonceStore
impl SqliteExecutionNonceStore
Sourcepub fn open(
path: impl AsRef<Path>,
) -> Result<Self, SqliteExecutionNonceStoreError>
pub fn open( path: impl AsRef<Path>, ) -> Result<Self, SqliteExecutionNonceStoreError>
Open the store at the given path. Creates the parent directory if needed.
Sourcepub fn open_in_memory() -> Result<Self, SqliteExecutionNonceStoreError>
pub fn open_in_memory() -> Result<Self, SqliteExecutionNonceStoreError>
Open an in-memory store for tests.
Sourcepub fn try_reserve(
&self,
nonce_id: &str,
now: i64,
expires_at: i64,
) -> Result<bool, SqliteExecutionNonceStoreError>
pub fn try_reserve( &self, nonce_id: &str, now: i64, expires_at: i64, ) -> Result<bool, SqliteExecutionNonceStoreError>
Reserve a nonce id. Shared code path for the trait impl and
tests – takes an explicit expires_at for caller-controlled
retention (the trait method uses now + RETENTION_GRACE_SECS).
Trait Implementations§
Source§impl ExecutionNonceStore for SqliteExecutionNonceStore
impl ExecutionNonceStore for SqliteExecutionNonceStore
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for SqliteExecutionNonceStore
impl !UnwindSafe for SqliteExecutionNonceStore
impl Freeze for SqliteExecutionNonceStore
impl Send for SqliteExecutionNonceStore
impl Sync for SqliteExecutionNonceStore
impl Unpin for SqliteExecutionNonceStore
impl UnsafeUnpin for SqliteExecutionNonceStore
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