pub struct InMemoryTenantStore { /* private fields */ }Expand description
Mutable in-memory tenant table for development and embedded deployments.
Implementations§
Source§impl InMemoryTenantStore
impl InMemoryTenantStore
Sourcepub fn new() -> InMemoryTenantStore
pub fn new() -> InMemoryTenantStore
Construct an empty tenant table.
Sourcepub fn insert(&self, api_key: &str, tenant: Tenant) -> Result<(), WeakApiKey>
pub fn insert(&self, api_key: &str, tenant: Tenant) -> Result<(), WeakApiKey>
Insert or replace a tenant under the presented plaintext API key.
The key is checked by validate_api_key_strength first, because a
digest lookup only protects a secret that was hard to guess to begin
with. Use InMemoryTenantStore::insert_unchecked when the key has
already been validated elsewhere.
§Errors
Returns WeakApiKey without inserting anything.
Sourcepub fn insert_unchecked(&self, api_key: &str, tenant: Tenant)
pub fn insert_unchecked(&self, api_key: &str, tenant: Tenant)
Insert or replace a tenant without checking the key’s strength.
For tests, for fixtures, and for deployments that validate keys at the
boundary where they are issued. Everything else should prefer
InMemoryTenantStore::insert.
Trait Implementations§
Source§impl Clone for InMemoryTenantStore
impl Clone for InMemoryTenantStore
Source§fn clone(&self) -> InMemoryTenantStore
fn clone(&self) -> InMemoryTenantStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryTenantStore
impl Debug for InMemoryTenantStore
Source§impl Default for InMemoryTenantStore
impl Default for InMemoryTenantStore
Source§fn default() -> InMemoryTenantStore
fn default() -> InMemoryTenantStore
Returns the “default value” for a type. Read more
Source§impl TenantStore for InMemoryTenantStore
impl TenantStore for InMemoryTenantStore
Auto Trait Implementations§
impl Freeze for InMemoryTenantStore
impl RefUnwindSafe for InMemoryTenantStore
impl Send for InMemoryTenantStore
impl Sync for InMemoryTenantStore
impl Unpin for InMemoryTenantStore
impl UnsafeUnpin for InMemoryTenantStore
impl UnwindSafe for InMemoryTenantStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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