redis 4.5.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1e483240f70aa8a92a7fe1f38968262ea82e84a97e436a9c7c695c032584313
4
- data.tar.gz: 1cb164b2d588ef2f2701b91371a12a0d90299a78994f0d614cb14ab0daa36243
3
+ metadata.gz: 7a7232fef186e6d6a11a90d8dd9aa7c71114f017e0afe9378999a96c9e6b4e05
4
+ data.tar.gz: 689f176b87909bf61eb60e57d1eb795198162a7e039104c80facf36880964bda
5
5
  SHA512:
6
- metadata.gz: 72c3e91839061ae26e27cbb08330f752acbba5f440c8549cad4325b2c2f517a907a0db11330ca9ba221255aa7b570efe2050bde9cbb905217794c4754c53dadb
7
- data.tar.gz: e92cc58111fb9e1553a3363c56569ef6064c3851263d5eb86147c907878650b697db5c598b2b2046f9c9025cc40ca7eda5ce16f4f21049ac49f09385cf80a92f
6
+ metadata.gz: 22b11dee92e298b46bb94a707156d3dbf9afb83c8e9e8cbf82cf366d582a7c1b7295d7f09a0fec01965245f4800c2482c0559d646f46ff1c6bba6423ab398ba9
7
+ data.tar.gz: 9a74ba29c8cb3d7634a44c78e30018a048e19cca66c7fad6a226722183f66546bebb370c92ecdf20522bb35ee72a09b2fda64891ff6d94db1702375bd1ba6b46
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Unreleased
2
2
 
3
+ # 4.5.1
4
+
5
+ * Restore the accidential auth behavior of redis-rb 4.3.0 with a warning. If provided with the `default` user's password, but a wrong username,
6
+ redis-rb will first try to connect as the provided user, but then will fallback to connect as the `default` user with the provided password.
7
+ This behavior is deprecated and will be removed in Redis 4.6.0. Fix #1038.
8
+
3
9
  # 4.5.0
4
10
 
5
11
  * Handle parts of the command using incompatible encodings. See #1037.
data/lib/redis/client.rb CHANGED
@@ -122,6 +122,16 @@ class Redis
122
122
  rescue CommandError => err # Likely on Redis < 6
123
123
  if err.message.match?(/ERR wrong number of arguments for \'auth\' command/)
124
124
  call [:auth, password]
125
+ elsif err.message.match?(/WRONGPASS invalid username-password pair/)
126
+ begin
127
+ call [:auth, password]
128
+ rescue CommandError
129
+ raise err
130
+ end
131
+ ::Kernel.warn(
132
+ "[redis-rb] The Redis connection was configured with username #{username.inspect}, but" \
133
+ " the provided password was for the default user. This will start failing in redis-rb 4.6."
134
+ )
125
135
  else
126
136
  raise
127
137
  end
@@ -21,7 +21,7 @@ class Redis
21
21
  super(*args)
22
22
 
23
23
  @timeout = @write_timeout = nil
24
- @buffer = "".dup
24
+ @buffer = "".b
25
25
  end
26
26
 
27
27
  def timeout=(timeout)
@@ -32,30 +32,13 @@ class Redis
32
32
  @write_timeout = (timeout if timeout && timeout > 0)
33
33
  end
34
34
 
35
- string_capacity_support = begin
36
- String.new(capacity: 0)
37
- true # Ruby 2.4+
38
- rescue ArgumentError
39
- false # Ruby 2.3
40
- end
41
-
42
- if string_capacity_support
43
- def read(nbytes)
44
- result = @buffer.slice!(0, nbytes)
35
+ def read(nbytes)
36
+ result = @buffer.slice!(0, nbytes)
45
37
 
46
- buffer = String.new(capacity: nbytes, encoding: Encoding::ASCII_8BIT)
47
- result << _read_from_socket(nbytes - result.bytesize, buffer) while result.bytesize < nbytes
38
+ buffer = String.new(capacity: nbytes, encoding: Encoding::ASCII_8BIT)
39
+ result << _read_from_socket(nbytes - result.bytesize, buffer) while result.bytesize < nbytes
48
40
 
49
- result
50
- end
51
- else
52
- def read(nbytes)
53
- result = @buffer.slice!(0, nbytes)
54
-
55
- result << _read_from_socket(nbytes - result.bytesize, "".b) while result.bytesize < nbytes
56
-
57
- result
58
- end
41
+ result
59
42
  end
60
43
 
61
44
  def gets
data/lib/redis/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Redis
4
- VERSION = '4.5.0'
4
+ VERSION = '4.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2021-10-14 00:00:00.000000000 Z
19
+ date: 2021-10-15 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: em-synchrony
@@ -102,9 +102,9 @@ licenses:
102
102
  metadata:
103
103
  bug_tracker_uri: https://github.com/redis/redis-rb/issues
104
104
  changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
105
- documentation_uri: https://www.rubydoc.info/gems/redis/4.5.0
105
+ documentation_uri: https://www.rubydoc.info/gems/redis/4.5.1
106
106
  homepage_uri: https://github.com/redis/redis-rb
107
- source_code_uri: https://github.com/redis/redis-rb/tree/v4.5.0
107
+ source_code_uri: https://github.com/redis/redis-rb/tree/v4.5.1
108
108
  post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths: