Class: AGCOD::Signature
- Inherits:
-
Object
- Object
- AGCOD::Signature
- Defined in:
- lib/aws_agcod/signature.rb
Constant Summary collapse
- SERVICE =
"AGCODService"
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.
13 14 15 16 17 |
# File 'lib/aws_agcod/signature.rb', line 13 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
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/aws_agcod/signature.rb', line 19 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 |