Struct rusoto_sts::StsSessionCredentialsProvider [−][src]
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]
sts_client: StsClient,
duration: Option<Duration>,
mfa_serial: Option<String>
) -> StsSessionCredentialsProvider
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 withset_mfa_code
.
pub fn set_mfa_code<S>(&mut self, code: S) where
S: Into<String>,
[src]
S: Into<String>,
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]
&self
) -> Result<GetSessionTokenResponse, RusotoError<GetSessionTokenError>>
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]
fn credentials<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AwsCredentials, CredentialsError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AwsCredentials, CredentialsError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for StsSessionCredentialsProvider
impl Send for StsSessionCredentialsProvider
impl Sync for StsSessionCredentialsProvider
impl Unpin for StsSessionCredentialsProvider
impl !UnwindSafe for StsSessionCredentialsProvider
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,