Module: AWS::Core::Signature::Version4

Included in:
AWS::CloudFormation::Request, IAM::Request, STS::Request, SimpleEmailService::Request
Defined in:
lib/aws/core/signature/version_4.rb

Instance Method Summary collapse

Instance Method Details

#add_authorization!(signer) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/aws/core/signature/version_4.rb', line 23

def add_authorization! signer
  self.access_key_id = signer.access_key_id
  datetime = Time.now.utc.strftime("%Y%m%dT%H%M%SZ")
  headers['content-type'] ||= 'application/x-www-form-urlencoded'
  headers['host'] = host
  headers['x-amz-date'] = datetime
  headers['x-amz-security-token'] = signer.session_token if signer.session_token
  headers['authorization'] = authorization(signer, datetime)
end