Skip to main content

AssumeRoleCredentialProvider

Struct AssumeRoleCredentialProvider 

Source
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

Source

pub fn new(role_arn: String, sts_signer: Signer<Credential>) -> Self

Create a new fixed-flow AssumeRole credential provider.

Source

pub fn with_role_session_name(self, name: String) -> Self

Set the role session name.

Source

pub fn with_external_id(self, id: String) -> Self

Set the external ID.

Source

pub fn with_duration_seconds(self, seconds: u32) -> Self

Set the duration in seconds.

Source

pub fn with_policy(self, policy: String) -> Self

Set the session policy.

Source

pub fn with_policy_arns(self, policy_arns: Vec<String>) -> Self

Set the session policy ARNs.

Source

pub fn with_tags(self, tags: Vec<(String, String)>) -> Self

Set the session tags.

Source

pub fn with_region(self, region: String) -> Self

Set the region used to select a regional STS endpoint.

Source

pub fn with_regional_sts_endpoint(self) -> Self

Use a regional STS endpoint.

Source

pub fn with_mfa_serial(self, serial_number: String) -> Self

Set the MFA serial number.

Source

pub fn with_mfa_code(self, token_code: String) -> Self

Set the MFA token code.

Source

pub fn from_env(ctx: &Context, sts_signer: Signer<Credential>) -> Option<Self>

Create a fixed-flow provider from AWS environment variables.

Trait Implementations§

Source§

impl Debug for AssumeRoleCredentialProvider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ProvideCredential for AssumeRoleCredentialProvider

Source§

type Credential = Credential

Credential returned by this loader. Read more
Source§

async fn provide_credential( &self, ctx: &Context, ) -> Result<Option<Self::Credential>>

Load signing credential from current env.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> ProvideCredentialDyn for T

Source§

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>>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V