amq-protocol 2.8.0 → 2.10.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: 7cd695fb0f7f7cc8c9d80109f349fdba92c500b5b8eea4ff6ea2c5e6dfdddd8d
4
- data.tar.gz: 929be34e6f1bd9c2f84fded2933e9f3775286e19babbabac45ce0ccab1b3c38d
3
+ metadata.gz: c9d86e9107594df07b07d144717a895fb0551f09274e7b02dd6d9133837a8b18
4
+ data.tar.gz: e7bfe990d54202a39787157e89fddbca53214a9045514cacf3e9055939171e9b
5
5
  SHA512:
6
- metadata.gz: 990e85acbfc80b8dbfa1be036705afdef1f96fdae2b1c8270ff00c972483925361d9dbb7807309fca6a0db55c3d795f8da34d3255f153ff463cda2d12ceed918
7
- data.tar.gz: 62f8b49269c978f162a21aced9eb22702ae676e28589da94f66b1560083c66878584a1999fa0611f4be1f205a402539b228f0d165107dc930d7a7112801cb8aa
6
+ metadata.gz: bb6d4dbd04ebd7526c4c12c13d2ad37e71912b7084b4459fc0694942c6e1cf814c9aa1315546e5b4e180145bb3a54c67e0c237250ddd1772e7fca5085e0eb5c1
7
+ data.tar.gz: 502a34f35b6dc6a6962f614a43bd0fa7a745bc1a46112174e544fbf151b8a6da5ddccbc76181ba5084510f4e6cefceb9121beca04d4b6049bfab6e55cd13399a
data/ChangeLog.md CHANGED
@@ -1,6 +1,38 @@
1
- ## Changes between 2.8.0 and 2.9.0 (unreleased)
1
+ ## Changes between 2.9.0 and 2.10.0 (Nov 2, 2026)
2
+
3
+ ### TLS Peer Verification Is No Longer Disabled by Default
4
+
5
+ An `amqps://` URI without `?verify=` no longer disables peer verification,
6
+ so clients such as Bunny apply their own default (`verify_peer: true` in Bunny's case).
7
+ Use `?verify=false` to opt out.
8
+
9
+ Brokers with self-signed or private-CA certificates now need `?cacertfile=`
10
+ in the URI.
11
+
12
+ Reported by Matthew Mongeau (Ruby Central).
13
+
14
+ GitHub advisory: [GHSA-499w-x7r4-fw7p](https://github.com/ruby-amqp/amq-protocol/security/advisories/GHSA-499w-x7r4-fw7p)
15
+
16
+
17
+ ## Changes between 2.8.0 and 2.9.0 (Aug 26, 2026)
18
+
19
+ ### amq-protocol Now Requires Ruby 3.2
20
+
21
+ Ruby 3.0 and 3.1 are end of life. The URI parser now uses
22
+ `URI.decode_uri_component`, which Ruby 3.2 provides.
23
+
24
+
25
+ ### URI Components Are Percent-Decoded, Not Form-Decoded
26
+
27
+ `AMQ::URI.parse` decoded the username, password and virtual host with
28
+ `CGI.unescape`, so a password such as `pa+ss` was parsed as `pa ss` and failed
29
+ to authenticate. They are now percent-decoded; use `%20` where a `+` used to
30
+ mean a space.
31
+
32
+ Contributed by @eglitobias.
33
+
34
+ GitHub issue: [#89](https://github.com/ruby-amqp/amq-protocol/pull/89)
2
35
 
3
- No changes yet.
4
36
 
5
37
  ## Changes between 2.7.0 and 2.8.0 (Apr 25, 2026)
6
38
 
data/README.md CHANGED
@@ -9,6 +9,8 @@ needs for you, including RabbitMQ extensions to AMQP 0.9.1.
9
9
 
10
10
  ## Supported Ruby Versions
11
11
 
12
+ * amq-protocol `2.9.0` requires Ruby 3.2 or later
13
+ * amq-protocol `2.8.0` requires Ruby 3.0 or later
12
14
  * amq-protocol `2.3.4` has fixes for Ruby 3.5 compatibility
13
15
  * amq-protocol `2.3.3` has fixes for Ruby 3.4 compatibility
14
16
  * amq-protocol `2.3.0` only supports Ruby 2.2+.
@@ -1,5 +1,5 @@
1
1
  module AMQ
2
2
  module Protocol
3
- VERSION = "2.8.0"
3
+ VERSION = "2.10.0"
4
4
  end # Protocol
5
5
  end # AMQ
data/lib/amq/settings.rb CHANGED
@@ -33,8 +33,8 @@ module AMQ
33
33
 
34
34
  # ssl parameters
35
35
  ssl: false,
36
- verify: false,
37
- fail_if_no_peer_cert: false,
36
+ verify: nil,
37
+ fail_if_no_peer_cert: nil,
38
38
  cacertfile: nil,
39
39
  certfile: nil,
40
40
  keyfile: nil
@@ -57,8 +57,8 @@ module AMQ
57
57
  # @option settings [Integer] :connection_timeout (nil) Time in milliseconds to wait while establishing a TCP connection to the server before giving up.
58
58
  # @option settings [Fixnum] :channel_max (nil) Maximum number of channels to permit on this connection.
59
59
  # @option settings [Array] :auth_mechanism ([]) SASL authentication mechanisms to consider when negotiating a mechanism with the server. This parameter can be specified multiple times to specify multiple mechanisms, e.g. `?auth_mechanism=plain&auth_mechanism=amqplain`.
60
- # @option settings [Boolean] :verify (false) Controls peer verification mode.
61
- # @option settings [Boolean] :fail_if_no_peer_cert (false) When set to true, TLS connection will be rejected if client fails to provide a certificate.
60
+ # @option settings [Boolean] :verify (nil) Controls peer verification mode. nil means "not specified", leaving the default to the client.
61
+ # @option settings [Boolean] :fail_if_no_peer_cert (nil) When set to true, TLS connection will be rejected if client fails to provide a certificate.
62
62
  # @option settings [String] :cacertfile (nil) Certificate Authority (CA) certificate file path.
63
63
  # @option settings [String] :certfile (nil) Server certificate file path.
64
64
  # @option settings [String] :keyfile (nil) Server private key file path.
data/lib/amq/uri.rb CHANGED
@@ -1,10 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- if RUBY_VERSION < "3.5"
4
- require "cgi/util"
5
- else
6
- require "cgi/escape"
7
- end
8
3
  require "uri"
9
4
 
10
5
  module AMQ
@@ -22,8 +17,8 @@ module AMQ
22
17
  connection_timeout: nil,
23
18
  channel_max: nil,
24
19
  auth_mechanism: [],
25
- verify: false,
26
- fail_if_no_peer_cert: false,
20
+ verify: nil,
21
+ fail_if_no_peer_cert: nil,
27
22
  cacertfile: nil,
28
23
  certfile: nil,
29
24
  keyfile: nil
@@ -38,8 +33,8 @@ module AMQ
38
33
  opts = DEFAULTS.dup
39
34
 
40
35
  opts[:scheme] = uri.scheme
41
- opts[:user] = ::CGI::unescape(uri.user) if uri.user
42
- opts[:pass] = ::CGI::unescape(uri.password) if uri.password
36
+ opts[:user] = ::URI.decode_uri_component(uri.user) if uri.user
37
+ opts[:pass] = ::URI.decode_uri_component(uri.password) if uri.password
43
38
  opts[:host] = uri.host if uri.host and uri.host != ""
44
39
  opts[:port] = uri.port || AMQP_DEFAULT_PORTS[uri.scheme]
45
40
  opts[:ssl] = uri.scheme.to_s.downcase =~ /amqps/i # TODO: rename to tls
@@ -47,7 +42,7 @@ module AMQ
47
42
  if $1.index('/')
48
43
  raise ArgumentError, "#{uri} has multiple-segment path; please percent-encode any slashes in the vhost name (e.g. /production => %2Fproduction). Learn more at http://bit.ly/amqp-gem-and-connection-uris"
49
44
  end
50
- opts[:vhost] = ::CGI::unescape($1)
45
+ opts[:vhost] = ::URI.decode_uri_component($1)
51
46
  end
52
47
 
53
48
  if uri.query
@@ -74,11 +69,13 @@ module AMQ
74
69
  end
75
70
 
76
71
  %w(verify fail_if_no_peer_cert).each do |tls_option|
77
- if query_params[tls_option] && uri.scheme == "amqp"
72
+ # absent means "not specified" so that clients can apply their own (secure) defaults
73
+ next if query_params[tls_option].nil?
74
+
75
+ if uri.scheme == "amqp"
78
76
  raise ArgumentError, "The option '#{tls_option}' can only be used in URIs that use amqps schema"
79
- else
80
- opts[tls_option.to_sym] = as_boolean(query_params[tls_option])
81
77
  end
78
+ opts[tls_option.to_sym] = as_boolean(query_params[tls_option])
82
79
  end
83
80
  end
84
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amq-protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Stastny
@@ -10,7 +10,7 @@ authors:
10
10
  - Mark Abramov
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-04-26 00:00:00.000000000 Z
13
+ date: 1980-01-02 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: |2
16
16
  amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not a
@@ -54,14 +54,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- version: '3.0'
57
+ version: '3.2'
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.6.2
64
+ rubygems_version: 4.0.16
65
65
  specification_version: 4
66
66
  summary: AMQP 0.9.1 encoding & decoding library.
67
67
  test_files: []