View Source AntikytheraAws.Signer.V4 (antikythera_aws v0.4.0)
Signing with Signature Version 4.
Summary
Functions
From given creds and request informations, returns headers ready for AWS request.
Functions
Link to this function
prepare_headers(creds, region, service, method, path, payload, headers, params)
View Source@spec prepare_headers( AntikytheraAws.Auth.Credentials.t(), String.t(), String.t(), Antikythera.Http.Method.t(), Antikythera.UnencodedPath.t(), binary(), Antikythera.Http.Headers.t(), [{String.t(), String.t()}] ) :: Antikythera.Http.Headers.t()
From given creds and request informations, returns headers ready for AWS request.
Arguments are mostly Antikythera.Httpc.request/5 compatible, with some extra treatments:
creds,region,servicemust be suppliedcredsare basically retrieved withAntikytheraAws.Auth.InstanceProfileCredentials
pathmust not include query string. Relative/redundant path must be resolved beforehand- Any characters in segments except RFC3986 "Unreserved Characters", will be encoded
- Escape chars ("%") in segments will be encoded to "%25"
payloadserialization must be done beforehand, since it will be hashed in signature and compared on AWSheadersmust have "host" field, which is a hard-requirement for signature- "x-amz-date" or "date" field value will be used as signature date. "x-amz-date" will be prioritized
- If neither exist, "x-amz-date" will be generated with current date
paramsmust be decoded query strings, in a list of tuple-2- To convert from
Antikythera.Http.QueryParams(which isCroma.SubtypeOfMap), just useMap.to_list/1
- To convert from