[−][src]Trait ironoxide::user::UserOps
Required methods
fn user_create(jwt: &str, password: &str) -> Result<UserCreateKeyPair>
Sync a new user within the IronCore system.
Arguments
jwt
- Valid IronCore or Auth0 JWTpassword
- Password used to encrypt and escrow the user's private master key
Returns
Newly generated UserCreateKeyPair
or Err. For most use cases this key pair can
be discarded as IronCore escrows your user's keys. The escrowed keys are unlocked
by the provided password.
fn user_list_devices(&self) -> Result<UserDeviceListResult>
Get all the devices for the current user
Returns
All devices for the current user, sorted by the device id.
fn generate_new_device(
jwt: &str,
password: &str,
device_create_options: &DeviceCreateOpts
) -> Result<DeviceContext>
jwt: &str,
password: &str,
device_create_options: &DeviceCreateOpts
) -> Result<DeviceContext>
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 JWTpassword
- Password used to encrypt and escrow the user's private keydevice_create_options
- Optional device create arguments, like device name
Returns
Details about the newly created device.
fn user_delete_device(&self, device_id: Option<&DeviceId>) -> Result<DeviceId>
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 fromuser_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(jwt: &str) -> Result<Option<UserVerifyResult>>
Verify a user given a JWT for their user record.
Arguments
jwt
- Valid IronCore JWT
Returns
Option of whether the users account record exists in the IronCore system or not. Err if the request couldn't be made.
fn user_get_public_key(
&self,
users: &[UserId]
) -> Result<HashMap<UserId, PublicKey>>
&self,
users: &[UserId]
) -> Result<HashMap<UserId, PublicKey>>
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.
Implementors
impl UserOps for IronOxide
[src]
fn user_verify(jwt: &str) -> Result<Option<UserVerifyResult>>
[src]
fn user_create(jwt: &str, password: &str) -> Result<UserCreateKeyPair>
[src]
fn generate_new_device(
jwt: &str,
password: &str,
device_create_options: &DeviceCreateOpts
) -> Result<DeviceContext>
[src]
jwt: &str,
password: &str,
device_create_options: &DeviceCreateOpts
) -> Result<DeviceContext>
fn user_get_public_key(
&self,
users: &[UserId]
) -> Result<HashMap<UserId, PublicKey>>
[src]
&self,
users: &[UserId]
) -> Result<HashMap<UserId, PublicKey>>