aws-sdk-sqs 1.70.0 → 1.72.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 +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-sqs/client.rb +70 -46
- data/lib/aws-sdk-sqs/plugins/md5s.rb +84 -35
- data/lib/aws-sdk-sqs.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc33461fcd4ab13322dca0464f15da04a78ecc9a7f35a0019d528486f815d80
|
4
|
+
data.tar.gz: 12e287ef33fdf91219e1fd26749c758667302b234d7a8ef17ab6d88d56003e76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
1
|
+
1.72.0
|
data/lib/aws-sdk-sqs/client.rb
CHANGED
@@ -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
|
-
#
|
205
|
-
#
|
206
|
-
#
|
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 [
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
366
|
-
#
|
367
|
-
#
|
368
|
-
#
|
369
|
-
#
|
370
|
-
#
|
371
|
-
# @option options [Float] :
|
372
|
-
#
|
373
|
-
#
|
374
|
-
#
|
375
|
-
#
|
376
|
-
#
|
377
|
-
#
|
378
|
-
#
|
379
|
-
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
#
|
384
|
-
#
|
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 [
|
387
|
-
#
|
420
|
+
# @option options [String] :ssl_ca_store
|
421
|
+
# Sets the X509::Store to verify peer certificate.
|
388
422
|
#
|
389
|
-
# @option options [
|
390
|
-
#
|
391
|
-
# connection.
|
423
|
+
# @option options [Float] :ssl_timeout
|
424
|
+
# Sets the SSL timeout in seconds
|
392
425
|
#
|
393
|
-
# @option options [
|
394
|
-
#
|
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.
|
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
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
98
|
-
|
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]
|
124
|
+
if !attribute[:string_value].nil?
|
101
125
|
encoded[name] << encode_length_and_string(attribute[:string_value])
|
102
|
-
elsif attribute[:binary_value]
|
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*'
|
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
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
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
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.
|
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-
|
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.
|
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.
|
32
|
+
version: 3.193.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: aws-sigv4
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|