Module canonical

Module canonical 

Source
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§

AuthParamsunstable
Authentication parameters extracted from the header or query string.
CanonicalRequestunstable
A canonicalized request for AWS SigV4.
ContentTypeCharsetunstable
The Content-Type header value, along with the character set (if specified).
SliceSignedHeaderRequirements
Static implementation of SignedHeaderRequirements that uses slices of string slices.
VecSignedHeaderRequirements
SignedHeaderRequirements that can be dynamically changed.

Enums§

UriElementunstable
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§

SignedHeaderRequirements
Trait for informing validation routines indicating which headers must be signed in addition to the standard AWS SigV4 headers.

Functions§

canonicalize_query_to_stringunstable
Convert a HashMap of query parameters to a string for the canonical request.
canonicalize_uri_pathunstable
Normalizes the specified URI path, removing redundant slashes and relative path components (unless performing S3 canonicalization).
debug_headersunstable
Formats HTTP headers in a HashMap suitable for debugging.
get_content_type_and_charsetunstable
Get the content type and character set used in the body
is_rfc3986_unreservedunstable
Indicates whether the specified byte is RFC3986 unreserved – i.e., can be represented without being percent-encoded, e.g. ‘?’ -> ‘%3F’.
latin1_to_stringunstable
Convert a Latin-1 slice of bytes to a UTF-8 string.
normalize_header_valueunstable
Normalizes a header value by trimming whitespace and converting multiple spaces to a single space.
normalize_headersunstable
Returns a sorted dictionary containing the header names and their values.
normalize_query_string_elementunstable
Normalize a single element (key or value from key=value) of a query string.
normalize_uri_elementunstable
Normalize the URI or query string according to RFC 3986. This performs the following operations:
normalize_uri_path_componentunstable
Normalizes a path element of a URI.
query_string_to_normalized_mapunstable
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_asciiunstable
Returns a byte slice with leading and trailing ASCII whitespace bytes removed.
trim_ascii_endunstable
Returns a byte slice with trailing ASCII whitespace bytes removed.
trim_ascii_startunstable
Returns a byte slice with leading ASCII whitespace bytes removed.
u8_to_upper_hexunstable
Convert a byte to uppercase hex representation.
unescape_uri_encodingunstable
Unescapes a URI percent-encoded string.

Type Aliases§

ConstSignedHeaderRequirements
SignedHeaderRequirements from constant slices.