Module aws_format

Module aws_format 

Source
Expand description

AWS-specific formatting.

Any creation of strings goes here.

Functions§

authorization_header_string
Generate the AWS authorization header.
canonical_query_string
Generate a canonical query string from the query pairs in the given URL.
canonical_request_string
Generate a canonical request. Assumes headers are already sorted and aws canonical.
canonical_uri_string
Generate a canonical URI string from the given URL. This is used in the AWS canonical request. It is always the path of the URL with percent encoding applied.
credential_scope_string
Generate an AWS scope string. This is used in the AWS authorization header. It is always YYYYMMDD’T’HHMMSS’Z’/region/service/aws4_request.
get_keys
Get the keys from a list of key-value pairs. Allocates.
query_params_string
Get the query params string. It is always ?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=credential&X-Amz-Date=long_date&X-Amz-Expires=expires&X-Amz-SignedHeaders=signed_headers. The credential is always access_key/credential_scope_string(datetime, region, service) with percent encoding. The datetime is always to_long_datetime(datetime).
security_token_string
Get the security token string. It is always &X-Amz-Security-Token=token with percent encoding.
string_to_sign
Generate the AWS string to sign. This is used in the AWS authorization header.
to_long_datetime
Convert a time::OffsetDateTime to a long date string. This is used in the AWS credential scope. It is always UTC, YYYYMMDD’T’HHMMSS’Z’, sortable and lexicographically comparable.
to_short_datetime
Convert a time::OffsetDateTime to a short date string. This is used in the AWS credential scope. It is always UTC, YYYYMMDD, sortable and lexicographically comparable.
uri_encode
Encode a URI following the specific requirements of the AWS service.