aws-sdk-core 3.267.0 → 3.268.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 +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +27 -13
- 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: 2546cab2f4448950c170b70e06f207e53ce73e6b4aa565876dd46955accc2ee8
|
|
4
|
+
data.tar.gz: 4332cc8dd04f55b96e0bbc41ea6d12368f8d1f88bf4e63ccbb8bf325abb6c8fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d04b9117b7230c735dfc7f22fb219f9c1267fbeb1e816cc590b2b61758a0579b80253d065494aaa840f1428aed54ab763d16a3f5a20d8167a9e7a14e2433821
|
|
7
|
+
data.tar.gz: fcab3d8beb1c93f7c1aa838f6180ec9e2e1f71d5199213b665c7ceb61766b2e98833e1904c960fc0d6aa8bef7c36feced29f7f4d05a5bda26b0c6a1197396822
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.268.0
|
|
@@ -331,14 +331,15 @@ module Aws
|
|
|
331
331
|
headers[algorithm_header] = checksum_properties[:algorithm]
|
|
332
332
|
end
|
|
333
333
|
|
|
334
|
+
return unless %w[header trailer].include?(checksum_properties[:in])
|
|
335
|
+
|
|
336
|
+
body = context.http_request.body
|
|
337
|
+
buffer_enabled = context.http_request.buffer_supported? if body.respond_to?(:read)
|
|
334
338
|
case checksum_properties[:in]
|
|
335
339
|
when 'header'
|
|
336
|
-
apply_request_checksum(context, headers, checksum_properties)
|
|
340
|
+
apply_request_checksum(context, headers, checksum_properties, buffer_enabled)
|
|
337
341
|
when 'trailer'
|
|
338
|
-
buffer_enabled = context.http_request.buffer_supported?
|
|
339
342
|
apply_request_trailer_checksum(context, headers, checksum_properties, buffer_enabled)
|
|
340
|
-
else
|
|
341
|
-
# nothing
|
|
342
343
|
end
|
|
343
344
|
end
|
|
344
345
|
|
|
@@ -356,19 +357,20 @@ module Aws
|
|
|
356
357
|
context[:skip_trailer_checksums]
|
|
357
358
|
end
|
|
358
359
|
|
|
359
|
-
def apply_request_checksum(context, headers, checksum_properties)
|
|
360
|
+
def apply_request_checksum(context, headers, checksum_properties, buffer_enabled)
|
|
360
361
|
header_name = checksum_properties[:name]
|
|
361
362
|
headers[header_name] = calculate_checksum(
|
|
362
363
|
checksum_properties[:algorithm],
|
|
363
|
-
context.http_request.body
|
|
364
|
+
context.http_request.body,
|
|
365
|
+
buffer_enabled
|
|
364
366
|
)
|
|
365
367
|
end
|
|
366
368
|
|
|
367
|
-
def calculate_checksum(algorithm, body)
|
|
369
|
+
def calculate_checksum(algorithm, body, buffer_enabled)
|
|
368
370
|
digest = ChecksumAlgorithm.digest_for_algorithm(algorithm)
|
|
369
371
|
if body.respond_to?(:read)
|
|
370
372
|
body.rewind
|
|
371
|
-
update_in_chunks(digest, body)
|
|
373
|
+
update_in_chunks(digest, body, buffer_enabled)
|
|
372
374
|
body.rewind
|
|
373
375
|
else
|
|
374
376
|
digest.update(body)
|
|
@@ -376,14 +378,26 @@ module Aws
|
|
|
376
378
|
digest.base64digest
|
|
377
379
|
end
|
|
378
380
|
|
|
379
|
-
def update_in_chunks(digest, io)
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
def update_in_chunks(digest, io, buffer_enabled)
|
|
382
|
+
if buffer_enabled
|
|
383
|
+
update_in_chunks_with_buffer(digest, io)
|
|
384
|
+
else
|
|
385
|
+
update_in_chunks_without_buffer(digest, io)
|
|
386
|
+
end
|
|
387
|
+
io.rewind
|
|
388
|
+
end
|
|
383
389
|
|
|
390
|
+
def update_in_chunks_with_buffer(digest, io)
|
|
391
|
+
buffer = ''.b
|
|
392
|
+
while (chunk = io.read(CHECKSUM_CHUNK_SIZE, buffer))
|
|
393
|
+
digest.update(chunk)
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
def update_in_chunks_without_buffer(digest, io)
|
|
398
|
+
while (chunk = io.read(CHECKSUM_CHUNK_SIZE))
|
|
384
399
|
digest.update(chunk)
|
|
385
400
|
end
|
|
386
|
-
io.rewind
|
|
387
401
|
end
|
|
388
402
|
|
|
389
403
|
def apply_request_trailer_checksum(context, headers, checksum_properties, buffer_enabled)
|
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