aws-sdk-core 3.263.0 → 3.264.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 +7 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/login_credentials.rb +21 -6
- data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +8 -9
- data/lib/aws-sdk-core/plugins/retry_errors.rb +14 -0
- data/lib/aws-sdk-signin/client.rb +1 -1
- data/lib/aws-sdk-signin.rb +1 -1
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +1 -1
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- 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: 0c0e562777b1e5fdc50edc2441fb40908175d08e94fdc0f74bf2d615a1b3586d
|
|
4
|
+
data.tar.gz: 42ae671ab8a8384b8a254258a9706297f29035cb97d039f6e69d37ca2a078a99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a0c773c066180a85a9e1a4d1a05cfe0ef5f7d04244719e3e1daa7887ac36177c30bf00bca21b74946a7ef4db5e3d7fea8a4185a4723c26beee9df76de351ac6
|
|
7
|
+
data.tar.gz: 0e3b4e4f29d1b814c35842e62f2b812984f3ce4454e27e074cd63f38aefc713355dd35659ff6336b30b5ce7daaf7d81be157c9b6e3117ece4c92d4c8e492f79c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
Unreleased Changes
|
|
2
2
|
------------------
|
|
3
3
|
|
|
4
|
+
3.264.0 (2026-11-04)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
* Feature - Support refreshing login credentials in the cached sign-in region, falling back to the configured region when missing or empty.
|
|
8
|
+
|
|
9
|
+
* Issue - Fix clock skew correction for long-running requests and slow response downloads by using the time response headers are received.
|
|
10
|
+
|
|
4
11
|
3.263.0 (2026-10-29)
|
|
5
12
|
------------------
|
|
6
13
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.264.0
|
|
@@ -12,7 +12,9 @@ module Aws
|
|
|
12
12
|
# ec2 = Aws::EC2::Client.new(credentials: login_credentials)
|
|
13
13
|
#
|
|
14
14
|
# If you omit the `:client` option, a new {Aws::Signin::Client} object will
|
|
15
|
-
# be constructed with additional options that were provided.
|
|
15
|
+
# be constructed with additional options that were provided. When the cached
|
|
16
|
+
# token records a different `signInRegion`, a client for that region is
|
|
17
|
+
# constructed the same way and used to refresh.
|
|
16
18
|
class LoginCredentials
|
|
17
19
|
include CredentialProvider
|
|
18
20
|
include RefreshingCredentials
|
|
@@ -23,22 +25,26 @@ module Aws
|
|
|
23
25
|
# PowerShell automatically.
|
|
24
26
|
#
|
|
25
27
|
# @option options [Signin::Client] :client Optional `Signin::Client`.
|
|
26
|
-
# If not provided, a client will be constructed.
|
|
28
|
+
# If not provided, a client will be constructed. A provided client is
|
|
29
|
+
# used for every refresh, so it must be configured for the region the
|
|
30
|
+
# login token was issued in.
|
|
27
31
|
def initialize(options = {})
|
|
28
32
|
raise ArgumentError, 'Missing login_session' unless options[:login_session]
|
|
29
33
|
|
|
30
34
|
@login_session = options.delete(:login_session)
|
|
31
35
|
@client = options[:client]
|
|
32
36
|
unless @client
|
|
33
|
-
client_opts = options.reject { |key, _| CLIENT_EXCLUDE_OPTIONS.include?(key) }
|
|
34
|
-
@client = Signin::Client.new(client_opts
|
|
37
|
+
@client_opts = options.reject { |key, _| CLIENT_EXCLUDE_OPTIONS.include?(key) }.merge(credentials: nil)
|
|
38
|
+
@client = Signin::Client.new(@client_opts)
|
|
35
39
|
end
|
|
36
40
|
@metrics = ['CREDENTIALS_LOGIN']
|
|
37
41
|
@async_refresh = true
|
|
38
42
|
super
|
|
39
43
|
end
|
|
40
44
|
|
|
41
|
-
# @return [Signin::Client]
|
|
45
|
+
# @return [Signin::Client] The client built from the given options. A refresh
|
|
46
|
+
# uses a client for another region when the cached token records a different
|
|
47
|
+
# `signInRegion`.
|
|
42
48
|
attr_reader :client
|
|
43
49
|
|
|
44
50
|
private
|
|
@@ -138,7 +144,7 @@ module Aws
|
|
|
138
144
|
refresh_token: token_json['refreshToken']
|
|
139
145
|
}
|
|
140
146
|
}
|
|
141
|
-
req =
|
|
147
|
+
req = signin_client(token_json['signInRegion']).build_request(:create_o_auth_2_token, options)
|
|
142
148
|
endpoint_params = Aws::Signin::EndpointParameters.create(req.context.config)
|
|
143
149
|
endpoint = req.context.config.endpoint_provider.resolve_endpoint(endpoint_params)
|
|
144
150
|
endpoint = URI.join(endpoint.url, @client.config.api.operation(:create_o_auth_2_token).http_request_uri).to_s
|
|
@@ -146,6 +152,15 @@ module Aws
|
|
|
146
152
|
req.send_request
|
|
147
153
|
end
|
|
148
154
|
|
|
155
|
+
# Refresh tokens can only be redeemed in the region they were issued in,
|
|
156
|
+
# which the login tool records in the cached token as `signInRegion`.
|
|
157
|
+
def signin_client(signin_region)
|
|
158
|
+
return @client if @client_opts.nil? || signin_region.to_s.empty? || signin_region == @client.config.region
|
|
159
|
+
|
|
160
|
+
@signin_region_clients ||= {}
|
|
161
|
+
@signin_region_clients[signin_region] ||= Signin::Client.new(@client_opts.merge(region: signin_region))
|
|
162
|
+
end
|
|
163
|
+
|
|
149
164
|
def dpop_proof(dpop_key, endpoint)
|
|
150
165
|
# Load private key from cached token file
|
|
151
166
|
private_key = OpenSSL::PKey.read(dpop_key)
|
|
@@ -39,7 +39,7 @@ module Aws
|
|
|
39
39
|
|
|
40
40
|
# Whether a response indicates skew large enough to warrant a retry; records nothing.
|
|
41
41
|
# @param context [Seahorse::Client::RequestContext]
|
|
42
|
-
# @param sent_at [Time, nil] raw (pre-skew) send time,
|
|
42
|
+
# @param sent_at [Time, nil] raw (pre-skew) send time, to discard slow requests
|
|
43
43
|
def clock_skewed?(context, sent_at = nil)
|
|
44
44
|
candidate = candidate_skew(context, sent_at)
|
|
45
45
|
!!candidate && candidate.abs > CLOCK_SKEW_THRESHOLD
|
|
@@ -47,7 +47,7 @@ module Aws
|
|
|
47
47
|
|
|
48
48
|
# Called on every response; records the skew candidate when one can be computed.
|
|
49
49
|
# @param context [Seahorse::Client::RequestContext]
|
|
50
|
-
# @param sent_at [Time, nil] raw (pre-skew) send time,
|
|
50
|
+
# @param sent_at [Time, nil] raw (pre-skew) send time, to discard slow requests
|
|
51
51
|
def update_clock_correction(context, sent_at = nil)
|
|
52
52
|
candidate = candidate_skew(context, sent_at)
|
|
53
53
|
return if candidate.nil?
|
|
@@ -74,23 +74,22 @@ module Aws
|
|
|
74
74
|
private
|
|
75
75
|
|
|
76
76
|
# Single source of truth for skew computation; returns a Float skew or nil.
|
|
77
|
+
# The candidate is the server Date minus the time the response headers were
|
|
78
|
+
# received (the current time if that was not recorded).
|
|
77
79
|
# @param context [Seahorse::Client::RequestContext]
|
|
78
|
-
# @param sent_at [Time, nil] raw (pre-skew) send time;
|
|
80
|
+
# @param sent_at [Time, nil] raw (pre-skew) send time; used only to discard slow requests
|
|
79
81
|
# @return [Float, nil]
|
|
80
82
|
def candidate_skew(context, sent_at = nil)
|
|
81
83
|
response = context.http_response
|
|
82
84
|
server_time = server_time(response)
|
|
83
85
|
# No candidate if the Date header is absent/unparseable or the response was cached.
|
|
84
86
|
return nil if server_time.nil? || response.headers['age']
|
|
85
|
-
return server_time - Time.now.utc unless sent_at
|
|
86
87
|
|
|
87
|
-
received_at = Time.now.utc
|
|
88
|
-
elapsed = received_at - sent_at
|
|
88
|
+
received_at = context.metadata[:response_received_at] || Time.now.utc
|
|
89
89
|
# Discard if the request was too slow for the measurement to be trusted.
|
|
90
|
-
return nil if
|
|
90
|
+
return nil if sent_at && received_at - sent_at > MAX_TRUSTED_REQUEST_DURATION
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
server_time - (sent_at + (elapsed / 2.0))
|
|
92
|
+
server_time - received_at
|
|
94
93
|
end
|
|
95
94
|
|
|
96
95
|
##
|
|
@@ -177,6 +177,16 @@ module Aws
|
|
|
177
177
|
DYNAMODB_SERVICES = Set['DynamoDB', 'DynamoDB Streams'].freeze
|
|
178
178
|
|
|
179
179
|
class << self
|
|
180
|
+
# @api private
|
|
181
|
+
# HTTP retries preserve the listener, so register it only once.
|
|
182
|
+
def track_response_time(context)
|
|
183
|
+
return unless context.retries.zero?
|
|
184
|
+
|
|
185
|
+
context.http_response.on_headers do
|
|
186
|
+
context.metadata[:response_received_at] = Time.now.utc
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
180
190
|
# TODO: Remove this gate and hardcode new retry behavior once
|
|
181
191
|
# AWS_NEW_RETRIES_2026 is enabled by default, which includes:
|
|
182
192
|
# - Default retry_mode to 'standard'
|
|
@@ -294,6 +304,7 @@ module Aws
|
|
|
294
304
|
def call(context)
|
|
295
305
|
context.metadata[:retries] ||= {}
|
|
296
306
|
config = context.config
|
|
307
|
+
RetryErrors.track_response_time(context)
|
|
297
308
|
|
|
298
309
|
get_send_token(config)
|
|
299
310
|
add_retry_headers(context)
|
|
@@ -451,6 +462,7 @@ module Aws
|
|
|
451
462
|
context.config.credentials.refresh! if refresh_credentials?(context, error)
|
|
452
463
|
context.http_request.body.rewind
|
|
453
464
|
context.http_response.reset
|
|
465
|
+
context.metadata.delete(:response_received_at)
|
|
454
466
|
call(context)
|
|
455
467
|
end
|
|
456
468
|
|
|
@@ -492,6 +504,7 @@ module Aws
|
|
|
492
504
|
class LegacyHandler < Seahorse::Client::Handler
|
|
493
505
|
|
|
494
506
|
def call(context)
|
|
507
|
+
RetryErrors.track_response_time(context)
|
|
495
508
|
response = with_metric { @handler.call(context) }
|
|
496
509
|
if response.error
|
|
497
510
|
error_inspector = Retries::ErrorInspector.new(
|
|
@@ -530,6 +543,7 @@ module Aws
|
|
|
530
543
|
context.config.credentials.refresh! if refresh_credentials?(context, error)
|
|
531
544
|
context.http_request.body.rewind
|
|
532
545
|
context.http_response.reset
|
|
546
|
+
context.metadata.delete(:response_received_at)
|
|
533
547
|
call(context)
|
|
534
548
|
end
|
|
535
549
|
|
data/lib/aws-sdk-signin.rb
CHANGED
data/lib/aws-sdk-sso/client.rb
CHANGED
data/lib/aws-sdk-sso.rb
CHANGED
data/lib/aws-sdk-ssooidc.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
data/lib/aws-sdk-sts.rb
CHANGED