[][src]Struct rusoto_sts::StsSessionCredentialsProvider

pub struct StsSessionCredentialsProvider { /* fields omitted */ }

AwsCredentials provider that calls GetSessionToken using the provided StsClient. To use with MFA, pass in the MFA serial number then set the MFA code. You will need to ensure the provider has a valid code each time you acquire a new STS token.

Implementations

impl StsSessionCredentialsProvider[src]

pub fn new(
    sts_client: StsClient,
    duration: Option<Duration>,
    mfa_serial: Option<String>
) -> StsSessionCredentialsProvider
[src]

Creates a new StsSessionCredentialsProvider with the given StsClient and session parameters.

  • sts_client - The StsClient to use to acquire session tokens.
  • duration - The duration of the session tokens. Default 1 hour.
  • mfa_serial - Optional MFA hardware device serial number or virtual device ARN. Set the MFA code with set_mfa_code.

pub fn set_mfa_code<S>(&mut self, code: S) where
    S: Into<String>, 
[src]

Set the MFA code for use when acquiring session tokens.

pub fn clear_mfa_code(&mut self)[src]

Clear the MFA code.

pub async fn get_session_token<'_>(
    &'_ self
) -> Result<GetSessionTokenResponse, RusotoError<GetSessionTokenError>>
[src]

Calls GetSessionToken to get a session token from the STS Api. Optionally uses MFA if the MFA serial number and code are set.

Trait Implementations

impl ProvideAwsCredentials for StsSessionCredentialsProvider[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> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,