pub struct DefaultTokenChain { /* private fields */ }
Available on crate feature
sso
only.Expand description
Default access token provider chain
Currently, the default chain only examines the shared config
(~/.aws/config
) file and the SSO token cache to resolve an
access token.
The AWS CLI can be used to retrieve the initial access token into the SSO token cache. Once it’s there, the SDK can refresh automatically long as the it remains refreshable (it will eventually expire).
§Examples
Create a default chain with a custom region:
use aws_types::region::Region;
use aws_config::default_provider::token::DefaultTokenChain;
let token_provider = DefaultTokenChain::builder()
.region(Region::new("us-west-1"))
.build();
Create a default chain with no overrides:
use aws_config::default_provider::token::DefaultTokenChain;
let token_provider = DefaultTokenChain::builder().build();
Create a default chain that uses a different profile:
use aws_config::default_provider::token::DefaultTokenChain;
let token_provider = DefaultTokenChain::builder()
.profile_name("otherprofile")
.build();
Implementations§
Trait Implementations§
Source§impl Debug for DefaultTokenChain
impl Debug for DefaultTokenChain
Source§impl ProvideToken for DefaultTokenChain
impl ProvideToken for DefaultTokenChain
Source§fn provide_token<'a>(&'a self) -> ProvideToken<'a>where
Self: 'a,
fn provide_token<'a>(&'a self) -> ProvideToken<'a>where
Self: 'a,
Returns a future that provides an access token.
Auto Trait Implementations§
impl Freeze for DefaultTokenChain
impl !RefUnwindSafe for DefaultTokenChain
impl Send for DefaultTokenChain
impl Sync for DefaultTokenChain
impl Unpin for DefaultTokenChain
impl !UnwindSafe for DefaultTokenChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.