class AWS::Signer
- AWS::Signer
- Reference
- Object
Overview
A Signer can sign a HTTP request using AWS4-HMAC-SHA256
as outlined by:
https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html
Signers are generally only used once, and they are scoped to the region,
AWS service, AWS credentials, and a point in time.
Defined in:
aws/signer.crConstructors
-
.new(region : String, service : String, creds : Credentials, time : Time = Time.utc)
Creates a new AWS V4 signer for the given region and service with the given credentials, valid at the given time.
-
.new(region : String, service : String, key : String, secret : String, token : Nil | String = nil, time : Time = Time.utc)
Creates a new AWS V4 signer for the given region and service with the given AWS AccessKeyId and SecretAccessKey, valid at the given time.
Instance Method Summary
-
#sign(payload : String) : String
Gets a signature for the given payload, as per
-
#sign(request : HTTP::Request) : String
Gets a signature for a payload extracted from the given request, as per docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html
-
#sign!(request : HTTP::Request)
Signs the given request - if it's a GET request, then it will add the signature as a query parameter; if it's a POST request, it will add the signature to the Authorization header.
Constructor Detail
Creates a new AWS V4 signer for the given region and service with the given credentials, valid at the given time.
Creates a new AWS V4 signer for the given region and service with the given AWS AccessKeyId and SecretAccessKey, valid at the given time.
Instance Method Detail
Gets a signature for a payload extracted from the given request, as per docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html
Signs the given request - if it's a GET request, then it will add the signature as a query parameter; if it's a POST request, it will add the signature to the Authorization header.