pub struct VerifierCache { /* private fields */ }Expand description
Caches SCRAM verifiers fetched via auth_query, keyed by
(upstream_addr, username).
Backed by moka::future::Cache, which provides:
- Bounded capacity via LRU-ish W-TinyLFU eviction, so entries for decommissioned users or upstreams don’t linger forever.
- Per-entry TTL via a custom
Expiryimpl, so each cluster’s configuredauth.cache_ttlis honoured independently — a setup with one short-lived and one long-lived cluster gets the exact behaviour each configured. - Concurrent miss coalescing via
try_get_with: multiple concurrent callers for the same key share a single upstream fetch, avoiding a thundering herd of auth queries when the first authentication request arrives for a fresh entry.
Implementations§
Source§impl VerifierCache
impl VerifierCache
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for VerifierCache
impl !UnwindSafe for VerifierCache
impl Freeze for VerifierCache
impl Send for VerifierCache
impl Sync for VerifierCache
impl Unpin for VerifierCache
impl UnsafeUnpin for VerifierCache
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