amqp-client 1.1.6 → 1.1.7

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: 10119835607b70ee73dd581f9bef3211a26fc18bb6fb7fa2f6e6bfe913076b16
4
- data.tar.gz: a30989dab30c2dea294c0310bbfd211a36fa7453d935200c6b7783553f5e816c
3
+ metadata.gz: 7b2125fb98c3f0172a05bce1cbf8aa0b6530df76685522c4d25772fa1edd2dc4
4
+ data.tar.gz: 204891c1da627b813f37b160029ab55ecf58c91481949b02dc5bf3b163288d0c
5
5
  SHA512:
6
- metadata.gz: 2658a0f4e151ab9fd0a56d1096e8d6b191b5e5164e27eadb8dc922651664440149fd1eef7b9d410fbcdf781eba3ef046b141c017b3b5d317b241ec7afa2d8150
7
- data.tar.gz: 73695493c9f72619279a5552bdea275f6aa781da3da1dadebb788eaff249f68e088b3eb9fc5cc7c3afab1d6df0b44bd83e18ce2aa3605ace83a00035dfd84890
6
+ metadata.gz: 290ce1a3d301e1119056e39eeb309b55d7fa0752e7bc4b012777ccab7c506f62eef255bffc7b62258bf8a56a22ea46e19f42c00ad91f4b8441b7ecf414c29c8d
7
+ data.tar.gz: 22070957cc3c58d77f7d6c15476943a9f23ab34496dfc473618c4625c4f8531eddcfc8fb92086bf566aaf548d650045c65617ac68d73a49ec07c4ad4f971030a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.1.7] - 2024-05-12
4
+
5
+ - Support for Connection.update-secret
6
+ - Allow sub-second connect_timeout
7
+ - Fixed: undefinied variable if message was returned and no on_return block was set
8
+
3
9
  ## [1.1.6] - 2024-03-26
4
10
 
5
11
  - Fixed: Channel#wait_for_confirms now waits for all confirms, in a thread safe way
data/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @84codes/customer
@@ -522,7 +522,7 @@ module AMQP
522
522
  if @on_return
523
523
  Thread.new { @on_return.call(next_msg) }
524
524
  else
525
- warn "AMQP-Client message returned: #{msg.inspect}"
525
+ warn "AMQP-Client message returned: #{next_msg.inspect}"
526
526
  end
527
527
  elsif next_msg.consumer_tag.nil?
528
528
  @basic_gets.push next_msg
@@ -18,7 +18,7 @@ module AMQP
18
18
  # @option options [Boolean] connection_name (PROGRAM_NAME) Set a name for the connection to be able to identify
19
19
  # the client from the broker
20
20
  # @option options [Boolean] verify_peer (true) Verify broker's TLS certificate, set to false for self-signed certs
21
- # @option options [Integer] connect_timeout (30) TCP connection timeout
21
+ # @option options [Float] connect_timeout (30) TCP connection timeout
22
22
  # @option options [Integer] heartbeat (0) Heartbeat timeout, defaults to 0 and relies on TCP keepalive instead
23
23
  # @option options [Integer] frame_max (131_072) Maximum frame size,
24
24
  # the smallest of the client's and the broker's values will be used
@@ -132,6 +132,16 @@ module AMQP
132
132
  nil
133
133
  end
134
134
 
135
+ # Update authentication secret, for example when an OAuth backend is used
136
+ # @param secret [String] The new secret
137
+ # @param reason [String] A reason to update it
138
+ # @return [nil]
139
+ def update_secret(secret, reason)
140
+ write_bytes FrameBytes.update_secret(secret, reason)
141
+ expect(:update_secret_ok)
142
+ nil
143
+ end
144
+
135
145
  # True if the connection is closed
136
146
  # @return [Boolean]
137
147
  def closed?
@@ -255,6 +265,8 @@ module AMQP
255
265
  when 61 # connection#unblocked
256
266
  @blocked = nil
257
267
  @on_unblocked.call
268
+ when 71 # connection#update_secret_ok
269
+ @replies.push [:update_secret_ok]
258
270
  else raise Error::UnsupportedMethodFrame, class_id, method_id
259
271
  end
260
272
  when 20 # channel
@@ -414,7 +426,7 @@ module AMQP
414
426
  # @return [Socket]
415
427
  # @return [OpenSSL::SSL::SSLSocket]
416
428
  def open_socket(host, port, tls, options)
417
- connect_timeout = options.fetch(:connect_timeout, 30).to_i
429
+ connect_timeout = options.fetch(:connect_timeout, 30).to_f
418
430
  socket = Socket.tcp host, port, connect_timeout: connect_timeout
419
431
  keepalive = options.fetch(:keepalive, "").split(":", 3).map!(&:to_i)
420
432
  enable_tcp_keepalive(socket, *keepalive)
@@ -81,6 +81,20 @@ module AMQP
81
81
  ].pack("C S> L> S> S> C")
82
82
  end
83
83
 
84
+ def self.update_secret(secret, reason)
85
+ frame_size = 4 + 4 + secret.bytesize + 1 + reason.bytesize
86
+ [
87
+ 1, # type: method
88
+ 0, # channel id
89
+ frame_size, # frame size
90
+ 10, # class: connection
91
+ 70, # method: close-ok
92
+ secret.bytesize, secret,
93
+ reason.bytesize, reason,
94
+ 206 # frame end
95
+ ].pack("C S> L> S> S> L>a* Ca* C")
96
+ end
97
+
84
98
  def self.channel_open(id)
85
99
  [
86
100
  1, # type: method
@@ -3,6 +3,6 @@
3
3
  module AMQP
4
4
  class Client
5
5
  # Version of the client library
6
- VERSION = "1.1.6"
6
+ VERSION = "1.1.7"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amqp-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Hörberg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-26 00:00:00.000000000 Z
11
+ date: 2024-05-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Modern AMQP 0-9-1 Ruby client
14
14
  email:
@@ -26,6 +26,7 @@ files:
26
26
  - ".rubocop_todo.yml"
27
27
  - ".yardopts"
28
28
  - CHANGELOG.md
29
+ - CODEOWNERS
29
30
  - Gemfile
30
31
  - LICENSE.txt
31
32
  - README.md
@@ -67,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
68
  - !ruby/object:Gem::Version
68
69
  version: '0'
69
70
  requirements: []
70
- rubygems_version: 3.5.3
71
+ rubygems_version: 3.5.9
71
72
  signing_key:
72
73
  specification_version: 4
73
74
  summary: AMQP 0-9-1 client