mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
Add mocked response headers
This commit is contained in:
parent
ff37e6b4f4
commit
cb521b66bb
1 changed files with 6 additions and 1 deletions
|
@ -43,6 +43,7 @@ module Fog
|
||||||
class Mock
|
class Mock
|
||||||
def assume_role(role_session_name, role_arn, external_id=nil, policy=nil, duration=3600)
|
def assume_role(role_session_name, role_arn, external_id=nil, policy=nil, duration=3600)
|
||||||
account_id = /[0-9]{12}/.match(role_arn)
|
account_id = /[0-9]{12}/.match(role_arn)
|
||||||
|
request_id = Fog::AWS::Mock.request_id
|
||||||
|
|
||||||
Excon::Response.new.tap do |response|
|
Excon::Response.new.tap do |response|
|
||||||
response.status = 200
|
response.status = 200
|
||||||
|
@ -54,7 +55,11 @@ module Fog
|
||||||
'SecretAccessKey' => Fog::Mock.random_base64(40),
|
'SecretAccessKey' => Fog::Mock.random_base64(40),
|
||||||
'SessionToken' => Fog::Mock.random_base64(580),
|
'SessionToken' => Fog::Mock.random_base64(580),
|
||||||
'Expiration' => (Time.now + duration).utc.iso8601,
|
'Expiration' => (Time.now + duration).utc.iso8601,
|
||||||
'RequestId' => Fog::AWS::Mock.request_id
|
'RequestId' => request_id,
|
||||||
|
}
|
||||||
|
|
||||||
|
response.headers = {
|
||||||
|
'x-amzn-RequestId' => request_id,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue