Expand description
Canonicalization functionality for signature generation and validation.
This includes various URL and header canonicalization functions, as well as the ability to create an AWS SigV4 canonical request.
Stability of this module is not guaranteed except for items exposed at the crate root. The functions and types are subject to change in minor/patch versions. This is exposed for testing purposes only.
Structs§
- Auth
Params unstable
- Authentication parameters extracted from the header or query string.
- Canonical
Request unstable
- A canonicalized request for AWS SigV4.
- Content
Type Charset unstable
- The Content-Type header value, along with the character set (if specified).
- Slice
Signed Header Requirements - Static implementation of SignedHeaderRequirements that uses slices of string slices.
- VecSigned
Header Requirements SignedHeaderRequirements
that can be dynamically changed.
Enums§
- UriElement
unstable
- Indicates whether we are normalizing a URI path element or a query string element. This is used to create the correct error message.
Constants§
- NO_
ADDITIONAL_ SIGNED_ HEADERS - Constant
SignedHeaderRequirements
value to use when no additional signed headers are required.
Traits§
- Signed
Header Requirements - Trait for informing validation routines indicating which headers must be signed in addition to the standard AWS SigV4 headers.
Functions§
- canonicalize_
query_ to_ string unstable
- Convert a
HashMap
of query parameters to a string for the canonical request. - canonicalize_
uri_ path unstable
- Normalizes the specified URI path, removing redundant slashes and relative path components (unless performing S3 canonicalization).
- debug_
headers unstable
- Formats HTTP headers in a HashMap suitable for debugging.
- get_
content_ type_ and_ charset unstable
- Get the content type and character set used in the body
- is_
rfc3986_ unreserved unstable
- Indicates whether the specified byte is RFC3986 unreserved – i.e., can be represented without being percent-encoded, e.g. ‘?’ -> ‘%3F’.
- latin1_
to_ string unstable
- Convert a Latin-1 slice of bytes to a UTF-8 string.
- normalize_
header_ value unstable
- Normalizes a header value by trimming whitespace and converting multiple spaces to a single space.
- normalize_
headers unstable
- Returns a sorted dictionary containing the header names and their values.
- normalize_
query_ string_ element unstable
- Normalize a single element (key or value from key=value) of a query string.
- normalize_
uri_ element unstable
- Normalize the URI or query string according to RFC 3986. This performs the following operations:
- normalize_
uri_ path_ component unstable
- Normalizes a path element of a URI.
- query_
string_ to_ normalized_ map unstable
- Normalize the query parameters by normalizing the keys and values of each parameter and return a
HashMap
mapping each key to a vector of values (since it is valid for a query parameters to appear multiple times). - trim_
ascii unstable
- Returns a byte slice with leading and trailing ASCII whitespace bytes removed.
- trim_
ascii_ end unstable
- Returns a byte slice with trailing ASCII whitespace bytes removed.
- trim_
ascii_ start unstable
- Returns a byte slice with leading ASCII whitespace bytes removed.
- u8_
to_ upper_ hex unstable
- Convert a byte to uppercase hex representation.
- unescape_
uri_ encoding unstable
- Unescapes a URI percent-encoded string.
Type Aliases§
- Const
Signed Header Requirements - SignedHeaderRequirements from constant slices.