Struct aws_config::profile::token::ProfileFileTokenProvider
source · pub struct ProfileFileTokenProvider { /* private fields */ }
Expand description
AWS profile-based access token provider
This token provider loads SSO session config from ~/.aws/config
,
and uses that config to resolve a cached SSO token from ~/.aws/sso/cache
.
The AWS CLI can be used to establish the cached SSO token.
Generally, this provider is constructed via the default provider chain. However, it can also be manually constructed with the builder:
use aws_config::profile::ProfileFileTokenProvider;
let provider = ProfileFileTokenProvider::builder().build();
Note: this provider, when called, will load and parse the ~/.aws/config
file
only once. Parsed file contents will be cached indefinitely.
This provider requires a profile with a sso_session
configured. For example,
[default]
sso_session = example
region = us-west-2
[sso-session example]
sso_start_url = https://example.awsapps.com/start
sso_region = us-west-2
Implementations§
Trait Implementations§
source§impl Debug for ProfileFileTokenProvider
impl Debug for ProfileFileTokenProvider
source§impl ProvideToken for ProfileFileTokenProvider
impl ProvideToken for ProfileFileTokenProvider
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 ProfileFileTokenProvider
impl !RefUnwindSafe for ProfileFileTokenProvider
impl Send for ProfileFileTokenProvider
impl Sync for ProfileFileTokenProvider
impl Unpin for ProfileFileTokenProvider
impl !UnwindSafe for ProfileFileTokenProvider
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.