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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14d69a27c6e9ab4d821838bda1ea44d24fbfeef46e957a4f635da7f252308370
4
- data.tar.gz: f94300ec6c2781db55bf7acc7f67307ff9f5a25935e659760fcfa6a00182e3f0
3
+ metadata.gz: eae55531a4bf8df3ab71fc6610d7824d11783e0fa37dbe8710be1c2f94ab1a3c
4
+ data.tar.gz: 387f4fea6740becb6ac8d1cf94c192025cf7b8736b23e72dbaac9ab35a262d88
5
5
  SHA512:
6
- metadata.gz: c982cee56307d55c6ff1b23692e7f63ffd4f6898a131c641e98aaab0a896ca712fc1b45380618eb8669cfae2a2b5a5d9c1fb878acfbc951efd7a663318d6ce0c
7
- data.tar.gz: bf509f3108e92cfe72fd05851cb23dbdd0506cd1256eb7cc001b494debeaa0e1d892be44f41abcb3cc8eed05ca795ba4ae445ae021a50fd47282044e20a661d9
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.267.0
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
- loop do
381
- chunk = io.read(CHECKSUM_CHUNK_SIZE)
382
- break unless chunk
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 = @base_chunk_size.to_s(HEX_BASE).size + 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.to_s(HEX_BASE) << "\r\n" << chunk << "\r\n"
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
@@ -1036,7 +1036,7 @@ module Aws::Signin
1036
1036
  tracer: tracer
1037
1037
  )
1038
1038
  context[:gem_name] = 'aws-sdk-core'
1039
- context[:gem_version] = '3.267.0'
1039
+ context[:gem_version] = '3.269.0'
1040
1040
  Seahorse::Client::Request.new(handlers, context)
1041
1041
  end
1042
1042
 
@@ -56,7 +56,7 @@ module Aws::Signin
56
56
  autoload :EndpointProvider, 'aws-sdk-signin/endpoint_provider'
57
57
  autoload :Endpoints, 'aws-sdk-signin/endpoints'
58
58
 
59
- GEM_VERSION = '3.267.0'
59
+ GEM_VERSION = '3.269.0'
60
60
 
61
61
  end
62
62
 
@@ -704,7 +704,7 @@ module Aws::SSO
704
704
  tracer: tracer
705
705
  )
706
706
  context[:gem_name] = 'aws-sdk-core'
707
- context[:gem_version] = '3.267.0'
707
+ context[:gem_version] = '3.269.0'
708
708
  Seahorse::Client::Request.new(handlers, context)
709
709
  end
710
710
 
data/lib/aws-sdk-sso.rb CHANGED
@@ -56,7 +56,7 @@ module Aws::SSO
56
56
  autoload :EndpointProvider, 'aws-sdk-sso/endpoint_provider'
57
57
  autoload :Endpoints, 'aws-sdk-sso/endpoints'
58
58
 
59
- GEM_VERSION = '3.267.0'
59
+ GEM_VERSION = '3.269.0'
60
60
 
61
61
  end
62
62
 
@@ -1087,7 +1087,7 @@ module Aws::SSOOIDC
1087
1087
  tracer: tracer
1088
1088
  )
1089
1089
  context[:gem_name] = 'aws-sdk-core'
1090
- context[:gem_version] = '3.267.0'
1090
+ context[:gem_version] = '3.269.0'
1091
1091
  Seahorse::Client::Request.new(handlers, context)
1092
1092
  end
1093
1093
 
@@ -56,7 +56,7 @@ module Aws::SSOOIDC
56
56
  autoload :EndpointProvider, 'aws-sdk-ssooidc/endpoint_provider'
57
57
  autoload :Endpoints, 'aws-sdk-ssooidc/endpoints'
58
58
 
59
- GEM_VERSION = '3.267.0'
59
+ GEM_VERSION = '3.269.0'
60
60
 
61
61
  end
62
62
 
@@ -2808,7 +2808,7 @@ module Aws::STS
2808
2808
  tracer: tracer
2809
2809
  )
2810
2810
  context[:gem_name] = 'aws-sdk-core'
2811
- context[:gem_version] = '3.267.0'
2811
+ context[:gem_version] = '3.269.0'
2812
2812
  Seahorse::Client::Request.new(handlers, context)
2813
2813
  end
2814
2814
 
data/lib/aws-sdk-sts.rb CHANGED
@@ -56,7 +56,7 @@ module Aws::STS
56
56
  autoload :EndpointProvider, 'aws-sdk-sts/endpoint_provider'
57
57
  autoload :Endpoints, 'aws-sdk-sts/endpoints'
58
58
 
59
- GEM_VERSION = '3.267.0'
59
+ GEM_VERSION = '3.269.0'
60
60
 
61
61
  end
62
62
 
@@ -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.key?(key.to_s)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.267.0
4
+ version: 3.269.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services