SigV4 Request Generator¶
View Licence Agreement- class sosw.components.sigv4.AwsSigV4RequestGenerator(**kwargs)[source]¶
Signature Version 4 (SigV4) is the process to add authentication information to AWS API requests sent by HTTP. For security, most requests to AWS must be signed with an access key. The access key consists of an access key ID and secret access key, which are commonly referred to as your security credentials.
How Signature Version 4 works:
Create a canonical request.
Use the canonical request and additional metadata to create a string for signing.
Derive a signing key from your AWS secret access key. Then use the signing key, and the string from the previous
Add the resulting signature to the HTTP request in a header.
- get_aws_sigv4_headers(request)[source]¶
Returns a dictionary containing the necessary headers for Amazon’s signature version 4 signing process.
- static get_headers_and_credential_date()[source]¶
Create a date for headers and the credential string
- static get_payload_hash(request)[source]¶
Create payload hash. For GET requests, the payload is an empty string (“”)
- static get_canonical_querystring(parsed_url)[source]¶
Create the canonical query string. According to AWS, by the end of this function our query string values must be URL-encoded (space=%20) and the parameters must be sorted by name.
- static get_canonical_uri(parsed_url)[source]¶
Create canonical URI–the part of the URI from domain to query string (use ‘/’ if no path)
- get_signature_key()[source]¶
Key derivation functions. See: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html