pub trait GroupOps {
// Required methods
fn group_create(
&self,
group_create_opts: &GroupCreateOpts,
) -> impl Future<Output = Result<GroupCreateResult>> + Send;
fn group_get_metadata(
&self,
id: &GroupId,
) -> impl Future<Output = Result<GroupGetResult>> + Send;
fn group_list(&self) -> impl Future<Output = Result<GroupListResult>> + Send;
fn group_update_name(
&self,
id: &GroupId,
name: Option<&GroupName>,
) -> impl Future<Output = Result<GroupMetaResult>> + Send;
fn group_rotate_private_key(
&self,
id: &GroupId,
) -> impl Future<Output = Result<GroupUpdatePrivateKeyResult>> + Send;
fn group_add_members(
&self,
id: &GroupId,
users: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send;
fn group_remove_members(
&self,
id: &GroupId,
revoke_list: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send;
fn group_add_admins(
&self,
id: &GroupId,
users: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send;
fn group_remove_admins(
&self,
id: &GroupId,
revoke_list: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send;
fn group_delete(
&self,
id: &GroupId,
) -> impl Future<Output = Result<GroupId>> + Send;
}
Expand description
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§
Sourcefn group_create(
&self,
group_create_opts: &GroupCreateOpts,
) -> impl Future<Output = Result<GroupCreateResult>> + Send
fn group_create( &self, group_create_opts: &GroupCreateOpts, ) -> impl Future<Output = Result<GroupCreateResult>> + Send
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?;
Sourcefn group_get_metadata(
&self,
id: &GroupId,
) -> impl Future<Output = Result<GroupGetResult>> + Send
fn group_get_metadata( &self, id: &GroupId, ) -> impl Future<Output = Result<GroupGetResult>> + Send
Sourcefn group_list(&self) -> impl Future<Output = Result<GroupListResult>> + Send
fn group_list(&self) -> impl Future<Output = Result<GroupListResult>> + Send
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();
Sourcefn group_update_name(
&self,
id: &GroupId,
name: Option<&GroupName>,
) -> impl Future<Output = Result<GroupMetaResult>> + Send
fn group_update_name( &self, id: &GroupId, name: Option<&GroupName>, ) -> impl Future<Output = Result<GroupMetaResult>> + Send
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?;
Sourcefn group_rotate_private_key(
&self,
id: &GroupId,
) -> impl Future<Output = Result<GroupUpdatePrivateKeyResult>> + Send
fn group_rotate_private_key( &self, id: &GroupId, ) -> impl Future<Output = Result<GroupUpdatePrivateKeyResult>> + Send
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();
Sourcefn group_add_members(
&self,
id: &GroupId,
users: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
fn group_add_members( &self, id: &GroupId, users: &[UserId], ) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
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.
Sourcefn group_remove_members(
&self,
id: &GroupId,
revoke_list: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
fn group_remove_members( &self, id: &GroupId, revoke_list: &[UserId], ) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
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.
Sourcefn group_add_admins(
&self,
id: &GroupId,
users: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
fn group_add_admins( &self, id: &GroupId, users: &[UserId], ) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
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.
Sourcefn group_remove_admins(
&self,
id: &GroupId,
revoke_list: &[UserId],
) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
fn group_remove_admins( &self, id: &GroupId, revoke_list: &[UserId], ) -> impl Future<Output = Result<GroupAccessEditResult>> + Send
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.
Sourcefn group_delete(
&self,
id: &GroupId,
) -> impl Future<Output = Result<GroupId>> + Send
fn group_delete( &self, id: &GroupId, ) -> impl Future<Output = Result<GroupId>> + Send
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?;
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.