omq-backend-rust 0.3.0-java → 0.3.1-java

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: 9895c2e753f379324c116f3082c76ab5d562e9d5b7e00539073bdfdd90fa2ac9
4
- data.tar.gz: 11cdd6699b6e7efa69a2e8e84a65641406732d3fffb33326311925c009b98c24
3
+ metadata.gz: f370ba47ebe7a1863dc94d2b6cecca7560a426fc5ba6b2f81526e74b04deb1a8
4
+ data.tar.gz: 80e0ff8cd0b407cdf8dfbcc9ee6563449f4b00a6f7d0a8f3c0eceb3774fdd973
5
5
  SHA512:
6
- metadata.gz: 58c0e0103fe6cffd7d73373045cdce94f113f9c7d520e7a7de909e7a311618318790e5bf7c01685efb83f7bea927b5af7588474189942c29f1f38a4f2ea36d3b
7
- data.tar.gz: 95dc600672be8c9ee8a5341b79ce090856ed8129053437fb4ca340d70e039cea9f980cc751ebffb1504f035ac827a1aee4ac837fc0da909e30db379e1c487a41
6
+ metadata.gz: c9f91b9f1e972858ee6bc2a12d7b351c038c4abe121eae58aa1b8063dba1afeb531676c1d01dd90dfd264e52e2027f06c6dbfbb48cdfe5b8d9faaac78e1b1190
7
+ data.tar.gz: 848d48b548e5a2ff5051ff860432daf63200deeae42603d3c587f6e695fdb43373ee9340867e53fd698fd22c2b6b9b9ecabcba9d800effc1cf17a457683fd8ef
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.1] - 2026-10-15
6
+
7
+ ### Fixed
8
+
9
+ - Resolve RADIO subscriber readiness on `join_received` monitor events.
10
+ - Reject unsupported security mechanisms instead of silently using NULL.
11
+ - Forward CURVE authenticators on MRI, TruffleRuby, and JRuby, preserving the
12
+ Ruby `PeerInfo` and crypto public-key types.
13
+ - Reject JRuby authenticator configuration when the OMQ.java callback classes
14
+ are missing from the JVM classpath.
15
+
16
+ ### Changed
17
+
18
+ - Require `omq-rs >= 0.2.5` for native authentication callbacks and REQ/REP
19
+ fixes: reject unrelated REQ replies and bodyless REP requests, and preserve
20
+ REP reply destinations across prefetched requests and disconnects.
21
+
5
22
  ## [0.3.0] - 2026-08-26
6
23
 
7
24
  ### Added
data/README.md CHANGED
@@ -12,8 +12,11 @@ MRI and TruffleRuby, or through OMQ.java on JRuby.
12
12
 
13
13
  ## Install
14
14
 
15
- The `omq-rs` dependency compiles OMQ.rs during installation on MRI and
16
- TruffleRuby. JRuby uses OMQ.java on Java 25 or newer. The Java gem selects the
15
+ The `omq-rs >= 0.2.5` dependency compiles OMQ.rs during installation on MRI
16
+ and TruffleRuby. This minimum includes the REQ/REP envelope and reply-routing
17
+ fixes in `omq-tokio` 0.28.1 and `omq-proto` 0.32.1.
18
+
19
+ JRuby uses OMQ.java on Java 25 or newer. The Java gem selects the
17
20
  matching OMQ.java artifact on Linux x86_64, macOS aarch64, macOS x86_64, and
18
21
  Windows x86_64.
19
22
 
@@ -48,8 +51,7 @@ ensure
48
51
  end
49
52
  ```
50
53
 
51
- The `:rust` backend is fully interoperable with the default `:ruby` backend.
52
- Mix backends freely within the same process.
54
+ Select a backend per socket to exchange ZMTP messages with Ruby and other peers.
53
55
 
54
56
  ## Supported socket types
55
57
 
@@ -62,6 +64,23 @@ SCATTER/GATHER, CHANNEL.
62
64
  - **NULL** (default)
63
65
  - **CURVE** (CurveZMQ, via [Nuckle](https://github.com/paddor/nuckle))
64
66
 
67
+ CURVE authenticators receive `Protocol::ZMTP::PeerInfo`, including a public key
68
+ from the configured crypto backend. As with the Ruby engine, the identity is
69
+ empty during authentication.
70
+
71
+ On JRuby, OMQ.java 0.3.0's JNI callback threads require the platform jar on the
72
+ JVM `CLASSPATH`. For example:
73
+
74
+ ```sh
75
+ CLASSPATH="$HOME/.m2/repository/io/github/paddor/omq-java/0.3.0/omq-java-0.3.0-linux-x86_64.jar" jruby app.rb
76
+ ```
77
+
78
+ Without it, configuring a CURVE authenticator raises `ArgumentError` before
79
+ opening a connection. CURVE without an authenticator does not need this workaround.
80
+
81
+ PLAIN and custom mechanisms raise `ArgumentError` before binding, connecting,
82
+ or sending. They are not supported by this adapter.
83
+
65
84
  ## Compressed transports
66
85
 
67
86
  The Rust backend supports `lz4+tcp://` and `zstd+tcp://`. Compression
@@ -426,8 +426,11 @@ module OMQ
426
426
 
427
427
  def apply_mechanism(builder)
428
428
  mech = @options.mechanism
429
- klass = mech.class.name
430
- return unless klass&.include?("Curve")
429
+ return if mech.nil? || mech.instance_of?(Protocol::ZMTP::Mechanism::Null)
430
+
431
+ unless defined?(Protocol::ZMTP::Mechanism::Curve) && mech.instance_of?(Protocol::ZMTP::Mechanism::Curve)
432
+ raise ArgumentError, "Rust backend does not support security mechanism #{mech.class}"
433
+ end
431
434
 
432
435
  require "protocol/zmtp/z85"
433
436
 
@@ -437,13 +440,32 @@ module OMQ
437
440
  )
438
441
 
439
442
  if mech.instance_variable_get(:@as_server)
440
- builder.curveServer(keypair)
443
+ if (authenticator = mech.instance_variable_get(:@authenticator))
444
+ validate_authenticator_classpath!
445
+ crypto = mech.instance_variable_get(:@crypto)
446
+ callback = lambda do |peer|
447
+ public_key = crypto::PublicKey.new(Protocol::ZMTP::Z85.decode(peer.publicKey.orElse(nil)))
448
+ !!authenticator.call(Protocol::ZMTP::PeerInfo.new(public_key: public_key, identity: ""))
449
+ end
450
+ builder.curveServer(keypair, callback)
451
+ else
452
+ builder.curveServer(keypair)
453
+ end
441
454
  else
442
455
  builder.curveClient(keypair, z85_key(mech.instance_variable_get(:@server_public), "server key"))
443
456
  end
444
457
  end
445
458
 
446
459
 
460
+ # OMQ.java's JNI callback threads resolve PeerInfo through the JVM
461
+ # system class loader, which cannot see JRuby's dynamically loaded jars.
462
+ def validate_authenticator_classpath!
463
+ ::Java::JavaLang::Class.forName("io.omq.PeerInfo", false, ::Java::JavaLang::ClassLoader.getSystemClassLoader)
464
+ rescue ::Java::JavaLang::ClassNotFoundException
465
+ raise ArgumentError, "JRuby CURVE authenticators require the OMQ.java jar on the JVM CLASSPATH"
466
+ end
467
+
468
+
447
469
  def z85_key(key, label)
448
470
  raw = key&.to_s&.b
449
471
  raise ArgumentError, "#{label} must be exactly 32 bytes" unless raw&.bytesize == 32
@@ -3,7 +3,7 @@
3
3
  module OMQ
4
4
  module Backend
5
5
  module Rust
6
- VERSION = "0.3.0"
6
+ VERSION = "0.3.1"
7
7
  end
8
8
  end
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omq-backend-rust
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: java
6
6
  authors:
7
7
  - Patrik Wenger
@@ -75,7 +75,7 @@ requirements:
75
75
  - jar io.github.paddor:omq-java:macos-aarch64, 0.3.0
76
76
  - jar io.github.paddor:omq-java:macos-x86_64, 0.3.0
77
77
  - jar io.github.paddor:omq-java:windows-x86_64, 0.3.0
78
- rubygems_version: 4.0.16
78
+ rubygems_version: 4.0.20
79
79
  specification_version: 4
80
80
  summary: Rust-backed engine for OMQ using OMQ.java on JRuby
81
81
  test_files: []