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: UserKey,
    ) -> 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_user_lock_state<'life0, 'async_trait>(
        &'life0 self,
        user_id: UserId,
    ) -> Pin<Box<dyn Future<Output = LockState> + 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,
        until: 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: UserKey, ) -> 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 that are currently locked or unlocked.

Source

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

Get the lock state of the user with the given ID.

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, until: Duration, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Suppress the vault timeout for the given user until the specified duration from now. Called when a heartbeat response is received, 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 devices leader’s IPC endpoint, given the current platform. There should only be one possible leader for any given device. For web clients, there is only one browser extension, for browser extensions there is only one desktop device, and for CLI clients there is also only one desktop device.

Implementors§