[][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.

Methods

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 fn get_session_token(&self) -> StsSessionCredentialsProviderFuture[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]

type Future = StsSessionCredentialsProviderFuture

The future response value.

Auto Trait Implementations

impl Send for StsSessionCredentialsProvider

impl Sync for StsSessionCredentialsProvider

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self