aws-sdk-core 3.263.0 → 3.265.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 +12 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/log/formatter.rb +3 -2
- data/lib/aws-sdk-core/log/param_filter.rb +73 -9
- 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: 8516c7b01f0db8c447079f16dc6194cfb7946271b929d1d26d770de75f8149ab
|
|
4
|
+
data.tar.gz: 96e33c08458de24eb3a480dfcebcc7dfc792554dd273ff95d401fe925ea27424
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f6055ceab696dc4e43df077da9229ddd68e6cc79765ca11766f31487e51932d39dcd2de2f0e9ca2f7dab9639519f54e74db8ba9ee2aab486a58e9fd9d99440d
|
|
7
|
+
data.tar.gz: ab07f8326345fc599f281df1aa345b1feb67037f846ef847595cf0872288bb785aac22b6cefe2034beb3deca3433ec3149b3bbeca25885451598381e52d33957
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
Unreleased Changes
|
|
2
2
|
------------------
|
|
3
3
|
|
|
4
|
+
3.265.0 (2026-11-06)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
* Feature - Improve model-aware filtering of nested request parameters and sensitivity detection for nested collections.
|
|
8
|
+
|
|
9
|
+
3.264.0 (2026-11-04)
|
|
10
|
+
------------------
|
|
11
|
+
|
|
12
|
+
* Feature - Support refreshing login credentials in the cached sign-in region, falling back to the configured region when missing or empty.
|
|
13
|
+
|
|
14
|
+
* Issue - Fix clock skew correction for long-running requests and slow response downloads by using the time response headers are received.
|
|
15
|
+
|
|
4
16
|
3.263.0 (2026-10-29)
|
|
5
17
|
------------------
|
|
6
18
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.265.0
|
|
@@ -132,8 +132,9 @@ module Aws
|
|
|
132
132
|
|
|
133
133
|
def _request_params(response)
|
|
134
134
|
params = response.context.params
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
operation = response.context.operation
|
|
136
|
+
ref = operation && operation.input
|
|
137
|
+
@param_formatter.summarize(@param_filter.filter(params, ref))
|
|
137
138
|
end
|
|
138
139
|
|
|
139
140
|
def _time(response)
|
|
@@ -24,7 +24,68 @@ module Aws
|
|
|
24
24
|
@additional_filters = options[:filter] || []
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
# Returns a copy with sensitive values replaced by "[FILTERED]".
|
|
28
|
+
#
|
|
29
|
+
# Uses generated SENSITIVE lists to choose which members to redact.
|
|
30
|
+
# Nested request hashes also use the global list for backwards compatibility.
|
|
31
|
+
# A ShapeRef preserves model types while filtering nested request parameters.
|
|
32
|
+
# Structure classes are also accepted for Structure#to_s and older callers.
|
|
33
|
+
#
|
|
34
|
+
# @param [Hash, Struct, Array, Object] values
|
|
35
|
+
# @param [Seahorse::Model::Shapes::ShapeRef, Class, nil] type
|
|
27
36
|
def filter(values, type)
|
|
37
|
+
return filter_ref(values, type, root: true) if type.is_a?(Seahorse::Model::Shapes::ShapeRef)
|
|
38
|
+
|
|
39
|
+
filter_by_class(values, type)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def filter_ref(value, ref, root: false)
|
|
45
|
+
return filter_by_class(value, value.class) unless ref
|
|
46
|
+
|
|
47
|
+
shape = ref.shape
|
|
48
|
+
case shape
|
|
49
|
+
when Seahorse::Model::Shapes::StructureShape
|
|
50
|
+
if value.is_a?(Hash) || value.is_a?(Struct)
|
|
51
|
+
return filter_struct(
|
|
52
|
+
value, shape.struct_class, shape,
|
|
53
|
+
use_global_filters: !root && value.is_a?(Hash)
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
when Seahorse::Model::Shapes::ListShape
|
|
57
|
+
return value.map { |v| filter_ref(v, shape.member) } if value.is_a?(Array)
|
|
58
|
+
when Seahorse::Model::Shapes::MapShape
|
|
59
|
+
return filter_map(value, shape) if value.is_a?(Hash)
|
|
60
|
+
when Seahorse::Model::Shapes::DocumentShape, nil
|
|
61
|
+
return filter_by_class(value, value.class)
|
|
62
|
+
else
|
|
63
|
+
return value
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
filter_by_class(value, value.class)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def filter_map(values, shape)
|
|
70
|
+
filtered = {}
|
|
71
|
+
values.each_pair do |key, value|
|
|
72
|
+
filtered[key] =
|
|
73
|
+
if @enabled && @additional_filters.include?(key)
|
|
74
|
+
'[FILTERED]'
|
|
75
|
+
else
|
|
76
|
+
filter_ref(value, shape.value)
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
filtered
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def member_ref(shape, key)
|
|
83
|
+
return unless key.is_a?(Symbol) || key.is_a?(String)
|
|
84
|
+
|
|
85
|
+
shape.member(key) if shape.member?(key)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def filter_by_class(values, type)
|
|
28
89
|
case values
|
|
29
90
|
when Struct then filter_struct(values, type)
|
|
30
91
|
when Hash then filter_hash(values, type)
|
|
@@ -33,18 +94,19 @@ module Aws
|
|
|
33
94
|
end
|
|
34
95
|
end
|
|
35
96
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def filter_struct(values, type)
|
|
39
|
-
if values.class.include? Aws::Structure::Union
|
|
97
|
+
def filter_struct(values, type, shape = nil, use_global_filters: false)
|
|
98
|
+
if values.is_a?(Struct) && values.class.include?(Aws::Structure::Union)
|
|
40
99
|
values = { values.member => values.value }
|
|
41
100
|
end
|
|
42
|
-
filter_hash(values, type)
|
|
101
|
+
filter_hash(values, type, shape, use_global_filters: use_global_filters)
|
|
43
102
|
end
|
|
44
103
|
|
|
45
|
-
def filter_hash(values, type)
|
|
46
|
-
if type.const_defined?(
|
|
104
|
+
def filter_hash(values, type, shape = nil, use_global_filters: false)
|
|
105
|
+
if type && type.const_defined?(:SENSITIVE)
|
|
47
106
|
filters = type::SENSITIVE + @additional_filters
|
|
107
|
+
# Nested hashes previously used the global list. Keep that protection
|
|
108
|
+
# alongside modeled sensitivity when following their shape references.
|
|
109
|
+
filters += SENSITIVE if use_global_filters
|
|
48
110
|
else
|
|
49
111
|
# Support backwards compatibility (new core + old service)
|
|
50
112
|
filters = SENSITIVE + @additional_filters
|
|
@@ -54,15 +116,17 @@ module Aws
|
|
|
54
116
|
values.each_pair do |key, value|
|
|
55
117
|
filtered[key] = if @enabled && filters.include?(key)
|
|
56
118
|
'[FILTERED]'
|
|
119
|
+
elsif shape
|
|
120
|
+
filter_ref(value, member_ref(shape, key))
|
|
57
121
|
else
|
|
58
|
-
|
|
122
|
+
filter_by_class(value, value.class)
|
|
59
123
|
end
|
|
60
124
|
end
|
|
61
125
|
filtered
|
|
62
126
|
end
|
|
63
127
|
|
|
64
128
|
def filter_array(values, type)
|
|
65
|
-
values.map { |value|
|
|
129
|
+
values.map { |value| filter_by_class(value, value.class) }
|
|
66
130
|
end
|
|
67
131
|
|
|
68
132
|
end
|
|
@@ -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