pub struct ProfileFileTokenProvider { /* private fields */ }
Available on crate feature
sso
only.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>
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.