Struct aws_config::default_provider::token::DefaultTokenChain
source · 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>
Creates a shared type from an unshared type.