View Source AntikytheraAws.Signer.V4 (antikythera_aws v0.3.1)
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
,service
must be suppliedcreds
are basically retrieved withAntikytheraAws.Auth.InstanceProfileCredentials
path
must 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"
payload
serialization must be done beforehand, since it will be hashed in signature and compared on AWSheaders
must 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
params
must 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