Skip to main content

ApiKeyRepository

Trait ApiKeyRepository 

Source
pub trait ApiKeyRepository:
    Send
    + Sync
    + 'static {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        data: CreateApiKey,
    ) -> Pin<Box<dyn Future<Output = Result<ApiKey>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key_hash: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ApiKey>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_user<'life0, 'async_trait>(
        &'life0 self,
        user_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ApiKey>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn revoke<'life0, 'async_trait>(
        &'life0 self,
        key_id: Uuid,
        user_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn touch_last_used<'life0, 'async_trait>(
        &'life0 self,
        key_id: Uuid,
        at: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn create<'life0, 'async_trait>( &'life0 self, data: CreateApiKey, ) -> Pin<Box<dyn Future<Output = Result<ApiKey>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn find_by_hash<'life0, 'life1, 'async_trait>( &'life0 self, key_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<ApiKey>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn find_by_user<'life0, 'async_trait>( &'life0 self, user_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<ApiKey>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn revoke<'life0, 'async_trait>( &'life0 self, key_id: Uuid, user_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn touch_last_used<'life0, 'async_trait>( &'life0 self, key_id: Uuid, at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§