anycable-core 1.6.1 → 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: ed5cba84c41eaff48b39efff0d9e6e1f92c717157fef1028138d5b2e4aedb8b7
4
- data.tar.gz: 03527a7b8abdb352df1db3d4b10cf1ea53016bf71f7a6d9dbe17aebc191d7c88
3
+ metadata.gz: 7b804d301dcb7d7c66c1e10456bd947938e0f4d4687c1ab3fb5d17e0e545a0f8
4
+ data.tar.gz: 1d39a7597cfe89f453835613ac3d7e651f64fddd6c4558753ad26b8c9e9b027c
5
5
  SHA512:
6
- metadata.gz: 447793f557f75d3f587196c7e3f85b563272e0a31a6c23cc3b653902619874dac2f8f92fe3ec6ad53a81bf301cfc67ff04670e35648356cbdaab5eeb8313003d
7
- data.tar.gz: 94535fc3bbbe995e1015868a7b9e29c34134bf72ad312e2ec4c96c630e925127bc658562b0d396607577e99426c6b3086b8bc84f3941e60889d1db2879c96534
6
+ metadata.gz: 37171d5afc7b3c9535590d41c607556fd6f29ceaf1fa90d638af12b4b562234db6e00dbdee4e51aa2eeed702a508add3e515586a0172f2935f01de4eaa25be8a
7
+ data.tar.gz: 47f3c1dad688a3f9039311a70e45adc87c7ed049d8a6b8e62e8b88d6692a59f604bd72eb4da34474ef7068bb21309b8b191f105c445793ce769d1dd6282f7b94
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
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
+
11
+ ## 1.6.2 (2025-12-18)
12
+
13
+ - Use the same default port for HTTP broadcasts as in AnyCable. ([@palkan][])
14
+
5
15
  ## 1.6.1 (2025-08-19)
6
16
 
7
17
  - Update gRPC server keepalive configuration. ([@palkan][])
data/lib/anycable/cli.rb CHANGED
@@ -55,7 +55,7 @@ module AnyCable
55
55
 
56
56
  print_version!
57
57
 
58
- logger.info "Serving #{defined?(::Rails) ? "Rails " : ""}application from #{boot_file}" unless embedded?
58
+ logger.info "Serving #{"Rails " if defined?(::Rails)}application from #{boot_file}" unless embedded?
59
59
 
60
60
  verify_connection_factory!
61
61
 
@@ -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",
@@ -55,7 +56,7 @@ module AnyCable
55
56
  nats_options: {},
56
57
 
57
58
  ### HTTP broadcasting options
58
- http_broadcast_url: "http://localhost:8090/_broadcast",
59
+ http_broadcast_url: nil,
59
60
  # DEPRECATED: use `broadcast_key` instead
60
61
  http_broadcast_secret: nil,
61
62
 
@@ -101,6 +102,11 @@ module AnyCable
101
102
  !http_health_port.nil? && http_health_port != ""
102
103
  end
103
104
 
105
+ def http_broadcast_url
106
+ # AnyCable accepts broadcast on a different port by default when no authentication configured
107
+ super || (broadcast_key! ? "http://localhost:8080/_broadcast" : "http://localhost:8090/_broadcast")
108
+ end
109
+
104
110
  def broadcast_key!
105
111
  if http_broadcast_secret && !broadcast_key
106
112
  self.broadcast_key ||= http_broadcast_secret
@@ -146,6 +152,7 @@ module AnyCable
146
152
  --redis-tls-verify=yes|no Whether to perform server certificate check in case of rediss:// protocol. Default: yes
147
153
  --redis-tls-client_cert-path=path Default: nil
148
154
  --redis-tls-client_key-path=path Default: nil
155
+ --redis-tls-ca-path=path Default: nil
149
156
 
150
157
  NATS
151
158
  --nats-servers=<...addresses> NATS servers for broadcasting, default: "nats://localhost:4222"
@@ -180,21 +187,21 @@ module AnyCable
180
187
  end.tap do |params|
181
188
  next unless redis_url.match?(/rediss:\/\//)
182
189
 
183
- if !!redis_tls_client_cert_path ^ !!redis_tls_client_key_path
184
- 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
185
198
  end
186
199
 
187
200
  if !redis_tls_verify?
188
- params[:ssl_params] = {verify_mode: OpenSSL::SSL::VERIFY_NONE}
189
- else
190
- cert_path, key_path = redis_tls_client_cert_path, redis_tls_client_key_path
191
- if cert_path && key_path
192
- params[:ssl_params] = {
193
- cert: OpenSSL::X509::Certificate.new(File.read(cert_path)),
194
- key: OpenSSL::PKey.read(File.read(key_path))
195
- }
196
- end
201
+ ssl_params[:verify_mode] = OpenSSL::SSL::VERIFY_NONE
197
202
  end
203
+
204
+ params[:ssl_params] = ssl_params unless ssl_params.empty?
198
205
  end
199
206
  end
200
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.1"
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.1
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-08-20 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