Class: AwsAgcod::Signature
- Inherits:
-
Object
- Object
- AwsAgcod::Signature
- Defined in:
- lib/aws_agcod/signature.rb
Constant Summary collapse
- SERVICE =
"AGCODService"- DEFAULT_REGION =
"us-east-1"
Instance Method Summary collapse
-
#initialize(credentials) ⇒ Signature
constructor
A new instance of Signature.
- #sign(uri, headers, body = "") ⇒ Object
Constructor Details
#initialize(credentials) ⇒ Signature
Returns a new instance of Signature.
14 15 16 17 18 |
# File 'lib/aws_agcod/signature.rb', line 14 def initialize(credentials) @access_key = credentials["access_key"] @secret_key = credentials["secret_key"] @region = credentials["region"] || DEFAULT_REGION end |
Instance Method Details
#sign(uri, headers, body = "") ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/aws_agcod/signature.rb', line 20 def sign(uri, headers, body = "") @uri = uri @headers = headers @body = body @date = headers["x-amz-date"] signed_headers = headers.dup signed_headers["Authorization"] = signed_headers end |