Enum scratchstack_aws_principal::actor::PrincipalActor[][src]

pub enum PrincipalActor {
    AssumedRole(AssumedRoleDetails),
    FederatedUser(FederatedUserDetails),
    Group(GroupDetails),
    InstanceProfile(InstanceProfileDetails),
    Role(RoleDetails),
    RootUser(RootUserDetails),
    User(UserDetails),
}

An active, identified AWS principal – an actor who is making requests against a service.

In addition to the ARN, an IAM principal actor also has a unique id that changes whenever the principal is recreated. This is in contrast to a PolicyPrincipal, which lacks this id.

Variants

AssumedRole(AssumedRoleDetails)

Details for an assumed role.

FederatedUser(FederatedUserDetails)

Details for a federated user.

Details for an IAM group.

InstanceProfile(InstanceProfileDetails)

Details for an instance profile.

Details for an IAM role.

RootUser(RootUserDetails)

Details for the root user of an account.

Details for an IAM user.

Implementations

impl PrincipalActor[src]

pub fn assumed_role<S1, S2, S3, S4>(
    partition: S1,
    account_id: S2,
    role_name: S3,
    session_name: S4,
    token_issue_time: u64,
    token_expire_time: u64
) -> Result<Self, PrincipalError> where
    S1: Into<String>,
    S2: Into<String>,
    S3: Into<String>,
    S4: Into<String>, 
[src]

Return a principal for an assumed role.

Arguments:

  • partition: The partition being addressed. This must meet the following requirements or a PrincipalError::InvalidPartition error will be returned:
    • The partition must be composed of ASCII alphanumeric characters or -.
    • The partition must have between 1 and 32 characters.
    • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.
  • account_id: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.
  • role_name: The name of the role being assumed. This must meet the following requirements or a PrincipalError::InvalidRoleName error will be returned:
    • The name must contain between 1 and 64 characters.
    • The name must be composed to ASCII alphanumeric characters or one of , - . = @ _.
  • session_name: A name to assign to the session. This must meet the following requirements or a PrincipalError::InvalidSessionName error will be returned:
    • The session name must contain between 2 and 64 characters.
    • The session name must be composed to ASCII alphanumeric characters or one of , - . = @ _.
  • token_issue_time: The time in seconds since the Unix epoch when the token was issued.
  • token_expire_time: the time in seconds since the Unix epoch when the token will become invalid.

Return value

If all of the requirements are met, a PrincipalActor with AssumedRoleDetails details is returned. Otherwise, a PrincipalError error is returned.

pub fn federated_user<S1, S2, S3>(
    partition: S1,
    account_id: S2,
    user_name: S3,
    token_issue_time: u64,
    token_expire_time: u64
) -> Result<Self, PrincipalError> where
    S1: Into<String>,
    S2: Into<String>,
    S3: Into<String>, 
[src]

Return a principal for a federated user.

Arguments:

  • partition: The partition being addressed. This must meet the following requirements or a PrincipalError::InvalidPartition error will be returned:
    • The partition must be composed of ASCII alphanumeric characters or -.
    • The partition must have between 1 and 32 characters.
    • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.
  • account_id: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.
  • user_name: The name of the federated user. This must meet the following requirements or a PrincipalError::InvalidFederatedUserName error will be returned:
    • The name must contain between 2 and 64 characters.
    • The name must be composed to ASCII alphanumeric characters or one of , - . = @ _.
  • token_issue_time: The time in seconds since the Unix epoch when the token was issued.
  • token_expire_time: the time in seconds since the Unix epoch when the token will become invalid.

Return value

If all of the requirements are met, a PrincipalActor with FederatedUserDetails details is returned. Otherwise, a PrincipalError error is returned.

pub fn group<S1, S2, S3, S4, S5>(
    partition: S1,
    account_id: S2,
    path: S3,
    group_name: S4,
    group_id: S5
) -> Result<Self, PrincipalError> where
    S1: Into<String>,
    S2: Into<String>,
    S3: Into<String>,
    S4: Into<String>,
    S5: Into<String>, 
[src]

Return a principal for a group.

Arguments

  • partition: The partition being addressed. This must meet the following requirements or a PrincipalError::InvalidPartition error will be returned:
    • The partition must be composed of ASCII alphanumeric characters or -.
    • The partition must have between 1 and 32 characters.
    • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.
  • account_id: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.
  • path: The IAM path the group is under. This must meet the following requirements or a PrincipalError::InvalidPath error will be returned:
    • The path must contain between 1 and 512 characters.
    • The path must start and end with /.
    • All characters in the path must be in the ASCII range 0x21 (!) through 0x7E (~). The AWS documentation erroneously indicates that 0x7F (DEL) is acceptable; however, the IAM APIs reject this character.
  • group_name: The name of the group. This must meet the following requirements or a PrincipalError::InvalidGroupName error will be returned:
    • The name must contain between 1 and 128 characters.
    • The name must be composed to ASCII alphanumeric characters or one of , - . = @ _.
  • group_id: The universally-unique identifier for the group. This must be a 20 character base-32 string starting with AGPA or a PrincipalError::InvalidGroupId error will be returned.

Return value

If all of the requirements are met, a PrincipalActor with GroupDetails details is returned. Otherwise, a PrincipalError error is returned.

pub fn instance_profile<S1, S2, S3, S4, S5>(
    partition: S1,
    account_id: S2,
    path: S3,
    instance_profile_name: S4,
    instance_profile_id: S5
) -> Result<Self, PrincipalError> where
    S1: Into<String>,
    S2: Into<String>,
    S3: Into<String>,
    S4: Into<String>,
    S5: Into<String>, 
[src]

Return a principal for an instance profile.

Arguments

  • partition: The partition being addressed. This must meet the following requirements or a PrincipalError::InvalidPartition error will be returned:
    • The partition must be composed of ASCII alphanumeric characters or -.
    • The partition must have between 1 and 32 characters.
    • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.
  • account_id: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.
  • path: The IAM path the group is under. This must meet the following requirements or a PrincipalError::InvalidPath error will be returned:
    • The path must contain between 1 and 512 characters.
    • The path must start and end with /.
    • All characters in the path must be in the ASCII range 0x21 (!) through 0x7E (~). The AWS documentation erroneously indicates that 0x7F (DEL) is acceptable; however, the IAM APIs reject this character.
  • instance_profile_name: The name of the instance profile. This must meet the following requirements or a PrincipalError::InvalidInstanceProfileName error will be returned:
    • The name must contain between 1 and 128 characters.
    • The name must be composed to ASCII alphanumeric characters or one of , - . = @ _.
  • instance_profile_id: The universally-unique identifier for the instance profile. This must be a 20 character base-32 string starting AIPA or a PrincipalError::InvalidInstanceProfileId error will be returned.

Return value

If all of the requirements are met, a PrincipalActor with InstanceProfileDetails details is returned. Otherwise, a PrincipalError error is returned.

pub fn role<S1, S2, S3, S4, S5>(
    partition: S1,
    account_id: S2,
    path: S3,
    role_name: S4,
    role_id: S5
) -> Result<Self, PrincipalError> where
    S1: Into<String>,
    S2: Into<String>,
    S3: Into<String>,
    S4: Into<String>,
    S5: Into<String>, 
[src]

Return a principal for a role.

Arguments

  • partition: The partition being addressed. This must meet the following requirements or a PrincipalError::InvalidPartition error will be returned:
    • The partition must be composed of ASCII alphanumeric characters or -.
    • The partition must have between 1 and 32 characters.
    • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.
  • account_id: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.
  • path: The IAM path the group is under. This must meet the following requirements or a PrincipalError::InvalidPath error will be returned:
    • The path must contain between 1 and 512 characters.
    • The path must start and end with /.
    • All characters in the path must be in the ASCII range 0x21 (!) through 0x7E (~). The AWS documentation erroneously indicates that 0x7F (DEL) is acceptable; however, the IAM APIs reject this character.
  • role_name: The name of the role. This must meet the following requirements or a PrincipalError::InvalidRoleName error will be returned:
    • The name must contain between 1 and 64 characters.
    • The name must be composed to ASCII alphanumeric characters or one of , - . = @ _.
  • role_id: The universally-unique identifier for the role. This must be a 20 character base-32 string starting with AROA or a PrincipalError::InvalidRoleId error will be returned.

Return value

If all of the requirements are met, a PrincipalActor with RoleDetails details is returned. Otherwise, a PrincipalError error is returned.

pub fn root_user<S1, S2>(
    partition: S1,
    account_id: S2
) -> Result<Self, PrincipalError> where
    S1: Into<String>,
    S2: Into<String>, 
[src]

Return a principal for the root user of an account.

Arguments

  • partition: The partition being addressed. This must meet the following requirements or a PrincipalError::InvalidPartition error will be returned:
    • The partition must be composed of ASCII alphanumeric characters or -.
    • The partition must have between 1 and 32 characters.
    • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.
  • account_id: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.

Return value

If all of the requirements are met, a PrincipalActor with RootUserDetails details is returned. Otherwise, a PrincipalError error is returned.

pub fn user<S1, S2, S3, S4, S5>(
    partition: S1,
    account_id: S2,
    path: S3,
    user_name: S4,
    user_id: S5
) -> Result<Self, PrincipalError> where
    S1: Into<String>,
    S2: Into<String>,
    S3: Into<String>,
    S4: Into<String>,
    S5: Into<String>, 
[src]

Return a principal for a user.

Arguments

  • partition: The partition being addressed. This must meet the following requirements or a PrincipalError::InvalidPartition error will be returned:
    • The partition must be composed of ASCII alphanumeric characters or -.
    • The partition must have between 1 and 32 characters.
    • A - cannot appear in the first or last position, nor can it appear in two consecutive characters.
  • account_id: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.
  • path: The IAM path the group is under. This must meet the following requirements or a PrincipalError::InvalidPath error will be returned:
    • The path must contain between 1 and 512 characters.
    • The path must start and end with /.
    • All characters in the path must be in the ASCII range 0x21 (!) through 0x7E (~). The AWS documentation erroneously indicates that 0x7F (DEL) is acceptable; however, the IAM APIs reject this character.
  • user_name: The name of the user. This must meet the following requirements or a PrincipalError::InvalidUserName error will be returned:
    • The name must contain between 1 and 64 characters.
    • The name must be composed to ASCII alphanumeric characters or one of , - . = @ _.
  • user_id: The universally-unique identifier for the user. This must be a 20 character base-32 string starting with AIDA or a PrincipalError::InvalidUserId error will be returned.

Return value

If all of the requirements are met, a PrincipalActor with UserDetails details is returned. Otherwise, a PrincipalError error is returned.

Trait Implementations

impl Clone for PrincipalActor[src]

impl Debug for PrincipalActor[src]

impl Display for PrincipalActor[src]

impl Eq for PrincipalActor[src]

impl From<PrincipalActor> for PolicyPrincipal[src]

fn from(from: PrincipalActor) -> PolicyPrincipal[src]

Convert the PrincipalActor into a PolicyPrincipal.

This is a lossy conversion, losing the identifier or token details attached to the actor.

impl PartialEq<PrincipalActor> for PrincipalActor[src]

impl StructuralEq for PrincipalActor[src]

impl StructuralPartialEq for PrincipalActor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Data for T where
    T: Clone + Debug + PartialEq<T> + Eq + Send + Sync + 'static, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.