aws-sdk-core 3.220.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/client_stubs.rb +22 -48
- data/lib/aws-sdk-core/plugins/stub_responses.rb +24 -8
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3240fa70bcc8af09bd2cf7dfaaa5801cb7786c7fd253beff8d859e6a65a4b135
|
4
|
+
data.tar.gz: cf8950c3f0291a93298b3723eb697d6930f55d6fcc6ddd4ed197db3d2225b8bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2cbfdcdb577a82a691c172f3f69785e0d0ab980fdf2cbb9387ef60c8b32531a0804f7cee8c799e7be17f8c6c2a43956fec8ad6425147516c1aaec75a3e6cb42
|
7
|
+
data.tar.gz: 0de986f5a38fc00014c90010e259c30c1c30714f8191aa1858af4a2bc6cf075ffd52d8caf1da4eacaaab0b987bc5cf245061d951b8fe86be0cba0b0f793a38fa
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.220.
|
1
|
+
3.220.1
|
@@ -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
|
-
@
|
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 = @
|
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
|
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
|
-
|
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
|
251
|
-
|
252
|
-
|
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
|
260
|
-
|
261
|
-
|
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
|
-
|
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,14 +273,14 @@ 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']
|
283
|
+
case @config.api.metadata['protocol']
|
310
284
|
when 'json' then Stubbing::Protocols::Json
|
311
285
|
when 'rest-json' then Stubbing::Protocols::RestJson
|
312
286
|
when 'rest-xml' then Stubbing::Protocols::RestXml
|
@@ -29,8 +29,16 @@ requests are made, and retries are disabled.
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
option(:stubs) { {} }
|
33
|
+
option(:stubs_mutex) { Mutex.new }
|
34
|
+
option(:api_requests) { [] }
|
35
|
+
option(:api_requests_mutex) { Mutex.new }
|
36
|
+
|
32
37
|
def add_handlers(handlers, config)
|
33
|
-
|
38
|
+
return unless config.stub_responses
|
39
|
+
|
40
|
+
handlers.add(ApiRequestsHandler)
|
41
|
+
handlers.add(StubbingHandler, step: :send)
|
34
42
|
end
|
35
43
|
|
36
44
|
def after_initialize(client)
|
@@ -46,8 +54,20 @@ requests are made, and retries are disabled.
|
|
46
54
|
end
|
47
55
|
end
|
48
56
|
|
49
|
-
class
|
57
|
+
class ApiRequestsHandler < Seahorse::Client::Handler
|
58
|
+
def call(context)
|
59
|
+
context.config.api_requests_mutex.synchronize do
|
60
|
+
context.config.api_requests << {
|
61
|
+
operation_name: context.operation_name,
|
62
|
+
params: context.params,
|
63
|
+
context: context
|
64
|
+
}
|
65
|
+
end
|
66
|
+
@handler.call(context)
|
67
|
+
end
|
68
|
+
end
|
50
69
|
|
70
|
+
class StubbingHandler < Seahorse::Client::Handler
|
51
71
|
def call(context)
|
52
72
|
span_wrapper(context) do
|
53
73
|
stub_responses(context)
|
@@ -57,14 +77,10 @@ requests are made, and retries are disabled.
|
|
57
77
|
private
|
58
78
|
|
59
79
|
def stub_responses(context)
|
60
|
-
stub = context.client.next_stub(context)
|
61
80
|
resp = Seahorse::Client::Response.new(context: context)
|
62
81
|
async_mode = context.client.is_a? Seahorse::Client::AsyncBase
|
63
|
-
|
64
|
-
|
65
|
-
else
|
66
|
-
apply_stub(stub, resp, async_mode)
|
67
|
-
end
|
82
|
+
stub = context.client.next_stub(context)
|
83
|
+
stub[:mutex].synchronize { apply_stub(stub, resp, async_mode) }
|
68
84
|
|
69
85
|
if async_mode
|
70
86
|
Seahorse::Client::AsyncResponse.new(
|
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
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.220.
|
4
|
+
version: 3.220.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-eventstream
|