aws-sdk-core 3.209.1 → 3.220.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +119 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-defaults/default_configuration.rb +1 -2
  5. data/lib/aws-sdk-core/arn.rb +1 -3
  6. data/lib/aws-sdk-core/cbor/decoder.rb +0 -2
  7. data/lib/aws-sdk-core/cbor/encoder.rb +2 -2
  8. data/lib/aws-sdk-core/cbor.rb +3 -56
  9. data/lib/aws-sdk-core/client_stubs.rb +29 -55
  10. data/lib/aws-sdk-core/endpoints/matchers.rb +1 -8
  11. data/lib/aws-sdk-core/json/error_handler.rb +2 -1
  12. data/lib/aws-sdk-core/json/handler.rb +1 -0
  13. data/lib/aws-sdk-core/log/param_formatter.rb +7 -3
  14. data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +332 -170
  15. data/lib/aws-sdk-core/plugins/http_checksum.rb +2 -8
  16. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +44 -25
  17. data/lib/aws-sdk-core/plugins/sign.rb +1 -1
  18. data/lib/aws-sdk-core/plugins/stub_responses.rb +24 -8
  19. data/lib/aws-sdk-core/plugins/user_agent.rb +10 -1
  20. data/lib/aws-sdk-core/rest/request/headers.rb +2 -2
  21. data/lib/aws-sdk-core/rpc_v2/builder.rb +1 -1
  22. data/lib/aws-sdk-core/{cbor → rpc_v2}/cbor_engine.rb +4 -5
  23. data/lib/aws-sdk-core/rpc_v2/content_type_handler.rb +3 -1
  24. data/lib/aws-sdk-core/rpc_v2/error_handler.rb +3 -2
  25. data/lib/aws-sdk-core/rpc_v2/handler.rb +2 -1
  26. data/lib/aws-sdk-core/rpc_v2/parser.rb +1 -1
  27. data/lib/aws-sdk-core/rpc_v2.rb +65 -2
  28. data/lib/aws-sdk-core/shared_config.rb +2 -0
  29. data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +12 -11
  30. data/lib/aws-sdk-core/stubbing/protocols/json.rb +11 -10
  31. data/lib/aws-sdk-core/stubbing/protocols/query.rb +7 -6
  32. data/lib/aws-sdk-core/stubbing/protocols/rest.rb +2 -1
  33. data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +9 -8
  34. data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +6 -5
  35. data/lib/aws-sdk-core/stubbing/protocols/rpc_v2.rb +13 -15
  36. data/lib/aws-sdk-core/stubbing.rb +2 -2
  37. data/lib/aws-sdk-sso/client.rb +52 -29
  38. data/lib/aws-sdk-sso/endpoint_parameters.rb +9 -6
  39. data/lib/aws-sdk-sso/endpoint_provider.rb +14 -18
  40. data/lib/aws-sdk-sso/endpoints.rb +2 -42
  41. data/lib/aws-sdk-sso/plugins/endpoints.rb +1 -14
  42. data/lib/aws-sdk-sso.rb +1 -1
  43. data/lib/aws-sdk-ssooidc/client.rb +76 -47
  44. data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +9 -6
  45. data/lib/aws-sdk-ssooidc/endpoint_provider.rb +14 -18
  46. data/lib/aws-sdk-ssooidc/endpoints.rb +2 -42
  47. data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +1 -14
  48. data/lib/aws-sdk-ssooidc/types.rb +20 -15
  49. data/lib/aws-sdk-ssooidc.rb +1 -1
  50. data/lib/aws-sdk-sts/client.rb +260 -81
  51. data/lib/aws-sdk-sts/client_api.rb +23 -0
  52. data/lib/aws-sdk-sts/endpoint_parameters.rb +10 -9
  53. data/lib/aws-sdk-sts/endpoint_provider.rb +33 -38
  54. data/lib/aws-sdk-sts/endpoints.rb +2 -94
  55. data/lib/aws-sdk-sts/errors.rb +16 -0
  56. data/lib/aws-sdk-sts/plugins/endpoints.rb +1 -22
  57. data/lib/aws-sdk-sts/types.rb +170 -28
  58. data/lib/aws-sdk-sts.rb +1 -1
  59. data/lib/seahorse/client/net_http/connection_pool.rb +2 -0
  60. data/lib/seahorse/client/response.rb +2 -0
  61. metadata +25 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b21a55766ac3b065464e202f9e5e8eaa449fb1b186776cc439f9ef6859c51923
4
- data.tar.gz: d0602af7e12f340646722e0ca65ebbe1b9950d8b7ac7da1da2bfaf22a6723fbb
3
+ metadata.gz: 3240fa70bcc8af09bd2cf7dfaaa5801cb7786c7fd253beff8d859e6a65a4b135
4
+ data.tar.gz: cf8950c3f0291a93298b3723eb697d6930f55d6fcc6ddd4ed197db3d2225b8bf
5
5
  SHA512:
6
- metadata.gz: dce3b13eced2c29beecdbc6929836c9917cc0d7524033cb76e0ea7ae6cf6f01c87b9f0f07a88a17197cb2989c4addf3a9c303acbdb6cf5fb331ecb328d16feec
7
- data.tar.gz: ace0cb1e6d8e05083601c36607a3c8d6902a72a36cec481081939626ce8399fa43b603b42d6fb026cddce1ec51ab98f405a02e6fa4eb861aabe23aa658519457
6
+ metadata.gz: d2cbfdcdb577a82a691c172f3f69785e0d0ab980fdf2cbb9387ef60c8b32531a0804f7cee8c799e7be17f8c6c2a43956fec8ad6425147516c1aaec75a3e6cb42
7
+ data.tar.gz: 0de986f5a38fc00014c90010e259c30c1c30714f8191aa1858af4a2bc6cf075ffd52d8caf1da4eacaaab0b987bc5cf245061d951b8fe86be0cba0b0f793a38fa
data/CHANGELOG.md CHANGED
@@ -1,6 +1,125 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 3.220.1 (2025-03-06)
5
+ ------------------
6
+
7
+ * Issue - Convert stubs at request time.
8
+
9
+ 3.220.0 (2025-03-04)
10
+ ------------------
11
+
12
+ * Feature - Updated Aws::STS::Client with the latest API changes.
13
+
14
+ 3.219.0 (2025-02-18)
15
+ ------------------
16
+
17
+ * Feature - Updated Aws::STS::Client with the latest API changes.
18
+
19
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
20
+
21
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
22
+
23
+ 3.218.1 (2025-02-07)
24
+ ------------------
25
+
26
+ * Issue - Add handling of block in ExtendedSession delegation (#3178).
27
+
28
+ 3.218.0 (2025-02-06)
29
+ ------------------
30
+
31
+ * Feature - Updated Aws::STS::Client with the latest API changes.
32
+
33
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
34
+
35
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
36
+
37
+ 3.217.1 (2025-01-30)
38
+ ------------------
39
+
40
+ * Issue - Add `transfer-encoding` and `connection` to list of unsigned sigv4 headers.
41
+
42
+ 3.217.0 (2025-01-24)
43
+ ------------------
44
+
45
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
46
+
47
+ * Feature - Fixed typos in the descriptions.
48
+
49
+ 3.216.1 (2025-01-22)
50
+ ------------------
51
+
52
+ * Issue - Use epoch seconds instead of milliseconds in cbor encode/decode.
53
+
54
+ * Issue - Add handling of block in response delegation (#3169).
55
+
56
+ 3.216.0 (2025-01-15)
57
+ ------------------
58
+
59
+ * Feature - Updated Aws::STS::Client with the latest API changes.
60
+
61
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
62
+
63
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
64
+
65
+ * Feature - Always calculate request checksums for operations that support or require it. Supported config options are `when_supported` and `when_required`. The default value is `when_supported`. This option is configured in code with `:request_checksum_calculation`, in the shared config file as `request_checksum_calculation`, and in the ENV as `ENV['AWS_REQUEST_CHECKSUM_CALCULATION']`.
66
+
67
+ * Feature - Always validate response checksums for operations that support or require it. Supported config options are `when_supported` and `when_required`. The default value is `when_supported`. This option is configured in code with `:response_checksum_validation`, in the shared config file as `response_checksum_validation`, and in the ENV as `ENV['AWS_RESPONSE_CHECKSUM_VALIDATION']`.
68
+
69
+ * Feature - Support CRC64NVME checksums through the `aws-crt` gem.
70
+
71
+ 3.215.1 (2025-01-14)
72
+ ------------------
73
+
74
+ * Issue - Fixed error when attempting to log an unlinked tempfile.
75
+
76
+ 3.215.0 (2025-01-10)
77
+ ------------------
78
+
79
+ * Feature - Updated Aws::STS::Client with the latest API changes.
80
+
81
+ * Feature - Fixed typos in the descriptions.
82
+
83
+ 3.214.1 (2024-12-28)
84
+ ------------------
85
+
86
+ * Issue - Fix documentation that references a non-existent method.
87
+
88
+ 3.214.0 (2024-11-25)
89
+ ------------------
90
+
91
+ * Feature - Updated configuration values for `defaults_mode`.
92
+
93
+ 3.213.0 (2024-11-14)
94
+ ------------------
95
+
96
+ * Feature - Updated Aws::STS::Client with the latest API changes.
97
+
98
+ * Feature - This release introduces the new API 'AssumeRoot', which returns short-term credentials that you can use to perform privileged tasks.
99
+
100
+ 3.212.0 (2024-11-06)
101
+ ------------------
102
+
103
+ * Feature - Updated Aws::STS::Client with the latest API changes.
104
+
105
+ 3.211.0 (2024-10-21)
106
+ ------------------
107
+
108
+ * Feature - Support functionality for services that migrate from AWS Query to AWS JSON or CBOR.
109
+
110
+ * Issue - Fix RPCv2 protocol to always send an Accept header for CBOR.
111
+
112
+ 3.210.0 (2024-10-18)
113
+ ------------------
114
+
115
+ * Feature - Updated Aws::STS::Client with the latest API changes.
116
+
117
+ * Feature - Updated Aws::SSOOIDC::Client with the latest API changes.
118
+
119
+ * Feature - Updated Aws::SSO::Client with the latest API changes.
120
+
121
+ * Feature - reduce memory usage by not using legacy endpoint data unless required.
122
+
4
123
  3.209.1 (2024-09-25)
5
124
  ------------------
6
125
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.209.1
1
+ 3.220.1
@@ -128,8 +128,7 @@ module Aws
128
128
  "override" => 3100
129
129
  }
130
130
  },
131
- "in-region" => {
132
- },
131
+ "in-region" => {},
133
132
  "cross-region" => {
134
133
  "connectTimeoutInMillis" => {
135
134
  "override" => 3100
@@ -24,9 +24,7 @@ module Aws
24
24
  # arn.resource
25
25
  # # => foo/bar
26
26
  #
27
- # # Note: parser available for parsing resource details
28
- # @see Aws::ARNParser#parse_resource
29
- #
27
+ # @see ARNParser
30
28
  # @see https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-arns
31
29
  class ARN
32
30
 
@@ -61,9 +61,7 @@ module Aws
61
61
  when :tag
62
62
  case (tag = read_tag)
63
63
  when TAG_TYPE_EPOCH
64
- type = peek_type
65
64
  item = decode_item
66
- item /= 1000.0 if type == :integer
67
65
  Time.at(item)
68
66
  when TAG_TYPE_BIGNUM, TAG_TYPE_NEG_BIGNUM
69
67
  read_bignum(tag)
@@ -226,8 +226,8 @@ module Aws
226
226
 
227
227
  def add_time(value)
228
228
  head(MAJOR_TYPE_TAG, TAG_TYPE_EPOCH)
229
- epoch_ms = (value.to_f * 1000).to_i
230
- add_integer(epoch_ms)
229
+ epoch = value.to_f
230
+ add_double(epoch)
231
231
  end
232
232
 
233
233
  def bignum_to_bytes(value)
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'cbor/encoder'
4
+ require_relative 'cbor/decoder'
5
+
3
6
  module Aws
4
7
  # @api private
5
8
  module Cbor
@@ -46,61 +49,5 @@ module Aws
46
49
  super("Unexpected additional information: #{add_info}")
47
50
  end
48
51
  end
49
-
50
- class << self
51
- # @param [Symbol,Class] engine
52
- # Must be one of the following values:
53
- #
54
- # * :cbor
55
- #
56
- def engine=(engine)
57
- @engine = Class === engine ? engine : load_engine(engine)
58
- end
59
-
60
- # @return [Class] Returns the default engine.
61
- # One of:
62
- #
63
- # * {CborEngine}
64
- #
65
- def engine
66
- set_default_engine unless @engine
67
- @engine
68
- end
69
-
70
- def encode(data)
71
- @engine.encode(data)
72
- end
73
-
74
- def decode(bytes)
75
- bytes.force_encoding(Encoding::BINARY)
76
- @engine.decode(bytes)
77
- end
78
-
79
- def set_default_engine
80
- [:cbor].each do |name|
81
- @engine ||= try_load_engine(name)
82
- end
83
-
84
- unless @engine
85
- raise 'Unable to find a compatible cbor library.'
86
- end
87
- end
88
-
89
- private
90
-
91
- def load_engine(name)
92
- require "aws-sdk-core/cbor/#{name}_engine"
93
- const_name = name[0].upcase + name[1..-1] + 'Engine'
94
- const_get(const_name)
95
- end
96
-
97
- def try_load_engine(name)
98
- load_engine(name)
99
- rescue LoadError
100
- false
101
- end
102
- end
103
-
104
- set_default_engine
105
52
  end
106
53
  end
@@ -15,27 +15,11 @@ module Aws
15
15
 
16
16
  # @api private
17
17
  def setup_stubbing
18
- @stubs = {}
19
- @stub_mutex = Mutex.new
20
18
  if Hash === @config.stub_responses
21
19
  @config.stub_responses.each do |operation_name, stubs|
22
20
  apply_stubs(operation_name, Array === stubs ? stubs : [stubs])
23
21
  end
24
22
  end
25
-
26
- # When a client is stubbed allow the user to access the requests made
27
- requests = @api_requests = []
28
- requests_mutex = @requests_mutex = Mutex.new
29
- self.handle do |context|
30
- requests_mutex.synchronize do
31
- requests << {
32
- operation_name: context.operation_name,
33
- params: context.params,
34
- context: context
35
- }
36
- end
37
- @handler.call(context)
38
- end
39
23
  end
40
24
 
41
25
  # Configures what data / errors should be returned from the named operation
@@ -175,7 +159,7 @@ module Aws
175
159
  # on a client that has not enabled response stubbing via
176
160
  # `:stub_responses => true`.
177
161
  def stub_responses(operation_name, *stubs)
178
- if config.stub_responses
162
+ if @config.stub_responses
179
163
  apply_stubs(operation_name, stubs.flatten)
180
164
  else
181
165
  msg = 'stubbing is not enabled; enable stubbing in the constructor '\
@@ -194,12 +178,12 @@ module Aws
194
178
  # @raise [NotImplementedError] Raises `NotImplementedError` when the client
195
179
  # is not stubbed.
196
180
  def api_requests(options = {})
197
- if config.stub_responses
198
- @requests_mutex.synchronize do
181
+ if @config.stub_responses
182
+ @config.api_requests_mutex.synchronize do
199
183
  if options[:exclude_presign]
200
- @api_requests.reject {|req| req[:context][:presigned_url] }
184
+ @config.api_requests.reject {|req| req[:context][:presigned_url] }
201
185
  else
202
- @api_requests
186
+ @config.api_requests
203
187
  end
204
188
  end
205
189
  else
@@ -228,54 +212,44 @@ module Aws
228
212
  # @return [Structure] Returns a stubbed response data structure. The
229
213
  # actual class returned will depend on the given `operation_name`.
230
214
  def stub_data(operation_name, data = {})
231
- Stubbing::StubData.new(config.api.operation(operation_name)).stub(data)
215
+ Stubbing::StubData.new(@config.api.operation(operation_name)).stub(data)
232
216
  end
233
217
 
234
218
  # @api private
235
219
  def next_stub(context)
236
220
  operation_name = context.operation_name.to_sym
237
- stub = @stub_mutex.synchronize do
238
- stubs = @stubs[operation_name] || []
221
+ stub = @config.stubs_mutex.synchronize do
222
+ stubs = @config.stubs[operation_name] || []
239
223
  case stubs.length
240
- when 0 then default_stub(operation_name)
224
+ when 0 then stub_data(operation_name)
241
225
  when 1 then stubs.first
242
226
  else stubs.shift
243
227
  end
244
228
  end
245
- Proc === stub ? convert_stub(operation_name, stub.call(context)) : stub
229
+ stub = convert_stub(operation_name, stub, context)
230
+ stub[:mutex] = Mutex.new
231
+ stub
246
232
  end
247
233
 
248
234
  private
249
235
 
250
- def default_stub(operation_name)
251
- stub = stub_data(operation_name)
252
- http_response_stub(operation_name, stub)
236
+ def apply_stubs(operation_name, stubs)
237
+ @config.stubs_mutex.synchronize do
238
+ @config.stubs[operation_name.to_sym] = stubs
239
+ end
253
240
  end
254
241
 
255
242
  # This method converts the given stub data and converts it to a
256
243
  # HTTP response (when possible). This enables the response stubbing
257
244
  # plugin to provide a HTTP response that triggers all normal events
258
245
  # during response handling.
259
- def apply_stubs(operation_name, stubs)
260
- @stub_mutex.synchronize do
261
- @stubs[operation_name.to_sym] = stubs.map do |stub|
262
- convert_stub(operation_name, stub)
263
- end
264
- end
265
- end
266
-
267
- def convert_stub(operation_name, stub)
268
- stub = case stub
269
- when Proc then stub
246
+ def convert_stub(operation_name, stub, context)
247
+ case stub
248
+ when Proc then convert_stub(operation_name, stub.call(context), context)
270
249
  when Exception, Class then { error: stub }
271
250
  when String then service_error_stub(stub)
272
- when Hash then http_response_stub(operation_name, stub)
273
- else { data: stub }
274
- end
275
- if Hash === stub
276
- stub[:mutex] = Mutex.new
251
+ else http_response_stub(operation_name, stub)
277
252
  end
278
- stub
279
253
  end
280
254
 
281
255
  def service_error_stub(error_code)
@@ -299,22 +273,22 @@ module Aws
299
273
  end
300
274
 
301
275
  def data_to_http_resp(operation_name, data)
302
- api = config.api
276
+ api = @config.api
303
277
  operation = api.operation(operation_name)
304
278
  ParamValidator.new(operation.output, input: false).validate!(data)
305
279
  protocol_helper.stub_data(api, operation, data)
306
280
  end
307
281
 
308
282
  def protocol_helper
309
- case config.api.metadata['protocol']
310
- when 'json' then Stubbing::Protocols::Json
311
- when 'rest-json' then Stubbing::Protocols::RestJson
312
- when 'rest-xml' then Stubbing::Protocols::RestXml
313
- when 'query' then Stubbing::Protocols::Query
314
- when 'ec2' then Stubbing::Protocols::EC2
283
+ case @config.api.metadata['protocol']
284
+ when 'json' then Stubbing::Protocols::Json
285
+ when 'rest-json' then Stubbing::Protocols::RestJson
286
+ when 'rest-xml' then Stubbing::Protocols::RestXml
287
+ when 'query' then Stubbing::Protocols::Query
288
+ when 'ec2' then Stubbing::Protocols::EC2
315
289
  when 'smithy-rpc-v2-cbor' then Stubbing::Protocols::RpcV2
316
- when 'api-gateway' then Stubbing::Protocols::ApiGateway
317
- else raise "unsupported protocol"
290
+ when 'api-gateway' then Stubbing::Protocols::ApiGateway
291
+ else raise 'unsupported protocol'
318
292
  end.new
319
293
  end
320
294
  end
@@ -94,14 +94,7 @@ module Aws
94
94
 
95
95
  # aws.partition(value: string) Option<Partition>
96
96
  def self.aws_partition(value)
97
- partition =
98
- Aws::Partitions.find { |p| p.region?(value) } ||
99
- Aws::Partitions.find { |p| value.match(p.region_regex) } ||
100
- Aws::Partitions.find { |p| p.name == 'aws' }
101
-
102
- return nil unless partition
103
-
104
- partition.metadata
97
+ Aws::Partitions::Metadata.partition(value)
105
98
  end
106
99
 
107
100
  # aws.parseArn(value: string) Option<ARN>
@@ -26,7 +26,8 @@ module Aws
26
26
  def error_code(json, context)
27
27
  code =
28
28
  if aws_query_error?(context)
29
- error = context.http_response.headers['x-amzn-query-error'].split(';')[0]
29
+ query_header = context.http_response.headers['x-amzn-query-error']
30
+ error, _type = query_header.split(';') # type not supported
30
31
  remove_prefix(error, context)
31
32
  else
32
33
  json['__type']
@@ -21,6 +21,7 @@ module Aws
21
21
  context.http_request.http_method = 'POST'
22
22
  context.http_request.headers['Content-Type'] = content_type(context)
23
23
  context.http_request.headers['X-Amz-Target'] = target(context)
24
+ context.http_request.headers['X-Amzn-Query-Mode'] = 'true' if query_compatible?(context)
24
25
  context.http_request.body = build_body(context)
25
26
  end
26
27
 
@@ -51,13 +51,17 @@ module Aws
51
51
  when String then summarize_string(value)
52
52
  when Hash then '{' + summarize_hash(value) + '}'
53
53
  when Array then summarize_array(value)
54
- when File then summarize_file(value.path)
55
- when Pathname then summarize_file(value)
54
+ when File then summarize_file(value)
55
+ when Pathname then summarize_filepath(value)
56
56
  else value.inspect
57
57
  end
58
58
  end
59
59
 
60
- def summarize_file(path)
60
+ def summarize_file(file)
61
+ "#<File:#{file.path} (#{file.size} bytes)>"
62
+ end
63
+
64
+ def summarize_filepath(path)
61
65
  "#<File:#{path} (#{File.size(path)} bytes)>"
62
66
  end
63
67