redis-actionpack 5.1.0 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/auto-assign-issues.yml +2 -0
- data/.gitignore +2 -1
- data/.travis.yml +17 -13
- data/Appraisals +23 -0
- data/CHANGELOG.md +252 -0
- data/Gemfile +8 -0
- data/README.md +31 -4
- data/bin/bundler-version-options.rb +1 -0
- data/gemfiles/rails_5.0.x.gemfile +9 -0
- data/gemfiles/rails_5.1.x.gemfile +9 -0
- data/gemfiles/rails_5.2.x.gemfile +9 -0
- data/gemfiles/rails_6.0.x.gemfile +9 -0
- data/lib/action_dispatch/middleware/session/redis_store.rb +27 -7
- data/lib/redis/actionpack/version.rb +1 -1
- data/redis-actionpack.gemspec +5 -12
- data/test/gemfiles/{Gemfile.rails-5.0.x → Gemfile.rails-6.0.x} +1 -2
- data/test/integration/redis_store_integration_test.rb +23 -0
- metadata +20 -102
- data/test/gemfiles/Gemfile.rails-4.0.x +0 -10
- data/test/gemfiles/Gemfile.rails-4.1.x +0 -10
- data/test/gemfiles/Gemfile.rails-4.2.x +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5e8c18274ebb8a1a35f6490ea21d3728ce4daebfc974b77d81f1e1d29c517b0a
|
4
|
+
data.tar.gz: b8b9b5cf0d95370bf4688c833bc854b32fcf153c0cdfab17b72828268dd5de77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17437048b9c715bd8029676f0da6865d10035fa1089484aaa14a8b6a9dc39f9296c53a8176212b372f4efeba379e6868d60e548468ac82aa520069c8d9ce0bc9
|
7
|
+
data.tar.gz: e84179116acf7607e560cb03721c1ecb662d946a55dba0604cfb853e41fa83ae3f9beb2f0be446958fb390dc06e49f848303252e3da2f146a6c76e51cd9a7822
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -2,23 +2,27 @@ language: ruby
|
|
2
2
|
before_install: gem install bundler
|
3
3
|
script: bundle exec rake
|
4
4
|
rvm:
|
5
|
-
- 2.3
|
6
|
-
- 2.4
|
7
|
-
- 2.5
|
8
|
-
- 2.6
|
9
|
-
-
|
5
|
+
- 2.3
|
6
|
+
- 2.4
|
7
|
+
- 2.5
|
8
|
+
- 2.6
|
9
|
+
- 2.7
|
10
|
+
- ruby-head
|
11
|
+
- jruby-head
|
10
12
|
gemfile:
|
11
|
-
-
|
12
|
-
-
|
13
|
-
-
|
14
|
-
-
|
13
|
+
- gemfiles/rails_5.0.x.gemfile
|
14
|
+
- gemfiles/rails_5.1.x.gemfile
|
15
|
+
- gemfiles/rails_5.2.x.gemfile
|
16
|
+
- gemfiles/rails_6.0.x.gemfile
|
15
17
|
matrix:
|
16
18
|
exclude:
|
17
|
-
|
18
|
-
|
19
|
+
- rvm: 2.3
|
20
|
+
gemfile: gemfiles/rails_6.0.x.gemfile
|
21
|
+
- rvm: 2.4
|
22
|
+
gemfile: gemfiles/rails_6.0.x.gemfile
|
19
23
|
allow_failures:
|
20
|
-
|
21
|
-
|
24
|
+
- rvm: ruby-head
|
25
|
+
- rvm: jruby-head
|
22
26
|
deploy:
|
23
27
|
provider: rubygems
|
24
28
|
api_key:
|
data/Appraisals
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
appraise 'rails-5.0.x' do
|
2
|
+
gem 'redis-store'
|
3
|
+
gem 'redis-rack'
|
4
|
+
gem 'actionpack', '~> 5.0.0'
|
5
|
+
end
|
6
|
+
|
7
|
+
appraise 'rails-5.1.x' do
|
8
|
+
gem 'redis-store'
|
9
|
+
gem 'redis-rack'
|
10
|
+
gem 'actionpack', '~> 5.1.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise 'rails-5.2.x' do
|
14
|
+
gem 'redis-store'
|
15
|
+
gem 'redis-rack'
|
16
|
+
gem 'actionpack', '~> 5.1.0'
|
17
|
+
end
|
18
|
+
|
19
|
+
appraise 'rails-6.0.x' do
|
20
|
+
gem 'redis-store'
|
21
|
+
gem 'redis-rack'
|
22
|
+
gem 'actionpack', '~> 6.0.0'
|
23
|
+
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,252 @@
|
|
1
|
+
v5.2.0 (2020-01-13)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Require latest version of redis-rack
|
5
|
+
Tom Scott
|
6
|
+
|
7
|
+
* Update version to v5.2.0 final
|
8
|
+
Tom Scott
|
9
|
+
|
10
|
+
* Fix for rack 2.0.8 (#28)
|
11
|
+
|
12
|
+
* Fix for rack 2.0.8
|
13
|
+
* add new redis-rack for tests
|
14
|
+
* add new ruby 2.7 for tests
|
15
|
+
Alexey Vasiliev
|
16
|
+
|
17
|
+
* v5.2.0.pre: Support Signed/Encrypted Cookies
|
18
|
+
Tom Scott
|
19
|
+
|
20
|
+
* Update README with info about signed cookies
|
21
|
+
Tom Scott
|
22
|
+
|
23
|
+
* Support Signed and Encrypted Cookie Storage (#27)
|
24
|
+
|
25
|
+
With the `:signed` option passed into the Redis session store, you can
|
26
|
+
now ensure that sessions will be set up in the browser using a
|
27
|
+
signed/encrypted cookie. This prevents user tampering by changing their
|
28
|
+
session ID or the data within the cookie.
|
29
|
+
|
30
|
+
Closes #21
|
31
|
+
Tom Scott
|
32
|
+
|
33
|
+
v5.1.0
|
34
|
+
--------------------------------------------------------------------------------
|
35
|
+
|
36
|
+
* Add appraisal to test on multiple versions of Rails (#18)
|
37
|
+
|
38
|
+
Update the build configuration to exclude older versions we no longer support and use Appraisal to test against multiple gemfiles/rubies in CI.
|
39
|
+
|
40
|
+
* Remove old gemfiles
|
41
|
+
* Update appraisal gemfiles
|
42
|
+
* Exclude some builds
|
43
|
+
* Install bundler on older versions of Ruby
|
44
|
+
* Prevent updating bundler to a non-compatible version
|
45
|
+
* Remove lockfiles from the repo
|
46
|
+
* Drop support for old versions of Rails & Ruby
|
47
|
+
* Automatically assign issues to @tubbo when they are created
|
48
|
+
Tom Scott
|
49
|
+
|
50
|
+
* Reduce build scope to only support Rails 5 & 6
|
51
|
+
Tom Scott
|
52
|
+
|
53
|
+
* v5.1.0: Support Rails 6
|
54
|
+
Tom Scott
|
55
|
+
|
56
|
+
* Bump max version constraint on actionpack (#25)
|
57
|
+
|
58
|
+
This change allows this gem to work with Rails 6.
|
59
|
+
Arjun Radhakrishnan
|
60
|
+
|
61
|
+
* Fix build
|
62
|
+
Tom Scott
|
63
|
+
|
64
|
+
* README: Use SVG badges
|
65
|
+
Olle Jonsson
|
66
|
+
|
67
|
+
* Gemspec: Drop EOL'd property rubyforge_project
|
68
|
+
Olle Jonsson
|
69
|
+
|
70
|
+
* Loosen Bundler dependency
|
71
|
+
Tom Scott
|
72
|
+
|
73
|
+
* Update testing matrix
|
74
|
+
Tom Scott
|
75
|
+
|
76
|
+
* Automatically release to RubyGems when new tags are pushed to GitHub
|
77
|
+
Tom Scott
|
78
|
+
|
79
|
+
* Add code owners
|
80
|
+
Tom Scott
|
81
|
+
|
82
|
+
* Clarify usage of gem in the README
|
83
|
+
Tom Scott
|
84
|
+
|
85
|
+
* Fix rails 4 build failure
|
86
|
+
Tom Scott
|
87
|
+
|
88
|
+
* Don't always use local testing gem
|
89
|
+
Tom Scott
|
90
|
+
|
91
|
+
v5.0.2
|
92
|
+
--------------------------------------------------------------------------------
|
93
|
+
|
94
|
+
* v5.0.2: Loosen dependencies to work with new minor redis-store versions
|
95
|
+
Tom Scott
|
96
|
+
|
97
|
+
* Update class name in README
|
98
|
+
Tom Scott
|
99
|
+
|
100
|
+
* Loosen redis-store dependency
|
101
|
+
Tom Scott
|
102
|
+
|
103
|
+
* Update tests to remove deprecation warnings
|
104
|
+
Tom Scott
|
105
|
+
|
106
|
+
* Remove testing code from Gemfile
|
107
|
+
Tom Scott
|
108
|
+
|
109
|
+
v5.0.1
|
110
|
+
--------------------------------------------------------------------------------
|
111
|
+
|
112
|
+
* Release v5.0.1
|
113
|
+
Tom Scott
|
114
|
+
|
115
|
+
* Respect cookie options in setting cookie with session ID
|
116
|
+
Michael Dawson
|
117
|
+
|
118
|
+
* Update tests and gemfiles to work on all supported versions.
|
119
|
+
|
120
|
+
Do not depend on pre-release versions of gems.
|
121
|
+
|
122
|
+
Move tests to use minitest-rails to alleviate some of the dependency hell.
|
123
|
+
|
124
|
+
Remove version_test.rb because that's dumb.
|
125
|
+
Connor Shea
|
126
|
+
|
127
|
+
v5.0.0
|
128
|
+
--------------------------------------------------------------------------------
|
129
|
+
|
130
|
+
* Update README.md (#12)
|
131
|
+
Nicolas
|
132
|
+
|
133
|
+
* Bump to 5.0.0
|
134
|
+
Ryan Bigg
|
135
|
+
|
136
|
+
* Fix gem dependency versions
|
137
|
+
Tom Scott
|
138
|
+
|
139
|
+
* Pre-Release of v5.0.0
|
140
|
+
Tom Scott
|
141
|
+
|
142
|
+
* Disable rbx-19mode on Travis CI
|
143
|
+
|
144
|
+
This syntax is no longer supported by Travis, so we aren't getting
|
145
|
+
reliable builds and thus must disable its use, at least for now. We were
|
146
|
+
getting problems on the Rails 4.0 and 4.1 Gemfiles.
|
147
|
+
|
148
|
+
More information is available at
|
149
|
+
https://travis-ci.org/redis-store/redis-actionpack/builds/112702496
|
150
|
+
Tom Scott
|
151
|
+
|
152
|
+
* exclue jruby-19 from rails5
|
153
|
+
Marc Roberts
|
154
|
+
|
155
|
+
* bump ruby 2.2 version in travis, rails5 need at least 2.2.4
|
156
|
+
Marc Roberts
|
157
|
+
|
158
|
+
* env is already an ActionDispatch::Request in rails5
|
159
|
+
Marc Roberts
|
160
|
+
|
161
|
+
* specify version of minitest-spec-rails
|
162
|
+
Marc Roberts
|
163
|
+
|
164
|
+
* need all of rails in gemfile for rails5
|
165
|
+
Marc Roberts
|
166
|
+
|
167
|
+
* use redis-store from github until a new gem is cut
|
168
|
+
Marc Roberts
|
169
|
+
|
170
|
+
* prevent rails5 deprecation warnings
|
171
|
+
Marc Roberts
|
172
|
+
|
173
|
+
* don't use mini_backtrace for now, incompatible with rails5
|
174
|
+
Marc Roberts
|
175
|
+
|
176
|
+
* bump rails5 gem version up to beta3
|
177
|
+
Marc Roberts
|
178
|
+
|
179
|
+
* use redis-rack via github for rails 5.0
|
180
|
+
Marc Roberts
|
181
|
+
|
182
|
+
* use minitest-spec-rails for consistency
|
183
|
+
Marc Roberts
|
184
|
+
|
185
|
+
* Merge remote-tracking branch 'upstream/master'
|
186
|
+
Miles Matthias
|
187
|
+
|
188
|
+
* update mini_specunit to minitest-spec-rails
|
189
|
+
Marc Roberts
|
190
|
+
|
191
|
+
* ignore .lock files in gemfiles
|
192
|
+
Marc Roberts
|
193
|
+
|
194
|
+
* correct gemfiles names in travis excludes
|
195
|
+
Marc Roberts
|
196
|
+
|
197
|
+
* fix gemspec path in gemfiles
|
198
|
+
Marc Roberts
|
199
|
+
|
200
|
+
* add multiple gemfiles for rails 4.0, 4.1, 4.2 and 5
|
201
|
+
Marc Roberts
|
202
|
+
|
203
|
+
* remove 1.9, add 2.1/2.2 rubies to travis
|
204
|
+
Marc Roberts
|
205
|
+
|
206
|
+
* Loosen dependancy on actionpack to support Rails 5
|
207
|
+
Marc Roberts
|
208
|
+
|
209
|
+
* travis ci add before_install
|
210
|
+
shiro16
|
211
|
+
|
212
|
+
* fixed travis.yml
|
213
|
+
shiro16
|
214
|
+
|
215
|
+
* travis ci add Ruby 2.1 and 2.2, 2.3.0
|
216
|
+
shiro16
|
217
|
+
|
218
|
+
* ignore stdout, file resulted from running tests
|
219
|
+
Miles Matthias
|
220
|
+
|
221
|
+
* Revert "Update README.md"
|
222
|
+
|
223
|
+
This reverts commit a4c7f94ed6283b28a34079b5a4917897d6a2b77d.
|
224
|
+
Ryan Bigg
|
225
|
+
|
226
|
+
* Update README.md
|
227
|
+
Ryan Bigg
|
228
|
+
|
229
|
+
* These silly version tests
|
230
|
+
Ryan Bigg
|
231
|
+
|
232
|
+
v4.0.1
|
233
|
+
--------------------------------------------------------------------------------
|
234
|
+
G
|
235
|
+
* Bump to 4.0.1
|
236
|
+
Ryan Bigg
|
237
|
+
|
238
|
+
* support the same values for domain as rails' session stores usually do
|
239
|
+
|
240
|
+
* needed to change the tests based on test in rails, so the options for the session store could be changed per test
|
241
|
+
|
242
|
+
Fixes #2
|
243
|
+
Michael Reinsch
|
244
|
+
|
245
|
+
v4.0.0
|
246
|
+
--------------------------------------------------------------------------------
|
247
|
+
|
248
|
+
* Enable CI
|
249
|
+
Luca Guidi
|
250
|
+
|
251
|
+
* Move from jodosha/redis-store
|
252
|
+
Luca Guidi
|
data/Gemfile
CHANGED
@@ -1,2 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
gemspec
|
3
|
+
|
4
|
+
gem "rake", "~> 10.5"
|
5
|
+
gem "bundler", "~> 2.1"
|
6
|
+
gem "mocha", "~> 0.14.0"
|
7
|
+
gem "minitest-rails", "~> 6.0"
|
8
|
+
gem "tzinfo", "~> 1.2"
|
9
|
+
gem "appraisal", "~> 2.2"
|
10
|
+
gem "redis-store-testing", github: 'redis-store/testing', branch: 'v0.0.3'
|
data/README.md
CHANGED
@@ -17,12 +17,39 @@ gem 'redis-actionpack'
|
|
17
17
|
|
18
18
|
## Usage
|
19
19
|
|
20
|
-
If you are using redis-store with Rails,
|
20
|
+
If you are using redis-store with Rails, head on over to the
|
21
|
+
[redis-rails README](https://github.com/redis-store/redis-rails#session-storage) to
|
22
|
+
learn how to integrate this gem into your Rails application.
|
23
|
+
|
24
|
+
For standalone usage:
|
21
25
|
|
22
26
|
```ruby
|
23
|
-
ActionController::Base.
|
27
|
+
ActionController::Base.session_store = :redis_store,
|
28
|
+
servers: %w(redis://localhost:6379/0/session),
|
29
|
+
expire_after: 90.minutes,
|
30
|
+
key: '_my_application_session',
|
31
|
+
threadsafe: false,
|
32
|
+
signed: true,
|
33
|
+
secure: true
|
24
34
|
```
|
25
35
|
|
36
|
+
A brief run-down of these options...
|
37
|
+
|
38
|
+
- **servers** is an Array of Redis server URLs that we will attempt to find
|
39
|
+
data from.
|
40
|
+
- **expire_after** is the default TTL of session keys. This is also set
|
41
|
+
as the expiry time of any cookies generated by the session store.
|
42
|
+
- **key** is the name of the cookie on the client side
|
43
|
+
- **threadsafe** is for applications that run on multiple instances. Set
|
44
|
+
this to `false` if you want to disable the global mutex lock on
|
45
|
+
session data. It's `true` by default, meaning the mutex will be
|
46
|
+
enabled.
|
47
|
+
- **signed** uses signed/encrypted cookies to store the local session on
|
48
|
+
a client machine, preventing a malicious user from tampering with its
|
49
|
+
contents.
|
50
|
+
- **secure** ensures HTTP cookies are transferred from server to client
|
51
|
+
on a secure (HTTPS) connection
|
52
|
+
|
26
53
|
## Running tests
|
27
54
|
|
28
55
|
```shell
|
@@ -37,8 +64,8 @@ If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" bun
|
|
37
64
|
|
38
65
|
## Status
|
39
66
|
|
40
|
-
[![Gem Version](https://badge.fury.io/rb/redis-actionpack.svg)](http://badge.fury.io/rb/redis-actionpack)
|
41
|
-
[![Build Status](https://secure.travis-ci.org/redis-store/redis-actionpack.svg?branch=master)](http://travis-ci.org/redis-store/redis-actionpack?branch=master)
|
67
|
+
[![Gem Version](https://badge.fury.io/rb/redis-actionpack.svg)](http://badge.fury.io/rb/redis-actionpack)
|
68
|
+
[![Build Status](https://secure.travis-ci.org/redis-store/redis-actionpack.svg?branch=master)](http://travis-ci.org/redis-store/redis-actionpack?branch=master)
|
42
69
|
[![Code Climate](https://codeclimate.com/github/redis-store/redis-actionpack.svg)](https://codeclimate.com/github/redis-store/redis-actionpack)
|
43
70
|
|
44
71
|
## Copyright
|
@@ -0,0 +1 @@
|
|
1
|
+
puts '-v 1.13.1' if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.3.0')
|
@@ -1,9 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'redis-store'
|
2
4
|
require 'redis-rack'
|
3
5
|
require 'action_dispatch/middleware/session/abstract_store'
|
4
6
|
|
5
7
|
module ActionDispatch
|
6
8
|
module Session
|
9
|
+
# Session storage in Redis, using +Redis::Rack+ as a basis.
|
7
10
|
class RedisStore < Rack::Session::Redis
|
8
11
|
include Compatibility
|
9
12
|
include StaleSessionCheck
|
@@ -15,20 +18,37 @@ module ActionDispatch
|
|
15
18
|
super
|
16
19
|
end
|
17
20
|
|
21
|
+
def generate_sid
|
22
|
+
Rack::Session::SessionId.new(super)
|
23
|
+
end
|
24
|
+
|
18
25
|
private
|
19
26
|
|
20
|
-
def set_cookie(env,
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
request
|
27
|
+
def set_cookie(env, _session_id, cookie)
|
28
|
+
request = wrap_in_request(env)
|
29
|
+
cookie_jar(request)[key] = cookie.merge(cookie_options)
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_cookie(request)
|
33
|
+
cookie_jar(request)[key]
|
34
|
+
end
|
35
|
+
|
36
|
+
def wrap_in_request(env)
|
37
|
+
return env if env.is_a?(ActionDispatch::Request)
|
38
|
+
ActionDispatch::Request.new(env)
|
27
39
|
end
|
28
40
|
|
29
41
|
def cookie_options
|
30
42
|
@default_options.slice(:httponly, :secure)
|
31
43
|
end
|
44
|
+
|
45
|
+
def cookie_jar(request)
|
46
|
+
if @default_options[:signed]
|
47
|
+
request.cookie_jar.signed_or_encrypted
|
48
|
+
else
|
49
|
+
request.cookie_jar
|
50
|
+
end
|
51
|
+
end
|
32
52
|
end
|
33
53
|
end
|
34
54
|
end
|
data/redis-actionpack.gemspec
CHANGED
@@ -9,23 +9,16 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = ['me@lucaguidi.com']
|
10
10
|
s.homepage = 'http://redis-store.org/redis-actionpack'
|
11
11
|
s.summary = %q{Redis session store for ActionPack}
|
12
|
-
s.description =
|
12
|
+
s.description = "#{s.summary}. Used for storing the Rails session in Redis."
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
-
s.executables =
|
17
|
+
s.executables = []
|
18
18
|
s.require_paths = ['lib']
|
19
|
+
s.required_ruby_version = '>= 2.3.0'
|
19
20
|
|
20
21
|
s.add_runtime_dependency 'redis-store', '>= 1.1.0', '< 2'
|
21
|
-
s.add_runtime_dependency 'redis-rack', '>= 1', '< 3'
|
22
|
-
s.add_runtime_dependency 'actionpack', '>=
|
23
|
-
|
24
|
-
s.add_development_dependency 'rake', '~> 10'
|
25
|
-
s.add_development_dependency 'bundler'
|
26
|
-
s.add_development_dependency 'mocha', '~> 0.14.0'
|
27
|
-
s.add_development_dependency 'minitest-rails'
|
28
|
-
s.add_development_dependency 'tzinfo'
|
29
|
-
# s.add_development_dependency 'mini_backtrace'
|
30
|
-
s.add_development_dependency 'redis-store-testing'
|
22
|
+
s.add_runtime_dependency 'redis-rack', '>= 2.1.0', '< 3'
|
23
|
+
s.add_runtime_dependency 'actionpack', '>= 5', '< 7'
|
31
24
|
end
|
@@ -69,6 +69,20 @@ class RedisStoreIntegrationTest < ::ActionDispatch::IntegrationTest
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
test "should set a signed cookie when the 'signed' option is set" do
|
73
|
+
with_test_route_set(signed: true) do
|
74
|
+
https!
|
75
|
+
|
76
|
+
get '/set_session_value'
|
77
|
+
assert_response :success
|
78
|
+
|
79
|
+
cookie = cookies.instance_variable_get('@cookies').first
|
80
|
+
|
81
|
+
assert_includes cookie.raw, '_session_id='
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
|
72
86
|
test "should set a http-only cookie by default" do
|
73
87
|
with_test_route_set do
|
74
88
|
get '/set_session_value'
|
@@ -238,8 +252,17 @@ class RedisStoreIntegrationTest < ::ActionDispatch::IntegrationTest
|
|
238
252
|
def initialize(routes, &blk)
|
239
253
|
@routes = routes
|
240
254
|
@stack = ActionDispatch::MiddlewareStack.new(&blk).build(@routes)
|
255
|
+
@secret = SecureRandom.hex
|
256
|
+
@key_generator = ActiveSupport::CachingKeyGenerator.new(
|
257
|
+
ActiveSupport::KeyGenerator.new(@secret, iterations: 2)
|
258
|
+
)
|
241
259
|
end
|
242
260
|
def call(env)
|
261
|
+
env[ActionDispatch::Cookies::GENERATOR_KEY] = @key_generator
|
262
|
+
env[ActionDispatch::Cookies::SIGNED_COOKIE_SALT] = SecureRandom.hex
|
263
|
+
if defined? ActionDispatch::Cookies::COOKIES_ROTATIONS
|
264
|
+
env[ActionDispatch::Cookies::COOKIES_ROTATIONS] = ActiveSupport::Messages::RotationConfiguration.new
|
265
|
+
end
|
243
266
|
@stack.call(env)
|
244
267
|
end
|
245
268
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-store
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 2.1.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '3'
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
49
|
+
version: 2.1.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '3'
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
59
|
+
version: '5'
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '7'
|
@@ -66,108 +66,33 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '5'
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '7'
|
73
|
-
|
74
|
-
|
75
|
-
requirement: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '10'
|
80
|
-
type: :development
|
81
|
-
prerelease: false
|
82
|
-
version_requirements: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - "~>"
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '10'
|
87
|
-
- !ruby/object:Gem::Dependency
|
88
|
-
name: bundler
|
89
|
-
requirement: !ruby/object:Gem::Requirement
|
90
|
-
requirements:
|
91
|
-
- - ">="
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
type: :development
|
95
|
-
prerelease: false
|
96
|
-
version_requirements: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '0'
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: mocha
|
103
|
-
requirement: !ruby/object:Gem::Requirement
|
104
|
-
requirements:
|
105
|
-
- - "~>"
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: 0.14.0
|
108
|
-
type: :development
|
109
|
-
prerelease: false
|
110
|
-
version_requirements: !ruby/object:Gem::Requirement
|
111
|
-
requirements:
|
112
|
-
- - "~>"
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
version: 0.14.0
|
115
|
-
- !ruby/object:Gem::Dependency
|
116
|
-
name: minitest-rails
|
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
|
-
- !ruby/object:Gem::Dependency
|
130
|
-
name: tzinfo
|
131
|
-
requirement: !ruby/object:Gem::Requirement
|
132
|
-
requirements:
|
133
|
-
- - ">="
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
version: '0'
|
136
|
-
type: :development
|
137
|
-
prerelease: false
|
138
|
-
version_requirements: !ruby/object:Gem::Requirement
|
139
|
-
requirements:
|
140
|
-
- - ">="
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: '0'
|
143
|
-
- !ruby/object:Gem::Dependency
|
144
|
-
name: redis-store-testing
|
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
|
-
description: Redis session store for ActionPack
|
73
|
+
description: Redis session store for ActionPack. Used for storing the Rails session
|
74
|
+
in Redis.
|
158
75
|
email:
|
159
76
|
- me@lucaguidi.com
|
160
77
|
executables: []
|
161
78
|
extensions: []
|
162
79
|
extra_rdoc_files: []
|
163
80
|
files:
|
81
|
+
- ".github/auto-assign-issues.yml"
|
164
82
|
- ".gitignore"
|
165
83
|
- ".travis.yml"
|
84
|
+
- Appraisals
|
85
|
+
- CHANGELOG.md
|
166
86
|
- CODEOWNERS
|
167
87
|
- Gemfile
|
168
88
|
- MIT-LICENSE
|
169
89
|
- README.md
|
170
90
|
- Rakefile
|
91
|
+
- bin/bundler-version-options.rb
|
92
|
+
- gemfiles/rails_5.0.x.gemfile
|
93
|
+
- gemfiles/rails_5.1.x.gemfile
|
94
|
+
- gemfiles/rails_5.2.x.gemfile
|
95
|
+
- gemfiles/rails_6.0.x.gemfile
|
171
96
|
- lib/action_dispatch/middleware/session/redis_store.rb
|
172
97
|
- lib/redis-actionpack.rb
|
173
98
|
- lib/redis/actionpack/version.rb
|
@@ -184,10 +109,7 @@ files:
|
|
184
109
|
- test/dummy/config/routes.rb
|
185
110
|
- test/dummy/script/rails
|
186
111
|
- test/fixtures/session_autoload_test/session_autoload_test/foo.rb
|
187
|
-
- test/gemfiles/Gemfile.rails-
|
188
|
-
- test/gemfiles/Gemfile.rails-4.1.x
|
189
|
-
- test/gemfiles/Gemfile.rails-4.2.x
|
190
|
-
- test/gemfiles/Gemfile.rails-5.0.x
|
112
|
+
- test/gemfiles/Gemfile.rails-6.0.x
|
191
113
|
- test/integration/redis_store_integration_test.rb
|
192
114
|
- test/test_helper.rb
|
193
115
|
homepage: http://redis-store.org/redis-actionpack
|
@@ -202,15 +124,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
124
|
requirements:
|
203
125
|
- - ">="
|
204
126
|
- !ruby/object:Gem::Version
|
205
|
-
version:
|
127
|
+
version: 2.3.0
|
206
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
129
|
requirements:
|
208
130
|
- - ">="
|
209
131
|
- !ruby/object:Gem::Version
|
210
132
|
version: '0'
|
211
133
|
requirements: []
|
212
|
-
|
213
|
-
rubygems_version: 2.6.14
|
134
|
+
rubygems_version: 3.1.2
|
214
135
|
signing_key:
|
215
136
|
specification_version: 4
|
216
137
|
summary: Redis session store for ActionPack
|
@@ -227,9 +148,6 @@ test_files:
|
|
227
148
|
- test/dummy/config/routes.rb
|
228
149
|
- test/dummy/script/rails
|
229
150
|
- test/fixtures/session_autoload_test/session_autoload_test/foo.rb
|
230
|
-
- test/gemfiles/Gemfile.rails-
|
231
|
-
- test/gemfiles/Gemfile.rails-4.1.x
|
232
|
-
- test/gemfiles/Gemfile.rails-4.2.x
|
233
|
-
- test/gemfiles/Gemfile.rails-5.0.x
|
151
|
+
- test/gemfiles/Gemfile.rails-6.0.x
|
234
152
|
- test/integration/redis_store_integration_test.rb
|
235
153
|
- test/test_helper.rb
|