[][src]Trait ironoxide::user::UserOps

pub trait UserOps {
    fn user_create<'life0, 'life1, 'life2, 'async_trait>(
        jwt: &'life0 str,
        password: &'life1 str,
        user_create_opts: &'life2 UserCreateOpts,
        timeout: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = Result<UserCreateResult>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
;
fn user_list_devices<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<UserDeviceListResult>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn generate_new_device<'life0, 'life1, 'life2, 'async_trait>(
        jwt: &'life0 str,
        password: &'life1 str,
        device_create_options: &'life2 DeviceCreateOpts,
        timeout: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = Result<DeviceAddResult>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
;
fn user_delete_device<'life0, 'life1, 'async_trait>(
        &'life0 self,
        device_id: Option<&'life1 DeviceId>
    ) -> Pin<Box<dyn Future<Output = Result<DeviceId>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn user_verify<'life0, 'async_trait>(
        jwt: &'life0 str,
        timeout: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = Result<Option<UserResult>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait
;
fn user_get_public_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        users: &'life1 [UserId]
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<UserId, PublicKey>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn user_rotate_private_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        password: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<UserUpdatePrivateKeyResult>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Required methods

fn user_create<'life0, 'life1, 'life2, 'async_trait>(
    jwt: &'life0 str,
    password: &'life1 str,
    user_create_opts: &'life2 UserCreateOpts,
    timeout: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<UserCreateResult>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait, 

Sync a new user within the IronCore system.

Arguments

  • jwt - Valid IronCore or Auth0 JWT
  • password - Password used to encrypt and escrow the user's private master key
  • user_create_opts - see UserCreateOpts
  • timeout - timeout for this operation or None for no timeout. Timed out operations return IronOxideErr::OperationTimedOut

Returns

Newly generated UserCreateResult or Err. For most use cases, this public key can be discarded as IronCore escrows your user's keys. The escrowed keys are unlocked by the provided password.

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

Get all the devices for the current user

Returns

All devices for the current user, sorted by the device id.

fn generate_new_device<'life0, 'life1, 'life2, 'async_trait>(
    jwt: &'life0 str,
    password: &'life1 str,
    device_create_options: &'life2 DeviceCreateOpts,
    timeout: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<DeviceAddResult>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait, 

Generates a new device for the user specified in the signed JWT.

This will result in a new transform key (from the user's master private key to the new device's public key) being generated and stored with the IronCore Service.

Arguments

  • jwt - Valid IronCore JWT
  • password - Password used to encrypt and escrow the user's private key
  • device_create_options - Optional device create arguments, like device name
  • timeout - timeout for this operation or None for no timeout. Timed out operations return IronOxideErr::OperationTimedOut

Returns

Details about the newly created device.

fn user_delete_device<'life0, 'life1, 'async_trait>(
    &'life0 self,
    device_id: Option<&'life1 DeviceId>
) -> Pin<Box<dyn Future<Output = Result<DeviceId>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Delete a user device.

If deleting the currently signed in device (None for device_id), the sdk will need to be reinitialized with IronOxide.initialize() before further use.

Arguments

  • device_id - ID of the device to delete. Get from user_list_devices. If None, deletes the currently SDK contexts device which once deleted will cause this SDK instance to no longer function.

Returns

Id of deleted device or IronOxideErr

fn user_verify<'life0, 'async_trait>(
    jwt: &'life0 str,
    timeout: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<Option<UserResult>>> + Send + 'async_trait>> where
    'life0: 'async_trait, 

Verify a user given a JWT for their user record.

Arguments

  • jwt - Valid IronCore JWT
  • timeout - timeout for this operation or None for no timeout. Timed out operations return IronOxideErr::OperationTimedOut

Returns

Option of whether the user's account record exists in the IronCore system or not. Err if the request couldn't be made.

fn user_get_public_key<'life0, 'life1, 'async_trait>(
    &'life0 self,
    users: &'life1 [UserId]
) -> Pin<Box<dyn Future<Output = Result<HashMap<UserId, PublicKey>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Get a list of user public keys given their IDs. Allows discovery of which user IDs have keys in the IronCore system to determine of they can be added to groups or have documents shared with them.

Arguments

  • users - List of user IDs to check

Returns

Map from user ID to users public key. Only users who have public keys will be returned in the map.

fn user_rotate_private_key<'life0, 'life1, 'async_trait>(
    &'life0 self,
    password: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<UserUpdatePrivateKeyResult>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Rotate the current user's private key, but leave the public key the same. There's no black magic here! This is accomplished via multi-party computation with the IronCore webservice.

Arguments

password - Password to unlock the current user's user master key

Returns

The (encrypted) updated private key and associated metadata

Loading content...

Implementors

impl UserOps for IronOxide[src]

Loading content...