aws-sdk-core 3.232.0 → 3.237.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 +4 -4
- data/CHANGELOG.md +37 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/assume_role_credentials.rb +8 -8
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +2 -2
- data/lib/aws-sdk-core/credential_provider_chain.rb +44 -22
- data/lib/aws-sdk-core/ecs_credentials.rb +13 -13
- data/lib/aws-sdk-core/instance_profile_credentials.rb +7 -7
- data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +28 -14
- data/lib/aws-sdk-core/refreshing_credentials.rb +8 -11
- data/lib/aws-sdk-core/sso_credentials.rb +1 -1
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sso/endpoint_parameters.rb +4 -4
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +20 -7
- data/lib/aws-sdk-ssooidc/client_api.rb +5 -0
- data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +4 -4
- data/lib/aws-sdk-ssooidc/errors.rb +10 -0
- data/lib/aws-sdk-ssooidc/types.rb +27 -15
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +65 -12
- data/lib/aws-sdk-sts/client_api.rb +26 -0
- data/lib/aws-sdk-sts/customizations.rb +0 -1
- data/lib/aws-sdk-sts/endpoint_parameters.rb +5 -5
- data/lib/aws-sdk-sts/errors.rb +16 -0
- data/lib/aws-sdk-sts/types.rb +48 -6
- data/lib/aws-sdk-sts.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 95d07e9b7ee04171f8d93e7d0616d89c8d7e738372b772d6f66a67fac0710c41
|
|
4
|
+
data.tar.gz: 00b8b6b00d2e61dee0054b198e73f76f27d2af1e282e01374126522e67991d98
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b77063dba0c37595b4096dd4a022a5446dc3fcb850bf24fff5546c025ce0dfb9fa96570e3259591708836a40c591df299879ebfb7b8648a4cbd736101fad30be
|
|
7
|
+
data.tar.gz: 05b16dade46a24d7c53d4dc4fa48226f18deaa2ebb410b9bf42a63305cdac965b888bc5b11d283d1ff6c8c5b73ee107135bc8b6dd861386eaea44a02148341cb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
Unreleased Changes
|
|
2
2
|
------------------
|
|
3
3
|
|
|
4
|
+
3.237.0 (2025-11-10)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
* Feature - Updated Aws::STS::Client with the latest API changes.
|
|
8
|
+
|
|
9
|
+
* Feature - Added GetDelegatedAccessToken API, which is not available for general use at this time.
|
|
10
|
+
|
|
11
|
+
3.236.0 (2025-10-30)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
* Feature - Updated Aws::STS::Client with the latest API changes.
|
|
15
|
+
|
|
16
|
+
* Feature - Updated Aws::SSO::Client with the latest API changes.
|
|
17
|
+
|
|
18
|
+
* Feature - Update endpoint ruleset parameters casing
|
|
19
|
+
|
|
20
|
+
3.235.0 (2025-10-24)
|
|
21
|
+
------------------
|
|
22
|
+
|
|
23
|
+
* Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
|
|
24
|
+
|
|
25
|
+
* Feature - Update endpoint ruleset parameters casing
|
|
26
|
+
|
|
27
|
+
3.234.0 (2025-10-21)
|
|
28
|
+
------------------
|
|
29
|
+
|
|
30
|
+
* Issue - Fix `request_checksum_calculation` `when_required` mode to only calculate checksums when explicitly provided by user.
|
|
31
|
+
|
|
32
|
+
* Feature - Add `CREDENTIALS_CODE` metric for `static_profile_` prefixed methods in default credential chain.
|
|
33
|
+
|
|
34
|
+
3.233.0 (2025-09-23)
|
|
35
|
+
------------------
|
|
36
|
+
|
|
37
|
+
* Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
|
|
38
|
+
|
|
39
|
+
* Feature - This release includes exception definition and documentation updates.
|
|
40
|
+
|
|
4
41
|
3.232.0 (2025-08-28)
|
|
5
42
|
------------------
|
|
6
43
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.237.0
|
|
@@ -7,7 +7,7 @@ module Aws
|
|
|
7
7
|
# {Aws::STS::Client#assume_role}.
|
|
8
8
|
#
|
|
9
9
|
# role_credentials = Aws::AssumeRoleCredentials.new(
|
|
10
|
-
# client: Aws::STS::Client.new(
|
|
10
|
+
# client: Aws::STS::Client.new(sts_options),
|
|
11
11
|
# role_arn: "linked::account::arn",
|
|
12
12
|
# role_session_name: "session-name"
|
|
13
13
|
# )
|
|
@@ -28,15 +28,15 @@ module Aws
|
|
|
28
28
|
# @option options [Integer] :duration_seconds
|
|
29
29
|
# @option options [String] :external_id
|
|
30
30
|
# @option options [STS::Client] :client
|
|
31
|
-
# @option options [
|
|
31
|
+
# @option options [Proc] :before_refresh A Proc called before
|
|
32
32
|
# credentials are refreshed. Useful for updating tokens.
|
|
33
|
-
#
|
|
34
|
-
# required and need to be refreshed.
|
|
35
|
-
# the following example:
|
|
33
|
+
# `:before_refresh` is called when AWS credentials are
|
|
34
|
+
# required and need to be refreshed. See the example in this doc.
|
|
36
35
|
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
#
|
|
36
|
+
# @example Tokens can be refreshed using a Proc.
|
|
37
|
+
# before_refresh = Proc.new do |assume_role_credentials|
|
|
38
|
+
# assume_role_credentials.assume_role_params['token_code'] = update_token
|
|
39
|
+
# end
|
|
40
40
|
#
|
|
41
41
|
def initialize(options = {})
|
|
42
42
|
client_opts = {}
|
|
@@ -9,11 +9,11 @@ module Aws
|
|
|
9
9
|
# {Aws::STS::Client#assume_role_with_web_identity}.
|
|
10
10
|
#
|
|
11
11
|
# role_credentials = Aws::AssumeRoleWebIdentityCredentials.new(
|
|
12
|
-
# client: Aws::STS::Client.new(
|
|
12
|
+
# client: Aws::STS::Client.new(sts_options),
|
|
13
13
|
# role_arn: "linked::account::arn",
|
|
14
14
|
# web_identity_token_file: "/path/to/token/file",
|
|
15
15
|
# role_session_name: "session-name"
|
|
16
|
-
# ...
|
|
16
|
+
# # ...
|
|
17
17
|
# )
|
|
18
18
|
# ec2 = Aws::EC2::Client.new(credentials: role_credentials)
|
|
19
19
|
#
|
|
@@ -11,7 +11,7 @@ module Aws
|
|
|
11
11
|
def resolve
|
|
12
12
|
providers.each do |method_name, options|
|
|
13
13
|
provider = send(method_name, options.merge(config: @config))
|
|
14
|
-
return provider if provider
|
|
14
|
+
return provider if provider&.set?
|
|
15
15
|
end
|
|
16
16
|
nil
|
|
17
17
|
end
|
|
@@ -54,47 +54,65 @@ module Aws
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def static_profile_assume_role_web_identity_credentials(options)
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
return unless Aws.shared_config.config_enabled? && options[:config]&.profile
|
|
58
|
+
|
|
59
|
+
with_metrics('CREDENTIALS_CODE') do
|
|
60
|
+
creds = Aws.shared_config.assume_role_web_identity_credentials_from_config(
|
|
59
61
|
profile: options[:config].profile,
|
|
60
62
|
region: options[:config].region
|
|
61
63
|
)
|
|
64
|
+
return unless creds
|
|
65
|
+
|
|
66
|
+
creds.metrics << 'CREDENTIALS_CODE'
|
|
67
|
+
creds
|
|
62
68
|
end
|
|
63
69
|
end
|
|
64
70
|
|
|
65
71
|
def static_profile_sso_credentials(options)
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
return unless Aws.shared_config.config_enabled? && options[:config]&.profile
|
|
73
|
+
|
|
74
|
+
with_metrics('CREDENTIALS_CODE') do
|
|
75
|
+
creds = Aws.shared_config.sso_credentials_from_config(
|
|
68
76
|
profile: options[:config].profile
|
|
69
77
|
)
|
|
78
|
+
return unless creds
|
|
79
|
+
|
|
80
|
+
creds.metrics << 'CREDENTIALS_CODE'
|
|
81
|
+
creds
|
|
70
82
|
end
|
|
71
83
|
end
|
|
72
84
|
|
|
73
85
|
def static_profile_assume_role_credentials(options)
|
|
74
|
-
|
|
75
|
-
|
|
86
|
+
return unless Aws.shared_config.config_enabled? && options[:config]&.profile
|
|
87
|
+
|
|
88
|
+
with_metrics('CREDENTIALS_CODE') do
|
|
89
|
+
creds = assume_role_with_profile(options, options[:config].profile)
|
|
90
|
+
return unless creds
|
|
91
|
+
|
|
92
|
+
creds.metrics << 'CREDENTIALS_CODE'
|
|
93
|
+
creds
|
|
76
94
|
end
|
|
77
95
|
end
|
|
78
96
|
|
|
79
97
|
def static_profile_credentials(options)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
98
|
+
return unless options[:config]&.profile
|
|
99
|
+
|
|
100
|
+
creds = SharedCredentials.new(profile_name: options[:config].profile)
|
|
101
|
+
creds.metrics << 'CREDENTIALS_PROFILE'
|
|
102
|
+
creds
|
|
85
103
|
rescue Errors::NoSuchProfileError
|
|
86
104
|
nil
|
|
87
105
|
end
|
|
88
106
|
|
|
89
107
|
def static_profile_process_credentials(options)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
return unless Aws.shared_config.config_enabled? && options[:config]&.profile
|
|
109
|
+
|
|
110
|
+
process_provider = Aws.shared_config.credential_process(profile: options[:config].profile)
|
|
111
|
+
return unless process_provider
|
|
112
|
+
|
|
113
|
+
creds = ProcessCredentials.new([process_provider])
|
|
114
|
+
creds.metrics.concat(%w[CREDENTIALS_PROFILE_PROCESS CREDENTIALS_CODE])
|
|
115
|
+
creds
|
|
98
116
|
rescue Errors::NoSuchProfileError
|
|
99
117
|
nil
|
|
100
118
|
end
|
|
@@ -122,7 +140,7 @@ module Aws
|
|
|
122
140
|
end
|
|
123
141
|
|
|
124
142
|
def determine_profile_name(options)
|
|
125
|
-
(options[:config]
|
|
143
|
+
(options[:config]&.profile) || ENV['AWS_PROFILE'] || ENV['AWS_DEFAULT_PROFILE'] || 'default'
|
|
126
144
|
end
|
|
127
145
|
|
|
128
146
|
def shared_credentials(options)
|
|
@@ -201,10 +219,14 @@ module Aws
|
|
|
201
219
|
profile: profile_name,
|
|
202
220
|
chain_config: @config
|
|
203
221
|
}
|
|
204
|
-
if options[:config]
|
|
222
|
+
if options[:config]&.region
|
|
205
223
|
assume_opts[:region] = options[:config].region
|
|
206
224
|
end
|
|
207
225
|
Aws.shared_config.assume_role_credentials_from_config(assume_opts)
|
|
208
226
|
end
|
|
227
|
+
|
|
228
|
+
def with_metrics(metrics, &block)
|
|
229
|
+
Aws::Plugins::UserAgent.metric(*metrics, &block)
|
|
230
|
+
end
|
|
209
231
|
end
|
|
210
232
|
end
|
|
@@ -42,26 +42,26 @@ module Aws
|
|
|
42
42
|
# @option options [Integer] :retries (5) Number of times to retry
|
|
43
43
|
# when retrieving credentials.
|
|
44
44
|
# @option options [String] :ip_address ('169.254.170.2') This value is
|
|
45
|
-
# ignored if
|
|
46
|
-
# @option options [Integer] :port (80) This value is ignored if
|
|
47
|
-
# is set and
|
|
45
|
+
# ignored if `:endpoint` is set and `:credential_path` is not set.
|
|
46
|
+
# @option options [Integer] :port (80) This value is ignored if `:endpoint`
|
|
47
|
+
# is set and `:credential_path` is not set.
|
|
48
48
|
# @option options [String] :credential_path By default, the value of the
|
|
49
|
-
# AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable.
|
|
49
|
+
# `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` environment variable.
|
|
50
50
|
# @option options [String] :endpoint The container credential endpoint.
|
|
51
|
-
# By default, this is the value of the AWS_CONTAINER_CREDENTIALS_FULL_URI
|
|
52
|
-
# environment variable. This value is ignored if
|
|
53
|
-
# ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'] is set.
|
|
51
|
+
# By default, this is the value of the `AWS_CONTAINER_CREDENTIALS_FULL_URI`
|
|
52
|
+
# environment variable. This value is ignored if `:credential_path` or
|
|
53
|
+
# `ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI']` is set.
|
|
54
54
|
# @option options [Float] :http_open_timeout (5)
|
|
55
55
|
# @option options [Float] :http_read_timeout (5)
|
|
56
|
-
# @option options [
|
|
56
|
+
# @option options [IO] :http_debug_output (nil) HTTP wire
|
|
57
|
+
# traces are sent to this object. You can specify something
|
|
58
|
+
# like `$stdout`.
|
|
59
|
+
# @option options [Numeric, Proc] :backoff By default, failures are retried
|
|
57
60
|
# with exponential back-off, i.e. `sleep(1.2 ** num_failures)`. You can
|
|
58
61
|
# pass a number of seconds to sleep between failed attempts, or
|
|
59
62
|
# a Proc that accepts the number of failures.
|
|
60
|
-
# @option options [
|
|
61
|
-
#
|
|
62
|
-
# like $stdout.
|
|
63
|
-
# @option options [Callable] before_refresh Proc called before
|
|
64
|
-
# credentials are refreshed. `before_refresh` is called
|
|
63
|
+
# @option options [Proc] :before_refresh A Proc called before
|
|
64
|
+
# credentials are refreshed. `:before_refresh` is called
|
|
65
65
|
# with an instance of this object when
|
|
66
66
|
# AWS credentials are required and need to be refreshed.
|
|
67
67
|
def initialize(options = {})
|
|
@@ -57,6 +57,9 @@ module Aws
|
|
|
57
57
|
|
|
58
58
|
# @param [Hash] options
|
|
59
59
|
# @option options [Integer] :retries (1) Number of times to retry when retrieving credentials.
|
|
60
|
+
# @option options [Numeric, Proc] :backoff By default, failures are retried with exponential back-off, i.e.
|
|
61
|
+
# `lambda { |num_failures| sleep(1.2 ** num_failures) }`. You can pass a number of seconds to sleep
|
|
62
|
+
# between failed attempts, or a Proc that accepts the number of failures.
|
|
60
63
|
# @option options [String] :endpoint ('http://169.254.169.254') The IMDS endpoint. This option has precedence
|
|
61
64
|
# over the `:endpoint_mode`.
|
|
62
65
|
# @option options [String] :endpoint_mode ('IPv4') The endpoint mode for the instance metadata service. This is
|
|
@@ -67,14 +70,11 @@ module Aws
|
|
|
67
70
|
# @option options [Integer] :port (80)
|
|
68
71
|
# @option options [Float] :http_open_timeout (1)
|
|
69
72
|
# @option options [Float] :http_read_timeout (1)
|
|
70
|
-
# @option options [Numeric, Proc] :delay By default, failures are retried with exponential back-off, i.e.
|
|
71
|
-
# `sleep(1.2 ** num_failures)`. You can pass a number of seconds to sleep between failed attempts, or a Proc
|
|
72
|
-
# that accepts the number of failures.
|
|
73
73
|
# @option options [IO] :http_debug_output (nil) HTTP wire traces are sent to this object.
|
|
74
74
|
# You can specify something like `$stdout`.
|
|
75
|
-
# @option options [Integer] :token_ttl Time-to-Live in seconds for EC2 Metadata Token used for fetching
|
|
76
|
-
# Metadata Profile Credentials
|
|
77
|
-
# @option options [
|
|
75
|
+
# @option options [Integer] :token_ttl (21600) Time-to-Live in seconds for EC2 Metadata Token used for fetching
|
|
76
|
+
# Metadata Profile Credentials.
|
|
77
|
+
# @option options [Proc] :before_refresh A Proc called before credentials are refreshed. `:before_refresh`
|
|
78
78
|
# is called with an instance of this object when AWS credentials are required and need to be refreshed.
|
|
79
79
|
def initialize(options = {})
|
|
80
80
|
@backoff = resolve_backoff(options[:backoff])
|
|
@@ -95,7 +95,7 @@ module Aws
|
|
|
95
95
|
super
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
# @return [
|
|
98
|
+
# @return [Boolean]
|
|
99
99
|
attr_reader :disable_imds_v1
|
|
100
100
|
|
|
101
101
|
# @return [Integer]
|
|
@@ -190,7 +190,6 @@ module Aws
|
|
|
190
190
|
name: "x-amz-checksum-#{algorithm.downcase}",
|
|
191
191
|
request_algorithm_header: request_algorithm_header(context)
|
|
192
192
|
}
|
|
193
|
-
|
|
194
193
|
context[:http_checksum][:request_algorithm] = request_algorithm
|
|
195
194
|
calculate_request_checksum(context, request_algorithm)
|
|
196
195
|
end
|
|
@@ -249,6 +248,7 @@ module Aws
|
|
|
249
248
|
return unless context.operation.http_checksum
|
|
250
249
|
|
|
251
250
|
input_member = context.operation.http_checksum['requestAlgorithmMember']
|
|
251
|
+
|
|
252
252
|
context.params[input_member.to_sym] ||= DEFAULT_CHECKSUM if input_member
|
|
253
253
|
end
|
|
254
254
|
|
|
@@ -271,25 +271,39 @@ module Aws
|
|
|
271
271
|
context.operation.http_checksum['responseAlgorithms']
|
|
272
272
|
end
|
|
273
273
|
|
|
274
|
-
def checksum_required?(context)
|
|
275
|
-
(http_checksum = context.operation.http_checksum) &&
|
|
276
|
-
(checksum_required = http_checksum['requestChecksumRequired']) &&
|
|
277
|
-
(checksum_required && context.config.request_checksum_calculation == 'when_required')
|
|
278
|
-
end
|
|
279
|
-
|
|
280
|
-
def checksum_optional?(context)
|
|
281
|
-
context.operation.http_checksum &&
|
|
282
|
-
context.config.request_checksum_calculation != 'when_required'
|
|
283
|
-
end
|
|
284
|
-
|
|
285
274
|
def checksum_provided_as_header?(headers)
|
|
286
275
|
headers.any? { |k, _| k.start_with?('x-amz-checksum-') }
|
|
287
276
|
end
|
|
288
277
|
|
|
278
|
+
# Determines whether a request checksum should be calculated.
|
|
279
|
+
# 1. **No existing checksum in header**: Skips if checksum header already present
|
|
280
|
+
# 2. **Operation support**: Considers model, client configuration and user input.
|
|
289
281
|
def should_calculate_request_checksum?(context)
|
|
290
282
|
!checksum_provided_as_header?(context.http_request.headers) &&
|
|
291
|
-
|
|
292
|
-
|
|
283
|
+
checksum_applicable?(context)
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Checks if checksum calculation should proceed based on operation requirements and client settings.
|
|
287
|
+
# Returns true when any of these conditions are met:
|
|
288
|
+
# 1. http checksum's requestChecksumRequired is true
|
|
289
|
+
# 2. Config for request_checksum_calculation is "when_supported"
|
|
290
|
+
# 3. Config for request_checksum_calculation is "when_required" AND user provided checksum algorithm
|
|
291
|
+
def checksum_applicable?(context)
|
|
292
|
+
http_checksum = context.operation.http_checksum
|
|
293
|
+
return false unless http_checksum
|
|
294
|
+
|
|
295
|
+
return true if http_checksum['requestChecksumRequired']
|
|
296
|
+
|
|
297
|
+
return false unless (algorithm_member = http_checksum['requestAlgorithmMember'])
|
|
298
|
+
|
|
299
|
+
case context.config.request_checksum_calculation
|
|
300
|
+
when 'when_supported'
|
|
301
|
+
true
|
|
302
|
+
when 'when_required'
|
|
303
|
+
!context.params[algorithm_member.to_sym].nil?
|
|
304
|
+
else
|
|
305
|
+
false
|
|
306
|
+
end
|
|
293
307
|
end
|
|
294
308
|
|
|
295
309
|
def choose_request_algorithm!(context)
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Aws
|
|
4
|
-
|
|
5
4
|
# Base class used credential classes that can be refreshed. This
|
|
6
5
|
# provides basic refresh logic in a thread-safe manner. Classes mixing in
|
|
7
|
-
# this module are expected to implement a
|
|
6
|
+
# this module are expected to implement a `#refresh` method that populates
|
|
8
7
|
# the following instance variables:
|
|
9
8
|
#
|
|
10
|
-
# * `@
|
|
11
|
-
# * `@
|
|
12
|
-
# * `@session_token`
|
|
13
|
-
# * `@expiration`
|
|
9
|
+
# * `@credentials` ({Credentials})
|
|
10
|
+
# * `@expiration` (Time)
|
|
14
11
|
#
|
|
15
|
-
# @api private
|
|
16
12
|
module RefreshingCredentials
|
|
17
|
-
|
|
18
13
|
SYNC_EXPIRATION_LENGTH = 300 # 5 minutes
|
|
19
14
|
ASYNC_EXPIRATION_LENGTH = 600 # 10 minutes
|
|
20
15
|
|
|
21
16
|
CLIENT_EXCLUDE_OPTIONS = Set.new([:before_refresh]).freeze
|
|
22
17
|
|
|
18
|
+
# @param [Hash] options
|
|
19
|
+
# @option options [Proc] :before_refresh A Proc called before credentials are refreshed.
|
|
20
|
+
# It accepts `self` as the only argument.
|
|
23
21
|
def initialize(options = {})
|
|
24
22
|
@mutex = Mutex.new
|
|
25
|
-
@before_refresh = options.delete(:before_refresh) if Hash
|
|
23
|
+
@before_refresh = options.delete(:before_refresh) if options.is_a?(Hash)
|
|
26
24
|
|
|
27
25
|
@before_refresh.call(self) if @before_refresh
|
|
28
26
|
refresh
|
|
@@ -59,7 +57,7 @@ module Aws
|
|
|
59
57
|
# Otherwise, if we're approaching expiration, use the existing credentials
|
|
60
58
|
# but attempt a refresh in the background.
|
|
61
59
|
def refresh_if_near_expiration!
|
|
62
|
-
#
|
|
60
|
+
# NOTE: This check is an optimization. Rather than acquire the mutex on every #refresh_if_near_expiration
|
|
63
61
|
# call, we check before doing so, and then we check within the mutex to avoid a race condition.
|
|
64
62
|
# See issue: https://github.com/aws/aws-sdk-ruby/issues/2641 for more info.
|
|
65
63
|
if near_expiration?(sync_expiration_length)
|
|
@@ -91,6 +89,5 @@ module Aws
|
|
|
91
89
|
true
|
|
92
90
|
end
|
|
93
91
|
end
|
|
94
|
-
|
|
95
92
|
end
|
|
96
93
|
end
|
|
@@ -7,7 +7,7 @@ module Aws
|
|
|
7
7
|
# {Aws::SSOTokenProvider} will be used to refresh the token if possible.
|
|
8
8
|
# This class does NOT implement the SSO login token flow - tokens
|
|
9
9
|
# must generated separately by running `aws login` from the
|
|
10
|
-
# AWS CLI with the correct profile. The
|
|
10
|
+
# AWS CLI with the correct profile. The {SSOCredentials} will
|
|
11
11
|
# auto-refresh the AWS credentials from SSO.
|
|
12
12
|
#
|
|
13
13
|
# # You must first run aws sso login --profile your-sso-profile
|
data/lib/aws-sdk-sso/client.rb
CHANGED
|
@@ -13,22 +13,22 @@ module Aws::SSO
|
|
|
13
13
|
# @!attribute region
|
|
14
14
|
# The AWS region used to dispatch the request.
|
|
15
15
|
#
|
|
16
|
-
# @return [
|
|
16
|
+
# @return [string]
|
|
17
17
|
#
|
|
18
18
|
# @!attribute use_dual_stack
|
|
19
19
|
# When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
|
|
20
20
|
#
|
|
21
|
-
# @return [
|
|
21
|
+
# @return [boolean]
|
|
22
22
|
#
|
|
23
23
|
# @!attribute use_fips
|
|
24
24
|
# When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
|
|
25
25
|
#
|
|
26
|
-
# @return [
|
|
26
|
+
# @return [boolean]
|
|
27
27
|
#
|
|
28
28
|
# @!attribute endpoint
|
|
29
29
|
# Override the endpoint used to send this request
|
|
30
30
|
#
|
|
31
|
-
# @return [
|
|
31
|
+
# @return [string]
|
|
32
32
|
#
|
|
33
33
|
EndpointParameters = Struct.new(
|
|
34
34
|
:region,
|
data/lib/aws-sdk-sso.rb
CHANGED
|
@@ -523,10 +523,9 @@ module Aws::SSOOIDC
|
|
|
523
523
|
# [1]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html
|
|
524
524
|
#
|
|
525
525
|
# @option params [Array<String>] :scope
|
|
526
|
-
# The list of scopes for which authorization is requested.
|
|
527
|
-
#
|
|
528
|
-
#
|
|
529
|
-
# that are configured for the client during the call to RegisterClient.
|
|
526
|
+
# The list of scopes for which authorization is requested. This
|
|
527
|
+
# parameter has no effect; the access token will always include all
|
|
528
|
+
# scopes configured during client registration.
|
|
530
529
|
#
|
|
531
530
|
# @option params [String] :redirect_uri
|
|
532
531
|
# Used only when calling this API for the Authorization Code grant type.
|
|
@@ -615,12 +614,26 @@ module Aws::SSOOIDC
|
|
|
615
614
|
req.send_request(options)
|
|
616
615
|
end
|
|
617
616
|
|
|
618
|
-
# Creates and returns access and refresh tokens for
|
|
619
|
-
# applications that are authenticated using IAM
|
|
617
|
+
# Creates and returns access and refresh tokens for authorized client
|
|
618
|
+
# applications that are authenticated using any IAM entity, such as a
|
|
619
|
+
# service role or user. These tokens might contain defined scopes that
|
|
620
|
+
# specify permissions such as `read:profile` or `write:data`. Through
|
|
621
|
+
# downscoping, you can use the scopes parameter to request tokens with
|
|
622
|
+
# reduced permissions compared to the original client application's
|
|
623
|
+
# permissions or, if applicable, the refresh token's scopes. The access
|
|
620
624
|
# token can be used to fetch short-lived credentials for the assigned
|
|
621
625
|
# Amazon Web Services accounts or to access application APIs using
|
|
622
626
|
# `bearer` authentication.
|
|
623
627
|
#
|
|
628
|
+
# <note markdown="1"> This API is used with Signature Version 4. For more information, see
|
|
629
|
+
# [Amazon Web Services Signature Version 4 for API Requests][1].
|
|
630
|
+
#
|
|
631
|
+
# </note>
|
|
632
|
+
#
|
|
633
|
+
#
|
|
634
|
+
#
|
|
635
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html
|
|
636
|
+
#
|
|
624
637
|
# @option params [required, String] :client_id
|
|
625
638
|
# The unique identifier string for the client or application. This value
|
|
626
639
|
# is an application ARN that has OAuth grants configured.
|
|
@@ -1068,7 +1081,7 @@ module Aws::SSOOIDC
|
|
|
1068
1081
|
tracer: tracer
|
|
1069
1082
|
)
|
|
1070
1083
|
context[:gem_name] = 'aws-sdk-core'
|
|
1071
|
-
context[:gem_version] = '3.
|
|
1084
|
+
context[:gem_version] = '3.237.0'
|
|
1072
1085
|
Seahorse::Client::Request.new(handlers, context)
|
|
1073
1086
|
end
|
|
1074
1087
|
|
|
@@ -15,6 +15,7 @@ module Aws::SSOOIDC
|
|
|
15
15
|
include Seahorse::Model
|
|
16
16
|
|
|
17
17
|
AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
|
|
18
|
+
AccessDeniedExceptionReason = Shapes::StringShape.new(name: 'AccessDeniedExceptionReason')
|
|
18
19
|
AccessToken = Shapes::StringShape.new(name: 'AccessToken')
|
|
19
20
|
ArnType = Shapes::StringShape.new(name: 'ArnType')
|
|
20
21
|
Assertion = Shapes::StringShape.new(name: 'Assertion')
|
|
@@ -46,6 +47,7 @@ module Aws::SSOOIDC
|
|
|
46
47
|
InvalidGrantException = Shapes::StructureShape.new(name: 'InvalidGrantException')
|
|
47
48
|
InvalidRedirectUriException = Shapes::StructureShape.new(name: 'InvalidRedirectUriException')
|
|
48
49
|
InvalidRequestException = Shapes::StructureShape.new(name: 'InvalidRequestException')
|
|
50
|
+
InvalidRequestExceptionReason = Shapes::StringShape.new(name: 'InvalidRequestExceptionReason')
|
|
49
51
|
InvalidRequestRegionException = Shapes::StructureShape.new(name: 'InvalidRequestRegionException')
|
|
50
52
|
InvalidScopeException = Shapes::StructureShape.new(name: 'InvalidScopeException')
|
|
51
53
|
Location = Shapes::StringShape.new(name: 'Location')
|
|
@@ -69,6 +71,7 @@ module Aws::SSOOIDC
|
|
|
69
71
|
UserCode = Shapes::StringShape.new(name: 'UserCode')
|
|
70
72
|
|
|
71
73
|
AccessDeniedException.add_member(:error, Shapes::ShapeRef.new(shape: Error, location_name: "error"))
|
|
74
|
+
AccessDeniedException.add_member(:reason, Shapes::ShapeRef.new(shape: AccessDeniedExceptionReason, location_name: "reason"))
|
|
72
75
|
AccessDeniedException.add_member(:error_description, Shapes::ShapeRef.new(shape: ErrorDescription, location_name: "error_description"))
|
|
73
76
|
AccessDeniedException.struct_class = Types::AccessDeniedException
|
|
74
77
|
|
|
@@ -147,6 +150,7 @@ module Aws::SSOOIDC
|
|
|
147
150
|
InvalidRedirectUriException.struct_class = Types::InvalidRedirectUriException
|
|
148
151
|
|
|
149
152
|
InvalidRequestException.add_member(:error, Shapes::ShapeRef.new(shape: Error, location_name: "error"))
|
|
153
|
+
InvalidRequestException.add_member(:reason, Shapes::ShapeRef.new(shape: InvalidRequestExceptionReason, location_name: "reason"))
|
|
150
154
|
InvalidRequestException.add_member(:error_description, Shapes::ShapeRef.new(shape: ErrorDescription, location_name: "error_description"))
|
|
151
155
|
InvalidRequestException.struct_class = Types::InvalidRequestException
|
|
152
156
|
|
|
@@ -282,6 +286,7 @@ module Aws::SSOOIDC
|
|
|
282
286
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
|
283
287
|
o.errors << Shapes::ShapeRef.new(shape: InvalidRedirectUriException)
|
|
284
288
|
o.errors << Shapes::ShapeRef.new(shape: UnsupportedGrantTypeException)
|
|
289
|
+
o.errors << Shapes::ShapeRef.new(shape: SlowDownException)
|
|
285
290
|
end)
|
|
286
291
|
|
|
287
292
|
api.add_operation(:start_device_authorization, Seahorse::Model::Operation.new.tap do |o|
|
|
@@ -13,22 +13,22 @@ module Aws::SSOOIDC
|
|
|
13
13
|
# @!attribute region
|
|
14
14
|
# The AWS region used to dispatch the request.
|
|
15
15
|
#
|
|
16
|
-
# @return [
|
|
16
|
+
# @return [string]
|
|
17
17
|
#
|
|
18
18
|
# @!attribute use_dual_stack
|
|
19
19
|
# When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
|
|
20
20
|
#
|
|
21
|
-
# @return [
|
|
21
|
+
# @return [boolean]
|
|
22
22
|
#
|
|
23
23
|
# @!attribute use_fips
|
|
24
24
|
# When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
|
|
25
25
|
#
|
|
26
|
-
# @return [
|
|
26
|
+
# @return [boolean]
|
|
27
27
|
#
|
|
28
28
|
# @!attribute endpoint
|
|
29
29
|
# Override the endpoint used to send this request
|
|
30
30
|
#
|
|
31
|
-
# @return [
|
|
31
|
+
# @return [string]
|
|
32
32
|
#
|
|
33
33
|
EndpointParameters = Struct.new(
|
|
34
34
|
:region,
|
|
@@ -62,6 +62,11 @@ module Aws::SSOOIDC
|
|
|
62
62
|
@data[:error]
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
+
# @return [String]
|
|
66
|
+
def reason
|
|
67
|
+
@data[:reason]
|
|
68
|
+
end
|
|
69
|
+
|
|
65
70
|
# @return [String]
|
|
66
71
|
def error_description
|
|
67
72
|
@data[:error_description]
|
|
@@ -222,6 +227,11 @@ module Aws::SSOOIDC
|
|
|
222
227
|
@data[:error]
|
|
223
228
|
end
|
|
224
229
|
|
|
230
|
+
# @return [String]
|
|
231
|
+
def reason
|
|
232
|
+
@data[:reason]
|
|
233
|
+
end
|
|
234
|
+
|
|
225
235
|
# @return [String]
|
|
226
236
|
def error_description
|
|
227
237
|
@data[:error_description]
|
|
@@ -17,6 +17,10 @@ module Aws::SSOOIDC
|
|
|
17
17
|
# `access_denied`.
|
|
18
18
|
# @return [String]
|
|
19
19
|
#
|
|
20
|
+
# @!attribute [rw] reason
|
|
21
|
+
# A string that uniquely identifies a reason for the error.
|
|
22
|
+
# @return [String]
|
|
23
|
+
#
|
|
20
24
|
# @!attribute [rw] error_description
|
|
21
25
|
# Human-readable text providing additional information, used to assist
|
|
22
26
|
# the client developer in understanding the error that occurred.
|
|
@@ -26,6 +30,7 @@ module Aws::SSOOIDC
|
|
|
26
30
|
#
|
|
27
31
|
class AccessDeniedException < Struct.new(
|
|
28
32
|
:error,
|
|
33
|
+
:reason,
|
|
29
34
|
:error_description)
|
|
30
35
|
SENSITIVE = []
|
|
31
36
|
include Aws::Structure
|
|
@@ -54,14 +59,20 @@ module Aws::SSOOIDC
|
|
|
54
59
|
end
|
|
55
60
|
|
|
56
61
|
# This structure contains Amazon Web Services-specific parameter
|
|
57
|
-
# extensions
|
|
58
|
-
#
|
|
62
|
+
# extensions and the [identity context][1].
|
|
63
|
+
#
|
|
64
|
+
#
|
|
65
|
+
#
|
|
66
|
+
# [1]: https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overview.html
|
|
59
67
|
#
|
|
60
68
|
# @!attribute [rw] identity_context
|
|
61
|
-
#
|
|
62
|
-
#
|
|
63
|
-
#
|
|
64
|
-
#
|
|
69
|
+
# The trusted context assertion is signed and encrypted by STS. It
|
|
70
|
+
# provides access to `sts:identity_context` claim in the `idToken`
|
|
71
|
+
# without JWT parsing
|
|
72
|
+
#
|
|
73
|
+
# Identity context comprises information that Amazon Web Services
|
|
74
|
+
# services use to make authorization decisions when they receive
|
|
75
|
+
# requests.
|
|
65
76
|
# @return [String]
|
|
66
77
|
#
|
|
67
78
|
# @see http://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/AwsAdditionalDetails AWS API Documentation
|
|
@@ -122,11 +133,9 @@ module Aws::SSOOIDC
|
|
|
122
133
|
# @return [String]
|
|
123
134
|
#
|
|
124
135
|
# @!attribute [rw] scope
|
|
125
|
-
# The list of scopes for which authorization is requested.
|
|
126
|
-
#
|
|
127
|
-
#
|
|
128
|
-
# scopes that are configured for the client during the call to
|
|
129
|
-
# RegisterClient.
|
|
136
|
+
# The list of scopes for which authorization is requested. This
|
|
137
|
+
# parameter has no effect; the access token will always include all
|
|
138
|
+
# scopes configured during client registration.
|
|
130
139
|
# @return [Array<String>]
|
|
131
140
|
#
|
|
132
141
|
# @!attribute [rw] redirect_uri
|
|
@@ -376,10 +385,8 @@ module Aws::SSOOIDC
|
|
|
376
385
|
# @return [Array<String>]
|
|
377
386
|
#
|
|
378
387
|
# @!attribute [rw] aws_additional_details
|
|
379
|
-
# A structure containing information from
|
|
380
|
-
#
|
|
381
|
-
# `idToken`. This provides direct access to identity information
|
|
382
|
-
# without requiring JWT parsing.
|
|
388
|
+
# A structure containing information from IAM Identity Center managed
|
|
389
|
+
# user and group information.
|
|
383
390
|
# @return [Types::AwsAdditionalDetails]
|
|
384
391
|
#
|
|
385
392
|
# @see http://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/CreateTokenWithIAMResponse AWS API Documentation
|
|
@@ -538,6 +545,10 @@ module Aws::SSOOIDC
|
|
|
538
545
|
# `invalid_request`.
|
|
539
546
|
# @return [String]
|
|
540
547
|
#
|
|
548
|
+
# @!attribute [rw] reason
|
|
549
|
+
# A string that uniquely identifies a reason for the error.
|
|
550
|
+
# @return [String]
|
|
551
|
+
#
|
|
541
552
|
# @!attribute [rw] error_description
|
|
542
553
|
# Human-readable text providing additional information, used to assist
|
|
543
554
|
# the client developer in understanding the error that occurred.
|
|
@@ -547,6 +558,7 @@ module Aws::SSOOIDC
|
|
|
547
558
|
#
|
|
548
559
|
class InvalidRequestException < Struct.new(
|
|
549
560
|
:error,
|
|
561
|
+
:reason,
|
|
550
562
|
:error_description)
|
|
551
563
|
SENSITIVE = []
|
|
552
564
|
include Aws::Structure
|
data/lib/aws-sdk-ssooidc.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
|
@@ -619,7 +619,7 @@ module Aws::STS
|
|
|
619
619
|
# The regex used to validate this parameter is a string of characters
|
|
620
620
|
# consisting of upper- and lower-case alphanumeric characters with no
|
|
621
621
|
# spaces. You can also include underscores or any of the following
|
|
622
|
-
# characters:
|
|
622
|
+
# characters: +=,.@-
|
|
623
623
|
#
|
|
624
624
|
#
|
|
625
625
|
#
|
|
@@ -813,7 +813,7 @@ module Aws::STS
|
|
|
813
813
|
# The regex used to validate this parameter is a string of characters
|
|
814
814
|
# consisting of upper- and lower-case alphanumeric characters with no
|
|
815
815
|
# spaces. You can also include underscores or any of the following
|
|
816
|
-
# characters:
|
|
816
|
+
# characters: +=,.@:\\/-
|
|
817
817
|
#
|
|
818
818
|
#
|
|
819
819
|
#
|
|
@@ -831,7 +831,7 @@ module Aws::STS
|
|
|
831
831
|
# The regex used to validate this parameter is a string of characters
|
|
832
832
|
# consisting of upper- and lower-case alphanumeric characters with no
|
|
833
833
|
# spaces. You can also include underscores or any of the following
|
|
834
|
-
# characters:
|
|
834
|
+
# characters: +=/:,.@-
|
|
835
835
|
#
|
|
836
836
|
# @option params [String] :token_code
|
|
837
837
|
# The value provided by the MFA device, if the trust policy of the role
|
|
@@ -892,7 +892,7 @@ module Aws::STS
|
|
|
892
892
|
#
|
|
893
893
|
# resp = client.assume_role({
|
|
894
894
|
# external_id: "123ABC",
|
|
895
|
-
# policy: "
|
|
895
|
+
# policy: "escaped-JSON-IAM-POLICY",
|
|
896
896
|
# role_arn: "arn:aws:iam::123456789012:role/demo",
|
|
897
897
|
# role_session_name: "testAssumeRoleSession",
|
|
898
898
|
# tags: [
|
|
@@ -996,6 +996,11 @@ module Aws::STS
|
|
|
996
996
|
# Applications can use these temporary security credentials to sign
|
|
997
997
|
# calls to Amazon Web Services services.
|
|
998
998
|
#
|
|
999
|
+
# <note markdown="1"> AssumeRoleWithSAML will not work on IAM Identity Center managed roles.
|
|
1000
|
+
# These roles' names start with `AWSReservedSSO_`.
|
|
1001
|
+
#
|
|
1002
|
+
# </note>
|
|
1003
|
+
#
|
|
999
1004
|
# **Session Duration**
|
|
1000
1005
|
#
|
|
1001
1006
|
# By default, the temporary security credentials created by
|
|
@@ -1414,7 +1419,8 @@ module Aws::STS
|
|
|
1414
1419
|
# (Optional) You can configure your IdP to pass attributes into your web
|
|
1415
1420
|
# identity token as session tags. Each session tag consists of a key
|
|
1416
1421
|
# name and an associated value. For more information about session tags,
|
|
1417
|
-
# see [Passing
|
|
1422
|
+
# see [Passing session tags using AssumeRoleWithWebIdentity][9] in the
|
|
1423
|
+
# *IAM User Guide*.
|
|
1418
1424
|
#
|
|
1419
1425
|
# You can pass up to 50 session tags. The plaintext session tag keys
|
|
1420
1426
|
# can’t exceed 128 characters and the values can’t exceed 256
|
|
@@ -1482,7 +1488,7 @@ module Aws::STS
|
|
|
1482
1488
|
# [6]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration
|
|
1483
1489
|
# [7]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
|
|
1484
1490
|
# [8]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
|
1485
|
-
# [9]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
|
1491
|
+
# [9]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_adding-assume-role-idp
|
|
1486
1492
|
# [10]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
|
1487
1493
|
# [11]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
|
1488
1494
|
# [12]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
|
@@ -1673,7 +1679,7 @@ module Aws::STS
|
|
|
1673
1679
|
#
|
|
1674
1680
|
# resp = client.assume_role_with_web_identity({
|
|
1675
1681
|
# duration_seconds: 3600,
|
|
1676
|
-
# policy: "
|
|
1682
|
+
# policy: "escaped-JSON-IAM-POLICY",
|
|
1677
1683
|
# provider_id: "www.amazon.com",
|
|
1678
1684
|
# role_arn: "arn:aws:iam::123456789012:role/FederatedWebIdentityRole",
|
|
1679
1685
|
# role_session_name: "app1",
|
|
@@ -1738,7 +1744,10 @@ module Aws::STS
|
|
|
1738
1744
|
end
|
|
1739
1745
|
|
|
1740
1746
|
# Returns a set of short term credentials you can use to perform
|
|
1741
|
-
# privileged tasks on a member account in your organization.
|
|
1747
|
+
# privileged tasks on a member account in your organization. You must
|
|
1748
|
+
# use credentials from an Organizations management account or a
|
|
1749
|
+
# delegated administrator account for IAM to call `AssumeRoot`. You
|
|
1750
|
+
# cannot use root user credentials to make this call.
|
|
1742
1751
|
#
|
|
1743
1752
|
# Before you can launch a privileged session, you must have centralized
|
|
1744
1753
|
# root access in your organization. For steps to enable this feature,
|
|
@@ -1755,19 +1764,29 @@ module Aws::STS
|
|
|
1755
1764
|
# were performed in a session. For more information, see [Track
|
|
1756
1765
|
# privileged tasks in CloudTrail][3] in the *IAM User Guide*.
|
|
1757
1766
|
#
|
|
1767
|
+
# When granting access to privileged tasks you should only grant the
|
|
1768
|
+
# necessary permissions required to perform that task. For more
|
|
1769
|
+
# information, see [Security best practices in IAM][4]. In addition, you
|
|
1770
|
+
# can use [service control policies][5] (SCPs) to manage and limit
|
|
1771
|
+
# permissions in your organization. See [General examples][6] in the
|
|
1772
|
+
# *Organizations User Guide* for more information on SCPs.
|
|
1773
|
+
#
|
|
1758
1774
|
#
|
|
1759
1775
|
#
|
|
1760
1776
|
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-enable-root-access.html
|
|
1761
1777
|
# [2]: https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html#sts-endpoints
|
|
1762
1778
|
# [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-track-privileged-tasks.html
|
|
1779
|
+
# [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
|
|
1780
|
+
# [5]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html
|
|
1781
|
+
# [6]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples_general.html
|
|
1763
1782
|
#
|
|
1764
1783
|
# @option params [required, String] :target_principal
|
|
1765
1784
|
# The member account principal ARN or account ID.
|
|
1766
1785
|
#
|
|
1767
1786
|
# @option params [required, Types::PolicyDescriptorType] :task_policy_arn
|
|
1768
1787
|
# The identity based policy that scopes the session to the privileged
|
|
1769
|
-
# tasks that can be performed. You
|
|
1770
|
-
# Services managed policies to scope root session actions
|
|
1788
|
+
# tasks that can be performed. You must use one of following Amazon Web
|
|
1789
|
+
# Services managed policies to scope root session actions:
|
|
1771
1790
|
#
|
|
1772
1791
|
# * [IAMAuditRootUserCredentials][1]
|
|
1773
1792
|
#
|
|
@@ -2078,6 +2097,40 @@ module Aws::STS
|
|
|
2078
2097
|
req.send_request(options)
|
|
2079
2098
|
end
|
|
2080
2099
|
|
|
2100
|
+
# This API is currently unavailable for general use.
|
|
2101
|
+
#
|
|
2102
|
+
# @option params [required, String] :trade_in_token
|
|
2103
|
+
#
|
|
2104
|
+
# @return [Types::GetDelegatedAccessTokenResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
2105
|
+
#
|
|
2106
|
+
# * {Types::GetDelegatedAccessTokenResponse#credentials #credentials} => Types::Credentials
|
|
2107
|
+
# * {Types::GetDelegatedAccessTokenResponse#packed_policy_size #packed_policy_size} => Integer
|
|
2108
|
+
# * {Types::GetDelegatedAccessTokenResponse#assumed_principal #assumed_principal} => String
|
|
2109
|
+
#
|
|
2110
|
+
# @example Request syntax with placeholder values
|
|
2111
|
+
#
|
|
2112
|
+
# resp = client.get_delegated_access_token({
|
|
2113
|
+
# trade_in_token: "tradeInTokenType", # required
|
|
2114
|
+
# })
|
|
2115
|
+
#
|
|
2116
|
+
# @example Response structure
|
|
2117
|
+
#
|
|
2118
|
+
# resp.credentials.access_key_id #=> String
|
|
2119
|
+
# resp.credentials.secret_access_key #=> String
|
|
2120
|
+
# resp.credentials.session_token #=> String
|
|
2121
|
+
# resp.credentials.expiration #=> Time
|
|
2122
|
+
# resp.packed_policy_size #=> Integer
|
|
2123
|
+
# resp.assumed_principal #=> String
|
|
2124
|
+
#
|
|
2125
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetDelegatedAccessToken AWS API Documentation
|
|
2126
|
+
#
|
|
2127
|
+
# @overload get_delegated_access_token(params = {})
|
|
2128
|
+
# @param [Hash] params ({})
|
|
2129
|
+
def get_delegated_access_token(params = {}, options = {})
|
|
2130
|
+
req = build_request(:get_delegated_access_token, params)
|
|
2131
|
+
req.send_request(options)
|
|
2132
|
+
end
|
|
2133
|
+
|
|
2081
2134
|
# Returns a set of temporary security credentials (consisting of an
|
|
2082
2135
|
# access key ID, a secret access key, and a security token) for a user.
|
|
2083
2136
|
# A typical use is in a proxy application that gets temporary security
|
|
@@ -2360,7 +2413,7 @@ module Aws::STS
|
|
|
2360
2413
|
# resp = client.get_federation_token({
|
|
2361
2414
|
# duration_seconds: 3600,
|
|
2362
2415
|
# name: "testFedUserSession",
|
|
2363
|
-
# policy: "
|
|
2416
|
+
# policy: "escaped-JSON-IAM-POLICY",
|
|
2364
2417
|
# tags: [
|
|
2365
2418
|
# {
|
|
2366
2419
|
# key: "Project",
|
|
@@ -2601,7 +2654,7 @@ module Aws::STS
|
|
|
2601
2654
|
tracer: tracer
|
|
2602
2655
|
)
|
|
2603
2656
|
context[:gem_name] = 'aws-sdk-core'
|
|
2604
|
-
context[:gem_version] = '3.
|
|
2657
|
+
context[:gem_version] = '3.237.0'
|
|
2605
2658
|
Seahorse::Client::Request.new(handlers, context)
|
|
2606
2659
|
end
|
|
2607
2660
|
|
|
@@ -28,11 +28,14 @@ module Aws::STS
|
|
|
28
28
|
DecodeAuthorizationMessageRequest = Shapes::StructureShape.new(name: 'DecodeAuthorizationMessageRequest')
|
|
29
29
|
DecodeAuthorizationMessageResponse = Shapes::StructureShape.new(name: 'DecodeAuthorizationMessageResponse')
|
|
30
30
|
ExpiredTokenException = Shapes::StructureShape.new(name: 'ExpiredTokenException', error: {"code" => "ExpiredTokenException", "httpStatusCode" => 400, "senderFault" => true})
|
|
31
|
+
ExpiredTradeInTokenException = Shapes::StructureShape.new(name: 'ExpiredTradeInTokenException', error: {"code" => "ExpiredTradeInTokenException", "httpStatusCode" => 400, "senderFault" => true})
|
|
31
32
|
FederatedUser = Shapes::StructureShape.new(name: 'FederatedUser')
|
|
32
33
|
GetAccessKeyInfoRequest = Shapes::StructureShape.new(name: 'GetAccessKeyInfoRequest')
|
|
33
34
|
GetAccessKeyInfoResponse = Shapes::StructureShape.new(name: 'GetAccessKeyInfoResponse')
|
|
34
35
|
GetCallerIdentityRequest = Shapes::StructureShape.new(name: 'GetCallerIdentityRequest')
|
|
35
36
|
GetCallerIdentityResponse = Shapes::StructureShape.new(name: 'GetCallerIdentityResponse')
|
|
37
|
+
GetDelegatedAccessTokenRequest = Shapes::StructureShape.new(name: 'GetDelegatedAccessTokenRequest')
|
|
38
|
+
GetDelegatedAccessTokenResponse = Shapes::StructureShape.new(name: 'GetDelegatedAccessTokenResponse')
|
|
36
39
|
GetFederationTokenRequest = Shapes::StructureShape.new(name: 'GetFederationTokenRequest')
|
|
37
40
|
GetFederationTokenResponse = Shapes::StructureShape.new(name: 'GetFederationTokenResponse')
|
|
38
41
|
GetSessionTokenRequest = Shapes::StructureShape.new(name: 'GetSessionTokenRequest')
|
|
@@ -67,6 +70,7 @@ module Aws::STS
|
|
|
67
70
|
durationSecondsType = Shapes::IntegerShape.new(name: 'durationSecondsType')
|
|
68
71
|
encodedMessageType = Shapes::StringShape.new(name: 'encodedMessageType')
|
|
69
72
|
expiredIdentityTokenMessage = Shapes::StringShape.new(name: 'expiredIdentityTokenMessage')
|
|
73
|
+
expiredTradeInTokenExceptionMessage = Shapes::StringShape.new(name: 'expiredTradeInTokenExceptionMessage')
|
|
70
74
|
externalIdType = Shapes::StringShape.new(name: 'externalIdType')
|
|
71
75
|
federatedIdType = Shapes::StringShape.new(name: 'federatedIdType')
|
|
72
76
|
idpCommunicationErrorMessage = Shapes::StringShape.new(name: 'idpCommunicationErrorMessage')
|
|
@@ -89,6 +93,7 @@ module Aws::STS
|
|
|
89
93
|
tagValueType = Shapes::StringShape.new(name: 'tagValueType')
|
|
90
94
|
tokenCodeType = Shapes::StringShape.new(name: 'tokenCodeType')
|
|
91
95
|
tokenType = Shapes::StringShape.new(name: 'tokenType')
|
|
96
|
+
tradeInTokenType = Shapes::StringShape.new(name: 'tradeInTokenType')
|
|
92
97
|
unrestrictedSessionPolicyDocumentType = Shapes::StringShape.new(name: 'unrestrictedSessionPolicyDocumentType')
|
|
93
98
|
urlType = Shapes::StringShape.new(name: 'urlType')
|
|
94
99
|
userIdType = Shapes::StringShape.new(name: 'userIdType')
|
|
@@ -180,6 +185,9 @@ module Aws::STS
|
|
|
180
185
|
ExpiredTokenException.add_member(:message, Shapes::ShapeRef.new(shape: expiredIdentityTokenMessage, location_name: "message"))
|
|
181
186
|
ExpiredTokenException.struct_class = Types::ExpiredTokenException
|
|
182
187
|
|
|
188
|
+
ExpiredTradeInTokenException.add_member(:message, Shapes::ShapeRef.new(shape: expiredTradeInTokenExceptionMessage, location_name: "message"))
|
|
189
|
+
ExpiredTradeInTokenException.struct_class = Types::ExpiredTradeInTokenException
|
|
190
|
+
|
|
183
191
|
FederatedUser.add_member(:federated_user_id, Shapes::ShapeRef.new(shape: federatedIdType, required: true, location_name: "FederatedUserId"))
|
|
184
192
|
FederatedUser.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, required: true, location_name: "Arn"))
|
|
185
193
|
FederatedUser.struct_class = Types::FederatedUser
|
|
@@ -197,6 +205,14 @@ module Aws::STS
|
|
|
197
205
|
GetCallerIdentityResponse.add_member(:arn, Shapes::ShapeRef.new(shape: arnType, location_name: "Arn"))
|
|
198
206
|
GetCallerIdentityResponse.struct_class = Types::GetCallerIdentityResponse
|
|
199
207
|
|
|
208
|
+
GetDelegatedAccessTokenRequest.add_member(:trade_in_token, Shapes::ShapeRef.new(shape: tradeInTokenType, required: true, location_name: "TradeInToken"))
|
|
209
|
+
GetDelegatedAccessTokenRequest.struct_class = Types::GetDelegatedAccessTokenRequest
|
|
210
|
+
|
|
211
|
+
GetDelegatedAccessTokenResponse.add_member(:credentials, Shapes::ShapeRef.new(shape: Credentials, location_name: "Credentials"))
|
|
212
|
+
GetDelegatedAccessTokenResponse.add_member(:packed_policy_size, Shapes::ShapeRef.new(shape: nonNegativeIntegerType, location_name: "PackedPolicySize"))
|
|
213
|
+
GetDelegatedAccessTokenResponse.add_member(:assumed_principal, Shapes::ShapeRef.new(shape: arnType, location_name: "AssumedPrincipal"))
|
|
214
|
+
GetDelegatedAccessTokenResponse.struct_class = Types::GetDelegatedAccessTokenResponse
|
|
215
|
+
|
|
200
216
|
GetFederationTokenRequest.add_member(:name, Shapes::ShapeRef.new(shape: userNameType, required: true, location_name: "Name"))
|
|
201
217
|
GetFederationTokenRequest.add_member(:policy, Shapes::ShapeRef.new(shape: sessionPolicyDocumentType, location_name: "Policy"))
|
|
202
218
|
GetFederationTokenRequest.add_member(:policy_arns, Shapes::ShapeRef.new(shape: policyDescriptorListType, location_name: "PolicyArns"))
|
|
@@ -358,6 +374,16 @@ module Aws::STS
|
|
|
358
374
|
o.output = Shapes::ShapeRef.new(shape: GetCallerIdentityResponse)
|
|
359
375
|
end)
|
|
360
376
|
|
|
377
|
+
api.add_operation(:get_delegated_access_token, Seahorse::Model::Operation.new.tap do |o|
|
|
378
|
+
o.name = "GetDelegatedAccessToken"
|
|
379
|
+
o.http_method = "POST"
|
|
380
|
+
o.http_request_uri = "/"
|
|
381
|
+
o.input = Shapes::ShapeRef.new(shape: GetDelegatedAccessTokenRequest)
|
|
382
|
+
o.output = Shapes::ShapeRef.new(shape: GetDelegatedAccessTokenResponse)
|
|
383
|
+
o.errors << Shapes::ShapeRef.new(shape: ExpiredTradeInTokenException)
|
|
384
|
+
o.errors << Shapes::ShapeRef.new(shape: RegionDisabledException)
|
|
385
|
+
end)
|
|
386
|
+
|
|
361
387
|
api.add_operation(:get_federation_token, Seahorse::Model::Operation.new.tap do |o|
|
|
362
388
|
o.name = "GetFederationToken"
|
|
363
389
|
o.http_method = "POST"
|
|
@@ -13,27 +13,27 @@ module Aws::STS
|
|
|
13
13
|
# @!attribute region
|
|
14
14
|
# The AWS region used to dispatch the request.
|
|
15
15
|
#
|
|
16
|
-
# @return [
|
|
16
|
+
# @return [string]
|
|
17
17
|
#
|
|
18
18
|
# @!attribute use_dual_stack
|
|
19
19
|
# When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
|
|
20
20
|
#
|
|
21
|
-
# @return [
|
|
21
|
+
# @return [boolean]
|
|
22
22
|
#
|
|
23
23
|
# @!attribute use_fips
|
|
24
24
|
# When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
|
|
25
25
|
#
|
|
26
|
-
# @return [
|
|
26
|
+
# @return [boolean]
|
|
27
27
|
#
|
|
28
28
|
# @!attribute endpoint
|
|
29
29
|
# Override the endpoint used to send this request
|
|
30
30
|
#
|
|
31
|
-
# @return [
|
|
31
|
+
# @return [string]
|
|
32
32
|
#
|
|
33
33
|
# @!attribute use_global_endpoint
|
|
34
34
|
# Whether the global endpoint should be used, rather then the regional endpoint for us-east-1.
|
|
35
35
|
#
|
|
36
|
-
# @return [
|
|
36
|
+
# @return [boolean]
|
|
37
37
|
#
|
|
38
38
|
EndpointParameters = Struct.new(
|
|
39
39
|
:region,
|
data/lib/aws-sdk-sts/errors.rb
CHANGED
|
@@ -28,6 +28,7 @@ module Aws::STS
|
|
|
28
28
|
#
|
|
29
29
|
# ## Error Classes
|
|
30
30
|
# * {ExpiredTokenException}
|
|
31
|
+
# * {ExpiredTradeInTokenException}
|
|
31
32
|
# * {IDPCommunicationErrorException}
|
|
32
33
|
# * This error class is not used. `IDPCommunicationError` is used during parsing instead.
|
|
33
34
|
# * {IDPRejectedClaimException}
|
|
@@ -62,6 +63,21 @@ module Aws::STS
|
|
|
62
63
|
end
|
|
63
64
|
end
|
|
64
65
|
|
|
66
|
+
class ExpiredTradeInTokenException < ServiceError
|
|
67
|
+
|
|
68
|
+
# @param [Seahorse::Client::RequestContext] context
|
|
69
|
+
# @param [String] message
|
|
70
|
+
# @param [Aws::STS::Types::ExpiredTradeInTokenException] data
|
|
71
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
|
72
|
+
super(context, message, data)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# @return [String]
|
|
76
|
+
def message
|
|
77
|
+
@message || @data[:message]
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
65
81
|
# @deprecated This error class is not used during parsing.
|
|
66
82
|
# Please use `IDPCommunicationError` instead.
|
|
67
83
|
class IDPCommunicationErrorException < ServiceError
|
data/lib/aws-sdk-sts/types.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Aws::STS
|
|
|
35
35
|
# The regex used to validate this parameter is a string of characters
|
|
36
36
|
# consisting of upper- and lower-case alphanumeric characters with no
|
|
37
37
|
# spaces. You can also include underscores or any of the following
|
|
38
|
-
# characters:
|
|
38
|
+
# characters: +=,.@-
|
|
39
39
|
#
|
|
40
40
|
#
|
|
41
41
|
#
|
|
@@ -240,7 +240,7 @@ module Aws::STS
|
|
|
240
240
|
# The regex used to validate this parameter is a string of characters
|
|
241
241
|
# consisting of upper- and lower-case alphanumeric characters with no
|
|
242
242
|
# spaces. You can also include underscores or any of the following
|
|
243
|
-
# characters:
|
|
243
|
+
# characters: +=,.@:\\/-
|
|
244
244
|
#
|
|
245
245
|
#
|
|
246
246
|
#
|
|
@@ -259,7 +259,7 @@ module Aws::STS
|
|
|
259
259
|
# The regex used to validate this parameter is a string of characters
|
|
260
260
|
# consisting of upper- and lower-case alphanumeric characters with no
|
|
261
261
|
# spaces. You can also include underscores or any of the following
|
|
262
|
-
# characters:
|
|
262
|
+
# characters: +=/:,.@-
|
|
263
263
|
# @return [String]
|
|
264
264
|
#
|
|
265
265
|
# @!attribute [rw] token_code
|
|
@@ -961,8 +961,8 @@ module Aws::STS
|
|
|
961
961
|
#
|
|
962
962
|
# @!attribute [rw] task_policy_arn
|
|
963
963
|
# The identity based policy that scopes the session to the privileged
|
|
964
|
-
# tasks that can be performed. You
|
|
965
|
-
# Services managed policies to scope root session actions
|
|
964
|
+
# tasks that can be performed. You must use one of following Amazon
|
|
965
|
+
# Web Services managed policies to scope root session actions:
|
|
966
966
|
#
|
|
967
967
|
# * [IAMAuditRootUserCredentials][1]
|
|
968
968
|
#
|
|
@@ -1144,6 +1144,17 @@ module Aws::STS
|
|
|
1144
1144
|
include Aws::Structure
|
|
1145
1145
|
end
|
|
1146
1146
|
|
|
1147
|
+
# @!attribute [rw] message
|
|
1148
|
+
# @return [String]
|
|
1149
|
+
#
|
|
1150
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/ExpiredTradeInTokenException AWS API Documentation
|
|
1151
|
+
#
|
|
1152
|
+
class ExpiredTradeInTokenException < Struct.new(
|
|
1153
|
+
:message)
|
|
1154
|
+
SENSITIVE = []
|
|
1155
|
+
include Aws::Structure
|
|
1156
|
+
end
|
|
1157
|
+
|
|
1147
1158
|
# Identifiers for the federated user that is associated with the
|
|
1148
1159
|
# credentials.
|
|
1149
1160
|
#
|
|
@@ -1239,6 +1250,37 @@ module Aws::STS
|
|
|
1239
1250
|
include Aws::Structure
|
|
1240
1251
|
end
|
|
1241
1252
|
|
|
1253
|
+
# @!attribute [rw] trade_in_token
|
|
1254
|
+
# @return [String]
|
|
1255
|
+
#
|
|
1256
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetDelegatedAccessTokenRequest AWS API Documentation
|
|
1257
|
+
#
|
|
1258
|
+
class GetDelegatedAccessTokenRequest < Struct.new(
|
|
1259
|
+
:trade_in_token)
|
|
1260
|
+
SENSITIVE = [:trade_in_token]
|
|
1261
|
+
include Aws::Structure
|
|
1262
|
+
end
|
|
1263
|
+
|
|
1264
|
+
# @!attribute [rw] credentials
|
|
1265
|
+
# Amazon Web Services credentials for API authentication.
|
|
1266
|
+
# @return [Types::Credentials]
|
|
1267
|
+
#
|
|
1268
|
+
# @!attribute [rw] packed_policy_size
|
|
1269
|
+
# @return [Integer]
|
|
1270
|
+
#
|
|
1271
|
+
# @!attribute [rw] assumed_principal
|
|
1272
|
+
# @return [String]
|
|
1273
|
+
#
|
|
1274
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetDelegatedAccessTokenResponse AWS API Documentation
|
|
1275
|
+
#
|
|
1276
|
+
class GetDelegatedAccessTokenResponse < Struct.new(
|
|
1277
|
+
:credentials,
|
|
1278
|
+
:packed_policy_size,
|
|
1279
|
+
:assumed_principal)
|
|
1280
|
+
SENSITIVE = []
|
|
1281
|
+
include Aws::Structure
|
|
1282
|
+
end
|
|
1283
|
+
|
|
1242
1284
|
# @!attribute [rw] name
|
|
1243
1285
|
# The name of the federated user. The name is used as an identifier
|
|
1244
1286
|
# for the temporary security credentials (such as `Bob`). For example,
|
|
@@ -1686,7 +1728,7 @@ module Aws::STS
|
|
|
1686
1728
|
#
|
|
1687
1729
|
#
|
|
1688
1730
|
#
|
|
1689
|
-
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html
|
|
1731
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate
|
|
1690
1732
|
#
|
|
1691
1733
|
# @!attribute [rw] message
|
|
1692
1734
|
# @return [String]
|
data/lib/aws-sdk-sts.rb
CHANGED