pub struct SigV4Authenticator { /* private fields */ }
Available on crate feature
unstable
only.Expand description
Low-level structure for performing AWS SigV4 authentication after a canonical request has been generated.
Implementations§
Source§impl SigV4Authenticator
impl SigV4Authenticator
Sourcepub fn builder() -> SigV4AuthenticatorBuilder
pub fn builder() -> SigV4AuthenticatorBuilder
Create a builder for SigV4Authenticator
.
Sourcepub fn canonical_request_sha256(&self) -> [u8; 32]
pub fn canonical_request_sha256(&self) -> [u8; 32]
Retrieve the SHA-256 hash of the canonical request.
Sourcepub fn credential(&self) -> &str
pub fn credential(&self) -> &str
Retrieve the credential passed into the request, in the form of keyid/date/region/service/aws4_request
.
Sourcepub fn session_token(&self) -> Option<&str>
pub fn session_token(&self) -> Option<&str>
Retrieve the optional session token.
Sourcepub fn request_timestamp(&self) -> DateTime<Utc>
pub fn request_timestamp(&self) -> DateTime<Utc>
Retrieve the timestamp of the request.
Sourcepub fn prevalidate(
&self,
region: &str,
service: &str,
server_timestamp: DateTime<Utc>,
allowed_mismatch: Duration,
) -> Result<(), SignatureError>
pub fn prevalidate( &self, region: &str, service: &str, server_timestamp: DateTime<Utc>, allowed_mismatch: Duration, ) -> Result<(), SignatureError>
Verify the request parameters make sense for the region, service, and specified timestamp. This must be called successfully before calling validate_signature.
Sourcepub async fn get_signing_key<S, F>(
&self,
region: &str,
service: &str,
get_signing_key: &mut S,
) -> Result<GetSigningKeyResponse, SignatureError>where
S: Service<GetSigningKeyRequest, Response = GetSigningKeyResponse, Error = BoxError, Future = F> + Send,
F: Future<Output = Result<GetSigningKeyResponse, BoxError>> + Send,
pub async fn get_signing_key<S, F>(
&self,
region: &str,
service: &str,
get_signing_key: &mut S,
) -> Result<GetSigningKeyResponse, SignatureError>where
S: Service<GetSigningKeyRequest, Response = GetSigningKeyResponse, Error = BoxError, Future = F> + Send,
F: Future<Output = Result<GetSigningKeyResponse, BoxError>> + Send,
Return the signing key (kSigning
from the AWS documentation)
for the request.
Sourcepub fn get_string_to_sign(&self) -> Vec<u8> ⓘ
pub fn get_string_to_sign(&self) -> Vec<u8> ⓘ
Return the string to sign for the request.
Sourcepub async fn validate_signature<S, F>(
&self,
region: &str,
service: &str,
server_timestamp: DateTime<Utc>,
allowed_mismatch: Duration,
get_signing_key: &mut S,
) -> Result<SigV4AuthenticatorResponse, SignatureError>where
S: Service<GetSigningKeyRequest, Response = GetSigningKeyResponse, Error = BoxError, Future = F> + Send,
F: Future<Output = Result<GetSigningKeyResponse, BoxError>> + Send,
pub async fn validate_signature<S, F>(
&self,
region: &str,
service: &str,
server_timestamp: DateTime<Utc>,
allowed_mismatch: Duration,
get_signing_key: &mut S,
) -> Result<SigV4AuthenticatorResponse, SignatureError>where
S: Service<GetSigningKeyRequest, Response = GetSigningKeyResponse, Error = BoxError, Future = F> + Send,
F: Future<Output = Result<GetSigningKeyResponse, BoxError>> + Send,
Validate the request signature.
Trait Implementations§
Source§impl Clone for SigV4Authenticator
impl Clone for SigV4Authenticator
Source§fn clone(&self) -> SigV4Authenticator
fn clone(&self) -> SigV4Authenticator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SigV4Authenticator
impl Debug for SigV4Authenticator
Source§impl Default for SigV4Authenticator
impl Default for SigV4Authenticator
Source§fn default() -> SigV4Authenticator
fn default() -> SigV4Authenticator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SigV4Authenticator
impl RefUnwindSafe for SigV4Authenticator
impl Send for SigV4Authenticator
impl Sync for SigV4Authenticator
impl Unpin for SigV4Authenticator
impl UnwindSafe for SigV4Authenticator
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