aws-sdk-core 3.262.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 +14 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/login_credentials.rb +21 -6
- data/lib/aws-sdk-core/pageable_response.rb +8 -1
- 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-core/plugins/stub_responses.rb +1 -1
- data/lib/aws-sdk-core/response.rb +23 -0
- data/lib/aws-sdk-core.rb +1 -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
- data/lib/seahorse/client/h2/connection.rb +9 -1
- data/lib/seahorse/client/net_http/handler.rb +1 -1
- metadata +2 -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,20 @@
|
|
|
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
|
+
|
|
11
|
+
3.263.0 (2026-10-29)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
* Feature - Reduce object allocation overhead for SDK responses. SDK clients now return `Aws::Response`, a subclass of `Seahorse::Client::Response`.
|
|
15
|
+
|
|
16
|
+
* Issue - Verify the server certificate hostname for `AsyncClient` HTTP/2 connections when `ssl_verify_peer` is enabled. Connections now fail if the server certificate does not match the endpoint hostname.
|
|
17
|
+
|
|
4
18
|
3.262.0 (2026-10-28)
|
|
5
19
|
------------------
|
|
6
20
|
|
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)
|
|
@@ -46,10 +46,16 @@ module Aws
|
|
|
46
46
|
# puts response.contents.map(&:key)
|
|
47
47
|
# end
|
|
48
48
|
#
|
|
49
|
+
# Every client response supports these methods. A response from an
|
|
50
|
+
# operation that does not paginate has a single page, so `last_page?`
|
|
51
|
+
# returns `true` and `each` yields only that response.
|
|
52
|
+
#
|
|
49
53
|
module PageableResponse
|
|
50
54
|
|
|
55
|
+
# Adds paging methods when needed and resets cached paging state.
|
|
56
|
+
# An {Aws::Response} already has the methods through its class.
|
|
51
57
|
def self.apply(base)
|
|
52
|
-
base.extend Extension
|
|
58
|
+
base.extend Extension unless Extension === base
|
|
53
59
|
base.instance_variable_set(:@last_page, nil)
|
|
54
60
|
base.instance_variable_set(:@more_results, nil)
|
|
55
61
|
base
|
|
@@ -217,5 +223,6 @@ module Aws
|
|
|
217
223
|
end
|
|
218
224
|
|
|
219
225
|
end
|
|
226
|
+
|
|
220
227
|
end
|
|
221
228
|
end
|
|
@@ -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
|
|
|
@@ -83,7 +83,7 @@ requests are made, and retries are disabled.
|
|
|
83
83
|
private
|
|
84
84
|
|
|
85
85
|
def stub_responses(context)
|
|
86
|
-
resp =
|
|
86
|
+
resp = Aws::Response.new(context: context)
|
|
87
87
|
async_mode = context.client.is_a? Seahorse::Client::AsyncBase
|
|
88
88
|
stub = context.client.next_stub(context)
|
|
89
89
|
stub[:mutex].synchronize { apply_stub(stub, resp, async_mode) }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
# Represents the response from an AWS service operation.
|
|
5
|
+
# Provides the Seahorse response interface and paging convenience methods.
|
|
6
|
+
#
|
|
7
|
+
# SDK clients return responses with paging ready to use. When constructing
|
|
8
|
+
# a response directly or inspecting it before paging setup in a custom handler,
|
|
9
|
+
# use {#data} to access or enumerate its fields. {#first} returns the response
|
|
10
|
+
# itself; page-state checks and complete page enumeration require a pager.
|
|
11
|
+
#
|
|
12
|
+
# @see PageableResponse
|
|
13
|
+
class Response < Seahorse::Client::Response
|
|
14
|
+
include PageableResponse::Extension
|
|
15
|
+
|
|
16
|
+
def initialize(options = {})
|
|
17
|
+
super
|
|
18
|
+
@pager = nil
|
|
19
|
+
@last_page = nil
|
|
20
|
+
@more_results = nil
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
data/lib/aws-sdk-core.rb
CHANGED
|
@@ -45,6 +45,7 @@ module Aws
|
|
|
45
45
|
autoload :Pager, 'aws-sdk-core/pager'
|
|
46
46
|
autoload :ParamConverter, 'aws-sdk-core/param_converter'
|
|
47
47
|
autoload :ParamValidator, 'aws-sdk-core/param_validator'
|
|
48
|
+
autoload :Response, 'aws-sdk-core/response'
|
|
48
49
|
autoload :SharedConfig, 'aws-sdk-core/shared_config'
|
|
49
50
|
autoload :Structure, 'aws-sdk-core/structure'
|
|
50
51
|
autoload :EmptyStructure, 'aws-sdk-core/structure'
|
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
|
@@ -79,7 +79,14 @@ module Seahorse
|
|
|
79
79
|
@socket.hostname = endpoint.host
|
|
80
80
|
|
|
81
81
|
debug_output("starting TLS for #{endpoint.host}:#{endpoint.port} ...")
|
|
82
|
-
|
|
82
|
+
begin
|
|
83
|
+
@socket.connect
|
|
84
|
+
@socket.post_connection_check(endpoint.host) if @ssl_verify_peer
|
|
85
|
+
rescue StandardError
|
|
86
|
+
@socket.close rescue nil
|
|
87
|
+
@socket = nil
|
|
88
|
+
raise
|
|
89
|
+
end
|
|
83
90
|
debug_output('TLS established')
|
|
84
91
|
else
|
|
85
92
|
@socket = tcp
|
|
@@ -215,6 +222,7 @@ module Seahorse
|
|
|
215
222
|
ssl_ctx = OpenSSL::SSL::SSLContext.new(:TLSv1_2)
|
|
216
223
|
if @ssl_verify_peer
|
|
217
224
|
ssl_ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
225
|
+
ssl_ctx.verify_hostname = true
|
|
218
226
|
ssl_ctx.ca_file = @ssl_ca_bundle || _default_ca_bundle
|
|
219
227
|
ssl_ctx.ca_path = @ssl_ca_directory || _default_ca_directory
|
|
220
228
|
ssl_ctx.cert_store = @ssl_ca_store if @ssl_ca_store
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aws-sdk-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.264.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Amazon Web Services
|
|
@@ -281,6 +281,7 @@ files:
|
|
|
281
281
|
- lib/aws-sdk-core/refreshing_token.rb
|
|
282
282
|
- lib/aws-sdk-core/resources.rb
|
|
283
283
|
- lib/aws-sdk-core/resources/collection.rb
|
|
284
|
+
- lib/aws-sdk-core/response.rb
|
|
284
285
|
- lib/aws-sdk-core/rest.rb
|
|
285
286
|
- lib/aws-sdk-core/rest/content_type_handler.rb
|
|
286
287
|
- lib/aws-sdk-core/rest/handler.rb
|