pub struct KeyStore { /* private fields */ }Expand description
The live keyring: source + hot-reload state. File-backed rings re-stat on lookup
(throttled to poll) and swap in the new ring when mtime moves; a reload that fails
to parse KEEPS the old ring and logs the error (never fail-open, never flap).
Implementations§
Source§impl KeyStore
impl KeyStore
Sourcepub fn from_spec(spec: &str) -> Result<KeyStore, String>
pub fn from_spec(spec: &str) -> Result<KeyStore, String>
Resolve the MEMRA_API_KEYS value: an existing file path loads as TOML;
otherwise a value containing ‘:’ parses as the inline list; anything else is a
loud config error (a mistyped path must not silently become an empty ring).
Sourcepub fn with_poll(self, poll: Duration) -> KeyStore
pub fn with_poll(self, poll: Duration) -> KeyStore
Override how often the key file is re-statted for hot reload. Public as a real knob: deployment-side tests (and unusual deployments) set it; the default poll is right for production.
Sourcepub fn file_path(&self) -> Option<&Path>
pub fn file_path(&self) -> Option<&Path>
pub: a deployment admin surface provisions keys against this file.
pub fn lookup(&self, key: &str) -> Result<TenantCtx, AuthDenied>
Auto Trait Implementations§
impl !Freeze for KeyStore
impl RefUnwindSafe for KeyStore
impl Send for KeyStore
impl Sync for KeyStore
impl Unpin for KeyStore
impl UnsafeUnpin for KeyStore
impl UnwindSafe for KeyStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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