pub struct DbOtpStore { /* private fields */ }Expand description
Database-backed OTP store for production use.
Stores OTP records in kipuka’s configured database (SQLite, PostgreSQL,
or MariaDB via sqlx). Hash-indexed for O(1) lookup during validation.
Implementations§
Trait Implementations§
Source§impl Default for DbOtpStore
impl Default for DbOtpStore
Source§impl OtpStore for DbOtpStore
impl OtpStore for DbOtpStore
Source§async fn find_by_hash(&self, _hash: &[u8]) -> OtpResult<Option<OtpRecord>>
async fn find_by_hash(&self, _hash: &[u8]) -> OtpResult<Option<OtpRecord>>
Find a record by its token hash.
Source§async fn increment_uses(&self, _id: &Uuid, _new_count: u32) -> OtpResult<()>
async fn increment_uses(&self, _id: &Uuid, _new_count: u32) -> OtpResult<()>
Increment the usage counter for a record.
Source§async fn cleanup_expired(&self) -> OtpResult<u64>
async fn cleanup_expired(&self) -> OtpResult<u64>
Remove all expired records (RHELBU-3536 R12).
Auto Trait Implementations§
impl Freeze for DbOtpStore
impl RefUnwindSafe for DbOtpStore
impl Send for DbOtpStore
impl Sync for DbOtpStore
impl Unpin for DbOtpStore
impl UnsafeUnpin for DbOtpStore
impl UnwindSafe for DbOtpStore
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