Skip to main content

S3ExpressSessionProvider

Struct S3ExpressSessionProvider 

Source
pub struct S3ExpressSessionProvider { /* private fields */ }
Expand description

S3 Express One Zone session provider that creates session credentials.

This provider implements the CreateSession API for S3 Express One Zone buckets, which provides low-latency access through temporary session-based credentials.

§Important

  • The session token returned by this provider should be used with the x-amz-s3session-token header instead of the standard x-amz-security-token header when making requests to S3 Express One Zone buckets.
  • This provider does not cache sessions internally. The upper layer (e.g., Signer) handles credential caching and will request new sessions when they expire.

§Example

use reqsign_aws_v4::{S3ExpressSessionProvider, DefaultCredentialProvider};
use reqsign_core::ProvideCredential;

let provider = S3ExpressSessionProvider::new(
    "my-bucket--usw2-az1--x-s3",
    DefaultCredentialProvider::new(),
);

// Each call to provide_credential creates a new session

Implementations§

Source§

impl S3ExpressSessionProvider

Source

pub fn new( bucket: impl Into<String>, provider: impl ProvideCredential<Credential = Credential> + 'static, ) -> Self

Create a new S3 Express session provider for a specific bucket.

§Arguments
  • bucket - The S3 Express One Zone bucket name (e.g., “my-bucket–usw2-az1–x-s3”)
  • provider - The base credential provider to use for CreateSession API calls

Trait Implementations§

Source§

impl Debug for S3ExpressSessionProvider

Source§

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

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

impl ProvideCredential for S3ExpressSessionProvider

Source§

type Credential = Credential

Credential returned by this loader. Read more
Source§

fn provide_credential<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 Context, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Credential>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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