22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/aws/core/signature/version_3.rb', line 22
def add_authorization!(signer)
self.access_key_id = signer.access_key_id
["x-amz-date"] ||= (["date"] ||= Time.now.rfc822)
["host"] ||= host
["x-amz-security-token"] = signer.session_token if
signer.respond_to?(:session_token) and signer.session_token
request_hash = OpenSSL::Digest::SHA256.digest(string_to_sign)
signature = signer.sign(request_hash)
["x-amzn-authorization"] =
"AWS3 "+
"AWSAccessKeyId=#{signer.access_key_id},"+
"Algorithm=HmacSHA256,"+
"SignedHeaders=#{.join(';')},"+
"Signature=#{signature}"
end
|