redis-rack 2.1.0 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +246 -0
- data/Gemfile +4 -0
- data/lib/rack/session/redis.rb +4 -4
- data/lib/redis/rack/connection.rb +5 -1
- data/lib/redis/rack/version.rb +1 -1
- data/redis-rack.gemspec +1 -3
- metadata +17 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8fe2b21455a3af95982db86314846abed8b97be35712009a6c720b1fe8a0e3f
|
4
|
+
data.tar.gz: 99c15862e3d1e7c1d16d460da299fcc0dc551a606ce9731710f153f51f3b6196
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef8ef0c5c0286d5df01ee90df055e19ef90969f11b0568a681e64f1955558837584504c5a1b62c8cfc5e7b6fead33cdfa39741f8048ecf787457cb85c7910e6d
|
7
|
+
data.tar.gz: e3f5a9642b8f50e9da6cc05f9387d7acca8245bd702e8f795690b383b6fe253ec037ab930e68a282c37e32f139956e00e6a9a5137dae5957cb03e332cfe057a4
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.1
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,246 @@
|
|
1
|
+
v2.1.0 (2020-01-13)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Update version to v2.1.0 final
|
5
|
+
Tom Scott
|
6
|
+
|
7
|
+
* Test against most recent versions of Ruby
|
8
|
+
Tom Scott
|
9
|
+
|
10
|
+
* Update gemspec to remove rubyforge_project
|
11
|
+
|
12
|
+
It is deprecated or removed already
|
13
|
+
|
14
|
+
Original warning message:
|
15
|
+
Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
|
16
|
+
PikachuEXE
|
17
|
+
|
18
|
+
* back tests to original state
|
19
|
+
Alexey Vasiliev
|
20
|
+
|
21
|
+
* Fix redis-rack for rack 2.0.8, small improvements
|
22
|
+
Alexey Vasiliev
|
23
|
+
|
24
|
+
* Fix redis-rack for rack 2.0.8, fix generate_unique_sid
|
25
|
+
Alexey Vasiliev
|
26
|
+
|
27
|
+
* Fix redis-rack for rack 2.0.8
|
28
|
+
Alexey Vasiliev
|
29
|
+
|
30
|
+
* v2.1.0.pre: Update Rack Session API, drop support for Rack 1.0
|
31
|
+
Tom Scott
|
32
|
+
|
33
|
+
v2.0.6
|
34
|
+
--------------------------------------------------------------------------------
|
35
|
+
|
36
|
+
* v2.0.6: Prevent Connection Pool from passing nil options
|
37
|
+
Tom Scott
|
38
|
+
|
39
|
+
* Make bundler dependency more permissive to support future ruby versions
|
40
|
+
Tom Scott
|
41
|
+
|
42
|
+
* Drop support for Rack v1
|
43
|
+
Tom Scott
|
44
|
+
|
45
|
+
* Update Rack::Session API Compatibility
|
46
|
+
|
47
|
+
The latest version of Rack [deprecated subclassing Rack::Session::ID](https://github.com/rack/rack/blob/master/lib/rack/session/abstract/id.rb#L412-L419),
|
48
|
+
replacing it instead with `Rack::Session::Persisted`. Update the method
|
49
|
+
implementations in this gem to support the new API. Shoutouts to @onk
|
50
|
+
for actually writing this code, we're pulling it in from his fork.
|
51
|
+
Tom Scott
|
52
|
+
|
53
|
+
* Automatically assign issues to @tubbo when they are created
|
54
|
+
Tom Scott
|
55
|
+
|
56
|
+
* Automatically release to RubyGems when new tags are pushed to GitHub
|
57
|
+
Tom Scott
|
58
|
+
|
59
|
+
* Raise Error when `:redis_store` is Incorrect Type
|
60
|
+
|
61
|
+
Passing an object that isn't a `Redis::Store` into the session storage
|
62
|
+
configuration can cause errors when methods are called with more
|
63
|
+
arguments than the default Redis client can handle. These additional
|
64
|
+
arguments are used by `Rack::Session::Redis` to configure the key
|
65
|
+
namespace and TTL globally in the main configuration, and pass them down
|
66
|
+
to `Redis::Store` to be appended to the key. An `ArgumentError` will now
|
67
|
+
be thrown when a `:redis_store` is of a type that isn't a `Redis::Store`
|
68
|
+
(or a subclass thereof).
|
69
|
+
|
70
|
+
Resolves #46
|
71
|
+
Tom Scott
|
72
|
+
|
73
|
+
* Add code owners
|
74
|
+
Tom Scott
|
75
|
+
|
76
|
+
* Do not provide nil values for missing connection pool options
|
77
|
+
|
78
|
+
Fixes #44
|
79
|
+
Jake Goulding
|
80
|
+
|
81
|
+
v2.0.5
|
82
|
+
--------------------------------------------------------------------------------
|
83
|
+
|
84
|
+
* v2.0.5 release
|
85
|
+
Tom Scott
|
86
|
+
|
87
|
+
* add spec to validate blank sessions are not stored in redis
|
88
|
+
mstruve
|
89
|
+
|
90
|
+
* dont store a blank session in redis
|
91
|
+
mstruve
|
92
|
+
|
93
|
+
* Add documentation for options
|
94
|
+
Daniel M Barlow
|
95
|
+
|
96
|
+
v2.0.4
|
97
|
+
--------------------------------------------------------------------------------
|
98
|
+
|
99
|
+
* Release 2.0.4
|
100
|
+
Tom Scott
|
101
|
+
|
102
|
+
* Remove .ruby-version
|
103
|
+
Tom Scott
|
104
|
+
|
105
|
+
* Remove rake, appraisal from gemspec executables
|
106
|
+
|
107
|
+
The contents of the bin directory are binstubs to assist development.
|
108
|
+
They are not intended to be shipped with the gem itself. This commit
|
109
|
+
updates the gemspec to ensure that they are not exposed to rubygems as
|
110
|
+
executables for redis-rack, which will fix conflicts with the legitimate
|
111
|
+
rake and appraisal executables provided by those other gems.
|
112
|
+
Matt Brictson
|
113
|
+
|
114
|
+
v2.0.3
|
115
|
+
--------------------------------------------------------------------------------
|
116
|
+
|
117
|
+
* v2.0.3: Avoid mutex locking with global option
|
118
|
+
Tom Scott
|
119
|
+
|
120
|
+
* Restore default_options in #generate_unique_sid
|
121
|
+
Tom Scott
|
122
|
+
|
123
|
+
* Refactor connection_pool code
|
124
|
+
|
125
|
+
Adds a `Redis::Rack::Connection` object for handling the instantiation
|
126
|
+
of a `Redis::Store` or a `ConnectionPool` if pool configuration is
|
127
|
+
given. Restores the purpose of `Rack::Session::Redis` to only implement
|
128
|
+
the session ID abstract API provided by Rack.
|
129
|
+
Tom Scott
|
130
|
+
|
131
|
+
* Rename :use_global_lock option to :threadsafe to match Rails
|
132
|
+
Garrett Thornburg
|
133
|
+
|
134
|
+
* Use mocha mocks to assert the mutex is never locked
|
135
|
+
Garrett Thornburg
|
136
|
+
|
137
|
+
* Allow redis-store v1.4
|
138
|
+
Shane O'Grady
|
139
|
+
|
140
|
+
* Create a :use_global_lock option that avoids the global lock
|
141
|
+
Garrett Thornburg
|
142
|
+
|
143
|
+
* Rake task for running all tests on all gem versions
|
144
|
+
Tom Scott
|
145
|
+
|
146
|
+
* Install Appraisal so we can test against multiple versions of Rack
|
147
|
+
Tom Scott
|
148
|
+
|
149
|
+
v2.0.2
|
150
|
+
--------------------------------------------------------------------------------
|
151
|
+
|
152
|
+
* v2.0.2: Resolve regression forcing Rack 2.x and above
|
153
|
+
Tom Scott
|
154
|
+
|
155
|
+
v2.0.1
|
156
|
+
--------------------------------------------------------------------------------
|
157
|
+
|
158
|
+
* v2.0.1: Relax gem dependencies
|
159
|
+
Tom Scott
|
160
|
+
|
161
|
+
* smoothen redis-store dependency
|
162
|
+
Mathieu Jobin
|
163
|
+
|
164
|
+
* Drop support for Rubinius 1.9 mode
|
165
|
+
|
166
|
+
1.9.x is EOL in MRI Ruby Land, and Rubinius 1.9 mode isn't really used
|
167
|
+
much anymore. This should make the builds pass again.
|
168
|
+
Tom Scott
|
169
|
+
|
170
|
+
* Update README.md (#20)
|
171
|
+
Nicolas
|
172
|
+
|
173
|
+
* Remove jruby 1.9 mode from the build matrix
|
174
|
+
Tom Scott
|
175
|
+
|
176
|
+
* Remove test because why
|
177
|
+
Tom Scott
|
178
|
+
|
179
|
+
v2.0.0
|
180
|
+
--------------------------------------------------------------------------------
|
181
|
+
|
182
|
+
* v2.0: Drop support for Ruby below 2.2 (thanks @connorshea)
|
183
|
+
|
184
|
+
Fixes #17, major shoutouts to @connorshea for getting this off the
|
185
|
+
ground. This also edits the CI config to drop support for older Ruby
|
186
|
+
versions.
|
187
|
+
Tom Scott
|
188
|
+
|
189
|
+
* Fix gem dependency versions
|
190
|
+
Tom Scott
|
191
|
+
|
192
|
+
* v2.0.0.pre Add support for Rails 5 and Rack 2.
|
193
|
+
Tom Scott
|
194
|
+
|
195
|
+
* v2.0.0: Upgrade to Rack 2.0
|
196
|
+
|
197
|
+
This release includes some backwards-incompatible changes that pertain
|
198
|
+
to Rails' upgrade to Rack 2.x.
|
199
|
+
Tom Scott
|
200
|
+
|
201
|
+
* Update README
|
202
|
+
Tom Scott
|
203
|
+
|
204
|
+
* Fix readme
|
205
|
+
Tom Scott
|
206
|
+
|
207
|
+
* travis.yml add Ruby 2.3.0
|
208
|
+
shiro16
|
209
|
+
|
210
|
+
* add 2.1 and 2.2 rubies to travis
|
211
|
+
Marc Roberts
|
212
|
+
|
213
|
+
* Remove support for Ruby 1.9
|
214
|
+
Marc Roberts
|
215
|
+
|
216
|
+
* Loosen dependancy on Rack to allow 1.5 and 2.x
|
217
|
+
|
218
|
+
Rails 5 beta requires Rack 2.x and this gem is unusable unless can use Rack 2.x
|
219
|
+
Marc Roberts
|
220
|
+
|
221
|
+
* Update README.md
|
222
|
+
Ryan Bigg
|
223
|
+
|
224
|
+
* add support for ConnectionPool
|
225
|
+
Roman Usherenko
|
226
|
+
|
227
|
+
* Introduce redis_store option (closes #1)
|
228
|
+
Kurakin Alexander
|
229
|
+
|
230
|
+
* Atomically lock session id and implement skip support.
|
231
|
+
W. Andrew Loe III
|
232
|
+
|
233
|
+
v1.5.0
|
234
|
+
------
|
235
|
+
|
236
|
+
* Enable CI
|
237
|
+
Luca Guidi
|
238
|
+
|
239
|
+
* Update README.md
|
240
|
+
Luca Guidi
|
241
|
+
|
242
|
+
* Moved back from jodosha/redis-store
|
243
|
+
Luca Guidi
|
244
|
+
|
245
|
+
* Moved
|
246
|
+
Luca Guidi
|
data/Gemfile
CHANGED
data/lib/rack/session/redis.rb
CHANGED
@@ -24,7 +24,7 @@ module Rack
|
|
24
24
|
loop do
|
25
25
|
sid = generate_sid
|
26
26
|
first = with do |c|
|
27
|
-
[*c.setnx(sid.private_id, session, @default_options)].first
|
27
|
+
[*c.setnx(sid.private_id, session, @default_options.to_hash)].first
|
28
28
|
end
|
29
29
|
break sid if [1, true].include?(first)
|
30
30
|
end
|
@@ -44,9 +44,9 @@ module Rack
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
def write_session(req, sid, new_session, options)
|
47
|
+
def write_session(req, sid, new_session, options = {})
|
48
48
|
with_lock(req, false) do
|
49
|
-
with { |c| c.set
|
49
|
+
with { |c| c.set(sid.private_id, new_session, options.to_hash) }
|
50
50
|
sid
|
51
51
|
end
|
52
52
|
end
|
@@ -65,7 +65,7 @@ module Rack
|
|
65
65
|
@default_options.fetch(:threadsafe, true)
|
66
66
|
end
|
67
67
|
|
68
|
-
def with_lock(req, default=nil)
|
68
|
+
def with_lock(req, default = nil)
|
69
69
|
@mutex.lock if req.multithread? && threadsafe?
|
70
70
|
yield
|
71
71
|
rescue Errno::ECONNREFUSED
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class Redis
|
2
2
|
module Rack
|
3
3
|
class Connection
|
4
|
+
POOL_KEYS = %i[pool pool_size pool_timeout].freeze
|
5
|
+
|
4
6
|
def initialize(options = {})
|
5
7
|
@options = options
|
6
8
|
@store = options[:redis_store]
|
@@ -24,7 +26,9 @@ class Redis
|
|
24
26
|
end
|
25
27
|
|
26
28
|
def pooled?
|
27
|
-
|
29
|
+
return @pooled if defined?(@pooled)
|
30
|
+
|
31
|
+
@pooled = POOL_KEYS.any? { |key| @options.key?(key) }
|
28
32
|
end
|
29
33
|
|
30
34
|
def pool
|
data/lib/redis/rack/version.rb
CHANGED
data/redis-rack.gemspec
CHANGED
@@ -20,12 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_runtime_dependency 'redis-store', ['< 2', '>= 1.2']
|
21
21
|
s.add_runtime_dependency 'rack', '>= 2.0.8', '< 3'
|
22
22
|
|
23
|
-
s.add_development_dependency 'rake', '
|
23
|
+
s.add_development_dependency 'rake', '>= 12.3.3'
|
24
24
|
s.add_development_dependency 'bundler', '> 1', '< 3'
|
25
25
|
s.add_development_dependency 'mocha', '~> 0.14.0'
|
26
26
|
s.add_development_dependency 'minitest', '~> 5'
|
27
|
-
s.add_development_dependency 'redis-store-testing'
|
28
27
|
s.add_development_dependency 'connection_pool', '~> 1.2.0'
|
29
|
-
s.add_development_dependency 'appraisal'
|
30
28
|
end
|
31
29
|
|
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-store
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.2'
|
20
17
|
- - "<"
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: '2'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.2'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.2'
|
30
27
|
- - "<"
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: '2'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rack
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,16 +54,16 @@ dependencies:
|
|
54
54
|
name: rake
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - "
|
57
|
+
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
59
|
+
version: 12.3.3
|
60
60
|
type: :development
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- - "
|
64
|
+
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
66
|
+
version: 12.3.3
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: bundler
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,20 +112,6 @@ dependencies:
|
|
112
112
|
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '5'
|
115
|
-
- !ruby/object:Gem::Dependency
|
116
|
-
name: redis-store-testing
|
117
|
-
requirement: !ruby/object:Gem::Requirement
|
118
|
-
requirements:
|
119
|
-
- - ">="
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
version: '0'
|
122
|
-
type: :development
|
123
|
-
prerelease: false
|
124
|
-
version_requirements: !ruby/object:Gem::Requirement
|
125
|
-
requirements:
|
126
|
-
- - ">="
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
version: '0'
|
129
115
|
- !ruby/object:Gem::Dependency
|
130
116
|
name: connection_pool
|
131
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,20 +126,6 @@ dependencies:
|
|
140
126
|
- - "~>"
|
141
127
|
- !ruby/object:Gem::Version
|
142
128
|
version: 1.2.0
|
143
|
-
- !ruby/object:Gem::Dependency
|
144
|
-
name: appraisal
|
145
|
-
requirement: !ruby/object:Gem::Requirement
|
146
|
-
requirements:
|
147
|
-
- - ">="
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
150
|
-
type: :development
|
151
|
-
prerelease: false
|
152
|
-
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
requirements:
|
154
|
-
- - ">="
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
version: '0'
|
157
129
|
description: Redis Store for Rack applications
|
158
130
|
email:
|
159
131
|
- me@lucaguidi.com
|
@@ -165,6 +137,7 @@ files:
|
|
165
137
|
- ".gitignore"
|
166
138
|
- ".ruby-version"
|
167
139
|
- ".travis.yml"
|
140
|
+
- CHANGELOG.md
|
168
141
|
- CODEOWNERS
|
169
142
|
- Gemfile
|
170
143
|
- MIT-LICENSE
|
@@ -184,7 +157,7 @@ homepage: http://redis-store.org/redis-rack
|
|
184
157
|
licenses:
|
185
158
|
- MIT
|
186
159
|
metadata: {}
|
187
|
-
post_install_message:
|
160
|
+
post_install_message:
|
188
161
|
rdoc_options: []
|
189
162
|
require_paths:
|
190
163
|
- lib
|
@@ -199,8 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
172
|
- !ruby/object:Gem::Version
|
200
173
|
version: '0'
|
201
174
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
203
|
-
signing_key:
|
175
|
+
rubygems_version: 3.1.2
|
176
|
+
signing_key:
|
204
177
|
specification_version: 4
|
205
178
|
summary: Redis Store for Rack
|
206
179
|
test_files:
|