[][src]Trait ironoxide::group::GroupOps

pub trait GroupOps {
#[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
;
#[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
;
#[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
;
#[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
;
#[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
;
#[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
;
#[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
;
#[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
;
#[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
;
#[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
; }

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]

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]

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]

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]

Modifies or removes a group's name.

Returns the updated metadata of the group.

Arguments

  • id - ID of the group to update
  • name - New name for the group. Provide a Some to update to a new name or a None 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]

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]

Adds members to a group.

Returns successful and failed additions.

Arguments

  • id - ID of the group to add members to
  • users - 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]

Removes members from a group.

Returns successful and failed removals.

Arguments

  • id - ID of the group to remove members from
  • revoke_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]

Adds administrators to a group.

Returns successful and failed additions.

Arguments

  • id - ID of the group to add administrators to
  • users - 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]

Removes administrators from a group.

Returns successful and failed removals.

Arguments

  • id - ID of the group to remove administrators from
  • revoke_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]

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?;
Loading content...

Implementors

impl GroupOps for IronOxide[src]

Loading content...