aws-sdk-cognitoidentity 1.49.0 → 1.49.1
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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b8f42ec184b1ee1c18b4f548682502a9ab5a5986d2871a85ed4b2faf333368f
|
4
|
+
data.tar.gz: b8eea9a955ad7cdda3e0a952a85ca1d583c7b088f1ecdb03a093245654ef2577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f3705550a899aadcf245e5297a579366ee06ad75e8b1a2c9b0e9d0323657e258aaacd0768dfa3fdd33c0bbaa0dc99557cbe061f4bf9ba939f26f2233176dd14
|
7
|
+
data.tar.gz: 5eb2f0b1a78b5c2e82a70471e4578313dce62e8d68a5ad19da8a8a8f3fbfda9af7248c5fa159217deea2e2cd6d7455e8185c222c0c228fd752310815751a44da
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.49.
|
1
|
+
1.49.1
|
@@ -1668,7 +1668,7 @@ module Aws::CognitoIdentity
|
|
1668
1668
|
params: params,
|
1669
1669
|
config: config)
|
1670
1670
|
context[:gem_name] = 'aws-sdk-cognitoidentity'
|
1671
|
-
context[:gem_version] = '1.49.
|
1671
|
+
context[:gem_version] = '1.49.1'
|
1672
1672
|
Seahorse::Client::Request.new(handlers, context)
|
1673
1673
|
end
|
1674
1674
|
|
@@ -23,7 +23,7 @@ module Aws
|
|
23
23
|
#
|
24
24
|
# ## Refreshing Credentials from Identity Service
|
25
25
|
#
|
26
|
-
# The CognitoIdentityCredentials will auto-refresh the AWS credentials from
|
26
|
+
# The `CognitoIdentityCredentials` will auto-refresh the AWS credentials from
|
27
27
|
# Cognito. In addition to AWS credentials expiring after a given amount of
|
28
28
|
# time, the login token from the identity provider will also expire.
|
29
29
|
# Once this token expires, it will not be usable to refresh AWS credentials,
|
@@ -32,19 +32,18 @@ module Aws
|
|
32
32
|
# supported by most identity providers. Consult the documentation for
|
33
33
|
# the identity provider for refreshing tokens. Once the refreshed token is
|
34
34
|
# acquired, you should make sure to update this new token in the
|
35
|
-
# CognitoIdentityCredentials object's {logins} property. The following
|
35
|
+
# `CognitoIdentityCredentials` object's {logins} property. The following
|
36
36
|
# code will update the WebIdentityToken, assuming you have retrieved
|
37
37
|
# an updated token from the identity provider:
|
38
38
|
#
|
39
|
-
#
|
40
|
-
#
|
39
|
+
# cognito_credentials.logins['graph.facebook.com'] = updatedToken;
|
40
|
+
# cognito_credentials.refresh! # required only if authentication state has changed
|
41
41
|
#
|
42
|
-
# The CognitoIdentityCredentials also provides a `before_refresh` callback
|
42
|
+
# The `CognitoIdentityCredentials` also provides a `before_refresh` callback
|
43
43
|
# that can be used to help manage refreshing identity provider tokens.
|
44
44
|
# `before_refresh` is called when AWS credentials are required and need
|
45
45
|
# to be refreshed and it has access to the CognitoIdentityCredentials object.
|
46
46
|
class CognitoIdentityCredentials
|
47
|
-
|
48
47
|
include CredentialProvider
|
49
48
|
include RefreshingCredentials
|
50
49
|
|
@@ -54,8 +53,8 @@ module Aws
|
|
54
53
|
# identifier in the format REGION:GUID
|
55
54
|
#
|
56
55
|
# @option options [String] :identity_pool_id Required unless identity_id
|
57
|
-
# is provided.
|
58
|
-
#
|
56
|
+
# is provided. An Amazon Cognito Identity Pool ID in the
|
57
|
+
# format REGION:GUID.
|
59
58
|
#
|
60
59
|
# @option options [Hash<String,String>] :logins A set of optional
|
61
60
|
# name-value pairs that map provider names to provider tokens.
|
@@ -69,16 +68,15 @@ module Aws
|
|
69
68
|
# that do not support role customization.
|
70
69
|
#
|
71
70
|
# @option options [Callable] before_refresh Proc called before
|
72
|
-
# credentials are refreshed from Cognito.
|
73
|
-
#
|
74
|
-
#
|
75
|
-
# the following example:
|
71
|
+
# credentials are refreshed from Cognito. `before_refresh` is called
|
72
|
+
# when AWS credentials are required and need to be refreshed.
|
73
|
+
# Login tokens can be refreshed using the following example:
|
76
74
|
#
|
77
75
|
# before_refresh = Proc.new do |cognito_credentials| do
|
78
76
|
# cognito_credentials.logins['graph.facebook.com'] = update_token
|
79
77
|
# end
|
80
78
|
#
|
81
|
-
# @option options [
|
79
|
+
# @option options [CognitoIdentity::Client] :client Optional CognitoIdentity
|
82
80
|
# client. If not provided, a client will be constructed.
|
83
81
|
def initialize(options = {})
|
84
82
|
@identity_pool_id = options.delete(:identity_pool_id)
|
@@ -88,9 +86,9 @@ module Aws
|
|
88
86
|
@async_refresh = false
|
89
87
|
|
90
88
|
client_opts = {}
|
91
|
-
options.each_pair { |k,v| client_opts[k] = v unless CLIENT_EXCLUDE_OPTIONS.include?(k) }
|
89
|
+
options.each_pair { |k, v| client_opts[k] = v unless CLIENT_EXCLUDE_OPTIONS.include?(k) }
|
92
90
|
|
93
|
-
|
91
|
+
unless @identity_pool_id || @identity_id
|
94
92
|
raise ArgumentError,
|
95
93
|
'Must provide either identity_pool_id or identity_id'
|
96
94
|
end
|
@@ -109,19 +107,21 @@ module Aws
|
|
109
107
|
|
110
108
|
# @return [String]
|
111
109
|
def identity_id
|
112
|
-
@identity_id ||= @client
|
113
|
-
|
114
|
-
|
110
|
+
@identity_id ||= @client.get_id(
|
111
|
+
identity_pool_id: @identity_pool_id,
|
112
|
+
logins: @logins
|
113
|
+
).identity_id
|
115
114
|
end
|
116
115
|
|
117
116
|
private
|
118
117
|
|
119
118
|
def refresh
|
120
|
-
@before_refresh
|
119
|
+
@before_refresh&.call(self)
|
121
120
|
|
122
121
|
resp = @client.get_credentials_for_identity(
|
123
122
|
identity_id: identity_id,
|
124
|
-
custom_role_arn: @custom_role_arn
|
123
|
+
custom_role_arn: @custom_role_arn,
|
124
|
+
logins: @logins
|
125
125
|
)
|
126
126
|
|
127
127
|
@credentials = Credentials.new(
|
@@ -134,4 +134,3 @@ module Aws
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
137
|
-
|
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.49.
|
4
|
+
version: 1.49.1
|
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: 2023-
|
11
|
+
date: 2023-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|