anycable-core 1.6.2 → 1.6.3

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: 0f273c9f627c0c7885a28b1f961bf45eb96c3f7b1ae94d42845c8b1e1dfc187c
4
- data.tar.gz: 66d6d1a1fd64f6011a6829c36ea62a7267566483f4fa470cfeb9a7031e2ee7f9
3
+ metadata.gz: 7b804d301dcb7d7c66c1e10456bd947938e0f4d4687c1ab3fb5d17e0e545a0f8
4
+ data.tar.gz: 1d39a7597cfe89f453835613ac3d7e651f64fddd6c4558753ad26b8c9e9b027c
5
5
  SHA512:
6
- metadata.gz: d7be5b0c420ac6ed1382a67a06b585339df4f4068c12333e3be973e46892b30f51fafb0af3f26fc8fb3437ee9c9f347cf63cbf54ca91f12254e9773e7beb23d1
7
- data.tar.gz: d8b0a2bc2bf146e0d1356656ca0363dabf0c5d4e277b4bb72e2e1a6c41b1e35dc929c741aec27b534d685e5a10900e41e21e827887f5c697638277c6c0c31ad8
6
+ metadata.gz: 37171d5afc7b3c9535590d41c607556fd6f29ceaf1fa90d638af12b4b562234db6e00dbdee4e51aa2eeed702a508add3e515586a0172f2935f01de4eaa25be8a
7
+ data.tar.gz: 47f3c1dad688a3f9039311a70e45adc87c7ed049d8a6b8e62e8b88d6692a59f604bd72eb4da34474ef7068bb21309b8b191f105c445793ce769d1dd6282f7b94
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.6.3 (2026-02-19)
6
+
7
+ - Handle nil input from gRPC. ([@palkan][])
8
+
9
+ - Add `redis_tls_ca_cert_path` configuration option. ([@palkan][])
10
+
5
11
  ## 1.6.2 (2025-12-18)
6
12
 
7
13
  - Use the same default port for HTTP broadcasts as in AnyCable. ([@palkan][])
@@ -47,6 +47,7 @@ module AnyCable
47
47
  redis_tls_verify: false,
48
48
  redis_tls_client_cert_path: nil,
49
49
  redis_tls_client_key_path: nil,
50
+ redis_tls_ca_cert_path: nil,
50
51
 
51
52
  ### NATS options
52
53
  nats_servers: "nats://localhost:4222",
@@ -151,6 +152,7 @@ module AnyCable
151
152
  --redis-tls-verify=yes|no Whether to perform server certificate check in case of rediss:// protocol. Default: yes
152
153
  --redis-tls-client_cert-path=path Default: nil
153
154
  --redis-tls-client_key-path=path Default: nil
155
+ --redis-tls-ca-path=path Default: nil
154
156
 
155
157
  NATS
156
158
  --nats-servers=<...addresses> NATS servers for broadcasting, default: "nats://localhost:4222"
@@ -185,21 +187,21 @@ module AnyCable
185
187
  end.tap do |params|
186
188
  next unless redis_url.match?(/rediss:\/\//)
187
189
 
188
- if !!redis_tls_client_cert_path ^ !!redis_tls_client_key_path
189
- raise_validation_error "Both Redis TLS client certificate and private key must be specified (or none of them)"
190
+ cert_path, key_path, ca_path = redis_tls_client_cert_path, redis_tls_client_key_path, redis_tls_ca_cert_path
191
+
192
+ ssl_params = {}
193
+
194
+ if cert_path && key_path
195
+ ssl_params[:cert] = OpenSSL::X509::Certificate.new(File.read(cert_path))
196
+ ssl_params[:key] = OpenSSL::PKey.read(File.read(key_path))
197
+ ssl_params[:ca_path] if ca_path
190
198
  end
191
199
 
192
200
  if !redis_tls_verify?
193
- params[:ssl_params] = {verify_mode: OpenSSL::SSL::VERIFY_NONE}
194
- else
195
- cert_path, key_path = redis_tls_client_cert_path, redis_tls_client_key_path
196
- if cert_path && key_path
197
- params[:ssl_params] = {
198
- cert: OpenSSL::X509::Certificate.new(File.read(cert_path)),
199
- key: OpenSSL::PKey.read(File.read(key_path))
200
- }
201
- end
201
+ ssl_params[:verify_mode] = OpenSSL::SSL::VERIFY_NONE
202
202
  end
203
+
204
+ params[:ssl_params] = ssl_params unless ssl_params.empty?
203
205
  end
204
206
  end
205
207
 
@@ -17,7 +17,7 @@ module AnyCable
17
17
  private
18
18
 
19
19
  def notify_exception(exp, method_name, request)
20
- AnyCable::ExceptionsHandling.notify(exp, method_name.to_s, request.to_h)
20
+ AnyCable::ExceptionsHandling.notify(exp, method_name.to_s, request&.to_h)
21
21
  end
22
22
 
23
23
  def response_class(method_name)
data/lib/anycable/rpc.rb CHANGED
@@ -90,7 +90,7 @@ module AnyCable
90
90
  end
91
91
 
92
92
  # TODO: Move sid to env in the future version of RPC proto
93
- unless Env.instance_methods(false).include?(:sid)
93
+ unless Env.method_defined?(:sid, false)
94
94
  class Env
95
95
  attr_accessor :sid
96
96
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
- VERSION = "1.6.2"
4
+ VERSION = "1.6.3"
5
5
  end
@@ -27,6 +27,8 @@ module AnyCable
27
27
  def redis_tls_client_cert_path=: (String) -> void
28
28
  def redis_tls_client_key_path: () -> String?
29
29
  def redis_tls_client_key_path=: (String) -> void
30
+ def redis_tls_ca_cert_path: () -> String?
31
+ def redis_tls_ca_cert_path=: (String) -> void
30
32
  def nats_servers: () -> Array[String]
31
33
  def nats_servers=: (Array[String]) -> void
32
34
  def nats_channel: () -> String
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-17 00:00:00.000000000 Z
11
+ date: 2026-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config