pub struct InMemoryKeyRepository { /* private fields */ }Expand description
In-memory implementation of KeyRepository for testing and development
Implementations§
Trait Implementations§
Source§impl Debug for InMemoryKeyRepository
impl Debug for InMemoryKeyRepository
Source§impl Default for InMemoryKeyRepository
impl Default for InMemoryKeyRepository
Source§impl KeyRepository for InMemoryKeyRepository
impl KeyRepository for InMemoryKeyRepository
Source§fn create<'life0, 'async_trait>(
&'life0 self,
key: ManagedApiKey,
) -> Pin<Box<dyn Future<Output = Result<ManagedApiKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
key: ManagedApiKey,
) -> Pin<Box<dyn Future<Output = Result<ManagedApiKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a new API key
Source§fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find a key by ID
Source§fn find_by_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
key_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
key_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find a key by its hash
Source§fn update<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
config: UpdateKeyConfig,
) -> Pin<Box<dyn Future<Output = Result<ManagedApiKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
config: UpdateKeyConfig,
) -> Pin<Box<dyn Future<Output = Result<ManagedApiKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update a key
Source§fn update_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
status: KeyStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_status<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
status: KeyStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update key status
Source§fn update_last_used<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_last_used<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update last used timestamp
Source§fn update_usage<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
record: UsageRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_usage<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
record: UsageRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update usage statistics
Source§fn list_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List keys by user ID
Source§fn list_by_team<'life0, 'async_trait>(
&'life0 self,
team_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_by_team<'life0, 'async_trait>(
&'life0 self,
team_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List keys by team ID
Source§fn list_all<'life0, 'async_trait>(
&'life0 self,
status: Option<KeyStatus>,
limit: Option<usize>,
offset: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_all<'life0, 'async_trait>(
&'life0 self,
status: Option<KeyStatus>,
limit: Option<usize>,
offset: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ManagedApiKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all keys with optional filters
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a key permanently
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryKeyRepository
impl Freeze for InMemoryKeyRepository
impl Send for InMemoryKeyRepository
impl Sync for InMemoryKeyRepository
impl Unpin for InMemoryKeyRepository
impl UnsafeUnpin for InMemoryKeyRepository
impl UnwindSafe for InMemoryKeyRepository
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
Source§impl<T> BudgetAwareRouting for T
impl<T> BudgetAwareRouting for T
Source§fn filter_by_budget(
&self,
providers: Vec<String>,
budget_router: &BudgetAwareRouter,
) -> Vec<String>
fn filter_by_budget( &self, providers: Vec<String>, budget_router: &BudgetAwareRouter, ) -> Vec<String>
Filter providers based on budget availability
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 moreCreates a shared type from an unshared type.