pub struct SignedRequest {
    pub method: String,
    pub service: String,
    pub region: Region,
    pub path: String,
    pub headers: BTreeMap<String, Vec<Vec<u8>>>,
    pub params: Params,
    pub scheme: Option<String>,
    pub hostname: Option<String>,
    pub payload: Option<SignedRequestPayload>,
    pub canonical_query_string: String,
    pub canonical_uri: String,
}
Expand description

A data structure for all the elements of an HTTP request that are involved in the Amazon Signature Version 4 signing process

Fields

method: String

The HTTP Method

service: String

The AWS Service

region: Region

The AWS Region

path: String

The HTTP request path

headers: BTreeMap<String, Vec<Vec<u8>>>

The HTTP Request Headers

params: Params

The HTTP request paramaters

scheme: Option<String>

The HTTP/HTTPS protocol

hostname: Option<String>

The AWS hostname

payload: Option<SignedRequestPayload>

The HTTP Content

canonical_query_string: String

The Standardised query string

canonical_uri: String

The Standardised URI

Implementations

Default constructor

Sets the value of the “content-type” header.

Sets the target hostname

Sets the target hostname using the current service type and region

See the implementation of build_hostname to see how this is done

Sets the new body (payload)

Sets the new body (payload) as a stream

Computes and sets the Content-MD5 header based on the current payload.

Has no effect if the payload is not set, or is not a buffer. Will not override an existing value for the Content-MD5 header.

Returns the current HTTP method

Returns the current path

Invokes canonical_uri(path) to return a canonical path

Returns the current canonical URI

Returns the current query string

Converts a paramater such as “example param”: “examplekey” into “&example+param=examplekey”

Returns the current headers

Returns the current http scheme (https or http)

Modify the region used for signing if needed, such as for AWS Organizations

Converts hostname to String if it exists, else it invokes build_hostname()

If the key exists in headers, set it to blank/unoccupied:

Add a value to the array of headers for the specified key. Headers are kept sorted by key name for use at signing (BTreeMap)

Adds parameter to the HTTP Request

Sets paramaters with a given variable of Params type

Generate a Presigned URL for AWS

See the documentation for more information.

Complement SignedRequest by ensuring the following HTTP headers are set accordingly:

  • host
  • content-type
  • content-length (if applicable)

Signs the request using Amazon Signature version 4 to verify identity. Authorization header uses AWS4-HMAC-SHA256 for signing.

Trait Implementations

Formats the value using the given formatter. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more