SignatureError

Enum SignatureError 

Source
#[non_exhaustive]
pub enum SignatureError { ExpiredToken(String), IO(Error), InternalServiceError(Box<dyn Error + Send + Sync>), InvalidBodyEncoding(String), InvalidClientTokenId(String), InvalidContentType(String), InvalidRequestMethod(String), IncompleteSignature(String), InvalidURIPath(String), MalformedQueryString(String), MissingAuthenticationToken(String), SignatureDoesNotMatch(Option<String>), }
Expand description

Error returned when an attempt at validating an AWS SigV4 signature fails.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ExpiredToken(String)

The security token included with the request is expired.

§

IO(Error)

Validation failed due to an underlying I/O error.

§

InternalServiceError(Box<dyn Error + Send + Sync>)

Validation failed due to an internal service error.

§

InvalidBodyEncoding(String)

The request body used an unsupported character set encoding. Currently only UTF-8 is supported.

§

InvalidClientTokenId(String)

The AWS access key provided does not exist in our records.

§

InvalidContentType(String)

The content-type of the request is unsupported.

§

InvalidRequestMethod(String)

Invalid request method.

§

IncompleteSignature(String)

The request signature does not conform to AWS standards. Sample messages:
Authorization header requires 'Credential' parameter. Authorization=...
Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header.
Date must be in ISO-8601 'basic format'. Got '...'. See http://en.wikipedia.org/wiki/ISO_8601
Unsupported AWS 'algorithm': 'AWS4-HMAC-SHA512'

§

InvalidURIPath(String)

The URI path includes invalid components. This can be a malformed hex encoding (e.g. %0J), a non-absolute URI path (foo/bar), or a URI path that attempts to navigate above the root (/x/../../../y).

§

MalformedQueryString(String)

A query parameter was malformed – the value could not be decoded as UTF-8, or the parameter was empty and this is not allowed (e.g. a signature parameter), or the parameter could not be parsed (e.g., the X-Amz-Date parameter is not a valid date).

Incomplete trailing escape % sequence

§

MissingAuthenticationToken(String)

The request must contain either a valid (registered) AWS access key ID or X.509 certificate. Sample messages:
Request is missing Authentication Token

§

SignatureDoesNotMatch(Option<String>)

Signature did not match the calculated signature value. Example messages:
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
Signature expired: 20210502T144040Z is now earlier than 20210502T173143Z (20210502T174643Z - 15 min.)
Signature not yet current: 20210502T183640Z is still later than 20210502T175140Z (20210502T173640Z + 15 min.)

Trait Implementations§

Source§

impl Debug for SignatureError

Source§

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

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

impl Display for SignatureError

Source§

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

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

impl Error for SignatureError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Box<dyn Error + Send + Sync>> for SignatureError

Source§

fn from(e: Box<dyn Error + Send + Sync>) -> SignatureError

Converts to this type from the input type.
Source§

impl From<Error> for SignatureError

Source§

fn from(e: IOError) -> SignatureError

Converts to this type from the input type.
Source§

impl ServiceError for SignatureError

Source§

fn error_code(&self) -> &'static str

The string status code for this error.
Source§

fn http_status(&self) -> StatusCode

The HTTP status code for this error.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.