pub struct MemoryServicePrincipalStore { /* private fields */ }Expand description
In-memory ServicePrincipalStore for tests and single-node
bootstrapping before the persistent impl lands (peer ticket against
cheers-sqlx). Cheap to clone — shares one backing map.
Implementations§
Trait Implementations§
Source§impl Clone for MemoryServicePrincipalStore
impl Clone for MemoryServicePrincipalStore
Source§fn clone(&self) -> MemoryServicePrincipalStore
fn clone(&self) -> MemoryServicePrincipalStore
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 MemoryServicePrincipalStore
impl Debug for MemoryServicePrincipalStore
Source§impl Default for MemoryServicePrincipalStore
impl Default for MemoryServicePrincipalStore
Source§fn default() -> MemoryServicePrincipalStore
fn default() -> MemoryServicePrincipalStore
Returns the “default value” for a type. Read more
Source§impl ServicePrincipalStore for MemoryServicePrincipalStore
impl ServicePrincipalStore for MemoryServicePrincipalStore
Source§fn insert_principal<'life0, 'life1, 'async_trait>(
&'life0 self,
principal: &'life1 Principal,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_principal<'life0, 'life1, 'async_trait>(
&'life0 self,
principal: &'life1 Principal,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert a fresh principal record. Returns
StoreError::Conflict if
the id already exists; the authority surfaces that as
ServicePrincipalError::AlreadyExists.Source§fn get_principal<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PrincipalId,
) -> Pin<Box<dyn Future<Output = Result<Option<Principal>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_principal<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PrincipalId,
) -> Pin<Box<dyn Future<Output = Result<Option<Principal>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up the principal record.
None if no such principal exists.Source§fn insert_signing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SigningKey,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_signing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SigningKey,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert a freshly-generated signing key. Returns
StoreError::Conflict if the kid is already taken (kids are
globally unique across the JWKS).Source§fn list_signing_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
principal: &'life1 PrincipalId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SigningKey>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_signing_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
principal: &'life1 PrincipalId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SigningKey>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
All signing keys (active + retiring) owned by
principal. Order is
unspecified — the authority filters and orders as it needs.Source§fn list_all_signing_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SigningKey>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_all_signing_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SigningKey>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
All signing keys in the table (across every principal), regardless
of status. The JWKS publication path filters these by
Active OR (Retiring AND retire_at > now).Source§fn retire_signing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
kid: &'life1 str,
retire_at: i64,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn retire_signing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
kid: &'life1 str,
retire_at: i64,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Flip the key identified by
kid to Retiring with the supplied
retire_at. Returns StoreError::NotFound when the kid is
unknown; idempotent if the key is already retiring (overwrites the
existing retire_at).Source§fn prune_retired_keys<'life0, 'async_trait>(
&'life0 self,
now: i64,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prune_retired_keys<'life0, 'async_trait>(
&'life0 self,
now: i64,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Permanently drop every signing key whose status is
Retiring and
whose retire_at <= now. Returns the count dropped. Read moreAuto Trait Implementations§
impl Freeze for MemoryServicePrincipalStore
impl RefUnwindSafe for MemoryServicePrincipalStore
impl Send for MemoryServicePrincipalStore
impl Sync for MemoryServicePrincipalStore
impl Unpin for MemoryServicePrincipalStore
impl UnsafeUnpin for MemoryServicePrincipalStore
impl UnwindSafe for MemoryServicePrincipalStore
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