aws-sdk-sqs 1.70.0 → 1.72.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e39a9eb3e92b4f93130e52d3e002ba963cd03c5f5e755cf339e8c85883ee10a7
4
- data.tar.gz: 8efebea51d0957b0d17e558b4ba79108827eda88454d5b54463b3a4c3d073093
3
+ metadata.gz: 5bc33461fcd4ab13322dca0464f15da04a78ecc9a7f35a0019d528486f815d80
4
+ data.tar.gz: 12e287ef33fdf91219e1fd26749c758667302b234d7a8ef17ab6d88d56003e76
5
5
  SHA512:
6
- metadata.gz: e815e358570d6098594e80bb81c32c2795dfc7f8b92592f1c5646867781e1f57c1220f80efe3e7e2424c7ef7334f3194ddb58c0f1533f9dddfa14f41fd74967c
7
- data.tar.gz: 210fb2b41bb8d08d460fb293a0ba6c336a9afdcd2630fd37a003852ac162cbc71aae986ee68075413e88c4765d8e6f693554a35a6d1be8c8da895badb4ed97ec
6
+ metadata.gz: d6b3398c64232fb1d2b608d899e5a51989cbb02a15bcb0429ccc167ce20a2d4616195bfa8035ee8e1d77192b4fba33bcccb861e62cbafb2242280cf1a717d68f
7
+ data.tar.gz: 6feb77d8953a9fec2461122819de5fd44b3c12a48e10a864a05db92e0a6dec7425e24aea353f0f0b3e09fcb6335bcfa4c7b0724c65951e918cd2a7b3faa67874
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.72.0 (2024-04-30)
5
+ ------------------
6
+
7
+ * Feature - Handle System Message Attributes MD5 verification.
8
+
9
+ 1.71.0 (2024-04-25)
10
+ ------------------
11
+
12
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
13
+
4
14
  1.70.0 (2024-01-26)
5
15
  ------------------
6
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.70.0
1
+ 1.72.0
@@ -22,6 +22,7 @@ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
22
22
  require 'aws-sdk-core/plugins/response_paging.rb'
23
23
  require 'aws-sdk-core/plugins/stub_responses.rb'
24
24
  require 'aws-sdk-core/plugins/idempotency_token.rb'
25
+ require 'aws-sdk-core/plugins/invocation_id.rb'
25
26
  require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
26
27
  require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
28
  require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
@@ -74,6 +75,7 @@ module Aws::SQS
74
75
  add_plugin(Aws::Plugins::ResponsePaging)
75
76
  add_plugin(Aws::Plugins::StubResponses)
76
77
  add_plugin(Aws::Plugins::IdempotencyToken)
78
+ add_plugin(Aws::Plugins::InvocationId)
77
79
  add_plugin(Aws::Plugins::JsonvalueConverter)
78
80
  add_plugin(Aws::Plugins::ClientMetricsPlugin)
79
81
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
@@ -200,10 +202,17 @@ module Aws::SQS
200
202
  # When set to 'true' the request body will not be compressed
201
203
  # for supported operations.
202
204
  #
203
- # @option options [String] :endpoint
204
- # The client endpoint is normally constructed from the `:region`
205
- # option. You should only configure an `:endpoint` when connecting
206
- # to test or custom endpoints. This should be a valid HTTP(S) URI.
205
+ # @option options [String, URI::HTTPS, URI::HTTP] :endpoint
206
+ # Normally you should not configure the `:endpoint` option
207
+ # directly. This is normally constructed from the `:region`
208
+ # option. Configuring `:endpoint` is normally reserved for
209
+ # connecting to test or custom endpoints. The endpoint should
210
+ # be a URI formatted like:
211
+ #
212
+ # 'http://example.com'
213
+ # 'https://example.com'
214
+ # 'http://example.com:123'
215
+ #
207
216
  #
208
217
  # @option options [Integer] :endpoint_cache_max_entries (1000)
209
218
  # Used for the maximum size limit of the LRU cache storing endpoints data
@@ -357,50 +366,65 @@ module Aws::SQS
357
366
  # @option options [Aws::SQS::EndpointProvider] :endpoint_provider
358
367
  # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::SQS::EndpointParameters`
359
368
  #
360
- # @option options [URI::HTTP,String] :http_proxy A proxy to send
361
- # requests through. Formatted like 'http://proxy.com:123'.
362
- #
363
- # @option options [Float] :http_open_timeout (15) The number of
364
- # seconds to wait when opening a HTTP session before raising a
365
- # `Timeout::Error`.
366
- #
367
- # @option options [Float] :http_read_timeout (60) The default
368
- # number of seconds to wait for response data. This value can
369
- # safely be set per-request on the session.
370
- #
371
- # @option options [Float] :http_idle_timeout (5) The number of
372
- # seconds a connection is allowed to sit idle before it is
373
- # considered stale. Stale connections are closed and removed
374
- # from the pool before making a request.
375
- #
376
- # @option options [Float] :http_continue_timeout (1) The number of
377
- # seconds to wait for a 100-continue response before sending the
378
- # request body. This option has no effect unless the request has
379
- # "Expect" header set to "100-continue". Defaults to `nil` which
380
- # disables this behaviour. This value can safely be set per
381
- # request on the session.
382
- #
383
- # @option options [Float] :ssl_timeout (nil) Sets the SSL timeout
384
- # in seconds.
369
+ # @option options [Float] :http_continue_timeout (1)
370
+ # The number of seconds to wait for a 100-continue response before sending the
371
+ # request body. This option has no effect unless the request has "Expect"
372
+ # header set to "100-continue". Defaults to `nil` which disables this
373
+ # behaviour. This value can safely be set per request on the session.
374
+ #
375
+ # @option options [Float] :http_idle_timeout (5)
376
+ # The number of seconds a connection is allowed to sit idle before it
377
+ # is considered stale. Stale connections are closed and removed from the
378
+ # pool before making a request.
379
+ #
380
+ # @option options [Float] :http_open_timeout (15)
381
+ # The default number of seconds to wait for response data.
382
+ # This value can safely be set per-request on the session.
383
+ #
384
+ # @option options [URI::HTTP,String] :http_proxy
385
+ # A proxy to send requests through. Formatted like 'http://proxy.com:123'.
386
+ #
387
+ # @option options [Float] :http_read_timeout (60)
388
+ # The default number of seconds to wait for response data.
389
+ # This value can safely be set per-request on the session.
390
+ #
391
+ # @option options [Boolean] :http_wire_trace (false)
392
+ # When `true`, HTTP debug output will be sent to the `:logger`.
393
+ #
394
+ # @option options [Proc] :on_chunk_received
395
+ # When a Proc object is provided, it will be used as callback when each chunk
396
+ # of the response body is received. It provides three arguments: the chunk,
397
+ # the number of bytes received, and the total number of
398
+ # bytes in the response (or nil if the server did not send a `content-length`).
399
+ #
400
+ # @option options [Proc] :on_chunk_sent
401
+ # When a Proc object is provided, it will be used as callback when each chunk
402
+ # of the request body is sent. It provides three arguments: the chunk,
403
+ # the number of bytes read from the body, and the total number of
404
+ # bytes in the body.
405
+ #
406
+ # @option options [Boolean] :raise_response_errors (true)
407
+ # When `true`, response errors are raised.
408
+ #
409
+ # @option options [String] :ssl_ca_bundle
410
+ # Full path to the SSL certificate authority bundle file that should be used when
411
+ # verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
412
+ # `:ssl_ca_directory` the the system default will be used if available.
413
+ #
414
+ # @option options [String] :ssl_ca_directory
415
+ # Full path of the directory that contains the unbundled SSL certificate
416
+ # authority files for verifying peer certificates. If you do
417
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
418
+ # default will be used if available.
385
419
  #
386
- # @option options [Boolean] :http_wire_trace (false) When `true`,
387
- # HTTP debug output will be sent to the `:logger`.
420
+ # @option options [String] :ssl_ca_store
421
+ # Sets the X509::Store to verify peer certificate.
388
422
  #
389
- # @option options [Boolean] :ssl_verify_peer (true) When `true`,
390
- # SSL peer certificates are verified when establishing a
391
- # connection.
423
+ # @option options [Float] :ssl_timeout
424
+ # Sets the SSL timeout in seconds
392
425
  #
393
- # @option options [String] :ssl_ca_bundle Full path to the SSL
394
- # certificate authority bundle file that should be used when
395
- # verifying peer certificates. If you do not pass
396
- # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
397
- # will be used if available.
398
- #
399
- # @option options [String] :ssl_ca_directory Full path of the
400
- # directory that contains the unbundled SSL certificate
401
- # authority files for verifying peer certificates. If you do
402
- # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
403
- # system default will be used if available.
426
+ # @option options [Boolean] :ssl_verify_peer (true)
427
+ # When `true`, SSL peer certificates are verified when establishing a connection.
404
428
  #
405
429
  def initialize(*args)
406
430
  super
@@ -2796,7 +2820,7 @@ module Aws::SQS
2796
2820
  params: params,
2797
2821
  config: config)
2798
2822
  context[:gem_name] = 'aws-sdk-sqs'
2799
- context[:gem_version] = '1.70.0'
2823
+ context[:gem_version] = '1.72.0'
2800
2824
  Seahorse::Client::Request.new(handlers, context)
2801
2825
  end
2802
2826
 
@@ -6,7 +6,6 @@ module Aws
6
6
  module SQS
7
7
  module Plugins
8
8
  class Md5s < Seahorse::Client::Plugin
9
-
10
9
  # @api private
11
10
  class Handler < Seahorse::Client::Handler
12
11
  def call(context)
@@ -26,16 +25,17 @@ module Aws
26
25
  'String' => 1,
27
26
  'Binary' => 2,
28
27
  'Number' => 1
29
- }
28
+ }.freeze
30
29
 
31
- DATA_TYPE = /\A(String|Binary|Number)(\..+)?\z/
30
+ DATA_TYPE = /\A(String|Binary|Number)(\..+)?\z/.freeze
32
31
 
33
32
  NORMALIZED_ENCODING = Encoding::UTF_8
34
33
 
35
34
  def validate_send_message(context, response)
36
35
  body = context.params[:message_body]
37
36
  attributes = context.params[:message_attributes]
38
- validate_single_message(body, attributes, response)
37
+ system_attributes = context.params[:message_system_attributes]
38
+ validate_single_message(body, attributes, system_attributes, response)
39
39
  end
40
40
 
41
41
  def validate_send_message_batch(context, response)
@@ -43,63 +43,87 @@ module Aws
43
43
  id = entry[:id]
44
44
  body = entry[:message_body]
45
45
  attributes = entry[:message_attributes]
46
+ system_attributes = entry[:message_system_attributes]
46
47
  message_response = response.successful.select { |r| r.id == id }[0]
47
48
  unless message_response.nil?
48
- validate_single_message(body, attributes, message_response)
49
+ validate_single_message(body, attributes, system_attributes, message_response)
49
50
  end
50
51
  end
51
52
  end
52
53
 
53
- def validate_single_message(body, attributes, response)
54
+ def validate_single_message(body, attributes, system_attributes, response)
54
55
  validate_body(body, response)
55
56
  unless attributes.nil? || attributes.empty?
56
57
  validate_attributes(attributes, response)
57
58
  end
59
+ unless system_attributes.nil? || system_attributes.empty?
60
+ validate_system_attributes(system_attributes, response)
61
+ end
58
62
  end
59
63
 
60
64
  def validate_body(body, response)
61
65
  calculated_md5 = md5_of_message_body(body)
62
66
  returned_md5 = response.md5_of_message_body
63
- if calculated_md5 != returned_md5
64
- error_message = mismatch_error_message(
65
- 'message body',
66
- calculated_md5,
67
- returned_md5,
68
- response)
69
- raise Aws::Errors::ChecksumError, error_message
70
- end
67
+ return unless calculated_md5 != returned_md5
68
+
69
+ error_message = mismatch_error_message(
70
+ 'message body',
71
+ calculated_md5,
72
+ returned_md5,
73
+ response
74
+ )
75
+ raise Aws::Errors::ChecksumError, error_message
71
76
  end
72
77
 
73
78
  def validate_attributes(attributes, response)
74
79
  calculated_md5 = md5_of_message_attributes(attributes)
75
80
  returned_md5 = response.md5_of_message_attributes
76
- if returned_md5 != calculated_md5
77
- error_message = mismatch_error_message(
78
- 'message attributes',
79
- calculated_md5,
80
- returned_md5,
81
- response)
82
- raise Aws::Errors::ChecksumError, error_message
83
- end
81
+ return unless returned_md5 != calculated_md5
82
+
83
+ error_message = mismatch_error_message(
84
+ 'message attributes',
85
+ calculated_md5,
86
+ returned_md5,
87
+ response
88
+ )
89
+ raise Aws::Errors::ChecksumError, error_message
90
+ end
91
+
92
+ def validate_system_attributes(system_attributes, response)
93
+ calculated_md5 = md5_of_message_system_attributes(system_attributes)
94
+ returned_md5 = response.md5_of_message_system_attributes
95
+ return unless returned_md5 != calculated_md5
96
+
97
+ error_message = mismatch_error_message(
98
+ 'message system attributes',
99
+ calculated_md5,
100
+ returned_md5,
101
+ response
102
+ )
103
+ raise Aws::Errors::ChecksumError, error_message
84
104
  end
85
105
 
86
106
  def md5_of_message_body(message_body)
87
107
  OpenSSL::Digest::MD5.hexdigest(message_body)
88
108
  end
89
109
 
110
+ # MD5 of Message Attributes and System Attributes are effectively
111
+ # the same calculation. However, keeping these as two methods because
112
+ # they are modeled as two different shapes.
113
+ ###
90
114
  def md5_of_message_attributes(message_attributes)
91
- encoded = { }
115
+ encoded = {}
92
116
  message_attributes.each do |name, attribute|
93
117
  name = name.to_s
94
118
  encoded[name] = String.new
95
119
  data_type_without_label = DATA_TYPE.match(attribute[:data_type])[1]
96
120
  encoded[name] << encode_length_and_bytes(name) <<
97
- encode_length_and_bytes(attribute[:data_type]) <<
98
- [TRANSPORT_TYPE_ENCODINGS[data_type_without_label]].pack('C'.freeze)
121
+ encode_length_and_bytes(attribute[:data_type]) <<
122
+ [TRANSPORT_TYPE_ENCODINGS[data_type_without_label]].pack('C')
99
123
 
100
- if attribute[:string_value] != nil
124
+ if !attribute[:string_value].nil?
101
125
  encoded[name] << encode_length_and_string(attribute[:string_value])
102
- elsif attribute[:binary_value] != nil
126
+ elsif !attribute[:binary_value].nil?
103
127
  encoded[name] << encode_length_and_bytes(attribute[:binary_value])
104
128
  end
105
129
  end
@@ -110,6 +134,30 @@ module Aws
110
134
  OpenSSL::Digest::MD5.hexdigest(buffer)
111
135
  end
112
136
 
137
+ def md5_of_message_system_attributes(message_system_attributes)
138
+ encoded = {}
139
+ message_system_attributes.each do |name, attribute|
140
+ name = name.to_s
141
+ encoded[name] = String.new
142
+ data_type_without_label = DATA_TYPE.match(attribute[:data_type])[1]
143
+ encoded[name] << encode_length_and_bytes(name) <<
144
+ encode_length_and_bytes(attribute[:data_type]) <<
145
+ [TRANSPORT_TYPE_ENCODINGS[data_type_without_label]].pack('C')
146
+
147
+ if !attribute[:string_value].nil?
148
+ encoded[name] << encode_length_and_string(attribute[:string_value])
149
+ elsif !attribute[:binary_value].nil?
150
+ encoded[name] << encode_length_and_bytes(attribute[:binary_value])
151
+ end
152
+ end
153
+
154
+ buffer = encoded.keys.sort.reduce(String.new) do |string, name|
155
+ string << encoded[name]
156
+ end
157
+ OpenSSL::Digest::MD5.hexdigest(buffer)
158
+ end
159
+ ###
160
+
113
161
  def encode_length_and_string(string)
114
162
  string = String.new(string)
115
163
  string.encode!(NORMALIZED_ENCODING)
@@ -117,7 +165,7 @@ module Aws
117
165
  end
118
166
 
119
167
  def encode_length_and_bytes(bytes)
120
- [bytes.bytesize, bytes].pack('L>a*'.freeze)
168
+ [bytes.bytesize, bytes].pack('L>a*')
121
169
  end
122
170
 
123
171
  def mismatch_error_message(section, local_md5, returned_md5, response)
@@ -154,13 +202,14 @@ not match.
154
202
  end
155
203
 
156
204
  def add_handlers(handlers, config)
157
- if config.verify_checksums
158
- handlers.add(Handler, {
159
- priority: 10 ,
160
- step: :validate,
161
- operations: [:send_message, :send_message_batch]
162
- })
163
- end
205
+ return unless config.verify_checksums
206
+
207
+ handlers.add(
208
+ Handler,
209
+ priority: 10,
210
+ step: :validate,
211
+ operations: %i[send_message send_message_batch]
212
+ )
164
213
  end
165
214
  end
166
215
  end
data/lib/aws-sdk-sqs.rb CHANGED
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-sqs/customizations'
54
54
  # @!group service
55
55
  module Aws::SQS
56
56
 
57
- GEM_VERSION = '1.70.0'
57
+ GEM_VERSION = '1.72.0'
58
58
 
59
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-sqs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.70.0
4
+ version: 1.72.0
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: 2024-01-26 00:00:00.000000000 Z
11
+ date: 2024-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.191.0
22
+ version: 3.193.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.191.0
32
+ version: 3.193.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: aws-sigv4
35
35
  requirement: !ruby/object:Gem::Requirement