pub struct AssumeRoleWithWebIdentityCredentialProvider { /* private fields */ }Expand description
AssumeRoleWithWebIdentityCredentialProvider will load credential via assume role with web identity.
This provider reads configuration from:
- An explicitly configured subject-token provider or token file
- Environment variables when no explicit token source is configured
Implementations§
Source§impl AssumeRoleWithWebIdentityCredentialProvider
impl AssumeRoleWithWebIdentityCredentialProvider
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new AssumeRoleWithWebIdentityCredentialProvider instance that reads from environment variables.
Sourcepub fn with_config(role_arn: String, token_file: PathBuf) -> Self
pub fn with_config(role_arn: String, token_file: PathBuf) -> Self
Create a new AssumeRoleWithWebIdentityCredentialProvider instance with explicit configuration.
Sourcepub fn with_role_arn(self, role_arn: impl Into<String>) -> Self
pub fn with_role_arn(self, role_arn: impl Into<String>) -> Self
Set the role ARN.
Sourcepub fn with_web_identity_token_file(
self,
token_file: impl Into<PathBuf>,
) -> Self
pub fn with_web_identity_token_file( self, token_file: impl Into<PathBuf>, ) -> Self
Set the web identity token file path.
This replaces any previously configured subject-token source.
Sourcepub fn with_subject_token(self, subject_token: impl Into<String>) -> Self
pub fn with_subject_token(self, subject_token: impl Into<String>) -> Self
Set a caller-provided subject token.
This replaces any previously configured subject-token source.
Sourcepub fn with_subject_token_and_expiration(
self,
subject_token: impl Into<String>,
expires_at: Timestamp,
) -> Self
pub fn with_subject_token_and_expiration( self, subject_token: impl Into<String>, expires_at: Timestamp, ) -> Self
Set a caller-provided subject token with its absolute source expiration.
This replaces any previously configured subject-token source.
Sourcepub fn with_role_session_name(self, name: String) -> Self
pub fn with_role_session_name(self, name: String) -> Self
Set the role session name.
Sourcepub fn with_duration_seconds(self, seconds: u32) -> Self
pub fn with_duration_seconds(self, seconds: u32) -> Self
Set the duration in seconds.
Sourcepub fn with_policy(self, policy: String) -> Self
pub fn with_policy(self, policy: String) -> Self
Set the session policy.
Sourcepub fn with_policy_arns(self, policy_arns: Vec<String>) -> Self
pub fn with_policy_arns(self, policy_arns: Vec<String>) -> Self
Set the session policy ARNs.
Sourcepub fn with_region(self, region: String) -> Self
pub fn with_region(self, region: String) -> Self
Set the region.
Sourcepub fn with_regional_sts_endpoint(self) -> Self
pub fn with_regional_sts_endpoint(self) -> Self
Use regional STS endpoint.
Trait Implementations§
Source§impl ProvideCredential for AssumeRoleWithWebIdentityCredentialProvider
impl ProvideCredential for AssumeRoleWithWebIdentityCredentialProvider
Source§type Credential = Credential
type Credential = Credential
Source§async fn provide_credential(
&self,
ctx: &Context,
) -> Result<Option<Self::Credential>>
async fn provide_credential( &self, ctx: &Context, ) -> Result<Option<Self::Credential>>
Auto Trait Implementations§
impl Freeze for AssumeRoleWithWebIdentityCredentialProvider
impl RefUnwindSafe for AssumeRoleWithWebIdentityCredentialProvider
impl Send for AssumeRoleWithWebIdentityCredentialProvider
impl Sync for AssumeRoleWithWebIdentityCredentialProvider
impl Unpin for AssumeRoleWithWebIdentityCredentialProvider
impl UnsafeUnpin for AssumeRoleWithWebIdentityCredentialProvider
impl UnwindSafe for AssumeRoleWithWebIdentityCredentialProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
Source§type Credential = <T as ProvideCredential>::Credential
type Credential = <T as ProvideCredential>::Credential
Source§fn provide_credential_dyn<'a>(
&'a self,
ctx: &'a Context,
) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
fn provide_credential_dyn<'a>( &'a self, ctx: &'a Context, ) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
ProvideCredential::provide_credential.