pub struct DatabaseKeyRepository { /* private fields */ }Implementations§
Source§impl DatabaseKeyRepository
impl DatabaseKeyRepository
pub fn new(storage: Arc<StorageLayer>) -> Self
Trait Implementations§
Source§impl Clone for DatabaseKeyRepository
impl Clone for DatabaseKeyRepository
Source§impl Debug for DatabaseKeyRepository
impl Debug for DatabaseKeyRepository
Source§impl KeyRepository for DatabaseKeyRepository
impl KeyRepository for DatabaseKeyRepository
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 DatabaseKeyRepository
impl !UnwindSafe for DatabaseKeyRepository
impl Freeze for DatabaseKeyRepository
impl Send for DatabaseKeyRepository
impl Sync for DatabaseKeyRepository
impl Unpin for DatabaseKeyRepository
impl UnsafeUnpin for DatabaseKeyRepository
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> 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 moreCreates a shared type from an unshared type.