aws-sdk-core 3.46.0 → 3.94.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +5 -5
  2. data/VERSION +1 -1
  3. data/lib/aws-sdk-core.rb +7 -0
  4. data/lib/aws-sdk-core/arn.rb +77 -0
  5. data/lib/aws-sdk-core/arn_parser.rb +38 -0
  6. data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +102 -0
  7. data/lib/aws-sdk-core/async_client_stubs.rb +80 -0
  8. data/lib/aws-sdk-core/binary.rb +3 -0
  9. data/lib/aws-sdk-core/binary/decode_handler.rb +9 -1
  10. data/lib/aws-sdk-core/binary/encode_handler.rb +32 -0
  11. data/lib/aws-sdk-core/binary/event_builder.rb +122 -0
  12. data/lib/aws-sdk-core/binary/event_parser.rb +48 -18
  13. data/lib/aws-sdk-core/binary/event_stream_decoder.rb +5 -2
  14. data/lib/aws-sdk-core/binary/event_stream_encoder.rb +53 -0
  15. data/lib/aws-sdk-core/client_side_monitoring/publisher.rb +9 -1
  16. data/lib/aws-sdk-core/client_stubs.rb +10 -9
  17. data/lib/aws-sdk-core/credential_provider.rb +0 -31
  18. data/lib/aws-sdk-core/credential_provider_chain.rb +79 -39
  19. data/lib/aws-sdk-core/deprecations.rb +16 -10
  20. data/lib/aws-sdk-core/ecs_credentials.rb +12 -8
  21. data/lib/aws-sdk-core/endpoint_cache.rb +14 -11
  22. data/lib/aws-sdk-core/errors.rb +94 -6
  23. data/lib/aws-sdk-core/event_emitter.rb +42 -0
  24. data/lib/aws-sdk-core/instance_profile_credentials.rb +120 -38
  25. data/lib/aws-sdk-core/json.rb +13 -14
  26. data/lib/aws-sdk-core/json/error_handler.rb +19 -2
  27. data/lib/aws-sdk-core/json/handler.rb +19 -1
  28. data/lib/aws-sdk-core/log/formatter.rb +7 -1
  29. data/lib/aws-sdk-core/log/param_filter.rb +3 -3
  30. data/lib/aws-sdk-core/pageable_response.rb +34 -20
  31. data/lib/aws-sdk-core/param_validator.rb +11 -5
  32. data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +26 -1
  33. data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +1 -1
  34. data/lib/aws-sdk-core/plugins/event_stream_configuration.rb +14 -0
  35. data/lib/aws-sdk-core/plugins/invocation_id.rb +33 -0
  36. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +8 -1
  37. data/lib/aws-sdk-core/plugins/retries/client_rate_limiter.rb +137 -0
  38. data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +98 -0
  39. data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +142 -0
  40. data/lib/aws-sdk-core/plugins/retries/retry_quota.rb +57 -0
  41. data/lib/aws-sdk-core/plugins/retry_errors.rb +290 -106
  42. data/lib/aws-sdk-core/plugins/signature_v4.rb +13 -2
  43. data/lib/aws-sdk-core/plugins/stub_responses.rb +20 -7
  44. data/lib/aws-sdk-core/plugins/transfer_encoding.rb +51 -0
  45. data/lib/aws-sdk-core/plugins/user_agent.rb +4 -8
  46. data/lib/aws-sdk-core/process_credentials.rb +9 -3
  47. data/lib/aws-sdk-core/shared_config.rb +95 -125
  48. data/lib/aws-sdk-core/structure.rb +1 -2
  49. data/lib/aws-sdk-core/stubbing/protocols/rest.rb +19 -0
  50. data/lib/aws-sdk-core/stubbing/stub_data.rb +13 -4
  51. data/lib/aws-sdk-core/util.rb +4 -0
  52. data/lib/aws-sdk-core/waiters/waiter.rb +2 -2
  53. data/lib/aws-sdk-core/xml/error_handler.rb +26 -3
  54. data/lib/aws-sdk-sts.rb +7 -4
  55. data/lib/aws-sdk-sts/client.rb +1109 -459
  56. data/lib/aws-sdk-sts/client_api.rb +67 -0
  57. data/lib/aws-sdk-sts/customizations.rb +2 -0
  58. data/lib/aws-sdk-sts/errors.rb +150 -0
  59. data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +32 -0
  60. data/lib/aws-sdk-sts/presigner.rb +67 -0
  61. data/lib/aws-sdk-sts/resource.rb +1 -0
  62. data/lib/aws-sdk-sts/types.rb +736 -176
  63. data/lib/seahorse.rb +9 -0
  64. data/lib/seahorse/client/async_base.rb +50 -0
  65. data/lib/seahorse/client/async_response.rb +62 -0
  66. data/lib/seahorse/client/base.rb +4 -2
  67. data/lib/seahorse/client/configuration.rb +4 -2
  68. data/lib/seahorse/client/events.rb +1 -1
  69. data/lib/seahorse/client/h2/connection.rb +246 -0
  70. data/lib/seahorse/client/h2/handler.rb +151 -0
  71. data/lib/seahorse/client/handler_list_entry.rb +2 -2
  72. data/lib/seahorse/client/http/async_response.rb +42 -0
  73. data/lib/seahorse/client/http/response.rb +13 -8
  74. data/lib/seahorse/client/logging/formatter.rb +4 -2
  75. data/lib/seahorse/client/net_http/connection_pool.rb +19 -20
  76. data/lib/seahorse/client/net_http/handler.rb +7 -1
  77. data/lib/seahorse/client/net_http/patches.rb +7 -1
  78. data/lib/seahorse/client/networking_error.rb +28 -0
  79. data/lib/seahorse/client/plugin.rb +5 -4
  80. data/lib/seahorse/client/plugins/content_length.rb +5 -2
  81. data/lib/seahorse/client/plugins/h2.rb +64 -0
  82. data/lib/seahorse/client/response.rb +3 -5
  83. data/lib/seahorse/model/api.rb +4 -0
  84. data/lib/seahorse/model/operation.rb +4 -0
  85. data/lib/seahorse/model/shapes.rb +2 -2
  86. metadata +43 -10
@@ -24,6 +24,8 @@ module Aws::STS
24
24
  DecodeAuthorizationMessageResponse = Shapes::StructureShape.new(name: 'DecodeAuthorizationMessageResponse')
25
25
  ExpiredTokenException = Shapes::StructureShape.new(name: 'ExpiredTokenException')
26
26
  FederatedUser = Shapes::StructureShape.new(name: 'FederatedUser')
27
+ GetAccessKeyInfoRequest = Shapes::StructureShape.new(name: 'GetAccessKeyInfoRequest')
28
+ GetAccessKeyInfoResponse = Shapes::StructureShape.new(name: 'GetAccessKeyInfoResponse')
27
29
  GetCallerIdentityRequest = Shapes::StructureShape.new(name: 'GetCallerIdentityRequest')
28
30
  GetCallerIdentityResponse = Shapes::StructureShape.new(name: 'GetCallerIdentityResponse')
29
31
  GetFederationTokenRequest = Shapes::StructureShape.new(name: 'GetFederationTokenRequest')
@@ -38,10 +40,12 @@ module Aws::STS
38
40
  MalformedPolicyDocumentException = Shapes::StructureShape.new(name: 'MalformedPolicyDocumentException')
39
41
  NameQualifier = Shapes::StringShape.new(name: 'NameQualifier')
40
42
  PackedPolicyTooLargeException = Shapes::StructureShape.new(name: 'PackedPolicyTooLargeException')
43
+ PolicyDescriptorType = Shapes::StructureShape.new(name: 'PolicyDescriptorType')
41
44
  RegionDisabledException = Shapes::StructureShape.new(name: 'RegionDisabledException')
42
45
  SAMLAssertionType = Shapes::StringShape.new(name: 'SAMLAssertionType')
43
46
  Subject = Shapes::StringShape.new(name: 'Subject')
44
47
  SubjectType = Shapes::StringShape.new(name: 'SubjectType')
48
+ Tag = Shapes::StructureShape.new(name: 'Tag')
45
49
  accessKeyIdType = Shapes::StringShape.new(name: 'accessKeyIdType')
46
50
  accessKeySecretType = Shapes::StringShape.new(name: 'accessKeySecretType')
47
51
  accountType = Shapes::StringShape.new(name: 'accountType')
@@ -62,11 +66,16 @@ module Aws::STS
62
66
  malformedPolicyDocumentMessage = Shapes::StringShape.new(name: 'malformedPolicyDocumentMessage')
63
67
  nonNegativeIntegerType = Shapes::IntegerShape.new(name: 'nonNegativeIntegerType')
64
68
  packedPolicyTooLargeMessage = Shapes::StringShape.new(name: 'packedPolicyTooLargeMessage')
69
+ policyDescriptorListType = Shapes::ListShape.new(name: 'policyDescriptorListType')
65
70
  regionDisabledMessage = Shapes::StringShape.new(name: 'regionDisabledMessage')
66
71
  roleDurationSecondsType = Shapes::IntegerShape.new(name: 'roleDurationSecondsType')
67
72
  roleSessionNameType = Shapes::StringShape.new(name: 'roleSessionNameType')
68
73
  serialNumberType = Shapes::StringShape.new(name: 'serialNumberType')
69
74
  sessionPolicyDocumentType = Shapes::StringShape.new(name: 'sessionPolicyDocumentType')
75
+ tagKeyListType = Shapes::ListShape.new(name: 'tagKeyListType')
76
+ tagKeyType = Shapes::StringShape.new(name: 'tagKeyType')
77
+ tagListType = Shapes::ListShape.new(name: 'tagListType')
78
+ tagValueType = Shapes::StringShape.new(name: 'tagValueType')
70
79
  tokenCodeType = Shapes::StringShape.new(name: 'tokenCodeType')
71
80
  tokenType = Shapes::StringShape.new(name: 'tokenType')
72
81
  urlType = Shapes::StringShape.new(name: 'urlType')
@@ -76,8 +85,11 @@ module Aws::STS
76
85
 
77
86
  AssumeRoleRequest.add_member(:role_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "RoleArn"))
78
87
  AssumeRoleRequest.add_member(:role_session_name, Shapes::ShapeRef.new(shape: roleSessionNameType, required: true, location_name: "RoleSessionName"))
88
+ AssumeRoleRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
79
89
  AssumeRoleRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
80
90
  AssumeRoleRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: roleDurationSecondsType, location_name: "DurationSeconds"))
91
+ AssumeRoleRequest.add_member(:tags, Shapes::ShapeRef.new(shape: tagListType, location_name: "Tags"))
92
+ AssumeRoleRequest.add_member(:transitive_tag_keys, Shapes::ShapeRef.new(shape: tagKeyListType, location_name: "TransitiveTagKeys"))
81
93
  AssumeRoleRequest.add_member(:external_id, Shapes::ShapeRef.new(shape: externalIdType, location_name: "ExternalId"))
82
94
  AssumeRoleRequest.add_member(:serial_number, Shapes::ShapeRef.new(shape: serialNumberType, location_name: "SerialNumber"))
83
95
  AssumeRoleRequest.add_member(:token_code, Shapes::ShapeRef.new(shape: tokenCodeType, location_name: "TokenCode"))
@@ -91,6 +103,7 @@ module Aws::STS
91
103
  AssumeRoleWithSAMLRequest.add_member(:role_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "RoleArn"))
92
104
  AssumeRoleWithSAMLRequest.add_member(:principal_arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "PrincipalArn"))
93
105
  AssumeRoleWithSAMLRequest.add_member(:saml_assertion, Shapes::ShapeRef.new(shape: SAMLAssertionType, required: true, location_name: "SAMLAssertion"))
106
+ AssumeRoleWithSAMLRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
94
107
  AssumeRoleWithSAMLRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
95
108
  AssumeRoleWithSAMLRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: roleDurationSecondsType, location_name: "DurationSeconds"))
96
109
  AssumeRoleWithSAMLRequest.struct_class = Types::AssumeRoleWithSAMLRequest
@@ -109,6 +122,7 @@ module Aws::STS
109
122
  AssumeRoleWithWebIdentityRequest.add_member(:role_session_name, Shapes::ShapeRef.new(shape: roleSessionNameType, required: true, location_name: "RoleSessionName"))
110
123
  AssumeRoleWithWebIdentityRequest.add_member(:web_identity_token, Shapes::ShapeRef.new(shape: clientTokenType, required: true, location_name: "WebIdentityToken"))
111
124
  AssumeRoleWithWebIdentityRequest.add_member(:provider_id, Shapes::ShapeRef.new(shape: urlType, location_name: "ProviderId"))
125
+ AssumeRoleWithWebIdentityRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
112
126
  AssumeRoleWithWebIdentityRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
113
127
  AssumeRoleWithWebIdentityRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: roleDurationSecondsType, location_name: "DurationSeconds"))
114
128
  AssumeRoleWithWebIdentityRequest.struct_class = Types::AssumeRoleWithWebIdentityRequest
@@ -137,10 +151,19 @@ module Aws::STS
137
151
  DecodeAuthorizationMessageResponse.add_member(:decoded_message, Shapes::ShapeRef.new(shape: decodedMessageType, location_name: "DecodedMessage"))
138
152
  DecodeAuthorizationMessageResponse.struct_class = Types::DecodeAuthorizationMessageResponse
139
153
 
154
+ ExpiredTokenException.add_member(:message, Shapes::ShapeRef.new(shape: expiredIdentityTokenMessage, location_name: "message"))
155
+ ExpiredTokenException.struct_class = Types::ExpiredTokenException
156
+
140
157
  FederatedUser.add_member(:federated_user_id, Shapes::ShapeRef.new(shape: federatedIdType, required: true, location_name: "FederatedUserId"))
141
158
  FederatedUser.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "Arn"))
142
159
  FederatedUser.struct_class = Types::FederatedUser
143
160
 
161
+ GetAccessKeyInfoRequest.add_member(:access_key_id, Shapes::ShapeRef.new(shape: accessKeyIdType, required: true, location_name: "AccessKeyId"))
162
+ GetAccessKeyInfoRequest.struct_class = Types::GetAccessKeyInfoRequest
163
+
164
+ GetAccessKeyInfoResponse.add_member(:account, Shapes::ShapeRef.new(shape: accountType, location_name: "Account"))
165
+ GetAccessKeyInfoResponse.struct_class = Types::GetAccessKeyInfoResponse
166
+
144
167
  GetCallerIdentityRequest.struct_class = Types::GetCallerIdentityRequest
145
168
 
146
169
  GetCallerIdentityResponse.add_member(:user_id, Shapes::ShapeRef.new(shape: userIdType, location_name: "UserId"))
@@ -150,7 +173,9 @@ module Aws::STS
150
173
 
151
174
  GetFederationTokenRequest.add_member(:name, Shapes::ShapeRef.new(shape: userNameType, required: true, location_name: "Name"))
152
175
  GetFederationTokenRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
176
+ GetFederationTokenRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
153
177
  GetFederationTokenRequest.add_member(:duration_seconds, Shapes::ShapeRef.new(shape: durationSecondsType, location_name: "DurationSeconds"))
178
+ GetFederationTokenRequest.add_member(:tags, Shapes::ShapeRef.new(shape: tagListType, location_name: "Tags"))
154
179
  GetFederationTokenRequest.struct_class = Types::GetFederationTokenRequest
155
180
 
156
181
  GetFederationTokenResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
@@ -166,6 +191,40 @@ module Aws::STS
166
191
  GetSessionTokenResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
167
192
  GetSessionTokenResponse.struct_class = Types::GetSessionTokenResponse
168
193
 
194
+ IDPCommunicationErrorException.add_member(:message, Shapes::ShapeRef.new(shape: idpCommunicationErrorMessage, location_name: "message"))
195
+ IDPCommunicationErrorException.struct_class = Types::IDPCommunicationErrorException
196
+
197
+ IDPRejectedClaimException.add_member(:message, Shapes::ShapeRef.new(shape: idpRejectedClaimMessage, location_name: "message"))
198
+ IDPRejectedClaimException.struct_class = Types::IDPRejectedClaimException
199
+
200
+ InvalidAuthorizationMessageException.add_member(:message, Shapes::ShapeRef.new(shape: invalidAuthorizationMessage, location_name: "message"))
201
+ InvalidAuthorizationMessageException.struct_class = Types::InvalidAuthorizationMessageException
202
+
203
+ InvalidIdentityTokenException.add_member(:message, Shapes::ShapeRef.new(shape: invalidIdentityTokenMessage, location_name: "message"))
204
+ InvalidIdentityTokenException.struct_class = Types::InvalidIdentityTokenException
205
+
206
+ MalformedPolicyDocumentException.add_member(:message, Shapes::ShapeRef.new(shape: malformedPolicyDocumentMessage, location_name: "message"))
207
+ MalformedPolicyDocumentException.struct_class = Types::MalformedPolicyDocumentException
208
+
209
+ PackedPolicyTooLargeException.add_member(:message, Shapes::ShapeRef.new(shape: packedPolicyTooLargeMessage, location_name: "message"))
210
+ PackedPolicyTooLargeException.struct_class = Types::PackedPolicyTooLargeException
211
+
212
+ PolicyDescriptorType.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, location_name: "arn"))
213
+ PolicyDescriptorType.struct_class = Types::PolicyDescriptorType
214
+
215
+ RegionDisabledException.add_member(:message, Shapes::ShapeRef.new(shape: regionDisabledMessage, location_name: "message"))
216
+ RegionDisabledException.struct_class = Types::RegionDisabledException
217
+
218
+ Tag.add_member(:key, Shapes::ShapeRef.new(shape: tagKeyType, required: true, location_name: "Key"))
219
+ Tag.add_member(:value, Shapes::ShapeRef.new(shape: tagValueType, required: true, location_name: "Value"))
220
+ Tag.struct_class = Types::Tag
221
+
222
+ policyDescriptorListType.member = Shapes::ShapeRef.new(shape: PolicyDescriptorType)
223
+
224
+ tagKeyListType.member = Shapes::ShapeRef.new(shape: tagKeyType)
225
+
226
+ tagListType.member = Shapes::ShapeRef.new(shape: Tag)
227
+
169
228
 
170
229
  # @api private
171
230
  API = Seahorse::Model::Api.new.tap do |api|
@@ -236,6 +295,14 @@ module Aws::STS
236
295
  o.errors << Shapes::ShapeRef.new(shape: InvalidAuthorizationMessageException)
237
296
  end)
238
297
 
298
+ api.add_operation(:get_access_key_info, Seahorse::Model::Operation.new.tap do |o|
299
+ o.name = "GetAccessKeyInfo"
300
+ o.http_method = "POST"
301
+ o.http_request_uri = "/"
302
+ o.input = Shapes::ShapeRef.new(shape: GetAccessKeyInfoRequest)
303
+ o.output = Shapes::ShapeRef.new(shape: GetAccessKeyInfoResponse)
304
+ end)
305
+
239
306
  api.add_operation(:get_caller_identity, Seahorse::Model::Operation.new.tap do |o|
240
307
  o.name = "GetCallerIdentity"
241
308
  o.http_method = "POST"
@@ -0,0 +1,2 @@
1
+ # utility classes
2
+ require 'aws-sdk-sts/presigner'
@@ -6,9 +6,159 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::STS
9
+
10
+ # When STS returns an error response, the Ruby SDK constructs and raises an error.
11
+ # These errors all extend Aws::STS::Errors::ServiceError < {Aws::Errors::ServiceError}
12
+ #
13
+ # You can rescue all STS errors using ServiceError:
14
+ #
15
+ # begin
16
+ # # do stuff
17
+ # rescue Aws::STS::Errors::ServiceError
18
+ # # rescues all STS API errors
19
+ # end
20
+ #
21
+ #
22
+ # ## Request Context
23
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
24
+ # information about the request that generated the error.
25
+ # See {Seahorse::Client::RequestContext} for more information.
26
+ #
27
+ # ## Error Classes
28
+ # * {ExpiredTokenException}
29
+ # * {IDPCommunicationErrorException}
30
+ # * {IDPRejectedClaimException}
31
+ # * {InvalidAuthorizationMessageException}
32
+ # * {InvalidIdentityTokenException}
33
+ # * {MalformedPolicyDocumentException}
34
+ # * {PackedPolicyTooLargeException}
35
+ # * {RegionDisabledException}
36
+ #
37
+ # Additionally, error classes are dynamically generated for service errors based on the error code
38
+ # if they are not defined above.
9
39
  module Errors
10
40
 
11
41
  extend Aws::Errors::DynamicErrors
12
42
 
43
+ class ExpiredTokenException < ServiceError
44
+
45
+ # @param [Seahorse::Client::RequestContext] context
46
+ # @param [String] message
47
+ # @param [Aws::STS::Types::ExpiredTokenException] data
48
+ def initialize(context, message, data = Aws::EmptyStructure.new)
49
+ super(context, message, data)
50
+ end
51
+
52
+ # @return [String]
53
+ def message
54
+ @message || @data[:message]
55
+ end
56
+ end
57
+
58
+ class IDPCommunicationErrorException < ServiceError
59
+
60
+ # @param [Seahorse::Client::RequestContext] context
61
+ # @param [String] message
62
+ # @param [Aws::STS::Types::IDPCommunicationErrorException] data
63
+ def initialize(context, message, data = Aws::EmptyStructure.new)
64
+ super(context, message, data)
65
+ end
66
+
67
+ # @return [String]
68
+ def message
69
+ @message || @data[:message]
70
+ end
71
+ end
72
+
73
+ class IDPRejectedClaimException < ServiceError
74
+
75
+ # @param [Seahorse::Client::RequestContext] context
76
+ # @param [String] message
77
+ # @param [Aws::STS::Types::IDPRejectedClaimException] data
78
+ def initialize(context, message, data = Aws::EmptyStructure.new)
79
+ super(context, message, data)
80
+ end
81
+
82
+ # @return [String]
83
+ def message
84
+ @message || @data[:message]
85
+ end
86
+ end
87
+
88
+ class InvalidAuthorizationMessageException < ServiceError
89
+
90
+ # @param [Seahorse::Client::RequestContext] context
91
+ # @param [String] message
92
+ # @param [Aws::STS::Types::InvalidAuthorizationMessageException] data
93
+ def initialize(context, message, data = Aws::EmptyStructure.new)
94
+ super(context, message, data)
95
+ end
96
+
97
+ # @return [String]
98
+ def message
99
+ @message || @data[:message]
100
+ end
101
+ end
102
+
103
+ class InvalidIdentityTokenException < ServiceError
104
+
105
+ # @param [Seahorse::Client::RequestContext] context
106
+ # @param [String] message
107
+ # @param [Aws::STS::Types::InvalidIdentityTokenException] data
108
+ def initialize(context, message, data = Aws::EmptyStructure.new)
109
+ super(context, message, data)
110
+ end
111
+
112
+ # @return [String]
113
+ def message
114
+ @message || @data[:message]
115
+ end
116
+ end
117
+
118
+ class MalformedPolicyDocumentException < ServiceError
119
+
120
+ # @param [Seahorse::Client::RequestContext] context
121
+ # @param [String] message
122
+ # @param [Aws::STS::Types::MalformedPolicyDocumentException] data
123
+ def initialize(context, message, data = Aws::EmptyStructure.new)
124
+ super(context, message, data)
125
+ end
126
+
127
+ # @return [String]
128
+ def message
129
+ @message || @data[:message]
130
+ end
131
+ end
132
+
133
+ class PackedPolicyTooLargeException < ServiceError
134
+
135
+ # @param [Seahorse::Client::RequestContext] context
136
+ # @param [String] message
137
+ # @param [Aws::STS::Types::PackedPolicyTooLargeException] data
138
+ def initialize(context, message, data = Aws::EmptyStructure.new)
139
+ super(context, message, data)
140
+ end
141
+
142
+ # @return [String]
143
+ def message
144
+ @message || @data[:message]
145
+ end
146
+ end
147
+
148
+ class RegionDisabledException < ServiceError
149
+
150
+ # @param [Seahorse::Client::RequestContext] context
151
+ # @param [String] message
152
+ # @param [Aws::STS::Types::RegionDisabledException] data
153
+ def initialize(context, message, data = Aws::EmptyStructure.new)
154
+ super(context, message, data)
155
+ end
156
+
157
+ # @return [String]
158
+ def message
159
+ @message || @data[:message]
160
+ end
161
+ end
162
+
13
163
  end
14
164
  end
@@ -0,0 +1,32 @@
1
+ module Aws
2
+ module STS
3
+ module Plugins
4
+
5
+ class STSRegionalEndpoints < Seahorse::Client::Plugin
6
+
7
+ option(:sts_regional_endpoints,
8
+ default: 'regional',
9
+ doc_type: String,
10
+ docstring: <<-DOCS) do |cfg|
11
+ Passing in 'regional' to enable regional endpoint for STS for all supported
12
+ regions (except 'aws-global'). Using 'legacy' mode will force all legacy
13
+ regions to resolve to the STS global endpoint.
14
+ DOCS
15
+ resolve_sts_regional_endpoints(cfg)
16
+ end
17
+
18
+ private
19
+
20
+ def self.resolve_sts_regional_endpoints(cfg)
21
+ env_mode = ENV['AWS_STS_REGIONAL_ENDPOINTS']
22
+ env_mode = nil if env_mode == ''
23
+ cfg_mode = Aws.shared_config.sts_regional_endpoints(
24
+ profile: cfg.profile)
25
+ env_mode || cfg_mode || 'regional'
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,67 @@
1
+ require 'aws-sigv4'
2
+
3
+ module Aws
4
+ module STS
5
+ # Allows you to create presigned URLs for STS operations.
6
+ #
7
+ # @example
8
+ #
9
+ # signer = Aws::STS::Presigner.new
10
+ # url = signer.get_caller_identity_presigned_url(
11
+ # headers: {"X-K8s-Aws-Id" => 'my-eks-cluster'}
12
+ # )
13
+ class Presigner
14
+ # @option options [Client] :client Optionally provide an existing
15
+ # STS client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Aws::STS::Client.new
18
+ end
19
+
20
+ # Returns a presigned url for get_caller_identity.
21
+ #
22
+ # @option options [Hash] :headers
23
+ # Headers that should be signed and sent along with the request. All
24
+ # x-amz-* headers must be present during signing. Other headers are
25
+ # optional.
26
+ #
27
+ # @return [String] A presigned url string.
28
+ #
29
+ # @example
30
+ #
31
+ # url = signer.get_caller_identity_presigned_url(
32
+ # headers: {"X-K8s-Aws-Id" => 'my-eks-cluster'},
33
+ # )
34
+ #
35
+ # This can be easily converted to a token used by the EKS service:
36
+ # {https://ruby-doc.org/stdlib-2.3.1/libdoc/base64/rdoc/Base64.html#method-i-encode64}
37
+ # "k8s-aws-v1." + Base64.urlsafe_encode64(url).chomp("==")
38
+ def get_caller_identity_presigned_url(options = {})
39
+ req = @client.build_request(:get_session_token, {})
40
+
41
+ param_list = Aws::Query::ParamList.new
42
+ param_list.set('Action', 'GetCallerIdentity')
43
+ param_list.set('Version', req.context.config.api.version)
44
+ Aws::Query::EC2ParamBuilder.new(param_list)
45
+ .apply(req.context.operation.input, {})
46
+
47
+ signer = Aws::Sigv4::Signer.new(
48
+ service: 'sts',
49
+ region: req.context.config.region,
50
+ credentials_provider: req.context.config.credentials
51
+ )
52
+
53
+ url = Aws::Partitions::EndpointProvider.resolve(
54
+ req.context.config.region, 'sts', 'regional'
55
+ )
56
+ url += "/?#{param_list}"
57
+
58
+ signer.presign_url(
59
+ http_method: 'GET',
60
+ url: url,
61
+ body: '',
62
+ headers: options[:headers]
63
+ ).to_s
64
+ end
65
+ end
66
+ end
67
+ end
@@ -6,6 +6,7 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::STS
9
+
9
10
  class Resource
10
11
 
11
12
  # @param options ({})
@@ -14,8 +14,20 @@ module Aws::STS
14
14
  # {
15
15
  # role_arn: "arnType", # required
16
16
  # role_session_name: "roleSessionNameType", # required
17
+ # policy_arns: [
18
+ # {
19
+ # arn: "arnType",
20
+ # },
21
+ # ],
17
22
  # policy: "sessionPolicyDocumentType",
18
23
  # duration_seconds: 1,
24
+ # tags: [
25
+ # {
26
+ # key: "tagKeyType", # required
27
+ # value: "tagValueType", # required
28
+ # },
29
+ # ],
30
+ # transitive_tag_keys: ["tagKeyType"],
19
31
  # external_id: "externalIdType",
20
32
  # serial_number: "serialNumberType",
21
33
  # token_code: "tokenCodeType",
@@ -34,8 +46,8 @@ module Aws::STS
34
46
  # visible to, and can be logged by the account that owns the role. The
35
47
  # role session name is also used in the ARN of the assumed role
36
48
  # principal. This means that subsequent cross-account API requests
37
- # using the temporary security credentials will expose the role
38
- # session name to the external account in their CloudTrail logs.
49
+ # that use the temporary security credentials will expose the role
50
+ # session name to the external account in their AWS CloudTrail logs.
39
51
  #
40
52
  # The regex used to validate this parameter is a string of characters
41
53
  # consisting of upper- and lower-case alphanumeric characters with no
@@ -43,39 +55,75 @@ module Aws::STS
43
55
  # characters: =,.@-
44
56
  # @return [String]
45
57
  #
46
- # @!attribute [rw] policy
47
- # An IAM policy in JSON format.
48
- #
49
- # This parameter is optional. If you pass a policy, the temporary
50
- # security credentials that are returned by the operation have the
51
- # permissions that are allowed by both (the intersection of) the
52
- # access policy of the role that is being assumed, *and* the policy
53
- # that you pass. This gives you a way to further restrict the
54
- # permissions for the resulting temporary security credentials. You
55
- # cannot use the passed policy to grant permissions that are in excess
56
- # of those allowed by the access policy of the role that is being
57
- # assumed. For more information, see [Permissions for AssumeRole,
58
- # AssumeRoleWithSAML, and AssumeRoleWithWebIdentity][1] in the *IAM
59
- # User Guide*.
58
+ # @!attribute [rw] policy_arns
59
+ # The Amazon Resource Names (ARNs) of the IAM managed policies that
60
+ # you want to use as managed session policies. The policies must exist
61
+ # in the same account as the role.
60
62
  #
61
- # The format for this parameter, as described by its regex pattern, is
62
- # a string of characters up to 2048 characters in length. The
63
- # characters can be any ASCII character from the space character to
64
- # the end of the valid character list (\\u0020-\\u00FF). It can also
63
+ # This parameter is optional. You can provide up to 10 managed policy
64
+ # ARNs. However, the plain text that you use for both inline and
65
+ # managed session policies can't exceed 2,048 characters. For more
66
+ # information about ARNs, see [Amazon Resource Names (ARNs) and AWS
67
+ # Service Namespaces][1] in the AWS General Reference.
68
+ #
69
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
70
+ # tags into a packed binary format that has a separate limit. Your
71
+ # request can fail for this limit even if your plain text meets the
72
+ # other requirements. The `PackedPolicySize` response element
73
+ # indicates by percentage how close the policies and tags for your
74
+ # request are to the upper size limit.
75
+ #
76
+ # </note>
77
+ #
78
+ # Passing policies to this operation returns new temporary
79
+ # credentials. The resulting session's permissions are the
80
+ # intersection of the role's identity-based policy and the session
81
+ # policies. You can use the role's temporary credentials in
82
+ # subsequent AWS API calls to access resources in the account that
83
+ # owns the role. You cannot use session policies to grant more
84
+ # permissions than those allowed by the identity-based policy of the
85
+ # role that is being assumed. For more information, see [Session
86
+ # Policies][2] in the *IAM User Guide*.
87
+ #
88
+ #
89
+ #
90
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
91
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
92
+ # @return [Array<Types::PolicyDescriptorType>]
93
+ #
94
+ # @!attribute [rw] policy
95
+ # An IAM policy in JSON format that you want to use as an inline
96
+ # session policy.
97
+ #
98
+ # This parameter is optional. Passing policies to this operation
99
+ # returns new temporary credentials. The resulting session's
100
+ # permissions are the intersection of the role's identity-based
101
+ # policy and the session policies. You can use the role's temporary
102
+ # credentials in subsequent AWS API calls to access resources in the
103
+ # account that owns the role. You cannot use session policies to grant
104
+ # more permissions than those allowed by the identity-based policy of
105
+ # the role that is being assumed. For more information, see [Session
106
+ # Policies][1] in the *IAM User Guide*.
107
+ #
108
+ # The plain text that you use for both inline and managed session
109
+ # policies can't exceed 2,048 characters. The JSON policy characters
110
+ # can be any ASCII character from the space character to the end of
111
+ # the valid character list (\\u0020 through \\u00FF). It can also
65
112
  # include the tab (\\u0009), linefeed (\\u000A), and carriage return
66
113
  # (\\u000D) characters.
67
114
  #
68
- # <note markdown="1"> The policy plain text must be 2048 bytes or shorter. However, an
69
- # internal conversion compresses it into a packed binary format with a
70
- # separate limit. The PackedPolicySize response element indicates by
71
- # percentage how close to the upper size limit the policy is, with
72
- # 100% equaling the maximum allowed size.
115
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
116
+ # tags into a packed binary format that has a separate limit. Your
117
+ # request can fail for this limit even if your plain text meets the
118
+ # other requirements. The `PackedPolicySize` response element
119
+ # indicates by percentage how close the policies and tags for your
120
+ # request are to the upper size limit.
73
121
  #
74
122
  # </note>
75
123
  #
76
124
  #
77
125
  #
78
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html
126
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
79
127
  # @return [String]
80
128
  #
81
129
  # @!attribute [rw] duration_seconds
@@ -89,7 +137,7 @@ module Aws::STS
89
137
  # value for your role, see [View the Maximum Session Duration Setting
90
138
  # for a Role][1] in the *IAM User Guide*.
91
139
  #
92
- # By default, the value is set to 3600 seconds.
140
+ # By default, the value is set to `3600` seconds.
93
141
  #
94
142
  # <note markdown="1"> The `DurationSeconds` parameter is separate from the duration of a
95
143
  # console session that you might request using the returned
@@ -103,30 +151,96 @@ module Aws::STS
103
151
  #
104
152
  #
105
153
  #
106
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
107
- # [2]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
154
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
155
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
108
156
  # @return [Integer]
109
157
  #
158
+ # @!attribute [rw] tags
159
+ # A list of session tags that you want to pass. Each session tag
160
+ # consists of a key name and an associated value. For more information
161
+ # about session tags, see [Tagging AWS STS Sessions][1] in the *IAM
162
+ # User Guide*.
163
+ #
164
+ # This parameter is optional. You can pass up to 50 session tags. The
165
+ # plain text session tag keys can’t exceed 128 characters, and the
166
+ # values can’t exceed 256 characters. For these and additional limits,
167
+ # see [IAM and STS Character Limits][2] in the *IAM User Guide*.
168
+ #
169
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
170
+ # tags into a packed binary format that has a separate limit. Your
171
+ # request can fail for this limit even if your plain text meets the
172
+ # other requirements. The `PackedPolicySize` response element
173
+ # indicates by percentage how close the policies and tags for your
174
+ # request are to the upper size limit.
175
+ #
176
+ # </note>
177
+ #
178
+ # You can pass a session tag with the same key as a tag that is
179
+ # already attached to the role. When you do, session tags override a
180
+ # role tag with the same key.
181
+ #
182
+ # Tag key–value pairs are not case sensitive, but case is preserved.
183
+ # This means that you cannot have separate `Department` and
184
+ # `department` tag keys. Assume that the role has the
185
+ # `Department`=`Marketing` tag and you pass the
186
+ # `department`=`engineering` session tag. `Department` and
187
+ # `department` are not saved as separate tags, and the session tag
188
+ # passed in the request takes precedence over the role tag.
189
+ #
190
+ # Additionally, if you used temporary credentials to perform this
191
+ # operation, the new session inherits any transitive session tags from
192
+ # the calling session. If you pass a session tag with the same key as
193
+ # an inherited tag, the operation fails. To view the inherited tags
194
+ # for a session, see the AWS CloudTrail logs. For more information,
195
+ # see [Viewing Session Tags in CloudTrail][3] in the *IAM User Guide*.
196
+ #
197
+ #
198
+ #
199
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
200
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
201
+ # [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs
202
+ # @return [Array<Types::Tag>]
203
+ #
204
+ # @!attribute [rw] transitive_tag_keys
205
+ # A list of keys for session tags that you want to set as transitive.
206
+ # If you set a tag key as transitive, the corresponding key and value
207
+ # passes to subsequent sessions in a role chain. For more information,
208
+ # see [Chaining Roles with Session Tags][1] in the *IAM User Guide*.
209
+ #
210
+ # This parameter is optional. When you set session tags as transitive,
211
+ # the session policy and session tags packed binary limit is not
212
+ # affected.
213
+ #
214
+ # If you choose not to specify a transitive tag key, then no tags are
215
+ # passed from this session to any subsequent sessions.
216
+ #
217
+ #
218
+ #
219
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
220
+ # @return [Array<String>]
221
+ #
110
222
  # @!attribute [rw] external_id
111
- # A unique identifier that is used by third parties when assuming
112
- # roles in their customers' accounts. For each role that the third
113
- # party can assume, they should instruct their customers to ensure the
114
- # role's trust policy checks for the external ID that the third party
115
- # generated. Each time the third party assumes the role, they should
116
- # pass the customer's external ID. The external ID is useful in order
117
- # to help third parties bind a role to the customer who created it.
118
- # For more information about the external ID, see [How to Use an
119
- # External ID When Granting Access to Your AWS Resources to a Third
223
+ # A unique identifier that might be required when you assume a role in
224
+ # another account. If the administrator of the account to which the
225
+ # role belongs provided you with an external ID, then provide that
226
+ # value in the `ExternalId` parameter. This value can be any string,
227
+ # such as a passphrase or account number. A cross-account role is
228
+ # usually set up to trust everyone in an account. Therefore, the
229
+ # administrator of the trusting account might send an external ID to
230
+ # the administrator of the trusted account. That way, only someone
231
+ # with the ID can assume the role, rather than everyone in the
232
+ # account. For more information about the external ID, see [How to Use
233
+ # an External ID When Granting Access to Your AWS Resources to a Third
120
234
  # Party][1] in the *IAM User Guide*.
121
235
  #
122
- # The regex used to validated this parameter is a string of characters
236
+ # The regex used to validate this parameter is a string of characters
123
237
  # consisting of upper- and lower-case alphanumeric characters with no
124
238
  # spaces. You can also include underscores or any of the following
125
239
  # characters: =,.@:/-
126
240
  #
127
241
  #
128
242
  #
129
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
243
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
130
244
  # @return [String]
131
245
  #
132
246
  # @!attribute [rw] serial_number
@@ -160,8 +274,11 @@ module Aws::STS
160
274
  class AssumeRoleRequest < Struct.new(
161
275
  :role_arn,
162
276
  :role_session_name,
277
+ :policy_arns,
163
278
  :policy,
164
279
  :duration_seconds,
280
+ :tags,
281
+ :transitive_tag_keys,
165
282
  :external_id,
166
283
  :serial_number,
167
284
  :token_code)
@@ -175,11 +292,11 @@ module Aws::STS
175
292
  # The temporary security credentials, which include an access key ID,
176
293
  # a secret access key, and a security (or session) token.
177
294
  #
178
- # **Note:** The size of the security token that STS APIs return is not
295
+ # <note markdown="1"> The size of the security token that STS API operations return is not
179
296
  # fixed. We strongly recommend that you make no assumptions about the
180
- # maximum size. As of this writing, the typical size is less than 4096
181
- # bytes, but that can vary. Also, future updates to AWS might require
182
- # larger sizes.
297
+ # maximum size.
298
+ #
299
+ # </note>
183
300
  # @return [Types::Credentials]
184
301
  #
185
302
  # @!attribute [rw] assumed_role_user
@@ -192,9 +309,10 @@ module Aws::STS
192
309
  # @return [Types::AssumedRoleUser]
193
310
  #
194
311
  # @!attribute [rw] packed_policy_size
195
- # A percentage value that indicates the size of the policy in packed
196
- # form. The service rejects any policy with a packed size greater than
197
- # 100 percent, which means the policy exceeded the allowed space.
312
+ # A percentage value that indicates the packed size of the session
313
+ # policies and session tags combined passed in the request. The
314
+ # request fails if the packed size is greater than 100 percent, which
315
+ # means the policies and tags exceeded the allowed space.
198
316
  # @return [Integer]
199
317
  #
200
318
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleResponse AWS API Documentation
@@ -213,6 +331,11 @@ module Aws::STS
213
331
  # role_arn: "arnType", # required
214
332
  # principal_arn: "arnType", # required
215
333
  # saml_assertion: "SAMLAssertionType", # required
334
+ # policy_arns: [
335
+ # {
336
+ # arn: "arnType",
337
+ # },
338
+ # ],
216
339
  # policy: "sessionPolicyDocumentType",
217
340
  # duration_seconds: 1,
218
341
  # }
@@ -232,45 +355,82 @@ module Aws::STS
232
355
  # IdP.
233
356
  #
234
357
  # For more information, see [Configuring a Relying Party and Adding
235
- # Claims][1] in the *Using IAM* guide.
358
+ # Claims][1] in the *IAM User Guide*.
236
359
  #
237
360
  #
238
361
  #
239
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html
362
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html
240
363
  # @return [String]
241
364
  #
242
- # @!attribute [rw] policy
243
- # An IAM policy in JSON format.
365
+ # @!attribute [rw] policy_arns
366
+ # The Amazon Resource Names (ARNs) of the IAM managed policies that
367
+ # you want to use as managed session policies. The policies must exist
368
+ # in the same account as the role.
244
369
  #
245
- # The policy parameter is optional. If you pass a policy, the
246
- # temporary security credentials that are returned by the operation
247
- # have the permissions that are allowed by both the access policy of
248
- # the role that is being assumed, <i> <b>and</b> </i> the policy that
249
- # you pass. This gives you a way to further restrict the permissions
250
- # for the resulting temporary security credentials. You cannot use the
251
- # passed policy to grant permissions that are in excess of those
252
- # allowed by the access policy of the role that is being assumed. For
253
- # more information, [Permissions for AssumeRole, AssumeRoleWithSAML,
254
- # and AssumeRoleWithWebIdentity][1] in the *IAM User Guide*.
370
+ # This parameter is optional. You can provide up to 10 managed policy
371
+ # ARNs. However, the plain text that you use for both inline and
372
+ # managed session policies can't exceed 2,048 characters. For more
373
+ # information about ARNs, see [Amazon Resource Names (ARNs) and AWS
374
+ # Service Namespaces][1] in the AWS General Reference.
255
375
  #
256
- # The format for this parameter, as described by its regex pattern, is
257
- # a string of characters up to 2048 characters in length. The
258
- # characters can be any ASCII character from the space character to
259
- # the end of the valid character list (\\u0020-\\u00FF). It can also
376
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
377
+ # tags into a packed binary format that has a separate limit. Your
378
+ # request can fail for this limit even if your plain text meets the
379
+ # other requirements. The `PackedPolicySize` response element
380
+ # indicates by percentage how close the policies and tags for your
381
+ # request are to the upper size limit.
382
+ #
383
+ # </note>
384
+ #
385
+ # Passing policies to this operation returns new temporary
386
+ # credentials. The resulting session's permissions are the
387
+ # intersection of the role's identity-based policy and the session
388
+ # policies. You can use the role's temporary credentials in
389
+ # subsequent AWS API calls to access resources in the account that
390
+ # owns the role. You cannot use session policies to grant more
391
+ # permissions than those allowed by the identity-based policy of the
392
+ # role that is being assumed. For more information, see [Session
393
+ # Policies][2] in the *IAM User Guide*.
394
+ #
395
+ #
396
+ #
397
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
398
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
399
+ # @return [Array<Types::PolicyDescriptorType>]
400
+ #
401
+ # @!attribute [rw] policy
402
+ # An IAM policy in JSON format that you want to use as an inline
403
+ # session policy.
404
+ #
405
+ # This parameter is optional. Passing policies to this operation
406
+ # returns new temporary credentials. The resulting session's
407
+ # permissions are the intersection of the role's identity-based
408
+ # policy and the session policies. You can use the role's temporary
409
+ # credentials in subsequent AWS API calls to access resources in the
410
+ # account that owns the role. You cannot use session policies to grant
411
+ # more permissions than those allowed by the identity-based policy of
412
+ # the role that is being assumed. For more information, see [Session
413
+ # Policies][1] in the *IAM User Guide*.
414
+ #
415
+ # The plain text that you use for both inline and managed session
416
+ # policies can't exceed 2,048 characters. The JSON policy characters
417
+ # can be any ASCII character from the space character to the end of
418
+ # the valid character list (\\u0020 through \\u00FF). It can also
260
419
  # include the tab (\\u0009), linefeed (\\u000A), and carriage return
261
420
  # (\\u000D) characters.
262
421
  #
263
- # <note markdown="1"> The policy plain text must be 2048 bytes or shorter. However, an
264
- # internal conversion compresses it into a packed binary format with a
265
- # separate limit. The PackedPolicySize response element indicates by
266
- # percentage how close to the upper size limit the policy is, with
267
- # 100% equaling the maximum allowed size.
422
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
423
+ # tags into a packed binary format that has a separate limit. Your
424
+ # request can fail for this limit even if your plain text meets the
425
+ # other requirements. The `PackedPolicySize` response element
426
+ # indicates by percentage how close the policies and tags for your
427
+ # request are to the upper size limit.
268
428
  #
269
429
  # </note>
270
430
  #
271
431
  #
272
432
  #
273
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html
433
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
274
434
  # @return [String]
275
435
  #
276
436
  # @!attribute [rw] duration_seconds
@@ -288,7 +448,7 @@ module Aws::STS
288
448
  # Maximum Session Duration Setting for a Role][1] in the *IAM User
289
449
  # Guide*.
290
450
  #
291
- # By default, the value is set to 3600 seconds.
451
+ # By default, the value is set to `3600` seconds.
292
452
  #
293
453
  # <note markdown="1"> The `DurationSeconds` parameter is separate from the duration of a
294
454
  # console session that you might request using the returned
@@ -302,8 +462,8 @@ module Aws::STS
302
462
  #
303
463
  #
304
464
  #
305
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
306
- # [2]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
465
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
466
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
307
467
  # @return [Integer]
308
468
  #
309
469
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLRequest AWS API Documentation
@@ -312,6 +472,7 @@ module Aws::STS
312
472
  :role_arn,
313
473
  :principal_arn,
314
474
  :saml_assertion,
475
+ :policy_arns,
315
476
  :policy,
316
477
  :duration_seconds)
317
478
  include Aws::Structure
@@ -325,11 +486,11 @@ module Aws::STS
325
486
  # The temporary security credentials, which include an access key ID,
326
487
  # a secret access key, and a security (or session) token.
327
488
  #
328
- # **Note:** The size of the security token that STS APIs return is not
489
+ # <note markdown="1"> The size of the security token that STS API operations return is not
329
490
  # fixed. We strongly recommend that you make no assumptions about the
330
- # maximum size. As of this writing, the typical size is less than 4096
331
- # bytes, but that can vary. Also, future updates to AWS might require
332
- # larger sizes.
491
+ # maximum size.
492
+ #
493
+ # </note>
333
494
  # @return [Types::Credentials]
334
495
  #
335
496
  # @!attribute [rw] assumed_role_user
@@ -338,9 +499,10 @@ module Aws::STS
338
499
  # @return [Types::AssumedRoleUser]
339
500
  #
340
501
  # @!attribute [rw] packed_policy_size
341
- # A percentage value that indicates the size of the policy in packed
342
- # form. The service rejects any policy with a packed size greater than
343
- # 100 percent, which means the policy exceeded the allowed space.
502
+ # A percentage value that indicates the packed size of the session
503
+ # policies and session tags combined passed in the request. The
504
+ # request fails if the packed size is greater than 100 percent, which
505
+ # means the policies and tags exceeded the allowed space.
344
506
  # @return [Integer]
345
507
  #
346
508
  # @!attribute [rw] subject
@@ -404,6 +566,11 @@ module Aws::STS
404
566
  # role_session_name: "roleSessionNameType", # required
405
567
  # web_identity_token: "clientTokenType", # required
406
568
  # provider_id: "urlType",
569
+ # policy_arns: [
570
+ # {
571
+ # arn: "arnType",
572
+ # },
573
+ # ],
407
574
  # policy: "sessionPolicyDocumentType",
408
575
  # duration_seconds: 1,
409
576
  # }
@@ -447,38 +614,75 @@ module Aws::STS
447
614
  # Do not specify this value for OpenID Connect ID tokens.
448
615
  # @return [String]
449
616
  #
450
- # @!attribute [rw] policy
451
- # An IAM policy in JSON format.
617
+ # @!attribute [rw] policy_arns
618
+ # The Amazon Resource Names (ARNs) of the IAM managed policies that
619
+ # you want to use as managed session policies. The policies must exist
620
+ # in the same account as the role.
452
621
  #
453
- # The policy parameter is optional. If you pass a policy, the
454
- # temporary security credentials that are returned by the operation
455
- # have the permissions that are allowed by both the access policy of
456
- # the role that is being assumed, <i> <b>and</b> </i> the policy that
457
- # you pass. This gives you a way to further restrict the permissions
458
- # for the resulting temporary security credentials. You cannot use the
459
- # passed policy to grant permissions that are in excess of those
460
- # allowed by the access policy of the role that is being assumed. For
461
- # more information, see [Permissions for AssumeRoleWithWebIdentity][1]
462
- # in the *IAM User Guide*.
622
+ # This parameter is optional. You can provide up to 10 managed policy
623
+ # ARNs. However, the plain text that you use for both inline and
624
+ # managed session policies can't exceed 2,048 characters. For more
625
+ # information about ARNs, see [Amazon Resource Names (ARNs) and AWS
626
+ # Service Namespaces][1] in the AWS General Reference.
463
627
  #
464
- # The format for this parameter, as described by its regex pattern, is
465
- # a string of characters up to 2048 characters in length. The
466
- # characters can be any ASCII character from the space character to
467
- # the end of the valid character list (\\u0020-\\u00FF). It can also
628
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
629
+ # tags into a packed binary format that has a separate limit. Your
630
+ # request can fail for this limit even if your plain text meets the
631
+ # other requirements. The `PackedPolicySize` response element
632
+ # indicates by percentage how close the policies and tags for your
633
+ # request are to the upper size limit.
634
+ #
635
+ # </note>
636
+ #
637
+ # Passing policies to this operation returns new temporary
638
+ # credentials. The resulting session's permissions are the
639
+ # intersection of the role's identity-based policy and the session
640
+ # policies. You can use the role's temporary credentials in
641
+ # subsequent AWS API calls to access resources in the account that
642
+ # owns the role. You cannot use session policies to grant more
643
+ # permissions than those allowed by the identity-based policy of the
644
+ # role that is being assumed. For more information, see [Session
645
+ # Policies][2] in the *IAM User Guide*.
646
+ #
647
+ #
648
+ #
649
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
650
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
651
+ # @return [Array<Types::PolicyDescriptorType>]
652
+ #
653
+ # @!attribute [rw] policy
654
+ # An IAM policy in JSON format that you want to use as an inline
655
+ # session policy.
656
+ #
657
+ # This parameter is optional. Passing policies to this operation
658
+ # returns new temporary credentials. The resulting session's
659
+ # permissions are the intersection of the role's identity-based
660
+ # policy and the session policies. You can use the role's temporary
661
+ # credentials in subsequent AWS API calls to access resources in the
662
+ # account that owns the role. You cannot use session policies to grant
663
+ # more permissions than those allowed by the identity-based policy of
664
+ # the role that is being assumed. For more information, see [Session
665
+ # Policies][1] in the *IAM User Guide*.
666
+ #
667
+ # The plain text that you use for both inline and managed session
668
+ # policies can't exceed 2,048 characters. The JSON policy characters
669
+ # can be any ASCII character from the space character to the end of
670
+ # the valid character list (\\u0020 through \\u00FF). It can also
468
671
  # include the tab (\\u0009), linefeed (\\u000A), and carriage return
469
672
  # (\\u000D) characters.
470
673
  #
471
- # <note markdown="1"> The policy plain text must be 2048 bytes or shorter. However, an
472
- # internal conversion compresses it into a packed binary format with a
473
- # separate limit. The PackedPolicySize response element indicates by
474
- # percentage how close to the upper size limit the policy is, with
475
- # 100% equaling the maximum allowed size.
674
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
675
+ # tags into a packed binary format that has a separate limit. Your
676
+ # request can fail for this limit even if your plain text meets the
677
+ # other requirements. The `PackedPolicySize` response element
678
+ # indicates by percentage how close the policies and tags for your
679
+ # request are to the upper size limit.
476
680
  #
477
681
  # </note>
478
682
  #
479
683
  #
480
684
  #
481
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html
685
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
482
686
  # @return [String]
483
687
  #
484
688
  # @!attribute [rw] duration_seconds
@@ -492,7 +696,7 @@ module Aws::STS
492
696
  # value for your role, see [View the Maximum Session Duration Setting
493
697
  # for a Role][1] in the *IAM User Guide*.
494
698
  #
495
- # By default, the value is set to 3600 seconds.
699
+ # By default, the value is set to `3600` seconds.
496
700
  #
497
701
  # <note markdown="1"> The `DurationSeconds` parameter is separate from the duration of a
498
702
  # console session that you might request using the returned
@@ -506,8 +710,8 @@ module Aws::STS
506
710
  #
507
711
  #
508
712
  #
509
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
510
- # [2]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
713
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
714
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
511
715
  # @return [Integer]
512
716
  #
513
717
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityRequest AWS API Documentation
@@ -517,6 +721,7 @@ module Aws::STS
517
721
  :role_session_name,
518
722
  :web_identity_token,
519
723
  :provider_id,
724
+ :policy_arns,
520
725
  :policy,
521
726
  :duration_seconds)
522
727
  include Aws::Structure
@@ -530,11 +735,11 @@ module Aws::STS
530
735
  # The temporary security credentials, which include an access key ID,
531
736
  # a secret access key, and a security token.
532
737
  #
533
- # **Note:** The size of the security token that STS APIs return is not
738
+ # <note markdown="1"> The size of the security token that STS API operations return is not
534
739
  # fixed. We strongly recommend that you make no assumptions about the
535
- # maximum size. As of this writing, the typical size is less than 4096
536
- # bytes, but that can vary. Also, future updates to AWS might require
537
- # larger sizes.
740
+ # maximum size.
741
+ #
742
+ # </note>
538
743
  # @return [Types::Credentials]
539
744
  #
540
745
  # @!attribute [rw] subject_from_web_identity_token
@@ -557,15 +762,16 @@ module Aws::STS
557
762
  # @return [Types::AssumedRoleUser]
558
763
  #
559
764
  # @!attribute [rw] packed_policy_size
560
- # A percentage value that indicates the size of the policy in packed
561
- # form. The service rejects any policy with a packed size greater than
562
- # 100 percent, which means the policy exceeded the allowed space.
765
+ # A percentage value that indicates the packed size of the session
766
+ # policies and session tags combined passed in the request. The
767
+ # request fails if the packed size is greater than 100 percent, which
768
+ # means the policies and tags exceeded the allowed space.
563
769
  # @return [Integer]
564
770
  #
565
771
  # @!attribute [rw] provider
566
772
  # The issuing authority of the web identity token presented. For
567
- # OpenID Connect ID Tokens this contains the value of the `iss` field.
568
- # For OAuth 2.0 access tokens, this contains the value of the
773
+ # OpenID Connect ID tokens, this contains the value of the `iss`
774
+ # field. For OAuth 2.0 access tokens, this contains the value of the
569
775
  # `ProviderId` parameter that was passed in the
570
776
  # `AssumeRoleWithWebIdentity` request.
571
777
  # @return [String]
@@ -600,11 +806,12 @@ module Aws::STS
600
806
  # @!attribute [rw] arn
601
807
  # The ARN of the temporary security credentials that are returned from
602
808
  # the AssumeRole action. For more information about ARNs and how to
603
- # use them in policies, see [IAM Identifiers][1] in *Using IAM*.
809
+ # use them in policies, see [IAM Identifiers][1] in the *IAM User
810
+ # Guide*.
604
811
  #
605
812
  #
606
813
  #
607
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html
814
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html
608
815
  # @return [String]
609
816
  #
610
817
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumedRoleUser AWS API Documentation
@@ -678,6 +885,20 @@ module Aws::STS
678
885
  include Aws::Structure
679
886
  end
680
887
 
888
+ # The web identity token that was passed is expired or is not valid. Get
889
+ # a new identity token from the identity provider and then retry the
890
+ # request.
891
+ #
892
+ # @!attribute [rw] message
893
+ # @return [String]
894
+ #
895
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/ExpiredTokenException AWS API Documentation
896
+ #
897
+ class ExpiredTokenException < Struct.new(
898
+ :message)
899
+ include Aws::Structure
900
+ end
901
+
681
902
  # Identifiers for the federated user that is associated with the
682
903
  # credentials.
683
904
  #
@@ -689,11 +910,11 @@ module Aws::STS
689
910
  # @!attribute [rw] arn
690
911
  # The ARN that specifies the federated user that is associated with
691
912
  # the credentials. For more information about ARNs and how to use them
692
- # in policies, see [IAM Identifiers][1] in *Using IAM*.
913
+ # in policies, see [IAM Identifiers][1] in the *IAM User Guide*.
693
914
  #
694
915
  #
695
916
  #
696
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html
917
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html
697
918
  # @return [String]
698
919
  #
699
920
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/FederatedUser AWS API Documentation
@@ -704,6 +925,39 @@ module Aws::STS
704
925
  include Aws::Structure
705
926
  end
706
927
 
928
+ # @note When making an API call, you may pass GetAccessKeyInfoRequest
929
+ # data as a hash:
930
+ #
931
+ # {
932
+ # access_key_id: "accessKeyIdType", # required
933
+ # }
934
+ #
935
+ # @!attribute [rw] access_key_id
936
+ # The identifier of an access key.
937
+ #
938
+ # This parameter allows (through its regex pattern) a string of
939
+ # characters that can consist of any upper- or lowercase letter or
940
+ # digit.
941
+ # @return [String]
942
+ #
943
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfoRequest AWS API Documentation
944
+ #
945
+ class GetAccessKeyInfoRequest < Struct.new(
946
+ :access_key_id)
947
+ include Aws::Structure
948
+ end
949
+
950
+ # @!attribute [rw] account
951
+ # The number used to identify the AWS account.
952
+ # @return [String]
953
+ #
954
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfoResponse AWS API Documentation
955
+ #
956
+ class GetAccessKeyInfoResponse < Struct.new(
957
+ :account)
958
+ include Aws::Structure
959
+ end
960
+
707
961
  # @api private
708
962
  #
709
963
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityRequest AWS API Documentation
@@ -715,14 +969,14 @@ module Aws::STS
715
969
  #
716
970
  # @!attribute [rw] user_id
717
971
  # The unique identifier of the calling entity. The exact value depends
718
- # on the type of entity making the call. The values returned are those
719
- # listed in the **aws:userid** column in the [Principal table][1]
720
- # found on the **Policy Variables** reference page in the *IAM User
721
- # Guide*.
972
+ # on the type of entity that is making the call. The values returned
973
+ # are those listed in the **aws:userid** column in the [Principal
974
+ # table][1] found on the **Policy Variables** reference page in the
975
+ # *IAM User Guide*.
722
976
  #
723
977
  #
724
978
  #
725
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable
979
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable
726
980
  # @return [String]
727
981
  #
728
982
  # @!attribute [rw] account
@@ -749,7 +1003,18 @@ module Aws::STS
749
1003
  # {
750
1004
  # name: "userNameType", # required
751
1005
  # policy: "sessionPolicyDocumentType",
1006
+ # policy_arns: [
1007
+ # {
1008
+ # arn: "arnType",
1009
+ # },
1010
+ # ],
752
1011
  # duration_seconds: 1,
1012
+ # tags: [
1013
+ # {
1014
+ # key: "tagKeyType", # required
1015
+ # value: "tagValueType", # required
1016
+ # },
1017
+ # ],
753
1018
  # }
754
1019
  #
755
1020
  # @!attribute [rw] name
@@ -765,63 +1030,158 @@ module Aws::STS
765
1030
  # @return [String]
766
1031
  #
767
1032
  # @!attribute [rw] policy
768
- # An IAM policy in JSON format that is passed with the
769
- # `GetFederationToken` call and evaluated along with the policy or
770
- # policies that are attached to the IAM user whose credentials are
771
- # used to call `GetFederationToken`. The passed policy is used to
772
- # scope down the permissions that are available to the IAM user, by
773
- # allowing only a subset of the permissions that are granted to the
774
- # IAM user. The passed policy cannot grant more permissions than those
775
- # granted to the IAM user. The final permissions for the federated
776
- # user are the most restrictive set based on the intersection of the
777
- # passed policy and the IAM user policy.
778
- #
779
- # If you do not pass a policy, the resulting temporary security
780
- # credentials have no effective permissions. The only exception is
781
- # when the temporary security credentials are used to access a
782
- # resource that has a resource-based policy that specifically allows
783
- # the federated user to access the resource.
1033
+ # An IAM policy in JSON format that you want to use as an inline
1034
+ # session policy.
784
1035
  #
785
- # The format for this parameter, as described by its regex pattern, is
786
- # a string of characters up to 2048 characters in length. The
787
- # characters can be any ASCII character from the space character to
788
- # the end of the valid character list (\\u0020-\\u00FF). It can also
1036
+ # You must pass an inline or managed [session policy][1] to this
1037
+ # operation. You can pass a single JSON policy document to use as an
1038
+ # inline session policy. You can also specify up to 10 managed
1039
+ # policies to use as managed session policies.
1040
+ #
1041
+ # This parameter is optional. However, if you do not pass any session
1042
+ # policies, then the resulting federated user session has no
1043
+ # permissions.
1044
+ #
1045
+ # When you pass session policies, the session permissions are the
1046
+ # intersection of the IAM user policies and the session policies that
1047
+ # you pass. This gives you a way to further restrict the permissions
1048
+ # for a federated user. You cannot use session policies to grant more
1049
+ # permissions than those that are defined in the permissions policy of
1050
+ # the IAM user. For more information, see [Session Policies][1] in the
1051
+ # *IAM User Guide*.
1052
+ #
1053
+ # The resulting credentials can be used to access a resource that has
1054
+ # a resource-based policy. If that policy specifically references the
1055
+ # federated user session in the `Principal` element of the policy, the
1056
+ # session has the permissions allowed by the policy. These permissions
1057
+ # are granted in addition to the permissions that are granted by the
1058
+ # session policies.
1059
+ #
1060
+ # The plain text that you use for both inline and managed session
1061
+ # policies can't exceed 2,048 characters. The JSON policy characters
1062
+ # can be any ASCII character from the space character to the end of
1063
+ # the valid character list (\\u0020 through \\u00FF). It can also
789
1064
  # include the tab (\\u0009), linefeed (\\u000A), and carriage return
790
1065
  # (\\u000D) characters.
791
1066
  #
792
- # <note markdown="1"> The policy plain text must be 2048 bytes or shorter. However, an
793
- # internal conversion compresses it into a packed binary format with a
794
- # separate limit. The PackedPolicySize response element indicates by
795
- # percentage how close to the upper size limit the policy is, with
796
- # 100% equaling the maximum allowed size.
1067
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
1068
+ # tags into a packed binary format that has a separate limit. Your
1069
+ # request can fail for this limit even if your plain text meets the
1070
+ # other requirements. The `PackedPolicySize` response element
1071
+ # indicates by percentage how close the policies and tags for your
1072
+ # request are to the upper size limit.
797
1073
  #
798
1074
  # </note>
799
1075
  #
800
- # For more information about how permissions work, see [Permissions
801
- # for GetFederationToken][1].
802
1076
  #
803
1077
  #
804
- #
805
- # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html
1078
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
806
1079
  # @return [String]
807
1080
  #
1081
+ # @!attribute [rw] policy_arns
1082
+ # The Amazon Resource Names (ARNs) of the IAM managed policies that
1083
+ # you want to use as a managed session policy. The policies must exist
1084
+ # in the same account as the IAM user that is requesting federated
1085
+ # access.
1086
+ #
1087
+ # You must pass an inline or managed [session policy][1] to this
1088
+ # operation. You can pass a single JSON policy document to use as an
1089
+ # inline session policy. You can also specify up to 10 managed
1090
+ # policies to use as managed session policies. The plain text that you
1091
+ # use for both inline and managed session policies can't exceed 2,048
1092
+ # characters. You can provide up to 10 managed policy ARNs. For more
1093
+ # information about ARNs, see [Amazon Resource Names (ARNs) and AWS
1094
+ # Service Namespaces][2] in the AWS General Reference.
1095
+ #
1096
+ # This parameter is optional. However, if you do not pass any session
1097
+ # policies, then the resulting federated user session has no
1098
+ # permissions.
1099
+ #
1100
+ # When you pass session policies, the session permissions are the
1101
+ # intersection of the IAM user policies and the session policies that
1102
+ # you pass. This gives you a way to further restrict the permissions
1103
+ # for a federated user. You cannot use session policies to grant more
1104
+ # permissions than those that are defined in the permissions policy of
1105
+ # the IAM user. For more information, see [Session Policies][1] in the
1106
+ # *IAM User Guide*.
1107
+ #
1108
+ # The resulting credentials can be used to access a resource that has
1109
+ # a resource-based policy. If that policy specifically references the
1110
+ # federated user session in the `Principal` element of the policy, the
1111
+ # session has the permissions allowed by the policy. These permissions
1112
+ # are granted in addition to the permissions that are granted by the
1113
+ # session policies.
1114
+ #
1115
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
1116
+ # tags into a packed binary format that has a separate limit. Your
1117
+ # request can fail for this limit even if your plain text meets the
1118
+ # other requirements. The `PackedPolicySize` response element
1119
+ # indicates by percentage how close the policies and tags for your
1120
+ # request are to the upper size limit.
1121
+ #
1122
+ # </note>
1123
+ #
1124
+ #
1125
+ #
1126
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
1127
+ # [2]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
1128
+ # @return [Array<Types::PolicyDescriptorType>]
1129
+ #
808
1130
  # @!attribute [rw] duration_seconds
809
1131
  # The duration, in seconds, that the session should last. Acceptable
810
1132
  # durations for federation sessions range from 900 seconds (15
811
- # minutes) to 129600 seconds (36 hours), with 43200 seconds (12 hours)
812
- # as the default. Sessions obtained using AWS account (root)
813
- # credentials are restricted to a maximum of 3600 seconds (one hour).
1133
+ # minutes) to 129,600 seconds (36 hours), with 43,200 seconds (12
1134
+ # hours) as the default. Sessions obtained using AWS account root user
1135
+ # credentials are restricted to a maximum of 3,600 seconds (one hour).
814
1136
  # If the specified duration is longer than one hour, the session
815
- # obtained by using AWS account (root) credentials defaults to one
816
- # hour.
1137
+ # obtained by using root user credentials defaults to one hour.
817
1138
  # @return [Integer]
818
1139
  #
1140
+ # @!attribute [rw] tags
1141
+ # A list of session tags. Each session tag consists of a key name and
1142
+ # an associated value. For more information about session tags, see
1143
+ # [Passing Session Tags in STS][1] in the *IAM User Guide*.
1144
+ #
1145
+ # This parameter is optional. You can pass up to 50 session tags. The
1146
+ # plain text session tag keys can’t exceed 128 characters and the
1147
+ # values can’t exceed 256 characters. For these and additional limits,
1148
+ # see [IAM and STS Character Limits][2] in the *IAM User Guide*.
1149
+ #
1150
+ # <note markdown="1"> An AWS conversion compresses the passed session policies and session
1151
+ # tags into a packed binary format that has a separate limit. Your
1152
+ # request can fail for this limit even if your plain text meets the
1153
+ # other requirements. The `PackedPolicySize` response element
1154
+ # indicates by percentage how close the policies and tags for your
1155
+ # request are to the upper size limit.
1156
+ #
1157
+ # </note>
1158
+ #
1159
+ # You can pass a session tag with the same key as a tag that is
1160
+ # already attached to the user you are federating. When you do,
1161
+ # session tags override a user tag with the same key.
1162
+ #
1163
+ # Tag key–value pairs are not case sensitive, but case is preserved.
1164
+ # This means that you cannot have separate `Department` and
1165
+ # `department` tag keys. Assume that the role has the
1166
+ # `Department`=`Marketing` tag and you pass the
1167
+ # `department`=`engineering` session tag. `Department` and
1168
+ # `department` are not saved as separate tags, and the session tag
1169
+ # passed in the request takes precedence over the role tag.
1170
+ #
1171
+ #
1172
+ #
1173
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
1174
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
1175
+ # @return [Array<Types::Tag>]
1176
+ #
819
1177
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenRequest AWS API Documentation
820
1178
  #
821
1179
  class GetFederationTokenRequest < Struct.new(
822
1180
  :name,
823
1181
  :policy,
824
- :duration_seconds)
1182
+ :policy_arns,
1183
+ :duration_seconds,
1184
+ :tags)
825
1185
  include Aws::Structure
826
1186
  end
827
1187
 
@@ -833,11 +1193,11 @@ module Aws::STS
833
1193
  # The temporary security credentials, which include an access key ID,
834
1194
  # a secret access key, and a security (or session) token.
835
1195
  #
836
- # **Note:** The size of the security token that STS APIs return is not
1196
+ # <note markdown="1"> The size of the security token that STS API operations return is not
837
1197
  # fixed. We strongly recommend that you make no assumptions about the
838
- # maximum size. As of this writing, the typical size is less than 4096
839
- # bytes, but that can vary. Also, future updates to AWS might require
840
- # larger sizes.
1198
+ # maximum size.
1199
+ #
1200
+ # </note>
841
1201
  # @return [Types::Credentials]
842
1202
  #
843
1203
  # @!attribute [rw] federated_user
@@ -848,9 +1208,10 @@ module Aws::STS
848
1208
  # @return [Types::FederatedUser]
849
1209
  #
850
1210
  # @!attribute [rw] packed_policy_size
851
- # A percentage value indicating the size of the policy in packed form.
852
- # The service rejects policies for which the packed size is greater
853
- # than 100 percent of the allowed value.
1211
+ # A percentage value that indicates the packed size of the session
1212
+ # policies and session tags combined passed in the request. The
1213
+ # request fails if the packed size is greater than 100 percent, which
1214
+ # means the policies and tags exceeded the allowed space.
854
1215
  # @return [Integer]
855
1216
  #
856
1217
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenResponse AWS API Documentation
@@ -874,9 +1235,9 @@ module Aws::STS
874
1235
  # @!attribute [rw] duration_seconds
875
1236
  # The duration, in seconds, that the credentials should remain valid.
876
1237
  # Acceptable durations for IAM user sessions range from 900 seconds
877
- # (15 minutes) to 129600 seconds (36 hours), with 43200 seconds (12
1238
+ # (15 minutes) to 129,600 seconds (36 hours), with 43,200 seconds (12
878
1239
  # hours) as the default. Sessions for AWS account owners are
879
- # restricted to a maximum of 3600 seconds (one hour). If the duration
1240
+ # restricted to a maximum of 3,600 seconds (one hour). If the duration
880
1241
  # is longer than one hour, the session for AWS account owners defaults
881
1242
  # to one hour.
882
1243
  # @return [Integer]
@@ -891,7 +1252,7 @@ module Aws::STS
891
1252
  # the device for an IAM user by going to the AWS Management Console
892
1253
  # and viewing the user's security credentials.
893
1254
  #
894
- # The regex used to validated this parameter is a string of characters
1255
+ # The regex used to validate this parameter is a string of characters
895
1256
  # consisting of upper- and lower-case alphanumeric characters with no
896
1257
  # spaces. You can also include underscores or any of the following
897
1258
  # characters: =,.@:/-
@@ -900,9 +1261,9 @@ module Aws::STS
900
1261
  # @!attribute [rw] token_code
901
1262
  # The value provided by the MFA device, if MFA is required. If any
902
1263
  # policy requires the IAM user to submit an MFA code, specify this
903
- # value. If MFA authentication is required, and the user does not
904
- # provide a code when requesting a set of temporary security
905
- # credentials, the user will receive an "access denied" response
1264
+ # value. If MFA authentication is required, the user must provide a
1265
+ # code when requesting a set of temporary security credentials. A user
1266
+ # who fails to provide the code receives an "access denied" response
906
1267
  # when requesting resources that require MFA authentication.
907
1268
  #
908
1269
  # The format for this parameter, as described by its regex pattern, is
@@ -926,11 +1287,11 @@ module Aws::STS
926
1287
  # The temporary security credentials, which include an access key ID,
927
1288
  # a secret access key, and a security (or session) token.
928
1289
  #
929
- # **Note:** The size of the security token that STS APIs return is not
1290
+ # <note markdown="1"> The size of the security token that STS API operations return is not
930
1291
  # fixed. We strongly recommend that you make no assumptions about the
931
- # maximum size. As of this writing, the typical size is less than 4096
932
- # bytes, but that can vary. Also, future updates to AWS might require
933
- # larger sizes.
1292
+ # maximum size.
1293
+ #
1294
+ # </note>
934
1295
  # @return [Types::Credentials]
935
1296
  #
936
1297
  # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenResponse AWS API Documentation
@@ -940,5 +1301,204 @@ module Aws::STS
940
1301
  include Aws::Structure
941
1302
  end
942
1303
 
1304
+ # The request could not be fulfilled because the identity provider (IDP)
1305
+ # that was asked to verify the incoming identity token could not be
1306
+ # reached. This is often a transient error caused by network conditions.
1307
+ # Retry the request a limited number of times so that you don't exceed
1308
+ # the request rate. If the error persists, the identity provider might
1309
+ # be down or not responding.
1310
+ #
1311
+ # @!attribute [rw] message
1312
+ # @return [String]
1313
+ #
1314
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/IDPCommunicationErrorException AWS API Documentation
1315
+ #
1316
+ class IDPCommunicationErrorException < Struct.new(
1317
+ :message)
1318
+ include Aws::Structure
1319
+ end
1320
+
1321
+ # The identity provider (IdP) reported that authentication failed. This
1322
+ # might be because the claim is invalid.
1323
+ #
1324
+ # If this error is returned for the `AssumeRoleWithWebIdentity`
1325
+ # operation, it can also mean that the claim has expired or has been
1326
+ # explicitly revoked.
1327
+ #
1328
+ # @!attribute [rw] message
1329
+ # @return [String]
1330
+ #
1331
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/IDPRejectedClaimException AWS API Documentation
1332
+ #
1333
+ class IDPRejectedClaimException < Struct.new(
1334
+ :message)
1335
+ include Aws::Structure
1336
+ end
1337
+
1338
+ # The error returned if the message passed to
1339
+ # `DecodeAuthorizationMessage` was invalid. This can happen if the token
1340
+ # contains invalid characters, such as linebreaks.
1341
+ #
1342
+ # @!attribute [rw] message
1343
+ # @return [String]
1344
+ #
1345
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/InvalidAuthorizationMessageException AWS API Documentation
1346
+ #
1347
+ class InvalidAuthorizationMessageException < Struct.new(
1348
+ :message)
1349
+ include Aws::Structure
1350
+ end
1351
+
1352
+ # The web identity token that was passed could not be validated by AWS.
1353
+ # Get a new identity token from the identity provider and then retry the
1354
+ # request.
1355
+ #
1356
+ # @!attribute [rw] message
1357
+ # @return [String]
1358
+ #
1359
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/InvalidIdentityTokenException AWS API Documentation
1360
+ #
1361
+ class InvalidIdentityTokenException < Struct.new(
1362
+ :message)
1363
+ include Aws::Structure
1364
+ end
1365
+
1366
+ # The request was rejected because the policy document was malformed.
1367
+ # The error message describes the specific error.
1368
+ #
1369
+ # @!attribute [rw] message
1370
+ # @return [String]
1371
+ #
1372
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/MalformedPolicyDocumentException AWS API Documentation
1373
+ #
1374
+ class MalformedPolicyDocumentException < Struct.new(
1375
+ :message)
1376
+ include Aws::Structure
1377
+ end
1378
+
1379
+ # The request was rejected because the total packed size of the session
1380
+ # policies and session tags combined was too large. An AWS conversion
1381
+ # compresses the session policy document, session policy ARNs, and
1382
+ # session tags into a packed binary format that has a separate limit.
1383
+ # The error message indicates by percentage how close the policies and
1384
+ # tags are to the upper size limit. For more information, see [Passing
1385
+ # Session Tags in STS][1] in the *IAM User Guide*.
1386
+ #
1387
+ # You could receive this error even though you meet other defined
1388
+ # session policy and session tag limits. For more information, see [IAM
1389
+ # and STS Entity Character Limits][2] in the *IAM User Guide*.
1390
+ #
1391
+ #
1392
+ #
1393
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
1394
+ # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html
1395
+ #
1396
+ # @!attribute [rw] message
1397
+ # @return [String]
1398
+ #
1399
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/PackedPolicyTooLargeException AWS API Documentation
1400
+ #
1401
+ class PackedPolicyTooLargeException < Struct.new(
1402
+ :message)
1403
+ include Aws::Structure
1404
+ end
1405
+
1406
+ # A reference to the IAM managed policy that is passed as a session
1407
+ # policy for a role session or a federated user session.
1408
+ #
1409
+ # @note When making an API call, you may pass PolicyDescriptorType
1410
+ # data as a hash:
1411
+ #
1412
+ # {
1413
+ # arn: "arnType",
1414
+ # }
1415
+ #
1416
+ # @!attribute [rw] arn
1417
+ # The Amazon Resource Name (ARN) of the IAM managed policy to use as a
1418
+ # session policy for the role. For more information about ARNs, see
1419
+ # [Amazon Resource Names (ARNs) and AWS Service Namespaces][1] in the
1420
+ # *AWS General Reference*.
1421
+ #
1422
+ #
1423
+ #
1424
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
1425
+ # @return [String]
1426
+ #
1427
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/PolicyDescriptorType AWS API Documentation
1428
+ #
1429
+ class PolicyDescriptorType < Struct.new(
1430
+ :arn)
1431
+ include Aws::Structure
1432
+ end
1433
+
1434
+ # STS is not activated in the requested region for the account that is
1435
+ # being asked to generate credentials. The account administrator must
1436
+ # use the IAM console to activate STS in that region. For more
1437
+ # information, see [Activating and Deactivating AWS STS in an AWS
1438
+ # Region][1] in the *IAM User Guide*.
1439
+ #
1440
+ #
1441
+ #
1442
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html
1443
+ #
1444
+ # @!attribute [rw] message
1445
+ # @return [String]
1446
+ #
1447
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/RegionDisabledException AWS API Documentation
1448
+ #
1449
+ class RegionDisabledException < Struct.new(
1450
+ :message)
1451
+ include Aws::Structure
1452
+ end
1453
+
1454
+ # You can pass custom key-value pair attributes when you assume a role
1455
+ # or federate a user. These are called session tags. You can then use
1456
+ # the session tags to control access to resources. For more information,
1457
+ # see [Tagging AWS STS Sessions][1] in the *IAM User Guide*.
1458
+ #
1459
+ #
1460
+ #
1461
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
1462
+ #
1463
+ # @note When making an API call, you may pass Tag
1464
+ # data as a hash:
1465
+ #
1466
+ # {
1467
+ # key: "tagKeyType", # required
1468
+ # value: "tagValueType", # required
1469
+ # }
1470
+ #
1471
+ # @!attribute [rw] key
1472
+ # The key for a session tag.
1473
+ #
1474
+ # You can pass up to 50 session tags. The plain text session tag keys
1475
+ # can’t exceed 128 characters. For these and additional limits, see
1476
+ # [IAM and STS Character Limits][1] in the *IAM User Guide*.
1477
+ #
1478
+ #
1479
+ #
1480
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
1481
+ # @return [String]
1482
+ #
1483
+ # @!attribute [rw] value
1484
+ # The value for a session tag.
1485
+ #
1486
+ # You can pass up to 50 session tags. The plain text session tag
1487
+ # values can’t exceed 256 characters. For these and additional limits,
1488
+ # see [IAM and STS Character Limits][1] in the *IAM User Guide*.
1489
+ #
1490
+ #
1491
+ #
1492
+ # [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
1493
+ # @return [String]
1494
+ #
1495
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/Tag AWS API Documentation
1496
+ #
1497
+ class Tag < Struct.new(
1498
+ :key,
1499
+ :value)
1500
+ include Aws::Structure
1501
+ end
1502
+
943
1503
  end
944
1504
  end