aws-sdk-cognitoidentity 1.17.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 03fef6e9604113455535566c9b980e2e13838ae4
4
- data.tar.gz: fc1ab18c67637b852a6a2c41ab89fe458d61bf35
2
+ SHA256:
3
+ metadata.gz: 248a99b15860cba96ca8e90332fb5668f4bbd33a6ddcd76cabe65ae6afad2748
4
+ data.tar.gz: f77b85540853f5519ac22f518b5e5b2de9a267f9d15f28801af1511e75c69f3a
5
5
  SHA512:
6
- metadata.gz: c446c1d5ad9834bf822f5baa7e9914d6f1fb3df7221a49162d37f106401332391cda15e1eb5e1c51820e82779d098c6eda3fe796b59baac955f5246304ed57a2
7
- data.tar.gz: '08e715731148063b68f2fe26ce14fffaccfad893b621ead0d6b6b6796caf49399525c817a07a691b36ff121a1c12f4d54fe6b728d47d0bc1dc2c0a44ce633741'
6
+ metadata.gz: a054787d09c66241ab5589d7ca2dd50e62d7bacd2875b9cea86e8773546f996e7231578437bce8182e2ab56a23c18fbac622e4e96b61a3ce76185e34016f663a
7
+ data.tar.gz: e77a439d1f65a3896b3fddc78eb0492a431ba8f0b331f9e1e384cbdf7583805096c5ff40299b59596e0a52ac66788a9369a803b37e33f901c960ea0f38fb2167
@@ -24,17 +24,20 @@ require_relative 'aws-sdk-cognitoidentity/customizations'
24
24
  # methods each accept a hash of request parameters and return a response
25
25
  # structure.
26
26
  #
27
+ # cognito_identity = Aws::CognitoIdentity::Client.new
28
+ # resp = cognito_identity.create_identity_pool(params)
29
+ #
27
30
  # See {Client} for more information.
28
31
  #
29
32
  # # Errors
30
33
  #
31
- # Errors returned from Amazon Cognito Identity all
32
- # extend {Errors::ServiceError}.
34
+ # Errors returned from Amazon Cognito Identity are defined in the
35
+ # {Errors} module and all extend {Errors::ServiceError}.
33
36
  #
34
37
  # begin
35
38
  # # do stuff
36
39
  # rescue Aws::CognitoIdentity::Errors::ServiceError
37
- # # rescues all service API errors
40
+ # # rescues all Amazon Cognito Identity API errors
38
41
  # end
39
42
  #
40
43
  # See {Errors} for more information.
@@ -42,6 +45,6 @@ require_relative 'aws-sdk-cognitoidentity/customizations'
42
45
  # @service
43
46
  module Aws::CognitoIdentity
44
47
 
45
- GEM_VERSION = '1.17.0'
48
+ GEM_VERSION = '1.22.0'
46
49
 
47
50
  end
@@ -30,6 +30,18 @@ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
30
30
  Aws::Plugins::GlobalConfiguration.add_identifier(:cognitoidentity)
31
31
 
32
32
  module Aws::CognitoIdentity
33
+ # An API client for CognitoIdentity. To construct a client, you need to configure a `:region` and `:credentials`.
34
+ #
35
+ # client = Aws::CognitoIdentity::Client.new(
36
+ # region: region_name,
37
+ # credentials: credentials,
38
+ # # ...
39
+ # )
40
+ #
41
+ # For details on configuring region and credentials see
42
+ # the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
43
+ #
44
+ # See {#initialize} for a full list of supported configuration options.
33
45
  class Client < Seahorse::Client::Base
34
46
 
35
47
  include Aws::ClientStubs
@@ -93,7 +105,7 @@ module Aws::CognitoIdentity
93
105
  # @option options [required, String] :region
94
106
  # The AWS region to connect to. The configured `:region` is
95
107
  # used to determine the service `:endpoint`. When not passed,
96
- # a default `:region` is search for in the following locations:
108
+ # a default `:region` is searched for in the following locations:
97
109
  #
98
110
  # * `Aws.config[:region]`
99
111
  # * `ENV['AWS_REGION']`
@@ -108,6 +120,12 @@ module Aws::CognitoIdentity
108
120
  # When set to `true`, a thread polling for endpoints will be running in
109
121
  # the background every 60 secs (default). Defaults to `false`.
110
122
  #
123
+ # @option options [Boolean] :adaptive_retry_wait_to_fill (true)
124
+ # Used only in `adaptive` retry mode. When true, the request will sleep
125
+ # until there is sufficent client side capacity to retry the request.
126
+ # When false, the request will raise a `RetryCapacityNotAvailableError` and will
127
+ # not retry instead of sleeping.
128
+ #
111
129
  # @option options [Boolean] :client_side_monitoring (false)
112
130
  # When `true`, client-side metrics will be collected for all API requests from
113
131
  # this client.
@@ -132,6 +150,10 @@ module Aws::CognitoIdentity
132
150
  # When `true`, an attempt is made to coerce request parameters into
133
151
  # the required types.
134
152
  #
153
+ # @option options [Boolean] :correct_clock_skew (true)
154
+ # Used only in `standard` and adaptive retry modes. Specifies whether to apply
155
+ # a clock skew correction and retry requests with skewed client clocks.
156
+ #
135
157
  # @option options [Boolean] :disable_host_prefix_injection (false)
136
158
  # Set to true to disable SDK automatically adding host prefix
137
159
  # to default service endpoint when available.
@@ -139,7 +161,7 @@ module Aws::CognitoIdentity
139
161
  # @option options [String] :endpoint
140
162
  # The client endpoint is normally constructed from the `:region`
141
163
  # option. You should only configure an `:endpoint` when connecting
142
- # to test endpoints. This should be avalid HTTP(S) URI.
164
+ # to test endpoints. This should be a valid HTTP(S) URI.
143
165
  #
144
166
  # @option options [Integer] :endpoint_cache_max_entries (1000)
145
167
  # Used for the maximum size limit of the LRU cache storing endpoints data
@@ -154,7 +176,7 @@ module Aws::CognitoIdentity
154
176
  # requests fetching endpoints information. Defaults to 60 sec.
155
177
  #
156
178
  # @option options [Boolean] :endpoint_discovery (false)
157
- # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
179
+ # When set to `true`, endpoint discovery will be enabled for operations when available.
158
180
  #
159
181
  # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
160
182
  # The log formatter.
@@ -166,15 +188,29 @@ module Aws::CognitoIdentity
166
188
  # The Logger instance to send log messages to. If this option
167
189
  # is not set, logging will be disabled.
168
190
  #
191
+ # @option options [Integer] :max_attempts (3)
192
+ # An integer representing the maximum number attempts that will be made for
193
+ # a single request, including the initial attempt. For example,
194
+ # setting this value to 5 will result in a request being retried up to
195
+ # 4 times. Used in `standard` and `adaptive` retry modes.
196
+ #
169
197
  # @option options [String] :profile ("default")
170
198
  # Used when loading credentials from the shared credentials file
171
199
  # at HOME/.aws/credentials. When not specified, 'default' is used.
172
200
  #
201
+ # @option options [Proc] :retry_backoff
202
+ # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
203
+ # This option is only used in the `legacy` retry mode.
204
+ #
173
205
  # @option options [Float] :retry_base_delay (0.3)
174
- # The base delay in seconds used by the default backoff function.
206
+ # The base delay in seconds used by the default backoff function. This option
207
+ # is only used in the `legacy` retry mode.
175
208
  #
176
209
  # @option options [Symbol] :retry_jitter (:none)
177
- # A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
210
+ # A delay randomiser function used by the default backoff function.
211
+ # Some predefined functions can be referenced by name - :none, :equal, :full,
212
+ # otherwise a Proc that takes and returns a number. This option is only used
213
+ # in the `legacy` retry mode.
178
214
  #
179
215
  # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
180
216
  #
@@ -182,11 +218,30 @@ module Aws::CognitoIdentity
182
218
  # The maximum number of times to retry failed requests. Only
183
219
  # ~ 500 level server errors and certain ~ 400 level client errors
184
220
  # are retried. Generally, these are throttling errors, data
185
- # checksum errors, networking errors, timeout errors and auth
186
- # errors from expired credentials.
221
+ # checksum errors, networking errors, timeout errors, auth errors,
222
+ # endpoint discovery, and errors from expired credentials.
223
+ # This option is only used in the `legacy` retry mode.
187
224
  #
188
225
  # @option options [Integer] :retry_max_delay (0)
189
- # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
226
+ # The maximum number of seconds to delay between retries (0 for no limit)
227
+ # used by the default backoff function. This option is only used in the
228
+ # `legacy` retry mode.
229
+ #
230
+ # @option options [String] :retry_mode ("legacy")
231
+ # Specifies which retry algorithm to use. Values are:
232
+ #
233
+ # * `legacy` - The pre-existing retry behavior. This is default value if
234
+ # no retry mode is provided.
235
+ #
236
+ # * `standard` - A standardized set of retry rules across the AWS SDKs.
237
+ # This includes support for retry quotas, which limit the number of
238
+ # unsuccessful retries a client can make.
239
+ #
240
+ # * `adaptive` - An experimental retry mode that includes all the
241
+ # functionality of `standard` mode along with automatic client side
242
+ # throttling. This is a provisional mode that may change behavior
243
+ # in the future.
244
+ #
190
245
  #
191
246
  # @option options [String] :secret_access_key
192
247
  #
@@ -219,16 +274,15 @@ module Aws::CognitoIdentity
219
274
  # requests through. Formatted like 'http://proxy.com:123'.
220
275
  #
221
276
  # @option options [Float] :http_open_timeout (15) The number of
222
- # seconds to wait when opening a HTTP session before rasing a
277
+ # seconds to wait when opening a HTTP session before raising a
223
278
  # `Timeout::Error`.
224
279
  #
225
280
  # @option options [Integer] :http_read_timeout (60) The default
226
281
  # number of seconds to wait for response data. This value can
227
- # safely be set
228
- # per-request on the session yeidled by {#session_for}.
282
+ # safely be set per-request on the session.
229
283
  #
230
284
  # @option options [Float] :http_idle_timeout (5) The number of
231
- # seconds a connection is allowed to sit idble before it is
285
+ # seconds a connection is allowed to sit idle before it is
232
286
  # considered stale. Stale connections are closed and removed
233
287
  # from the pool before making a request.
234
288
  #
@@ -237,7 +291,7 @@ module Aws::CognitoIdentity
237
291
  # request body. This option has no effect unless the request has
238
292
  # "Expect" header set to "100-continue". Defaults to `nil` which
239
293
  # disables this behaviour. This value can safely be set per
240
- # request on the session yeidled by {#session_for}.
294
+ # request on the session.
241
295
  #
242
296
  # @option options [Boolean] :http_wire_trace (false) When `true`,
243
297
  # HTTP debug output will be sent to the `:logger`.
@@ -265,9 +319,8 @@ module Aws::CognitoIdentity
265
319
  # @!group API Operations
266
320
 
267
321
  # Creates a new identity pool. The identity pool is a store of user
268
- # identity information that is specific to your AWS account. The limit
269
- # on identity pools is 60 per account. The keys for
270
- # `SupportedLoginProviders` are as follows:
322
+ # identity information that is specific to your AWS account. The keys
323
+ # for `SupportedLoginProviders` are as follows:
271
324
  #
272
325
  # * Facebook: `graph.facebook.com`
273
326
  #
@@ -287,6 +340,15 @@ module Aws::CognitoIdentity
287
340
  # @option params [required, Boolean] :allow_unauthenticated_identities
288
341
  # TRUE if the identity pool supports unauthenticated logins.
289
342
  #
343
+ # @option params [Boolean] :allow_classic_flow
344
+ # Enables or disables the Basic (Classic) authentication flow. For more
345
+ # information, see [Identity Pools (Federated Identities) Authentication
346
+ # Flow][1] in the *Amazon Cognito Developer Guide*.
347
+ #
348
+ #
349
+ #
350
+ # [1]: https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html
351
+ #
290
352
  # @option params [Hash<String,String>] :supported_login_providers
291
353
  # Optional key:value pairs mapping provider names to provider app IDs.
292
354
  #
@@ -320,6 +382,7 @@ module Aws::CognitoIdentity
320
382
  # * {Types::IdentityPool#identity_pool_id #identity_pool_id} => String
321
383
  # * {Types::IdentityPool#identity_pool_name #identity_pool_name} => String
322
384
  # * {Types::IdentityPool#allow_unauthenticated_identities #allow_unauthenticated_identities} => Boolean
385
+ # * {Types::IdentityPool#allow_classic_flow #allow_classic_flow} => Boolean
323
386
  # * {Types::IdentityPool#supported_login_providers #supported_login_providers} => Hash&lt;String,String&gt;
324
387
  # * {Types::IdentityPool#developer_provider_name #developer_provider_name} => String
325
388
  # * {Types::IdentityPool#open_id_connect_provider_arns #open_id_connect_provider_arns} => Array&lt;String&gt;
@@ -332,6 +395,7 @@ module Aws::CognitoIdentity
332
395
  # resp = client.create_identity_pool({
333
396
  # identity_pool_name: "IdentityPoolName", # required
334
397
  # allow_unauthenticated_identities: false, # required
398
+ # allow_classic_flow: false,
335
399
  # supported_login_providers: {
336
400
  # "IdentityProviderName" => "IdentityProviderId",
337
401
  # },
@@ -355,6 +419,7 @@ module Aws::CognitoIdentity
355
419
  # resp.identity_pool_id #=> String
356
420
  # resp.identity_pool_name #=> String
357
421
  # resp.allow_unauthenticated_identities #=> Boolean
422
+ # resp.allow_classic_flow #=> Boolean
358
423
  # resp.supported_login_providers #=> Hash
359
424
  # resp.supported_login_providers["IdentityProviderName"] #=> String
360
425
  # resp.developer_provider_name #=> String
@@ -487,6 +552,7 @@ module Aws::CognitoIdentity
487
552
  # * {Types::IdentityPool#identity_pool_id #identity_pool_id} => String
488
553
  # * {Types::IdentityPool#identity_pool_name #identity_pool_name} => String
489
554
  # * {Types::IdentityPool#allow_unauthenticated_identities #allow_unauthenticated_identities} => Boolean
555
+ # * {Types::IdentityPool#allow_classic_flow #allow_classic_flow} => Boolean
490
556
  # * {Types::IdentityPool#supported_login_providers #supported_login_providers} => Hash&lt;String,String&gt;
491
557
  # * {Types::IdentityPool#developer_provider_name #developer_provider_name} => String
492
558
  # * {Types::IdentityPool#open_id_connect_provider_arns #open_id_connect_provider_arns} => Array&lt;String&gt;
@@ -505,6 +571,7 @@ module Aws::CognitoIdentity
505
571
  # resp.identity_pool_id #=> String
506
572
  # resp.identity_pool_name #=> String
507
573
  # resp.allow_unauthenticated_identities #=> Boolean
574
+ # resp.allow_classic_flow #=> Boolean
508
575
  # resp.supported_login_providers #=> Hash
509
576
  # resp.supported_login_providers["IdentityProviderName"] #=> String
510
577
  # resp.developer_provider_name #=> String
@@ -787,6 +854,11 @@ module Aws::CognitoIdentity
787
854
  # implications: an attacker could use a leaked token to access your AWS
788
855
  # resources for the token's duration.
789
856
  #
857
+ # <note markdown="1"> Please provide for a small grace period, usually no more than 5
858
+ # minutes, to account for clock skew.
859
+ #
860
+ # </note>
861
+ #
790
862
  # @return [Types::GetOpenIdTokenForDeveloperIdentityResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
791
863
  #
792
864
  # * {Types::GetOpenIdTokenForDeveloperIdentityResponse#identity_id #identity_id} => String
@@ -1163,7 +1235,7 @@ module Aws::CognitoIdentity
1163
1235
  # The Amazon Resource Name (ARN) of the identity pool to assign the tags
1164
1236
  # to.
1165
1237
  #
1166
- # @option params [Hash<String,String>] :tags
1238
+ # @option params [required, Hash<String,String>] :tags
1167
1239
  # The tags to assign to the identity pool.
1168
1240
  #
1169
1241
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
@@ -1172,7 +1244,7 @@ module Aws::CognitoIdentity
1172
1244
  #
1173
1245
  # resp = client.tag_resource({
1174
1246
  # resource_arn: "ARNString", # required
1175
- # tags: {
1247
+ # tags: { # required
1176
1248
  # "TagKeysType" => "TagValueType",
1177
1249
  # },
1178
1250
  # })
@@ -1272,7 +1344,7 @@ module Aws::CognitoIdentity
1272
1344
  # The Amazon Resource Name (ARN) of the identity pool that the tags are
1273
1345
  # assigned to.
1274
1346
  #
1275
- # @option params [Array<String>] :tag_keys
1347
+ # @option params [required, Array<String>] :tag_keys
1276
1348
  # The keys of the tags to remove from the user pool.
1277
1349
  #
1278
1350
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
@@ -1281,7 +1353,7 @@ module Aws::CognitoIdentity
1281
1353
  #
1282
1354
  # resp = client.untag_resource({
1283
1355
  # resource_arn: "ARNString", # required
1284
- # tag_keys: ["TagKeysType"],
1356
+ # tag_keys: ["TagKeysType"], # required
1285
1357
  # })
1286
1358
  #
1287
1359
  # @see http://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/UntagResource AWS API Documentation
@@ -1306,6 +1378,15 @@ module Aws::CognitoIdentity
1306
1378
  # @option params [required, Boolean] :allow_unauthenticated_identities
1307
1379
  # TRUE if the identity pool supports unauthenticated logins.
1308
1380
  #
1381
+ # @option params [Boolean] :allow_classic_flow
1382
+ # Enables or disables the Basic (Classic) authentication flow. For more
1383
+ # information, see [Identity Pools (Federated Identities) Authentication
1384
+ # Flow][1] in the *Amazon Cognito Developer Guide*.
1385
+ #
1386
+ #
1387
+ #
1388
+ # [1]: https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html
1389
+ #
1309
1390
  # @option params [Hash<String,String>] :supported_login_providers
1310
1391
  # Optional key:value pairs mapping provider names to provider app IDs.
1311
1392
  #
@@ -1333,6 +1414,7 @@ module Aws::CognitoIdentity
1333
1414
  # * {Types::IdentityPool#identity_pool_id #identity_pool_id} => String
1334
1415
  # * {Types::IdentityPool#identity_pool_name #identity_pool_name} => String
1335
1416
  # * {Types::IdentityPool#allow_unauthenticated_identities #allow_unauthenticated_identities} => Boolean
1417
+ # * {Types::IdentityPool#allow_classic_flow #allow_classic_flow} => Boolean
1336
1418
  # * {Types::IdentityPool#supported_login_providers #supported_login_providers} => Hash&lt;String,String&gt;
1337
1419
  # * {Types::IdentityPool#developer_provider_name #developer_provider_name} => String
1338
1420
  # * {Types::IdentityPool#open_id_connect_provider_arns #open_id_connect_provider_arns} => Array&lt;String&gt;
@@ -1346,6 +1428,7 @@ module Aws::CognitoIdentity
1346
1428
  # identity_pool_id: "IdentityPoolId", # required
1347
1429
  # identity_pool_name: "IdentityPoolName", # required
1348
1430
  # allow_unauthenticated_identities: false, # required
1431
+ # allow_classic_flow: false,
1349
1432
  # supported_login_providers: {
1350
1433
  # "IdentityProviderName" => "IdentityProviderId",
1351
1434
  # },
@@ -1369,6 +1452,7 @@ module Aws::CognitoIdentity
1369
1452
  # resp.identity_pool_id #=> String
1370
1453
  # resp.identity_pool_name #=> String
1371
1454
  # resp.allow_unauthenticated_identities #=> Boolean
1455
+ # resp.allow_classic_flow #=> Boolean
1372
1456
  # resp.supported_login_providers #=> Hash
1373
1457
  # resp.supported_login_providers["IdentityProviderName"] #=> String
1374
1458
  # resp.developer_provider_name #=> String
@@ -1405,7 +1489,7 @@ module Aws::CognitoIdentity
1405
1489
  params: params,
1406
1490
  config: config)
1407
1491
  context[:gem_name] = 'aws-sdk-cognitoidentity'
1408
- context[:gem_version] = '1.17.0'
1492
+ context[:gem_version] = '1.22.0'
1409
1493
  Seahorse::Client::Request.new(handlers, context)
1410
1494
  end
1411
1495
 
@@ -17,6 +17,7 @@ module Aws::CognitoIdentity
17
17
  AmbiguousRoleResolutionType = Shapes::StringShape.new(name: 'AmbiguousRoleResolutionType')
18
18
  ClaimName = Shapes::StringShape.new(name: 'ClaimName')
19
19
  ClaimValue = Shapes::StringShape.new(name: 'ClaimValue')
20
+ ClassicFlow = Shapes::BooleanShape.new(name: 'ClassicFlow')
20
21
  CognitoIdentityProvider = Shapes::StructureShape.new(name: 'CognitoIdentityProvider')
21
22
  CognitoIdentityProviderClientId = Shapes::StringShape.new(name: 'CognitoIdentityProviderClientId')
22
23
  CognitoIdentityProviderList = Shapes::ListShape.new(name: 'CognitoIdentityProviderList')
@@ -126,6 +127,7 @@ module Aws::CognitoIdentity
126
127
 
127
128
  CreateIdentityPoolInput.add_member(:identity_pool_name, Shapes::ShapeRef.new(shape: IdentityPoolName, required: true, location_name: "IdentityPoolName"))
128
129
  CreateIdentityPoolInput.add_member(:allow_unauthenticated_identities, Shapes::ShapeRef.new(shape: IdentityPoolUnauthenticated, required: true, location_name: "AllowUnauthenticatedIdentities"))
130
+ CreateIdentityPoolInput.add_member(:allow_classic_flow, Shapes::ShapeRef.new(shape: ClassicFlow, location_name: "AllowClassicFlow"))
129
131
  CreateIdentityPoolInput.add_member(:supported_login_providers, Shapes::ShapeRef.new(shape: IdentityProviders, location_name: "SupportedLoginProviders"))
130
132
  CreateIdentityPoolInput.add_member(:developer_provider_name, Shapes::ShapeRef.new(shape: DeveloperProviderName, location_name: "DeveloperProviderName"))
131
133
  CreateIdentityPoolInput.add_member(:open_id_connect_provider_arns, Shapes::ShapeRef.new(shape: OIDCProviderList, location_name: "OpenIdConnectProviderARNs"))
@@ -219,6 +221,7 @@ module Aws::CognitoIdentity
219
221
  IdentityPool.add_member(:identity_pool_id, Shapes::ShapeRef.new(shape: IdentityPoolId, required: true, location_name: "IdentityPoolId"))
220
222
  IdentityPool.add_member(:identity_pool_name, Shapes::ShapeRef.new(shape: IdentityPoolName, required: true, location_name: "IdentityPoolName"))
221
223
  IdentityPool.add_member(:allow_unauthenticated_identities, Shapes::ShapeRef.new(shape: IdentityPoolUnauthenticated, required: true, location_name: "AllowUnauthenticatedIdentities"))
224
+ IdentityPool.add_member(:allow_classic_flow, Shapes::ShapeRef.new(shape: ClassicFlow, location_name: "AllowClassicFlow"))
222
225
  IdentityPool.add_member(:supported_login_providers, Shapes::ShapeRef.new(shape: IdentityProviders, location_name: "SupportedLoginProviders"))
223
226
  IdentityPool.add_member(:developer_provider_name, Shapes::ShapeRef.new(shape: DeveloperProviderName, location_name: "DeveloperProviderName"))
224
227
  IdentityPool.add_member(:open_id_connect_provider_arns, Shapes::ShapeRef.new(shape: OIDCProviderList, location_name: "OpenIdConnectProviderARNs"))
@@ -345,7 +348,7 @@ module Aws::CognitoIdentity
345
348
  SetIdentityPoolRolesInput.struct_class = Types::SetIdentityPoolRolesInput
346
349
 
347
350
  TagResourceInput.add_member(:resource_arn, Shapes::ShapeRef.new(shape: ARNString, required: true, location_name: "ResourceArn"))
348
- TagResourceInput.add_member(:tags, Shapes::ShapeRef.new(shape: IdentityPoolTagsType, location_name: "Tags"))
351
+ TagResourceInput.add_member(:tags, Shapes::ShapeRef.new(shape: IdentityPoolTagsType, required: true, location_name: "Tags"))
349
352
  TagResourceInput.struct_class = Types::TagResourceInput
350
353
 
351
354
  TagResourceResponse.struct_class = Types::TagResourceResponse
@@ -371,7 +374,7 @@ module Aws::CognitoIdentity
371
374
  UnprocessedIdentityIdList.member = Shapes::ShapeRef.new(shape: UnprocessedIdentityId)
372
375
 
373
376
  UntagResourceInput.add_member(:resource_arn, Shapes::ShapeRef.new(shape: ARNString, required: true, location_name: "ResourceArn"))
374
- UntagResourceInput.add_member(:tag_keys, Shapes::ShapeRef.new(shape: IdentityPoolTagsListType, location_name: "TagKeys"))
377
+ UntagResourceInput.add_member(:tag_keys, Shapes::ShapeRef.new(shape: IdentityPoolTagsListType, required: true, location_name: "TagKeys"))
375
378
  UntagResourceInput.struct_class = Types::UntagResourceInput
376
379
 
377
380
  UntagResourceResponse.struct_class = Types::UntagResourceResponse
@@ -1,7 +1 @@
1
- # WARNING ABOUT GENERATED CODE
2
- #
3
- # This file is generated. See the contributing for info on making contributions:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
- #
6
- # WARNING ABOUT GENERATED CODE
7
-
1
+ require 'aws-sdk-cognitoidentity/customizations/cognito_identity_credentials'
@@ -0,0 +1,132 @@
1
+ require 'set'
2
+ require 'securerandom'
3
+ require 'base64'
4
+
5
+ module Aws
6
+ module CognitoIdentity
7
+ # An auto-refreshing credential provider that
8
+ # represents credentials retrieved from STS Web Identity Federation using
9
+ # the Amazon Cognito Identity service.
10
+ #
11
+ # This provider gets credentials using the
12
+ # {Client.get_credentials_for_identity} service operation, which
13
+ # requires either an `identity_id` or an `identity_pool_id` (Amazon Cognito
14
+ # Identity Pool ID), which is used to call {Client.get_id} to
15
+ # obtain an `identity_id` automatically.
16
+ #
17
+ # In addition, if this credential provider is used to provide authenticated
18
+ # login, the `logins` map may be set to the tokens provided by the
19
+ # respective identity providers. See {#initialize} for an example on
20
+ # creating a credentials object with proper property values.
21
+ #
22
+ # ## Refreshing Credentials from Identity Service
23
+ #
24
+ # The CognitoIdentityCredentials will auto-refresh the AWS credentials from
25
+ # Cognito. In addition to AWS credentials expiring after a given amount of
26
+ # time, the login token from the identity provider will also expire.
27
+ # Once this token expires, it will not be usable to refresh AWS credentials,
28
+ # and another token will be needed. The SDK does not manage refreshing of
29
+ # the token value, but this can be done through a "refresh token"
30
+ # supported by most identity providers. Consult the documentation for
31
+ # the identity provider for refreshing tokens. Once the refreshed token is
32
+ # acquired, you should make sure to update this new token in the
33
+ # CognitoIdentityCredentials object's {logins} property. The following
34
+ # code will update the WebIdentityToken, assuming you have retrieved
35
+ # an updated token from the identity provider:
36
+ #
37
+ # AWS.config.credentials.logins['graph.facebook.com'] = updatedToken;
38
+ # AWS.config.credentials.refresh! # required only if authentication state has changed
39
+ #
40
+ # The CognitoIdentityCredentials also provides a `before_refresh` callback
41
+ # that can be used to help manage refreshing identity provider tokens.
42
+ # `before_refresh` is called when AWS credentials are required and need
43
+ # to be refreshed and it has access to the CognitoIdentityCredentials object.
44
+ class CognitoIdentityCredentials
45
+
46
+ include CredentialProvider
47
+ include RefreshingCredentials
48
+
49
+ # @param [Hash] options
50
+ # @option options [String] :identity_id the Cognito identity_id. Required
51
+ # unless identity_pool_id is given. A unique
52
+ # identifier in the format REGION:GUID
53
+ #
54
+ # @option options [String] :identity_pool_id Required unless identity_id
55
+ # is provided. A Amazon Cognito
56
+ # Identity Pool ID)in the format REGION:GUID.
57
+ #
58
+ # @option options [Hash<String,String>] :logins A set of optional
59
+ # name-value pairs that map provider names to provider tokens.
60
+ # The name-value pair will follow the syntax
61
+ # "provider_name": "provider_user_identifier".
62
+ #
63
+ # @option options [String] :custom_role_arn The Amazon Resource
64
+ # Name (ARN) of the role to be assumed when multiple roles were received
65
+ # in the token from the identity provider. For example, a SAML-based
66
+ # identity provider. This parameter is optional for identity providers
67
+ # that do not support role customization.
68
+ #
69
+ # @option options [Callable] before_refresh Proc called before
70
+ # credentials are refreshed from Cognito. Useful for updating logins/
71
+ # auth tokens. `before_refresh` is called when AWS credentials are
72
+ # required and need to be refreshed. Login tokens can be refreshed using
73
+ # the following example:
74
+ #
75
+ # before_refresh = Proc.new do |cognito_credentials| do
76
+ # cognito_credentials.logins['graph.facebook.com'] = update_token
77
+ # end
78
+ #
79
+ # @option options [STS::CognitoIdentity] :client Optional CognitoIdentity
80
+ # client. If not provided, a client will be constructed.
81
+ def initialize(options = {})
82
+ @identity_pool_id = options.delete(:identity_pool_id)
83
+ @identity_id = options.delete(:identity_id)
84
+ @custom_role_arn = options.delete(:custom_role_arn)
85
+ @logins = options.delete(:logins) || {}
86
+ @before_refresh = options.delete(:before_refresh)
87
+
88
+ if !@identity_pool_id && !@identity_id
89
+ raise ArgumentError,
90
+ 'Must provide either identity_pool_id or identity_id'
91
+ end
92
+
93
+ @client = options[:client] || CognitoIdentity::Client.new(
94
+ options.merge(credentials: false)
95
+ )
96
+ super
97
+ end
98
+
99
+ # @return [CognitoIdentity::Client]
100
+ attr_reader :client
101
+
102
+ # @return [Hash<String,String>]
103
+ attr_accessor :logins
104
+
105
+ # @return [String]
106
+ def identity_id
107
+ @identity_id ||= @client
108
+ .get_id(identity_pool_id: @identity_pool_id)
109
+ .identity_id
110
+ end
111
+
112
+ private
113
+
114
+ def refresh
115
+ @before_refresh.call(self) if @before_refresh
116
+
117
+ resp = @client.get_credentials_for_identity(
118
+ identity_id: identity_id,
119
+ custom_role_arn: @custom_role_arn
120
+ )
121
+
122
+ @credentials = Credentials.new(
123
+ resp.credentials.access_key_id,
124
+ resp.credentials.secret_key,
125
+ resp.credentials.session_token
126
+ )
127
+ @expiration = resp.credentials.expiration
128
+ end
129
+ end
130
+ end
131
+ end
132
+
@@ -6,6 +6,39 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::CognitoIdentity
9
+
10
+ # When CognitoIdentity returns an error response, the Ruby SDK constructs and raises an error.
11
+ # These errors all extend Aws::CognitoIdentity::Errors::ServiceError < {Aws::Errors::ServiceError}
12
+ #
13
+ # You can rescue all CognitoIdentity errors using ServiceError:
14
+ #
15
+ # begin
16
+ # # do stuff
17
+ # rescue Aws::CognitoIdentity::Errors::ServiceError
18
+ # # rescues all CognitoIdentity 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
+ # * {ConcurrentModificationException}
29
+ # * {DeveloperUserAlreadyRegisteredException}
30
+ # * {ExternalServiceException}
31
+ # * {InternalErrorException}
32
+ # * {InvalidIdentityPoolConfigurationException}
33
+ # * {InvalidParameterException}
34
+ # * {LimitExceededException}
35
+ # * {NotAuthorizedException}
36
+ # * {ResourceConflictException}
37
+ # * {ResourceNotFoundException}
38
+ # * {TooManyRequestsException}
39
+ #
40
+ # Additionally, error classes are dynamically generated for service errors based on the error code
41
+ # if they are not defined above.
9
42
  module Errors
10
43
 
11
44
  extend Aws::Errors::DynamicErrors
@@ -23,7 +56,6 @@ module Aws::CognitoIdentity
23
56
  def message
24
57
  @message || @data[:message]
25
58
  end
26
-
27
59
  end
28
60
 
29
61
  class DeveloperUserAlreadyRegisteredException < ServiceError
@@ -39,7 +71,6 @@ module Aws::CognitoIdentity
39
71
  def message
40
72
  @message || @data[:message]
41
73
  end
42
-
43
74
  end
44
75
 
45
76
  class ExternalServiceException < ServiceError
@@ -55,7 +86,6 @@ module Aws::CognitoIdentity
55
86
  def message
56
87
  @message || @data[:message]
57
88
  end
58
-
59
89
  end
60
90
 
61
91
  class InternalErrorException < ServiceError
@@ -71,7 +101,6 @@ module Aws::CognitoIdentity
71
101
  def message
72
102
  @message || @data[:message]
73
103
  end
74
-
75
104
  end
76
105
 
77
106
  class InvalidIdentityPoolConfigurationException < ServiceError
@@ -87,7 +116,6 @@ module Aws::CognitoIdentity
87
116
  def message
88
117
  @message || @data[:message]
89
118
  end
90
-
91
119
  end
92
120
 
93
121
  class InvalidParameterException < ServiceError
@@ -103,7 +131,6 @@ module Aws::CognitoIdentity
103
131
  def message
104
132
  @message || @data[:message]
105
133
  end
106
-
107
134
  end
108
135
 
109
136
  class LimitExceededException < ServiceError
@@ -119,7 +146,6 @@ module Aws::CognitoIdentity
119
146
  def message
120
147
  @message || @data[:message]
121
148
  end
122
-
123
149
  end
124
150
 
125
151
  class NotAuthorizedException < ServiceError
@@ -135,7 +161,6 @@ module Aws::CognitoIdentity
135
161
  def message
136
162
  @message || @data[:message]
137
163
  end
138
-
139
164
  end
140
165
 
141
166
  class ResourceConflictException < ServiceError
@@ -151,7 +176,6 @@ module Aws::CognitoIdentity
151
176
  def message
152
177
  @message || @data[:message]
153
178
  end
154
-
155
179
  end
156
180
 
157
181
  class ResourceNotFoundException < ServiceError
@@ -167,7 +191,6 @@ module Aws::CognitoIdentity
167
191
  def message
168
192
  @message || @data[:message]
169
193
  end
170
-
171
194
  end
172
195
 
173
196
  class TooManyRequestsException < ServiceError
@@ -183,7 +206,6 @@ module Aws::CognitoIdentity
183
206
  def message
184
207
  @message || @data[:message]
185
208
  end
186
-
187
209
  end
188
210
 
189
211
  end
@@ -6,6 +6,7 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::CognitoIdentity
9
+
9
10
  class Resource
10
11
 
11
12
  # @param options ({})
@@ -72,6 +72,7 @@ module Aws::CognitoIdentity
72
72
  # {
73
73
  # identity_pool_name: "IdentityPoolName", # required
74
74
  # allow_unauthenticated_identities: false, # required
75
+ # allow_classic_flow: false,
75
76
  # supported_login_providers: {
76
77
  # "IdentityProviderName" => "IdentityProviderId",
77
78
  # },
@@ -98,6 +99,16 @@ module Aws::CognitoIdentity
98
99
  # TRUE if the identity pool supports unauthenticated logins.
99
100
  # @return [Boolean]
100
101
  #
102
+ # @!attribute [rw] allow_classic_flow
103
+ # Enables or disables the Basic (Classic) authentication flow. For
104
+ # more information, see [Identity Pools (Federated Identities)
105
+ # Authentication Flow][1] in the *Amazon Cognito Developer Guide*.
106
+ #
107
+ #
108
+ #
109
+ # [1]: https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html
110
+ # @return [Boolean]
111
+ #
101
112
  # @!attribute [rw] supported_login_providers
102
113
  # Optional key:value pairs mapping provider names to provider app IDs.
103
114
  # @return [Hash<String,String>]
@@ -137,6 +148,7 @@ module Aws::CognitoIdentity
137
148
  class CreateIdentityPoolInput < Struct.new(
138
149
  :identity_pool_name,
139
150
  :allow_unauthenticated_identities,
151
+ :allow_classic_flow,
140
152
  :supported_login_providers,
141
153
  :developer_provider_name,
142
154
  :open_id_connect_provider_arns,
@@ -523,6 +535,11 @@ module Aws::CognitoIdentity
523
535
  # in setting the expiration time for a token, as there are significant
524
536
  # security implications: an attacker could use a leaked token to
525
537
  # access your AWS resources for the token's duration.
538
+ #
539
+ # <note markdown="1"> Please provide for a small grace period, usually no more than 5
540
+ # minutes, to account for clock skew.
541
+ #
542
+ # </note>
526
543
  # @return [Integer]
527
544
  #
528
545
  # @see http://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/GetOpenIdTokenForDeveloperIdentityInput AWS API Documentation
@@ -642,6 +659,7 @@ module Aws::CognitoIdentity
642
659
  # identity_pool_id: "IdentityPoolId", # required
643
660
  # identity_pool_name: "IdentityPoolName", # required
644
661
  # allow_unauthenticated_identities: false, # required
662
+ # allow_classic_flow: false,
645
663
  # supported_login_providers: {
646
664
  # "IdentityProviderName" => "IdentityProviderId",
647
665
  # },
@@ -672,6 +690,16 @@ module Aws::CognitoIdentity
672
690
  # TRUE if the identity pool supports unauthenticated logins.
673
691
  # @return [Boolean]
674
692
  #
693
+ # @!attribute [rw] allow_classic_flow
694
+ # Enables or disables the Basic (Classic) authentication flow. For
695
+ # more information, see [Identity Pools (Federated Identities)
696
+ # Authentication Flow][1] in the *Amazon Cognito Developer Guide*.
697
+ #
698
+ #
699
+ #
700
+ # [1]: https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html
701
+ # @return [Boolean]
702
+ #
675
703
  # @!attribute [rw] supported_login_providers
676
704
  # Optional key:value pairs mapping provider names to provider app IDs.
677
705
  # @return [Hash<String,String>]
@@ -706,6 +734,7 @@ module Aws::CognitoIdentity
706
734
  :identity_pool_id,
707
735
  :identity_pool_name,
708
736
  :allow_unauthenticated_identities,
737
+ :allow_classic_flow,
709
738
  :supported_login_providers,
710
739
  :developer_provider_name,
711
740
  :open_id_connect_provider_arns,
@@ -1296,7 +1325,7 @@ module Aws::CognitoIdentity
1296
1325
  #
1297
1326
  # {
1298
1327
  # resource_arn: "ARNString", # required
1299
- # tags: {
1328
+ # tags: { # required
1300
1329
  # "TagKeysType" => "TagValueType",
1301
1330
  # },
1302
1331
  # }
@@ -1433,7 +1462,7 @@ module Aws::CognitoIdentity
1433
1462
  #
1434
1463
  # {
1435
1464
  # resource_arn: "ARNString", # required
1436
- # tag_keys: ["TagKeysType"],
1465
+ # tag_keys: ["TagKeysType"], # required
1437
1466
  # }
1438
1467
  #
1439
1468
  # @!attribute [rw] resource_arn
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-cognitoidentity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-23 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -56,6 +56,7 @@ files:
56
56
  - lib/aws-sdk-cognitoidentity/client.rb
57
57
  - lib/aws-sdk-cognitoidentity/client_api.rb
58
58
  - lib/aws-sdk-cognitoidentity/customizations.rb
59
+ - lib/aws-sdk-cognitoidentity/customizations/cognito_identity_credentials.rb
59
60
  - lib/aws-sdk-cognitoidentity/errors.rb
60
61
  - lib/aws-sdk-cognitoidentity/resource.rb
61
62
  - lib/aws-sdk-cognitoidentity/types.rb
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
82
  version: '0'
82
83
  requirements: []
83
84
  rubyforge_project:
84
- rubygems_version: 2.5.2.3
85
+ rubygems_version: 2.7.6.2
85
86
  signing_key:
86
87
  specification_version: 4
87
88
  summary: AWS SDK for Ruby - Amazon Cognito Identity