pub struct MemoryCampPrincipalStore { /* private fields */ }Implementations§
Source§impl MemoryCampPrincipalStore
impl MemoryCampPrincipalStore
pub fn new() -> Self
Sourcepub fn delegations(&self) -> Vec<UserDelegation>
pub fn delegations(&self) -> Vec<UserDelegation>
Test affordance — return every retained delegation in insertion order. The persistent impl exposes this through an audit-read endpoint (R020-F14); the memory impl just hands them back.
Trait Implementations§
Source§impl CampPrincipalStore for MemoryCampPrincipalStore
impl CampPrincipalStore for MemoryCampPrincipalStore
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 camp principal record. Returns
StoreError::Conflict
if the id already exists; the authority surfaces that as
CampAuthorityError::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 camp principal record.
None if no such principal
exists.Source§fn insert_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
cred: &'life1 CampBootstrapCredential,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
cred: &'life1 CampBootstrapCredential,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert a freshly-issued bootstrap credential. Returns
StoreError::Conflict if token is already taken (the authority
generates from a 256-bit CSPRNG, so collisions are
cryptographically negligible).Source§fn get_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CampBootstrapCredential>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CampBootstrapCredential>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a bootstrap credential by its opaque token.
None if no
such credential exists.Source§fn insert_delegation<'life0, 'life1, 'async_trait>(
&'life0 self,
delegation: &'life1 UserDelegation,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_delegation<'life0, 'life1, 'async_trait>(
&'life0 self,
delegation: &'life1 UserDelegation,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist the user-signed delegation as the auditable “user U
authorised camp C” record. The store is append-only for delegations:
once written, the row is never modified (revocation rides on the
principal, not the delegation).
Source§fn revoke_camps_bound_to<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 PrincipalId,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke_camps_bound_to<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 PrincipalId,
_now: i64,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Clone for MemoryCampPrincipalStore
impl Clone for MemoryCampPrincipalStore
Source§fn clone(&self) -> MemoryCampPrincipalStore
fn clone(&self) -> MemoryCampPrincipalStore
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 MemoryCampPrincipalStore
impl Debug for MemoryCampPrincipalStore
Source§impl Default for MemoryCampPrincipalStore
impl Default for MemoryCampPrincipalStore
Source§fn default() -> MemoryCampPrincipalStore
fn default() -> MemoryCampPrincipalStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryCampPrincipalStore
impl RefUnwindSafe for MemoryCampPrincipalStore
impl Send for MemoryCampPrincipalStore
impl Sync for MemoryCampPrincipalStore
impl Unpin for MemoryCampPrincipalStore
impl UnsafeUnpin for MemoryCampPrincipalStore
impl UnwindSafe for MemoryCampPrincipalStore
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