Struct AssumeRoleRequest

Source
pub struct AssumeRoleRequest {
    pub duration_seconds: u32,
    pub policy: Option<Policy>,
    pub role_arn: String,
    pub role_session_name: String,
    pub external_id: Option<String>,
}
Expand description

AssumeRole 请求体

Fields§

§duration_seconds: u32

Token 有效期。单位:秒。

Token 有效期最小值为 900 秒,最大值为要扮演角色的 MaxSessionDuration 时间。默认值为 3600 秒。

§policy: Option<Policy>

为 STS Token 额外添加的一个权限策略,进一步限制 STS Token 的权限。具体如下:

  • 如果指定该权限策略,则 STS Token 最终的权限策略取 RAM 角色权限策略与该权限策略的交集。
  • 如果不指定该权限策略,则 STS Token 最终的权限策略取 RAM 角色的权限策略。
§role_arn: String

要扮演的 RAM 角色 ARN。

§role_session_name: String

角色会话名称。

该参数为用户自定义参数。 通常设置为调用该 API 的用户身份,例如:用户名。在操作审计日志中, 即使是同一个 RAM 角色执行的操作, 也可以根据不同的 RoleSessionName 来区分实际操作者,以实现用户级别的访问审计。

长度为 2~64 个字符,可包含英文字母、数字和特殊字符.@-_

§external_id: Option<String>

角色外部 ID。 该参数为外部提供的用于表示角色的参数信息,主要功能是防止混淆代理人问题。

长度为 2~1224 个字符,可包含英文字母、数字和特殊字符 =,.@:/-_。正则为:[\w+=,.@:\/-]*

Implementations§

Source§

impl AssumeRoleRequest

Source

pub fn new( role_arn: &str, role_session_name: &str, policy: Option<Policy>, duration_seconds: u32, ) -> Self

Trait Implementations§

Source§

impl Serialize for AssumeRoleRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,