mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
27 lines
868 B
Ruby
27 lines
868 B
Ruby
|
Shindo.tests('AWS::STS | assume role with web identity', ['aws']) do
|
||
|
@sts = Fog::AWS[:sts]
|
||
|
@iam = Fog::AWS[:iam]
|
||
|
@role = @iam.create_role('sts', Fog::AWS::IAM::EC2_ASSUME_ROLE_POLICY).body['Role']
|
||
|
@token = Fog::AWS::Mock.key_id
|
||
|
|
||
|
@response_format = {
|
||
|
'AssumedRoleUser' => {
|
||
|
'Arn' => String,
|
||
|
'AssumedRoleId' => String,
|
||
|
},
|
||
|
'Audience' => String,
|
||
|
'Credentials' => {
|
||
|
'AccessKeyId' => String,
|
||
|
'Expiration' => Time,
|
||
|
'SecretAccessKey' => String,
|
||
|
'SessionToken' => String,
|
||
|
},
|
||
|
'Provider' => String,
|
||
|
'SubjectFromWebIdentityToken' => String,
|
||
|
}
|
||
|
|
||
|
tests("#assume_role_with_web_identity('#{@role['Arn']}', '#{@token}', 'fog')").formats(@response_format) do
|
||
|
@sts.assume_role_with_web_identity(@role['Arn'], @token, 'fog', :iam => @iam).body
|
||
|
end
|
||
|
end
|