Enum SignatureError

Source
pub enum SignatureError {
Show 17 variants IO(Error), InvalidBodyEncoding { message: String, }, InvalidCredential { message: String, }, InvalidSecretKey, InvalidSignature { message: String, }, InvalidSigningKeyKind { message: String, }, InvalidURIPath { message: String, }, MalformedHeader { message: String, }, MalformedParameter { message: String, }, MalformedSignature { message: String, }, MissingHeader { header: String, }, MissingParameter { parameter: String, }, MultipleHeaderValues { header: String, }, MultipleParameterValues { parameter: String, }, TimestampOutOfRange { minimum: DateTime<Utc>, maximum: DateTime<Utc>, received: DateTime<Utc>, }, UnknownAccessKey { access_key: String, }, UnknownSignatureAlgorithm { algorithm: String, },
}
Expand description

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

Variants§

§

IO(Error)

Validation failed due to an underlying I/O error.

§

InvalidBodyEncoding

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

Fields

§message: String

A message describing the error.

§

InvalidCredential

The request signature specified an invalid credential – either the access key was not specified, or the credential scope (in the form <code>_date_/_region_/_service_/aws4_request</code>) did not match the expected value for the server.

Fields

§message: String

A message describing the error.

§

InvalidSecretKey

The secret key contains invalid bytes.

§

InvalidSignature

The signature passed in the request did not match the calculated signature value.

Fields

§message: String

A message describing the error.

§

InvalidSigningKeyKind

The type of signing key is incorrect for this operation.

Fields

§message: String

A message describing the error.

§

InvalidURIPath

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

Fields

§message: String

A message describing the error.

§

MalformedHeader

An HTTP header was malformed – the value could not be decoded as UTF-8, or the header was empty and this is not allowed (e.g. the content-type header), or the header could not be parsed (e.g., the date header is not a valid date).

Fields

§message: String

A message describing the error.

§

MalformedParameter

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

Fields

§message: String

A message describing the error.

§

MalformedSignature

The AWS SigV4 signature was malformed in some way. This can include invalid timestamp formats, missing authorization components, or unparseable components.

Fields

§message: String

A message describing the error.

§

MissingHeader

A required HTTP header (and its equivalent in the query string) is missing.

Fields

§header: String

The name of the missing header.

§

MissingParameter

A required query parameter is missing. This is used internally in the library; external callers only see MissingHeader.

Fields

§parameter: String

The name of the missing query parameter.

§

MultipleHeaderValues

An HTTP header that can be specified only once was specified multiple times.

Fields

§header: String

The name of the header.

§

MultipleParameterValues

A query parameter that can be specified only once was specified multiple times.

Fields

§parameter: String

The name of the query parameter.

§

TimestampOutOfRange

The timestamp in the request is out of the allowed range.

Fields

§minimum: DateTime<Utc>

The minimum allowed timestamp.

§maximum: DateTime<Utc>

The maximum allowed timestamp.

§received: DateTime<Utc>

The timestamp received in the request.

§

UnknownAccessKey

The access key specified in the request is unknown.

Fields

§access_key: String

The unknown access key.

§

UnknownSignatureAlgorithm

The signature algorithm requested by the caller is unknown. This library only supports the AWS4-HMAC-SHA256 algorithm.

Fields

§algorithm: String

The unknown signature algorithm.

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<Error> for SignatureError

Source§

fn from(e: IOError) -> SignatureError

Converts to this type from the input type.

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