pub struct DashboardSessionIssuer { /* private fields */ }Expand description
Mints and verifies self-contained dashboard-access sessions, keyed by the
pairing api_key + the PIN record’s salt. Build one with
DashboardSessionIssuer::from_api_key_and_salt.
Implementations§
Source§impl DashboardSessionIssuer
impl DashboardSessionIssuer
Sourcepub fn from_api_key_and_salt(api_key: &str, salt: &[u8]) -> Self
pub fn from_api_key_and_salt(api_key: &str, salt: &[u8]) -> Self
Derive the session key from the pairing api_key and the PIN salt under
the fixed label: K = HMAC-SHA256(api_key, LABEL || salt). A fresh salt
(written on every PIN set/reset) yields a fresh K, so a reset revokes
every prior session.
Sourcepub fn mint(&self, ttl_seconds: i64) -> DashboardSession
pub fn mint(&self, ttl_seconds: i64) -> DashboardSession
Mint a session valid for ttl_seconds, using the wall clock.
Sourcepub fn mint_at(&self, ttl_seconds: i64, now: i64) -> DashboardSession
pub fn mint_at(&self, ttl_seconds: i64, now: i64) -> DashboardSession
Deterministic mint core (explicit clock) for tests and cross-impl vectors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DashboardSessionIssuer
impl RefUnwindSafe for DashboardSessionIssuer
impl Send for DashboardSessionIssuer
impl Sync for DashboardSessionIssuer
impl Unpin for DashboardSessionIssuer
impl UnsafeUnpin for DashboardSessionIssuer
impl UnwindSafe for DashboardSessionIssuer
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