Skip to main content

SharedUnlockDriver

Trait SharedUnlockDriver 

Source
pub trait SharedUnlockDriver {
    // Required methods
    fn lock_user<'life0, 'async_trait>(
        &'life0 self,
        user_id: UserId,
    ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unlock_user<'life0, 'async_trait>(
        &'life0 self,
        user_id: UserId,
        user_key: SymmetricCryptoKey,
    ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_users<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<UserId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_vault_url<'life0, 'async_trait>(
        &'life0 self,
        user_id: UserId,
    ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn suppress_vault_timeout<'life0, 'async_trait>(
        &'life0 self,
        user_id: UserId,
        suppression_duration: Duration,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn discover_leader<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<Endpoint>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait that implmeents the device’s shared unlock driver. These functions need to be implemented in order to allow the shared unlock system to function.

Required Methods§

Source

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

Lock the user with the given ID.

Source

fn unlock_user<'life0, 'async_trait>( &'life0 self, user_id: UserId, user_key: SymmetricCryptoKey, ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unlock the user with the given ID.

Source

fn list_users<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<UserId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all users this device has an account for, locked or unlocked.

Source

fn get_vault_url<'life0, 'async_trait>( &'life0 self, user_id: UserId, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get vault_url for the user with the given ID, if available. This is used to verify IPC message sources

Source

fn suppress_vault_timeout<'life0, 'async_trait>( &'life0 self, user_id: UserId, suppression_duration: Duration, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Suppress the vault timeout for the given user for the specified duration. Called when a sync is received from this device’s leader, keeping the shared session active.

Source

fn discover_leader<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Endpoint>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Discovers the endpoint of the peer above this one in the device hierarchy or none if this device is at the top of the hierarchy. The local peer disables vault timeout if it is not at the top of the hierarchy.

Implementors§