[−][src]Trait ironoxide::group::GroupOps
IronOxide Group Operations
Key Terms
- ID - The ID representing a group. It must be unique within the group's segment and will not be encrypted.
- Name - The human-readable name of a group. It does not need to be unique and will not be encrypted.
- Member - A user who is able to encrypt and decrypt data using the group.
- Admin - A user who is able to manage the group's member and admin lists. An admin cannot encrypt or decrypt data using the group unless they first add themselves as group members or are added by another admin.
- Owner - The user who owns the group. The owner has the same permissions as a group admin, but is protected from being removed as a group admin.
- Rotation - Changing a group's private key while leaving its public key unchanged. This can be accomplished by calling group_rotate_private_key.
Required methods
#[must_use]pub fn group_create<'life0, 'life1, 'async_trait>(
&'life0 self,
group_create_opts: &'life1 GroupCreateOpts
) -> Pin<Box<dyn Future<Output = Result<GroupCreateResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
group_create_opts: &'life1 GroupCreateOpts
) -> Pin<Box<dyn Future<Output = Result<GroupCreateResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Creates a group.
With default GroupCreateOpts
, the group will be assigned an ID and have no name. The creating user will become the
owner of the group and the only group member and administrator.
Arguments
group_create_opts
- Group creation parameters. Default values are provided with
GroupCreateOpts::default()
Examples
let group_id = Some(GroupId::try_from("empl412")?); let opts = GroupCreateOpts::new(group_id, None, true, true, None, vec![], vec![], false); let group = sdk.group_create(&opts).await?;
#[must_use]pub fn group_get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupGetResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupGetResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Gets the full metadata for a group.
The encrypted private key for the group will not be returned.
Arguments
id
- ID of the group to retrieve
Examples
let group_id = GroupId::try_from("empl412")?; let group_metadata = sdk.group_get_metadata(&group_id).await?;
#[must_use]pub fn group_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<GroupListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<GroupListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Lists all of the groups that the current user is an admin or a member of.
Examples
let group_list = sdk.group_list().await?; let groups: Vec<GroupMetaResult> = group_list.result().to_vec();
#[must_use]pub fn group_update_name<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
name: Option<&'life2 GroupName>
) -> Pin<Box<dyn Future<Output = Result<GroupMetaResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
name: Option<&'life2 GroupName>
) -> Pin<Box<dyn Future<Output = Result<GroupMetaResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Modifies or removes a group's name.
Returns the updated metadata of the group.
Arguments
id
- ID of the group to updatename
- New name for the group. Provide aSome
to update to a new name or aNone
to clear the group's name
Examples
let group_id = GroupId::try_from("empl412")?; let new_name = GroupName::try_from("HQ Employees")?; let new_metadata = sdk.group_update_name(&group_id, Some(&new_name)).await?;
#[must_use]pub fn group_rotate_private_key<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupUpdatePrivateKeyResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupUpdatePrivateKeyResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Rotates a group's private key while leaving its public key unchanged.
There's no black magic here! This is accomplished via multi-party computation with the IronCore webservice.
Note: You must be an administrator of a group in order to rotate its private key.
Arguments
id
- ID of the group whose private key should be rotated
Examples
let group_id = GroupId::try_from("empl412")?; let rotate_result = sdk.group_rotate_private_key(&group_id).await?; let new_rotation = rotate_result.needs_rotation();
#[must_use]pub fn group_add_members<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
users: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
users: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Adds members to a group.
Returns successful and failed additions.
Arguments
id
- ID of the group to add members tousers
- List of users to add as group members
Examples
let group_id = GroupId::try_from("empl412")?; let user = UserId::try_from("colt")?; let add_result = sdk.group_add_members(&group_id, &vec![user]).await?; let new_members: Vec<UserId> = add_result.succeeded().to_vec(); let failures: Vec<GroupAccessEditErr> = add_result.failed().to_vec();
Errors
This operation supports partial success. If the request succeeds, then the resulting GroupAccessEditResult
will indicate which additions succeeded and which failed, and it will provide an explanation for each failure.
#[must_use]pub fn group_remove_members<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Removes members from a group.
Returns successful and failed removals.
Arguments
id
- ID of the group to remove members fromrevoke_list
- List of users to remove as group members
Examples
let group_id = GroupId::try_from("empl412")?; let user = UserId::try_from("colt")?; let remove_result = sdk.group_remove_members(&group_id, &vec![user]).await?; let removed_members: Vec<UserId> = remove_result.succeeded().to_vec(); let failures: Vec<GroupAccessEditErr> = remove_result.failed().to_vec();
Errors
This operation supports partial success. If the request succeeds, then the resulting GroupAccessEditResult
will indicate which removals succeeded and which failed, and it will provide an explanation for each failure.
#[must_use]pub fn group_add_admins<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
users: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
users: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Adds administrators to a group.
Returns successful and failed additions.
Arguments
id
- ID of the group to add administrators tousers
- List of users to add as group administrators
Examples
let group_id = GroupId::try_from("empl412")?; let user = UserId::try_from("colt")?; let add_result = sdk.group_add_admins(&group_id, &vec![user]).await?; let new_admins: Vec<UserId> = add_result.succeeded().to_vec(); let failures: Vec<GroupAccessEditErr> = add_result.failed().to_vec();
Errors
This operation supports partial success. If the request succeeds, then the resulting GroupAccessEditResult
will indicate which additions succeeded and which failed, and it will provide an explanation for each failure.
#[must_use]pub fn group_remove_admins<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Removes administrators from a group.
Returns successful and failed removals.
Arguments
id
- ID of the group to remove administrators fromrevoke_list
- List of users to remove as group administrators
Examples
let group_id = GroupId::try_from("empl412")?; let user = UserId::try_from("colt")?; let remove_result = sdk.group_remove_admins(&group_id, &vec![user]).await?; let removed_admins: Vec<UserId> = remove_result.succeeded().to_vec(); let failures: Vec<GroupAccessEditErr> = remove_result.failed().to_vec();
Errors
This operation supports partial success. If the request succeeds, then the resulting GroupAccessEditResult
will indicate which removals succeeded and which failed, and it will provide an explanation for each failure.
#[must_use]pub fn group_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupId>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupId>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Deletes a group.
A group can be deleted even if it has existing members and administrators.
Warning: Deleting a group will prevent its members from decrypting all of the documents previously encrypted to the group. Caution should be used when deleting groups.
Arguments
id
- ID of the group to delete
Examples
let group_id = GroupId::try_from("empl412")?; let deleted_group_id = sdk.group_delete(&group_id).await?;
Implementors
impl GroupOps for IronOxide
[src]
pub fn group_create<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 GroupCreateOpts
) -> Pin<Box<dyn Future<Output = Result<GroupCreateResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
opts: &'life1 GroupCreateOpts
) -> Pin<Box<dyn Future<Output = Result<GroupCreateResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
pub fn group_get_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupGetResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupGetResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
pub fn group_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<GroupListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<GroupListResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn group_update_name<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
name: Option<&'life2 GroupName>
) -> Pin<Box<dyn Future<Output = Result<GroupMetaResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
name: Option<&'life2 GroupName>
) -> Pin<Box<dyn Future<Output = Result<GroupMetaResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
pub fn group_rotate_private_key<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupUpdatePrivateKeyResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupUpdatePrivateKeyResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
pub fn group_add_members<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
grant_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
grant_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
pub fn group_remove_members<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
pub fn group_add_admins<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
users: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
users: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
pub fn group_remove_admins<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId,
revoke_list: &'life2 [UserId]
) -> Pin<Box<dyn Future<Output = Result<GroupAccessEditResult>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
pub fn group_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupId>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: &'life1 GroupId
) -> Pin<Box<dyn Future<Output = Result<GroupId>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,