pub struct AssumeRoleCredentialProvider { /* private fields */ }Expand description
Loads credentials through one fixed AWS STS AssumeRole flow.
Use reqsign_core::Granter with the SigV4 crate’s explicit AssumeRole
granter when the source credential and grant are supplied per vending
operation.
Implementations§
Source§impl AssumeRoleCredentialProvider
impl AssumeRoleCredentialProvider
Sourcepub fn new(role_arn: String, sts_signer: Signer<Credential>) -> Self
pub fn new(role_arn: String, sts_signer: Signer<Credential>) -> Self
Create a new fixed-flow AssumeRole credential provider.
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_external_id(self, id: String) -> Self
pub fn with_external_id(self, id: String) -> Self
Set the external ID.
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.
Set the session tags.
Sourcepub fn with_region(self, region: String) -> Self
pub fn with_region(self, region: String) -> Self
Set the region used to select a regional STS endpoint.
Sourcepub fn with_regional_sts_endpoint(self) -> Self
pub fn with_regional_sts_endpoint(self) -> Self
Use a regional STS endpoint.
Sourcepub fn with_mfa_serial(self, serial_number: String) -> Self
pub fn with_mfa_serial(self, serial_number: String) -> Self
Set the MFA serial number.
Sourcepub fn with_mfa_code(self, token_code: String) -> Self
pub fn with_mfa_code(self, token_code: String) -> Self
Set the MFA token code.
Trait Implementations§
Source§impl Debug for AssumeRoleCredentialProvider
impl Debug for AssumeRoleCredentialProvider
Source§impl ProvideCredential for AssumeRoleCredentialProvider
impl ProvideCredential for AssumeRoleCredentialProvider
Source§type Credential = Credential
type Credential = Credential
Credential returned by this loader. Read more
Source§async fn provide_credential(
&self,
ctx: &Context,
) -> Result<Option<Self::Credential>>
async fn provide_credential( &self, ctx: &Context, ) -> Result<Option<Self::Credential>>
Load signing credential from current env.
Auto Trait Implementations§
impl !RefUnwindSafe for AssumeRoleCredentialProvider
impl !UnwindSafe for AssumeRoleCredentialProvider
impl Freeze for AssumeRoleCredentialProvider
impl Send for AssumeRoleCredentialProvider
impl Sync for AssumeRoleCredentialProvider
impl Unpin for AssumeRoleCredentialProvider
impl UnsafeUnpin for AssumeRoleCredentialProvider
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
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
Credential returned by this loader.
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>>
Dyn version of
ProvideCredential::provide_credential.