devise-jwt-cookie 0.3.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +86 -86
- data/README.md +1 -1
- data/lib/devise/jwt/cookie/middleware.rb +9 -1
- data/lib/devise/jwt/cookie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bfd64ce1b6ade938b40ed67a7a0acc5e7b591d6bfe50c0e42dbc486715d9daa
|
4
|
+
data.tar.gz: e0e6c56fffce4f5af264bf8441e682435796ce6280dcb4eb009aaa048685a54a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f89ad148f023ce45a332f241b7dfa26de45034b2bd466a23886440634f37b790e868321311ac9766460cf347d023a3b2d240ce42e23da579ed5bda67e687288
|
7
|
+
data.tar.gz: 335e39879ae9f5021abbcc5cba43cfa4d1f84c7de8fb34d0c82a36c2571be1860638ec7c25f1f266755c4fa59fbec20d9751a4e60ebf5c74d53a72a9b8a44057
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
devise-jwt-cookie (0.
|
4
|
+
devise-jwt-cookie (0.5.0)
|
5
5
|
devise-jwt (~> 0.6)
|
6
6
|
dry-auto_inject (~> 0.6)
|
7
7
|
dry-configurable (~> 0.9, < 0.11)
|
@@ -9,67 +9,67 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actioncable (5.2.
|
13
|
-
actionpack (= 5.2.
|
12
|
+
actioncable (5.2.7)
|
13
|
+
actionpack (= 5.2.7)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailer (5.2.
|
17
|
-
actionpack (= 5.2.
|
18
|
-
actionview (= 5.2.
|
19
|
-
activejob (= 5.2.
|
16
|
+
actionmailer (5.2.7)
|
17
|
+
actionpack (= 5.2.7)
|
18
|
+
actionview (= 5.2.7)
|
19
|
+
activejob (= 5.2.7)
|
20
20
|
mail (~> 2.5, >= 2.5.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
|
-
actionpack (5.2.
|
23
|
-
actionview (= 5.2.
|
24
|
-
activesupport (= 5.2.
|
22
|
+
actionpack (5.2.7)
|
23
|
+
actionview (= 5.2.7)
|
24
|
+
activesupport (= 5.2.7)
|
25
25
|
rack (~> 2.0, >= 2.0.8)
|
26
26
|
rack-test (>= 0.6.3)
|
27
27
|
rails-dom-testing (~> 2.0)
|
28
28
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
29
|
-
actionview (5.2.
|
30
|
-
activesupport (= 5.2.
|
29
|
+
actionview (5.2.7)
|
30
|
+
activesupport (= 5.2.7)
|
31
31
|
builder (~> 3.1)
|
32
32
|
erubi (~> 1.4)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
34
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
35
|
-
activejob (5.2.
|
36
|
-
activesupport (= 5.2.
|
35
|
+
activejob (5.2.7)
|
36
|
+
activesupport (= 5.2.7)
|
37
37
|
globalid (>= 0.3.6)
|
38
|
-
activemodel (5.2.
|
39
|
-
activesupport (= 5.2.
|
40
|
-
activerecord (5.2.
|
41
|
-
activemodel (= 5.2.
|
42
|
-
activesupport (= 5.2.
|
38
|
+
activemodel (5.2.7)
|
39
|
+
activesupport (= 5.2.7)
|
40
|
+
activerecord (5.2.7)
|
41
|
+
activemodel (= 5.2.7)
|
42
|
+
activesupport (= 5.2.7)
|
43
43
|
arel (>= 9.0)
|
44
|
-
activestorage (5.2.
|
45
|
-
actionpack (= 5.2.
|
46
|
-
activerecord (= 5.2.
|
47
|
-
marcel (~> 0.
|
48
|
-
activesupport (5.2.
|
44
|
+
activestorage (5.2.7)
|
45
|
+
actionpack (= 5.2.7)
|
46
|
+
activerecord (= 5.2.7)
|
47
|
+
marcel (~> 1.0.0)
|
48
|
+
activesupport (5.2.7)
|
49
49
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
50
50
|
i18n (>= 0.7, < 2)
|
51
51
|
minitest (~> 5.1)
|
52
52
|
tzinfo (~> 1.1)
|
53
53
|
arel (9.0.0)
|
54
|
-
bcrypt (3.1.
|
54
|
+
bcrypt (3.1.17)
|
55
55
|
builder (3.2.4)
|
56
|
-
byebug (11.
|
56
|
+
byebug (11.1.3)
|
57
57
|
codeclimate-test-reporter (1.0.7)
|
58
58
|
simplecov
|
59
|
-
coderay (1.1.
|
60
|
-
concurrent-ruby (1.1.
|
59
|
+
coderay (1.1.3)
|
60
|
+
concurrent-ruby (1.1.10)
|
61
61
|
crass (1.0.6)
|
62
|
-
devise (4.
|
62
|
+
devise (4.8.1)
|
63
63
|
bcrypt (~> 3.0)
|
64
64
|
orm_adapter (~> 0.1)
|
65
65
|
railties (>= 4.1.0)
|
66
66
|
responders
|
67
67
|
warden (~> 1.2.3)
|
68
|
-
devise-jwt (0.
|
68
|
+
devise-jwt (0.8.1)
|
69
69
|
devise (~> 4.0)
|
70
|
-
warden-jwt_auth (~> 0.
|
71
|
-
diff-lcs (1.
|
72
|
-
docile (1.
|
70
|
+
warden-jwt_auth (~> 0.5)
|
71
|
+
diff-lcs (1.5.0)
|
72
|
+
docile (1.4.0)
|
73
73
|
dry-auto_inject (0.7.0)
|
74
74
|
dry-container (>= 0.3.4)
|
75
75
|
dry-configurable (0.9.0)
|
@@ -78,75 +78,75 @@ GEM
|
|
78
78
|
dry-container (0.7.2)
|
79
79
|
concurrent-ruby (~> 1.0)
|
80
80
|
dry-configurable (~> 0.1, >= 0.1.3)
|
81
|
-
dry-core (0.
|
81
|
+
dry-core (0.6.0)
|
82
82
|
concurrent-ruby (~> 1.0)
|
83
|
-
erubi (1.
|
84
|
-
globalid (0.
|
85
|
-
activesupport (>=
|
86
|
-
i18n (1.
|
83
|
+
erubi (1.10.0)
|
84
|
+
globalid (1.0.0)
|
85
|
+
activesupport (>= 5.0)
|
86
|
+
i18n (1.10.0)
|
87
87
|
concurrent-ruby (~> 1.0)
|
88
|
-
json (2.
|
89
|
-
jwt (2.
|
90
|
-
loofah (2.
|
88
|
+
json (2.6.1)
|
89
|
+
jwt (2.3.0)
|
90
|
+
loofah (2.15.0)
|
91
91
|
crass (~> 1.0.2)
|
92
92
|
nokogiri (>= 1.5.9)
|
93
93
|
mail (2.7.1)
|
94
94
|
mini_mime (>= 0.1.1)
|
95
|
-
marcel (0.
|
96
|
-
mimemagic (~> 0.3.2)
|
95
|
+
marcel (1.0.2)
|
97
96
|
method_source (1.0.0)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
97
|
+
mini_mime (1.1.2)
|
98
|
+
mini_portile2 (2.6.1)
|
99
|
+
minitest (5.15.0)
|
100
|
+
nio4r (2.5.8)
|
101
|
+
nokogiri (1.12.5)
|
102
|
+
mini_portile2 (~> 2.6.1)
|
103
|
+
racc (~> 1.4)
|
105
104
|
orm_adapter (0.5.0)
|
106
|
-
pry (0.13.
|
105
|
+
pry (0.13.1)
|
107
106
|
coderay (~> 1.1)
|
108
107
|
method_source (~> 1.0)
|
109
|
-
pry-byebug (3.
|
108
|
+
pry-byebug (3.9.0)
|
110
109
|
byebug (~> 11.0)
|
111
|
-
pry (~> 0.
|
112
|
-
|
110
|
+
pry (~> 0.13.0)
|
111
|
+
racc (1.6.0)
|
112
|
+
rack (2.2.3)
|
113
113
|
rack-test (1.1.0)
|
114
114
|
rack (>= 1.0, < 3)
|
115
|
-
rails (5.2.
|
116
|
-
actioncable (= 5.2.
|
117
|
-
actionmailer (= 5.2.
|
118
|
-
actionpack (= 5.2.
|
119
|
-
actionview (= 5.2.
|
120
|
-
activejob (= 5.2.
|
121
|
-
activemodel (= 5.2.
|
122
|
-
activerecord (= 5.2.
|
123
|
-
activestorage (= 5.2.
|
124
|
-
activesupport (= 5.2.
|
115
|
+
rails (5.2.7)
|
116
|
+
actioncable (= 5.2.7)
|
117
|
+
actionmailer (= 5.2.7)
|
118
|
+
actionpack (= 5.2.7)
|
119
|
+
actionview (= 5.2.7)
|
120
|
+
activejob (= 5.2.7)
|
121
|
+
activemodel (= 5.2.7)
|
122
|
+
activerecord (= 5.2.7)
|
123
|
+
activestorage (= 5.2.7)
|
124
|
+
activesupport (= 5.2.7)
|
125
125
|
bundler (>= 1.3.0)
|
126
|
-
railties (= 5.2.
|
126
|
+
railties (= 5.2.7)
|
127
127
|
sprockets-rails (>= 2.0.0)
|
128
128
|
rails-dom-testing (2.0.3)
|
129
129
|
activesupport (>= 4.2.0)
|
130
130
|
nokogiri (>= 1.6)
|
131
|
-
rails-html-sanitizer (1.
|
131
|
+
rails-html-sanitizer (1.4.2)
|
132
132
|
loofah (~> 2.3)
|
133
|
-
railties (5.2.
|
134
|
-
actionpack (= 5.2.
|
135
|
-
activesupport (= 5.2.
|
133
|
+
railties (5.2.7)
|
134
|
+
actionpack (= 5.2.7)
|
135
|
+
activesupport (= 5.2.7)
|
136
136
|
method_source
|
137
137
|
rake (>= 0.8.7)
|
138
138
|
thor (>= 0.19.0, < 2.0)
|
139
139
|
rake (12.3.3)
|
140
|
-
responders (3.0.
|
140
|
+
responders (3.0.1)
|
141
141
|
actionpack (>= 5.0)
|
142
142
|
railties (>= 5.0)
|
143
143
|
rspec (3.9.0)
|
144
144
|
rspec-core (~> 3.9.0)
|
145
145
|
rspec-expectations (~> 3.9.0)
|
146
146
|
rspec-mocks (~> 3.9.0)
|
147
|
-
rspec-core (3.9.
|
148
|
-
rspec-support (~> 3.9.
|
149
|
-
rspec-expectations (3.9.
|
147
|
+
rspec-core (3.9.3)
|
148
|
+
rspec-support (~> 3.9.3)
|
149
|
+
rspec-expectations (3.9.4)
|
150
150
|
diff-lcs (>= 1.2.0, < 2.0)
|
151
151
|
rspec-support (~> 3.9.0)
|
152
152
|
rspec-mocks (3.9.1)
|
@@ -160,34 +160,34 @@ GEM
|
|
160
160
|
rspec-expectations (~> 3.9.0)
|
161
161
|
rspec-mocks (~> 3.9.0)
|
162
162
|
rspec-support (~> 3.9.0)
|
163
|
-
rspec-support (3.9.
|
163
|
+
rspec-support (3.9.4)
|
164
164
|
simplecov (0.17.0)
|
165
165
|
docile (~> 1.1)
|
166
166
|
json (>= 1.8, < 3)
|
167
167
|
simplecov-html (~> 0.10.0)
|
168
168
|
simplecov-html (0.10.2)
|
169
|
-
sprockets (
|
169
|
+
sprockets (4.0.3)
|
170
170
|
concurrent-ruby (~> 1.0)
|
171
171
|
rack (> 1, < 3)
|
172
|
-
sprockets-rails (3.2
|
173
|
-
actionpack (>=
|
174
|
-
activesupport (>=
|
172
|
+
sprockets-rails (3.4.2)
|
173
|
+
actionpack (>= 5.2)
|
174
|
+
activesupport (>= 5.2)
|
175
175
|
sprockets (>= 3.0.0)
|
176
176
|
sqlite3 (1.4.2)
|
177
|
-
thor (1.
|
177
|
+
thor (1.2.1)
|
178
178
|
thread_safe (0.3.6)
|
179
|
-
tzinfo (1.2.
|
179
|
+
tzinfo (1.2.9)
|
180
180
|
thread_safe (~> 0.1)
|
181
|
-
warden (1.2.
|
182
|
-
rack (>= 2.0.
|
183
|
-
warden-jwt_auth (0.
|
181
|
+
warden (1.2.9)
|
182
|
+
rack (>= 2.0.9)
|
183
|
+
warden-jwt_auth (0.5.0)
|
184
184
|
dry-auto_inject (~> 0.6)
|
185
|
-
dry-configurable (~> 0.9
|
185
|
+
dry-configurable (~> 0.9)
|
186
186
|
jwt (~> 2.1)
|
187
187
|
warden (~> 1.2)
|
188
|
-
websocket-driver (0.7.
|
188
|
+
websocket-driver (0.7.5)
|
189
189
|
websocket-extensions (>= 0.1.0)
|
190
|
-
websocket-extensions (0.1.
|
190
|
+
websocket-extensions (0.1.5)
|
191
191
|
|
192
192
|
PLATFORMS
|
193
193
|
ruby
|
data/README.md
CHANGED
@@ -12,11 +12,19 @@ module Devise
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
+
token_should_be_revoked = token_should_be_revoked?(env)
|
16
|
+
if token_should_be_revoked
|
17
|
+
# add the Authorization header, devise-jwt needs this to revoke tokens
|
18
|
+
# we need to make sure this is done before the other middleware is run
|
19
|
+
request = ActionDispatch::Request.new(env)
|
20
|
+
env['HTTP_AUTHORIZATION'] = "Bearer #{CookieHelper.new.read_from(request.cookies)}"
|
21
|
+
end
|
22
|
+
|
15
23
|
status, headers, response = app.call(env)
|
16
24
|
if headers['Authorization'] && env[ENV_KEY]
|
17
25
|
name, cookie = CookieHelper.new.build(env[ENV_KEY])
|
18
26
|
Rack::Utils.set_cookie_header!(headers, name, cookie)
|
19
|
-
elsif token_should_be_revoked
|
27
|
+
elsif token_should_be_revoked
|
20
28
|
name, cookie = CookieHelper.new.build(nil)
|
21
29
|
Rack::Utils.set_cookie_header!(headers, name, cookie)
|
22
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-jwt-cookie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niels van der Zanden
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise-jwt
|