Skip to main content

MemoryServicePrincipalStore

Struct MemoryServicePrincipalStore 

Source
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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryServicePrincipalStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryServicePrincipalStore

Source§

fn default() -> MemoryServicePrincipalStore

Returns the “default value” for a type. Read more
Source§

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,

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,

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,

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,

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,

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,

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,

Permanently drop every signing key whose status is Retiring and whose retire_at <= now. Returns the count dropped. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.