valkey-glide-rb 1.1.0.pre.rc2 → 1.1.0.pre.rc3
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 +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +1 -1
- data/lib/valkey/commands/pubsub_commands.rb +5 -5
- data/lib/valkey/native/aarch64-apple-darwin/libglide_ffi.dylib +0 -0
- data/lib/valkey/native/aarch64-unknown-linux-gnu/libglide_ffi.so +0 -0
- data/lib/valkey/native/aarch64-unknown-linux-musl/libglide_ffi.so +0 -0
- data/lib/valkey/native/x86_64-unknown-linux-gnu/libglide_ffi.so +0 -0
- data/lib/valkey/native/x86_64-unknown-linux-musl/libglide_ffi.so +0 -0
- data/lib/valkey/pipeline.rb +1 -1
- data/lib/valkey/version.rb +1 -1
- data/lib/valkey.rb +18 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2b56ce43feb7a6fe10f96cf8d243f12ab2f3d687e2066c37a2267beef22b793f
|
|
4
|
+
data.tar.gz: f6a02aadfb46c360e43d4ce84752cf3454ae8e033fd9d7f4faae5dc859c94b84
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 777f1d480b2288b468e8b0785d928d3426878791bf2123d316dad93fa213dc5199fa9dc2568d881c5cb684876fd253babbcca85b5725e2fb2aa893acbc0db13e
|
|
7
|
+
data.tar.gz: 8c7a0453527025ecb0f3017f0b4e821f6ebe5b9fc22fc306f350db86ea67bdbe6f59280d1e84658fe6c55c0c3dbd2f2042c09ce307b8871653adb2e3c183f384
|
data/CHANGELOG.md
CHANGED
|
@@ -38,6 +38,7 @@ GLIDE Ruby follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
38
38
|
|
|
39
39
|
### Changed
|
|
40
40
|
|
|
41
|
+
- Changed `publish` to accept positional arguments as `publish(channel, message, sharded: false)`, matching redis-rb. ([#432](https://github.com/valkey-io/valkey-glide-ruby/pull/432))
|
|
41
42
|
- Prevented `client(:subcommand)` from invoking private methods, so custom `Valkey` subclasses must make any dispatched `client_*` handlers public. ([#246](https://github.com/valkey-io/valkey-glide-ruby/pull/246))
|
|
42
43
|
- Trimmed whitespace from string `client_az` values and rejected blank values when an availability-zone affinity strategy is selected. ([#349](https://github.com/valkey-io/valkey-glide-ruby/pull/349))
|
|
43
44
|
- Changed `eval`, `evalsha`, their read-only variants, and `script_load` to execute server commands, accept integer key counts, and report missing scripts instead of reloading them automatically. ([#227](https://github.com/valkey-io/valkey-glide-ruby/pull/227))
|
|
@@ -49,6 +50,7 @@ GLIDE Ruby follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
49
50
|
|
|
50
51
|
### Fixed
|
|
51
52
|
|
|
53
|
+
- Stopped echoing `ssl_params` values, including private keys, in connection errors, and accepted PEM text for `ca_file`, `cert`, and `key`. ([#428](https://github.com/valkey-io/valkey-glide-ruby/pull/428))
|
|
52
54
|
- Required TLS for IAM authentication, rejecting IAM configurations without TLS during client creation. ([#397](https://github.com/valkey-io/valkey-glide-ruby/pull/397))
|
|
53
55
|
- Rejected `cluster_mode: true` without an explicit seed node instead of connecting to the standalone default. ([#344](https://github.com/valkey-io/valkey-glide-ruby/pull/344))
|
|
54
56
|
- Treated empty `lib_name:` and `client_info_tag:` values as unset so they no longer produce invalid library names. ([#246](https://github.com/valkey-io/valkey-glide-ruby/pull/246))
|
data/README.md
CHANGED
|
@@ -110,7 +110,7 @@ client.get("foo")
|
|
|
110
110
|
| `timeout` | Request timeout in seconds (default `5.0`) |
|
|
111
111
|
| `connect_timeout` | Connection timeout in seconds |
|
|
112
112
|
| `ssl`| Enable TLS if true |
|
|
113
|
-
| `ssl_params` | TLS options {`ca_file`, `cert`, `key`, `ca_path`, `root_certs`} |
|
|
113
|
+
| `ssl_params` | TLS options {`ca_file`, `cert`, `key`, `ca_path`, `root_certs`}. `ca_file`, `cert` and `key` each accept a file path, PEM text, or an OpenSSL object. |
|
|
114
114
|
| `cluster_mode` | Enable cluster client |
|
|
115
115
|
| `nodes` | Array of `{ host:, port: }` hashes |
|
|
116
116
|
| `protocol` | `:resp3` (default) or `:resp2`|
|
|
@@ -334,17 +334,17 @@ class Valkey
|
|
|
334
334
|
#
|
|
335
335
|
# This method aggregates the PUBLISH and SPUBLISH functionalities; the mode is selected with the
|
|
336
336
|
# `sharded` parameter. In both modes the request is routed using the hashed channel as key. The
|
|
337
|
-
# argument order is `(
|
|
337
|
+
# argument order is `(channel, message)`, matching redis-rb.
|
|
338
338
|
#
|
|
339
339
|
# @example Publish a message
|
|
340
|
-
# valkey.publish("Hello, World!"
|
|
340
|
+
# valkey.publish("channel1", "Hello, World!")
|
|
341
341
|
# # => 2
|
|
342
342
|
# @example Publish on a sharded channel
|
|
343
|
-
# valkey.publish("Hello, Shard!",
|
|
343
|
+
# valkey.publish("shard1", "Hello, Shard!", sharded: true)
|
|
344
344
|
# # => 1
|
|
345
345
|
#
|
|
346
|
-
# @param [String] message - the message to publish
|
|
347
346
|
# @param [String] channel - the channel to publish the message on
|
|
347
|
+
# @param [String] message - the message to publish
|
|
348
348
|
# @param [Boolean] sharded - use sharded Pub/Sub mode; only available in cluster mode
|
|
349
349
|
# (`cluster_mode: true`). Since: Valkey version 7.0.0
|
|
350
350
|
#
|
|
@@ -354,7 +354,7 @@ class Valkey
|
|
|
354
354
|
#
|
|
355
355
|
# @see https://valkey.io/commands/publish/
|
|
356
356
|
# @see https://valkey.io/commands/spublish/
|
|
357
|
-
def publish(
|
|
357
|
+
def publish(channel, message, sharded: false)
|
|
358
358
|
request_type = sharded ? RequestType::SPUBLISH : RequestType::PUBLISH
|
|
359
359
|
send_command(request_type, [channel.to_s, message.to_s])
|
|
360
360
|
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/valkey/pipeline.rb
CHANGED
|
@@ -188,7 +188,7 @@ class Valkey
|
|
|
188
188
|
# rubocop:enable Lint/UselessMethodDefinition
|
|
189
189
|
|
|
190
190
|
# Mirror Python sync which only allow sharded Pub/Sub in ClusterBatch.
|
|
191
|
-
def publish(
|
|
191
|
+
def publish(channel, message, sharded: false)
|
|
192
192
|
raise ArgumentError, "publish with sharded: true is only available in cluster mode." if sharded && !cluster_mode?
|
|
193
193
|
|
|
194
194
|
super
|
data/lib/valkey/version.rb
CHANGED
data/lib/valkey.rb
CHANGED
|
@@ -293,13 +293,13 @@ class Valkey
|
|
|
293
293
|
# TLS/SSL certificates
|
|
294
294
|
root_certs = []
|
|
295
295
|
if options[:ssl_params].is_a?(Hash)
|
|
296
|
-
# ca_file - CA certificate file path
|
|
296
|
+
# ca_file - CA certificate file path, PEM text or OpenSSL::X509::Certificate
|
|
297
297
|
root_certs << read_ssl_value(options[:ssl_params][:ca_file], "CA") if options[:ssl_params][:ca_file]
|
|
298
298
|
|
|
299
299
|
# Additional root certificates from ca_path
|
|
300
300
|
if options[:ssl_params][:ca_path]
|
|
301
301
|
ca_path = options[:ssl_params][:ca_path]
|
|
302
|
-
raise ArgumentError, "CA path does not exist
|
|
302
|
+
raise ArgumentError, "CA path does not exist (pass a directory path)" unless Dir.exist?(ca_path)
|
|
303
303
|
|
|
304
304
|
Dir.glob(File.join(ca_path, "*.crt")).each do |cert_file|
|
|
305
305
|
root_certs << File.binread(cert_file) if File.readable?(cert_file)
|
|
@@ -309,10 +309,10 @@ class Valkey
|
|
|
309
309
|
end
|
|
310
310
|
end
|
|
311
311
|
|
|
312
|
-
# cert - file path or OpenSSL::X509::Certificate
|
|
312
|
+
# cert - file path, PEM text or OpenSSL::X509::Certificate
|
|
313
313
|
json_options["client_cert"] = read_ssl_value(options[:ssl_params][:cert], "Cert") if options[:ssl_params][:cert]
|
|
314
314
|
|
|
315
|
-
# key - file path or OpenSSL::PKey
|
|
315
|
+
# key - file path, PEM text or OpenSSL::PKey
|
|
316
316
|
json_options["client_key"] = read_ssl_value(options[:ssl_params][:key], "Key") if options[:ssl_params][:key]
|
|
317
317
|
|
|
318
318
|
# Direct root_certs array support
|
|
@@ -663,14 +663,23 @@ class Valkey
|
|
|
663
663
|
conn
|
|
664
664
|
end
|
|
665
665
|
|
|
666
|
-
#
|
|
667
|
-
# Accepts a
|
|
666
|
+
# Resolves an `ssl_params` `ca_file`, `cert` or `key` value to certificate or key content.
|
|
667
|
+
# Accepts PEM text (a String containing `-----BEGIN `), a file path (any other String),
|
|
668
|
+
# an OpenSSL object (#to_pem / #to_der), or a fallback #to_s.
|
|
669
|
+
# Error messages never include the value: it may be a private key.
|
|
668
670
|
def read_ssl_value(value, label)
|
|
669
671
|
if value.is_a?(String)
|
|
670
|
-
|
|
671
|
-
raise ArgumentError, "#{label} file is not readable: #{value}" unless File.readable?(value)
|
|
672
|
+
return value if value.include?("-----BEGIN ")
|
|
672
673
|
|
|
673
|
-
|
|
674
|
+
expected = "(pass a file path, PEM text, or an OpenSSL object)"
|
|
675
|
+
raise ArgumentError, "#{label} file does not exist #{expected}" unless File.exist?(value)
|
|
676
|
+
raise ArgumentError, "#{label} file is not readable #{expected}" unless File.readable?(value)
|
|
677
|
+
|
|
678
|
+
begin
|
|
679
|
+
File.binread(value)
|
|
680
|
+
rescue SystemCallError, IOError
|
|
681
|
+
raise ArgumentError, "#{label} file could not be read #{expected}", cause: nil
|
|
682
|
+
end
|
|
674
683
|
# Duck-typing check
|
|
675
684
|
elsif value.respond_to?(:to_pem)
|
|
676
685
|
value.to_pem
|