baiji v0.6.7 Baiji.Request.Sign

Implement request signing functions. The code in this file replicates that of the aws-elixir library (github.com/jkakar/aws-elixir)

Link to this section Summary

Functions

Add an Authorization header to the Request struct

Add a formatted date header to the given request’s header list

Add a security token header if a security token has been set on the operation struct

Build a canonical query string

Generate a string that contains information about the request in canonical format

Convert a list of header tuples to canonical format

Generate a credential scope string

Encode a body string by generating a SHA256 digest and encoding it to hex

Calculate the request signature

Generate a signed headers string by extracting header names, converting them to lower-case and joining them with semicolons

Generate a signing key using AWS credentials, the target service, time, etc

Generate a string to sign

Add signing headers to the given request using the AWS Signature Version 4 protocol

Add signing and authorization headers to the given request using the AWS Signature Version 4 protocol

Link to this section Functions

Link to this function add_authorization_header(sign)

Add an Authorization header to the Request struct

Link to this function add_authorization_header(headers, access_key_id, credential_scope, signed_headers, signature)
Link to this function add_date_header(sign)

Add a formatted date header to the given request’s header list

Link to this function add_date_header(headers, time)
Link to this function add_security_token(sign)

Add a security token header if a security token has been set on the operation struct

Link to this function add_security_token(headers, token)
Link to this function canonical_query_string(query)

Build a canonical query string

Link to this function canonical_request(sign)

Generate a string that contains information about the request in canonical format

Link to this function canonical_request(url, method, headers, body)
Link to this function canonicalize_headers(headers)

Convert a list of header tuples to canonical format

Link to this function credential_scope(time, region, service)

Generate a credential scope string

Link to this function encode_body(body)

Encode a body string by generating a SHA256 digest and encoding it to hex

Link to this function signature(sign)

Calculate the request signature

Link to this function signature(signing_key, string_to_sign)
Link to this function signed_headers(sign)

Generate a signed headers string by extracting header names, converting them to lower-case and joining them with semicolons.

Link to this function signing_key(sign)

Generate a signing key using AWS credentials, the target service, time, etc.

Link to this function signing_key(secret_access_key, time, region, service)
Link to this function string_to_sign(sign)

Generate a string to sign

Link to this function string_to_sign(time, region, service, canonical_request)

Add signing headers to the given request using the AWS Signature Version 4 protocol

Link to this function v4(request, time)

Add signing and authorization headers to the given request using the AWS Signature Version 4 protocol