aws-sdk-core 3.267.0 → 3.269.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/plugins/checksum_algorithm.rb +34 -15
- 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/model/shapes.rb +6 -6
- 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: eae55531a4bf8df3ab71fc6610d7824d11783e0fa37dbe8710be1c2f94ab1a3c
|
|
4
|
+
data.tar.gz: 387f4fea6740becb6ac8d1cf94c192025cf7b8736b23e72dbaac9ab35a262d88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4d7c4ed00cd830770a12a06be30d71545876e282fae34d108908166f60ea27b2eb5e0d5401f50a7f592661dc82a3bd02787df8d67ebec5ead24a0881b585171
|
|
7
|
+
data.tar.gz: 4c14f561992f1f08b63eb4b5ddf315c1e07de3beb4e0c6e7ac281b7ba2fd1ffa09bee53e1de5d0e780541544e6b32d4363f48d7ca364944df55ebf8f9f30c3a8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
Unreleased Changes
|
|
2
2
|
------------------
|
|
3
3
|
|
|
4
|
+
3.269.0 (2026-11-16)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
* Feature - Reduce memory usage of loaded service APIs by allocating shape metadata Hashes on first write.
|
|
8
|
+
|
|
9
|
+
* Feature - Reuse the chunk size header of full chunks when streaming request bodies with checksum trailers.
|
|
10
|
+
|
|
11
|
+
3.268.0 (2026-11-11)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
* Feature - Reuse read buffers to reduce allocations when calculating request checksums sent in headers.
|
|
15
|
+
|
|
4
16
|
3.267.0 (2026-11-10)
|
|
5
17
|
------------------
|
|
6
18
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.269.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)
|
|
@@ -495,6 +509,7 @@ module Aws
|
|
|
495
509
|
@chunk_size = Thread.current[:net_http_override_body_stream_chunk] || DEFAULT_TRAILER_CHUNK_SIZE
|
|
496
510
|
@overhead_bytes = calculate_overhead(@chunk_size)
|
|
497
511
|
@base_chunk_size = @chunk_size - @overhead_bytes
|
|
512
|
+
@full_chunk_size_hex = @base_chunk_size.to_s(HEX_BASE).freeze
|
|
498
513
|
@chunk = ''.b
|
|
499
514
|
@read_chunk = method(buffer_enabled ? :read_chunk_with_buffer : :read_chunk_without_buffer)
|
|
500
515
|
@encoded_buffer = +''
|
|
@@ -507,7 +522,7 @@ module Aws
|
|
|
507
522
|
n_full_chunks = orig_body_size / @base_chunk_size
|
|
508
523
|
partial_bytes = orig_body_size % @base_chunk_size
|
|
509
524
|
|
|
510
|
-
full_chunk_overhead = @
|
|
525
|
+
full_chunk_overhead = @full_chunk_size_hex.bytesize + CHUNK_OVERHEAD
|
|
511
526
|
chunked_body_size = n_full_chunks * (@base_chunk_size + full_chunk_overhead)
|
|
512
527
|
unless partial_bytes.zero?
|
|
513
528
|
chunked_body_size += partial_bytes.to_s(HEX_BASE).size + partial_bytes + CHUNK_OVERHEAD
|
|
@@ -568,7 +583,7 @@ module Aws
|
|
|
568
583
|
chunk = @read_chunk.call
|
|
569
584
|
if chunk && !chunk.empty?
|
|
570
585
|
@digest.update(chunk)
|
|
571
|
-
@encoded_buffer << chunk.bytesize
|
|
586
|
+
@encoded_buffer << chunk_size_hex(chunk.bytesize) << "\r\n" << chunk << "\r\n"
|
|
572
587
|
else
|
|
573
588
|
@encoded_buffer << "0\r\n" << trailer_string << "\r\n\r\n"
|
|
574
589
|
@eof = true
|
|
@@ -576,6 +591,10 @@ module Aws
|
|
|
576
591
|
end
|
|
577
592
|
end
|
|
578
593
|
|
|
594
|
+
def chunk_size_hex(bytesize)
|
|
595
|
+
bytesize == @base_chunk_size ? @full_chunk_size_hex : bytesize.to_s(HEX_BASE)
|
|
596
|
+
end
|
|
597
|
+
|
|
579
598
|
def trailer_string
|
|
580
599
|
{ @location_name => @digest.base64digest }.map { |k, v| "#{k}:#{v}" }.join("\r\n")
|
|
581
600
|
end
|
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
|
@@ -9,7 +9,7 @@ module Seahorse
|
|
|
9
9
|
class ShapeRef
|
|
10
10
|
|
|
11
11
|
def initialize(options = {})
|
|
12
|
-
@metadata =
|
|
12
|
+
@metadata = nil
|
|
13
13
|
@required = false
|
|
14
14
|
@deprecated = false
|
|
15
15
|
@location = nil
|
|
@@ -84,7 +84,7 @@ module Seahorse
|
|
|
84
84
|
|
|
85
85
|
# Gets metadata for the given `key`.
|
|
86
86
|
def [](key)
|
|
87
|
-
if @metadata
|
|
87
|
+
if @metadata&.key?(key.to_s)
|
|
88
88
|
@metadata[key.to_s]
|
|
89
89
|
elsif @shape
|
|
90
90
|
@shape[key.to_s]
|
|
@@ -93,7 +93,7 @@ module Seahorse
|
|
|
93
93
|
|
|
94
94
|
# Sets metadata for the given `key`.
|
|
95
95
|
def []=(key, value)
|
|
96
|
-
@metadata[key.to_s] = value
|
|
96
|
+
(@metadata ||= {})[key.to_s] = value
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
end
|
|
@@ -101,7 +101,7 @@ module Seahorse
|
|
|
101
101
|
class Shape
|
|
102
102
|
|
|
103
103
|
def initialize(options = {})
|
|
104
|
-
@metadata =
|
|
104
|
+
@metadata = nil
|
|
105
105
|
options.each_pair do |key, value|
|
|
106
106
|
if respond_to?("#{key}=")
|
|
107
107
|
send("#{key}=", value)
|
|
@@ -122,12 +122,12 @@ module Seahorse
|
|
|
122
122
|
|
|
123
123
|
# Gets metadata for the given `key`.
|
|
124
124
|
def [](key)
|
|
125
|
-
@metadata[key.to_s]
|
|
125
|
+
@metadata && @metadata[key.to_s]
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
# Sets metadata for the given `key`.
|
|
129
129
|
def []=(key, value)
|
|
130
|
-
@metadata[key.to_s] = value
|
|
130
|
+
(@metadata ||= {})[key.to_s] = value
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
end
|