sorcery-jwt 0.2.1 → 1.0.0

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.
@@ -0,0 +1,278 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sorcery-jwt (0.2.1)
5
+ jwt (>= 1.0, < 3.0)
6
+ sorcery (>= 0.16.5, < 0.19)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ action_text-trix (2.1.19)
12
+ railties
13
+ actioncable (8.1.3.1)
14
+ actionpack (= 8.1.3.1)
15
+ activesupport (= 8.1.3.1)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ zeitwerk (~> 2.6)
19
+ actionmailbox (8.1.3.1)
20
+ actionpack (= 8.1.3.1)
21
+ activejob (= 8.1.3.1)
22
+ activerecord (= 8.1.3.1)
23
+ activestorage (= 8.1.3.1)
24
+ activesupport (= 8.1.3.1)
25
+ mail (>= 2.8.0)
26
+ actionmailer (8.1.3.1)
27
+ actionpack (= 8.1.3.1)
28
+ actionview (= 8.1.3.1)
29
+ activejob (= 8.1.3.1)
30
+ activesupport (= 8.1.3.1)
31
+ mail (>= 2.8.0)
32
+ rails-dom-testing (~> 2.2)
33
+ actionpack (8.1.3.1)
34
+ actionview (= 8.1.3.1)
35
+ activesupport (= 8.1.3.1)
36
+ nokogiri (>= 1.8.5)
37
+ rack (>= 2.2.4)
38
+ rack-session (>= 1.0.1)
39
+ rack-test (>= 0.6.3)
40
+ rails-dom-testing (~> 2.2)
41
+ rails-html-sanitizer (~> 1.6)
42
+ useragent (~> 0.16)
43
+ actiontext (8.1.3.1)
44
+ action_text-trix (~> 2.1.15)
45
+ actionpack (= 8.1.3.1)
46
+ activerecord (= 8.1.3.1)
47
+ activestorage (= 8.1.3.1)
48
+ activesupport (= 8.1.3.1)
49
+ globalid (>= 0.6.0)
50
+ nokogiri (>= 1.8.5)
51
+ actionview (8.1.3.1)
52
+ activesupport (= 8.1.3.1)
53
+ builder (~> 3.1)
54
+ erubi (~> 1.11)
55
+ rails-dom-testing (~> 2.2)
56
+ rails-html-sanitizer (~> 1.6)
57
+ activejob (8.1.3.1)
58
+ activesupport (= 8.1.3.1)
59
+ globalid (>= 0.3.6)
60
+ activemodel (8.1.3.1)
61
+ activesupport (= 8.1.3.1)
62
+ activerecord (8.1.3.1)
63
+ activemodel (= 8.1.3.1)
64
+ activesupport (= 8.1.3.1)
65
+ timeout (>= 0.4.0)
66
+ activestorage (8.1.3.1)
67
+ actionpack (= 8.1.3.1)
68
+ activejob (= 8.1.3.1)
69
+ activerecord (= 8.1.3.1)
70
+ activesupport (= 8.1.3.1)
71
+ marcel (~> 1.0)
72
+ activesupport (8.1.3.1)
73
+ base64
74
+ bigdecimal
75
+ concurrent-ruby (~> 1.0, >= 1.3.1)
76
+ connection_pool (>= 2.2.5)
77
+ drb
78
+ i18n (>= 1.6, < 2)
79
+ json
80
+ logger (>= 1.4.2)
81
+ minitest (>= 5.1)
82
+ securerandom (>= 0.3)
83
+ tzinfo (~> 2.0, >= 2.0.5)
84
+ uri (>= 0.13.1)
85
+ anonymous_loader (0.1.3)
86
+ version_gem (~> 1.1, >= 1.1.14)
87
+ auth-sanitizer (0.2.3)
88
+ version_gem (~> 1.1, >= 1.1.14)
89
+ base64 (0.3.0)
90
+ bcrypt (3.1.22)
91
+ bigdecimal (4.1.2)
92
+ builder (3.3.0)
93
+ concurrent-ruby (1.3.8)
94
+ connection_pool (3.0.2)
95
+ crass (1.0.7)
96
+ date (3.5.1)
97
+ diff-lcs (1.6.2)
98
+ drb (2.2.3)
99
+ erb (6.0.7)
100
+ erubi (1.13.1)
101
+ faraday (2.14.3)
102
+ faraday-net_http (>= 2.0, < 3.5)
103
+ json
104
+ logger
105
+ faraday-net_http (3.4.4)
106
+ net-http (~> 0.5)
107
+ globalid (1.4.0)
108
+ activesupport (>= 6.1)
109
+ hashie (5.1.0)
110
+ logger
111
+ i18n (1.15.2)
112
+ concurrent-ruby (~> 1.0)
113
+ io-console (0.9.2)
114
+ irb (1.18.0)
115
+ pp (>= 0.6.0)
116
+ prism (>= 1.3.0)
117
+ rdoc (>= 4.0.0)
118
+ reline (>= 0.4.2)
119
+ json (2.21.2)
120
+ jwt (2.10.3)
121
+ base64
122
+ logger (1.7.0)
123
+ loofah (2.25.2)
124
+ crass (~> 1.0.2)
125
+ nokogiri (>= 1.12.0)
126
+ mail (2.9.1)
127
+ logger
128
+ mini_mime (>= 0.1.1)
129
+ net-imap
130
+ net-pop
131
+ net-smtp
132
+ marcel (1.2.1)
133
+ mini_mime (1.1.5)
134
+ minitest (6.0.6)
135
+ drb (~> 2.0)
136
+ prism (~> 1.5)
137
+ multi_xml (0.9.1)
138
+ bigdecimal (>= 3.1, < 5)
139
+ net-http (0.9.1)
140
+ uri (>= 0.11.1)
141
+ net-imap (0.6.6)
142
+ date
143
+ net-protocol
144
+ net-pop (0.1.2)
145
+ net-protocol
146
+ net-protocol (0.3.0)
147
+ timeout
148
+ net-smtp (0.5.1)
149
+ net-protocol
150
+ nio4r (2.7.5)
151
+ nokogiri (1.19.4-x86_64-linux-gnu)
152
+ racc (~> 1.4)
153
+ oauth (1.1.8)
154
+ anonymous_loader (~> 0.1, >= 0.1.3)
155
+ auth-sanitizer (~> 0.2, >= 0.2.3)
156
+ base64 (~> 0.1)
157
+ oauth-tty (~> 1.0, >= 1.0.13)
158
+ snaky_hash (~> 2.0, >= 2.0.7)
159
+ version_gem (~> 1.1, >= 1.1.14)
160
+ oauth-tty (1.0.13)
161
+ anonymous_loader (~> 0.1, >= 0.1.3)
162
+ auth-sanitizer (~> 0.2, >= 0.2.3)
163
+ version_gem (~> 1.1, >= 1.1.14)
164
+ oauth2 (2.0.25)
165
+ anonymous_loader (~> 0.1, >= 0.1.3)
166
+ auth-sanitizer (~> 0.2, >= 0.2.3)
167
+ faraday (>= 0.17.3, < 4.0)
168
+ jwt (>= 1.0, < 4.0)
169
+ logger (~> 1.2)
170
+ multi_xml (~> 0.5)
171
+ rack (>= 1.2, < 4)
172
+ snaky_hash (~> 2.0, >= 2.0.7)
173
+ version_gem (~> 1.1, >= 1.1.14)
174
+ pp (0.6.4)
175
+ prettyprint
176
+ prettyprint (0.2.0)
177
+ prism (1.9.0)
178
+ racc (1.8.1)
179
+ rack (3.2.7)
180
+ rack-session (2.1.2)
181
+ base64 (>= 0.1.0)
182
+ rack (>= 3.0.0)
183
+ rack-test (2.2.0)
184
+ rack (>= 1.3)
185
+ rackup (2.3.1)
186
+ rack (>= 3)
187
+ rails (8.1.3.1)
188
+ actioncable (= 8.1.3.1)
189
+ actionmailbox (= 8.1.3.1)
190
+ actionmailer (= 8.1.3.1)
191
+ actionpack (= 8.1.3.1)
192
+ actiontext (= 8.1.3.1)
193
+ actionview (= 8.1.3.1)
194
+ activejob (= 8.1.3.1)
195
+ activemodel (= 8.1.3.1)
196
+ activerecord (= 8.1.3.1)
197
+ activestorage (= 8.1.3.1)
198
+ activesupport (= 8.1.3.1)
199
+ bundler (>= 1.15.0)
200
+ railties (= 8.1.3.1)
201
+ rails-dom-testing (2.3.0)
202
+ activesupport (>= 5.0.0)
203
+ minitest
204
+ nokogiri (>= 1.6)
205
+ rails-html-sanitizer (1.7.1)
206
+ loofah (~> 2.25, >= 2.25.2)
207
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
208
+ railties (8.1.3.1)
209
+ actionpack (= 8.1.3.1)
210
+ activesupport (= 8.1.3.1)
211
+ irb (~> 1.13)
212
+ rackup (>= 1.0.0)
213
+ rake (>= 12.2)
214
+ thor (~> 1.0, >= 1.2.2)
215
+ tsort (>= 0.2)
216
+ zeitwerk (~> 2.6)
217
+ rake (13.4.2)
218
+ rbs (4.2.0)
219
+ logger
220
+ prism (>= 1.6.0)
221
+ tsort
222
+ rdoc (8.0.0)
223
+ erb
224
+ prism (>= 1.6.0)
225
+ rbs (>= 4.0.0)
226
+ tsort
227
+ reline (0.7.0)
228
+ io-console (~> 0.5)
229
+ rspec (3.13.2)
230
+ rspec-core (~> 3.13.0)
231
+ rspec-expectations (~> 3.13.0)
232
+ rspec-mocks (~> 3.13.0)
233
+ rspec-core (3.13.6)
234
+ rspec-support (~> 3.13.0)
235
+ rspec-expectations (3.13.5)
236
+ diff-lcs (>= 1.2.0, < 2.0)
237
+ rspec-support (~> 3.13.0)
238
+ rspec-mocks (3.13.8)
239
+ diff-lcs (>= 1.2.0, < 2.0)
240
+ rspec-support (~> 3.13.0)
241
+ rspec-support (3.13.7)
242
+ securerandom (0.4.1)
243
+ snaky_hash (2.0.7)
244
+ hashie (>= 0.1.0, < 6)
245
+ version_gem (~> 1.1, >= 1.1.14)
246
+ sorcery (0.17.0)
247
+ bcrypt (~> 3.1)
248
+ oauth (>= 0.6)
249
+ oauth2 (~> 2.0)
250
+ sqlite3 (2.9.6-x86_64-linux-gnu)
251
+ thor (1.5.0)
252
+ timeout (0.6.1)
253
+ tsort (0.2.0)
254
+ tzinfo (2.0.6)
255
+ concurrent-ruby (~> 1.0)
256
+ uri (1.1.1)
257
+ useragent (0.16.11)
258
+ version_gem (1.1.15)
259
+ websocket-driver (0.8.2)
260
+ base64
261
+ websocket-extensions (>= 0.1.0)
262
+ websocket-extensions (0.1.5)
263
+ zeitwerk (2.8.3)
264
+
265
+ PLATFORMS
266
+ x86_64-linux
267
+
268
+ DEPENDENCIES
269
+ activerecord (~> 8.0)
270
+ rails (~> 8.0)
271
+ rake (~> 13.0)
272
+ rspec (~> 3.0)
273
+ sorcery (= 0.17.0)
274
+ sorcery-jwt!
275
+ sqlite3 (~> 2.0)
276
+
277
+ BUNDLED WITH
278
+ 2.6.9
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "sorcery", "= 0.18.0"
4
+ gemspec path: "../"
@@ -0,0 +1,307 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sorcery-jwt (0.2.1)
5
+ jwt (>= 1.0, < 3.0)
6
+ sorcery (>= 0.16.5, < 0.19)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ action_text-trix (2.1.19)
12
+ railties
13
+ actioncable (8.1.3.1)
14
+ actionpack (= 8.1.3.1)
15
+ activesupport (= 8.1.3.1)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ zeitwerk (~> 2.6)
19
+ actionmailbox (8.1.3.1)
20
+ actionpack (= 8.1.3.1)
21
+ activejob (= 8.1.3.1)
22
+ activerecord (= 8.1.3.1)
23
+ activestorage (= 8.1.3.1)
24
+ activesupport (= 8.1.3.1)
25
+ mail (>= 2.8.0)
26
+ actionmailer (8.1.3.1)
27
+ actionpack (= 8.1.3.1)
28
+ actionview (= 8.1.3.1)
29
+ activejob (= 8.1.3.1)
30
+ activesupport (= 8.1.3.1)
31
+ mail (>= 2.8.0)
32
+ rails-dom-testing (~> 2.2)
33
+ actionpack (8.1.3.1)
34
+ actionview (= 8.1.3.1)
35
+ activesupport (= 8.1.3.1)
36
+ nokogiri (>= 1.8.5)
37
+ rack (>= 2.2.4)
38
+ rack-session (>= 1.0.1)
39
+ rack-test (>= 0.6.3)
40
+ rails-dom-testing (~> 2.2)
41
+ rails-html-sanitizer (~> 1.6)
42
+ useragent (~> 0.16)
43
+ actiontext (8.1.3.1)
44
+ action_text-trix (~> 2.1.15)
45
+ actionpack (= 8.1.3.1)
46
+ activerecord (= 8.1.3.1)
47
+ activestorage (= 8.1.3.1)
48
+ activesupport (= 8.1.3.1)
49
+ globalid (>= 0.6.0)
50
+ nokogiri (>= 1.8.5)
51
+ actionview (8.1.3.1)
52
+ activesupport (= 8.1.3.1)
53
+ builder (~> 3.1)
54
+ erubi (~> 1.11)
55
+ rails-dom-testing (~> 2.2)
56
+ rails-html-sanitizer (~> 1.6)
57
+ activejob (8.1.3.1)
58
+ activesupport (= 8.1.3.1)
59
+ globalid (>= 0.3.6)
60
+ activemodel (8.1.3.1)
61
+ activesupport (= 8.1.3.1)
62
+ activerecord (8.1.3.1)
63
+ activemodel (= 8.1.3.1)
64
+ activesupport (= 8.1.3.1)
65
+ timeout (>= 0.4.0)
66
+ activestorage (8.1.3.1)
67
+ actionpack (= 8.1.3.1)
68
+ activejob (= 8.1.3.1)
69
+ activerecord (= 8.1.3.1)
70
+ activesupport (= 8.1.3.1)
71
+ marcel (~> 1.0)
72
+ activesupport (8.1.3.1)
73
+ base64
74
+ bigdecimal
75
+ concurrent-ruby (~> 1.0, >= 1.3.1)
76
+ connection_pool (>= 2.2.5)
77
+ drb
78
+ i18n (>= 1.6, < 2)
79
+ json
80
+ logger (>= 1.4.2)
81
+ minitest (>= 5.1)
82
+ securerandom (>= 0.3)
83
+ tzinfo (~> 2.0, >= 2.0.5)
84
+ uri (>= 0.13.1)
85
+ anonymous_loader (0.1.3)
86
+ version_gem (~> 1.1, >= 1.1.14)
87
+ auth-sanitizer (0.2.3)
88
+ version_gem (~> 1.1, >= 1.1.14)
89
+ base64 (0.3.0)
90
+ bcrypt (3.1.22)
91
+ bigdecimal (4.1.2)
92
+ builder (3.3.0)
93
+ concurrent-ruby (1.3.8)
94
+ connection_pool (3.0.2)
95
+ crass (1.0.7)
96
+ date (3.5.1)
97
+ diff-lcs (1.6.2)
98
+ drb (2.2.3)
99
+ erb (6.0.7)
100
+ erubi (1.13.1)
101
+ faraday (2.14.3)
102
+ faraday-net_http (>= 2.0, < 3.5)
103
+ json
104
+ logger
105
+ faraday-net_http (3.4.4)
106
+ net-http (~> 0.5)
107
+ globalid (1.4.0)
108
+ activesupport (>= 6.1)
109
+ hashie (5.1.0)
110
+ logger
111
+ i18n (1.15.2)
112
+ concurrent-ruby (~> 1.0)
113
+ io-console (0.9.2)
114
+ irb (1.18.0)
115
+ pp (>= 0.6.0)
116
+ prism (>= 1.3.0)
117
+ rdoc (>= 4.0.0)
118
+ reline (>= 0.4.2)
119
+ json (2.21.2)
120
+ jwt (2.10.3)
121
+ base64
122
+ logger (1.7.0)
123
+ loofah (2.25.2)
124
+ crass (~> 1.0.2)
125
+ nokogiri (>= 1.12.0)
126
+ mail (2.9.1)
127
+ logger
128
+ mini_mime (>= 0.1.1)
129
+ net-imap
130
+ net-pop
131
+ net-smtp
132
+ marcel (1.2.1)
133
+ mini_mime (1.1.5)
134
+ minitest (6.0.6)
135
+ drb (~> 2.0)
136
+ prism (~> 1.5)
137
+ multi_xml (0.9.1)
138
+ bigdecimal (>= 3.1, < 5)
139
+ net-http (0.9.1)
140
+ uri (>= 0.11.1)
141
+ net-imap (0.6.6)
142
+ date
143
+ net-protocol
144
+ net-pop (0.1.2)
145
+ net-protocol
146
+ net-protocol (0.3.0)
147
+ timeout
148
+ net-smtp (0.5.1)
149
+ net-protocol
150
+ nio4r (2.7.5)
151
+ nokogiri (1.19.4-aarch64-linux-gnu)
152
+ racc (~> 1.4)
153
+ nokogiri (1.19.4-aarch64-linux-musl)
154
+ racc (~> 1.4)
155
+ nokogiri (1.19.4-arm-linux-gnu)
156
+ racc (~> 1.4)
157
+ nokogiri (1.19.4-arm-linux-musl)
158
+ racc (~> 1.4)
159
+ nokogiri (1.19.4-arm64-darwin)
160
+ racc (~> 1.4)
161
+ nokogiri (1.19.4-x86_64-darwin)
162
+ racc (~> 1.4)
163
+ nokogiri (1.19.4-x86_64-linux-gnu)
164
+ racc (~> 1.4)
165
+ nokogiri (1.19.4-x86_64-linux-musl)
166
+ racc (~> 1.4)
167
+ oauth (1.1.8)
168
+ anonymous_loader (~> 0.1, >= 0.1.3)
169
+ auth-sanitizer (~> 0.2, >= 0.2.3)
170
+ base64 (~> 0.1)
171
+ oauth-tty (~> 1.0, >= 1.0.13)
172
+ snaky_hash (~> 2.0, >= 2.0.7)
173
+ version_gem (~> 1.1, >= 1.1.14)
174
+ oauth-tty (1.0.13)
175
+ anonymous_loader (~> 0.1, >= 0.1.3)
176
+ auth-sanitizer (~> 0.2, >= 0.2.3)
177
+ version_gem (~> 1.1, >= 1.1.14)
178
+ oauth2 (2.0.25)
179
+ anonymous_loader (~> 0.1, >= 0.1.3)
180
+ auth-sanitizer (~> 0.2, >= 0.2.3)
181
+ faraday (>= 0.17.3, < 4.0)
182
+ jwt (>= 1.0, < 4.0)
183
+ logger (~> 1.2)
184
+ multi_xml (~> 0.5)
185
+ rack (>= 1.2, < 4)
186
+ snaky_hash (~> 2.0, >= 2.0.7)
187
+ version_gem (~> 1.1, >= 1.1.14)
188
+ pp (0.6.4)
189
+ prettyprint
190
+ prettyprint (0.2.0)
191
+ prism (1.9.0)
192
+ racc (1.8.1)
193
+ rack (3.2.7)
194
+ rack-session (2.1.2)
195
+ base64 (>= 0.1.0)
196
+ rack (>= 3.0.0)
197
+ rack-test (2.2.0)
198
+ rack (>= 1.3)
199
+ rackup (2.3.1)
200
+ rack (>= 3)
201
+ rails (8.1.3.1)
202
+ actioncable (= 8.1.3.1)
203
+ actionmailbox (= 8.1.3.1)
204
+ actionmailer (= 8.1.3.1)
205
+ actionpack (= 8.1.3.1)
206
+ actiontext (= 8.1.3.1)
207
+ actionview (= 8.1.3.1)
208
+ activejob (= 8.1.3.1)
209
+ activemodel (= 8.1.3.1)
210
+ activerecord (= 8.1.3.1)
211
+ activestorage (= 8.1.3.1)
212
+ activesupport (= 8.1.3.1)
213
+ bundler (>= 1.15.0)
214
+ railties (= 8.1.3.1)
215
+ rails-dom-testing (2.3.0)
216
+ activesupport (>= 5.0.0)
217
+ minitest
218
+ nokogiri (>= 1.6)
219
+ rails-html-sanitizer (1.7.1)
220
+ loofah (~> 2.25, >= 2.25.2)
221
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
222
+ railties (8.1.3.1)
223
+ actionpack (= 8.1.3.1)
224
+ activesupport (= 8.1.3.1)
225
+ irb (~> 1.13)
226
+ rackup (>= 1.0.0)
227
+ rake (>= 12.2)
228
+ thor (~> 1.0, >= 1.2.2)
229
+ tsort (>= 0.2)
230
+ zeitwerk (~> 2.6)
231
+ rake (13.4.2)
232
+ rbs (4.2.0)
233
+ logger
234
+ prism (>= 1.6.0)
235
+ tsort
236
+ rdoc (8.0.0)
237
+ erb
238
+ prism (>= 1.6.0)
239
+ rbs (>= 4.0.0)
240
+ tsort
241
+ reline (0.7.0)
242
+ io-console (~> 0.5)
243
+ rspec (3.13.2)
244
+ rspec-core (~> 3.13.0)
245
+ rspec-expectations (~> 3.13.0)
246
+ rspec-mocks (~> 3.13.0)
247
+ rspec-core (3.13.6)
248
+ rspec-support (~> 3.13.0)
249
+ rspec-expectations (3.13.5)
250
+ diff-lcs (>= 1.2.0, < 2.0)
251
+ rspec-support (~> 3.13.0)
252
+ rspec-mocks (3.13.8)
253
+ diff-lcs (>= 1.2.0, < 2.0)
254
+ rspec-support (~> 3.13.0)
255
+ rspec-support (3.13.7)
256
+ securerandom (0.4.1)
257
+ snaky_hash (2.0.7)
258
+ hashie (>= 0.1.0, < 6)
259
+ version_gem (~> 1.1, >= 1.1.14)
260
+ sorcery (0.18.0)
261
+ bcrypt (~> 3.1)
262
+ oauth (>= 0.6)
263
+ oauth2 (~> 2.0)
264
+ railties (>= 7.1)
265
+ sqlite3 (2.9.6-aarch64-linux-gnu)
266
+ sqlite3 (2.9.6-aarch64-linux-musl)
267
+ sqlite3 (2.9.6-arm-linux-gnu)
268
+ sqlite3 (2.9.6-arm-linux-musl)
269
+ sqlite3 (2.9.6-arm64-darwin)
270
+ sqlite3 (2.9.6-x86_64-darwin)
271
+ sqlite3 (2.9.6-x86_64-linux-gnu)
272
+ sqlite3 (2.9.6-x86_64-linux-musl)
273
+ thor (1.5.0)
274
+ timeout (0.6.1)
275
+ tsort (0.2.0)
276
+ tzinfo (2.0.6)
277
+ concurrent-ruby (~> 1.0)
278
+ uri (1.1.1)
279
+ useragent (0.16.11)
280
+ version_gem (1.1.15)
281
+ websocket-driver (0.8.2)
282
+ base64
283
+ websocket-extensions (>= 0.1.0)
284
+ websocket-extensions (0.1.5)
285
+ zeitwerk (2.8.3)
286
+
287
+ PLATFORMS
288
+ aarch64-linux-gnu
289
+ aarch64-linux-musl
290
+ arm-linux-gnu
291
+ arm-linux-musl
292
+ arm64-darwin
293
+ x86_64-darwin
294
+ x86_64-linux-gnu
295
+ x86_64-linux-musl
296
+
297
+ DEPENDENCIES
298
+ activerecord (~> 8.0)
299
+ rails (~> 8.0)
300
+ rake (~> 13.0)
301
+ rspec (~> 3.0)
302
+ sorcery (= 0.18.0)
303
+ sorcery-jwt!
304
+ sqlite3 (~> 2.0)
305
+
306
+ BUNDLED WITH
307
+ 2.6.9
@@ -10,6 +10,9 @@ module Sorcery
10
10
  module InstanceMethods
11
11
  protected
12
12
 
13
+ # A sorcery login source: authenticates the request from the
14
+ # Authorization header when it carries a validly signed, unexpired
15
+ # JWT whose id and email claims match a user.
13
16
  def login_from_jwt
14
17
  claims = decoded_token.first.slice("id", "email")
15
18
  return @current_user = nil if claims.empty?
@@ -21,6 +24,10 @@ module Sorcery
21
24
  @current_user = nil
22
25
  end
23
26
 
27
+ # Authenticates credentials via sorcery and, on success, issues a
28
+ # JWT for the user carrying its id and email claims.
29
+ #
30
+ # @return [String, nil] the JWT, or nil when credentials fail
24
31
  def login_and_issue_token(*credentials)
25
32
  return unless (user = user_class.authenticate(*credentials))
26
33
 
@@ -1,5 +1,5 @@
1
1
  module Sorcery
2
2
  module Jwt
3
- VERSION = "0.2.1".freeze
3
+ VERSION = "1.0.0".freeze
4
4
  end
5
5
  end
@@ -15,11 +15,14 @@ module Sorcery
15
15
  attr_accessor :jwt_algorithm
16
16
  # How long the session should be valid for in seconds. Will be set as the exp claim in the token.
17
17
  attr_accessor :session_expiry
18
+ # Clock-skew tolerance in seconds applied when verifying exp. nil disables leeway.
19
+ attr_accessor :exp_leeway
18
20
  end
19
21
 
20
22
  base.sorcery_config.instance_eval do
21
23
  @defaults[:@jwt_algorithm] = "HS256"
22
24
  @defaults[:@session_expiry] = 60 * 60 * 24 * 7 * 2 # 2 weeks
25
+ @defaults[:@exp_leeway] = nil
23
26
 
24
27
  reset!
25
28
  end
@@ -30,15 +33,33 @@ module Sorcery
30
33
  end
31
34
 
32
35
  module ClassMethods
36
+ # Encodes a JWT for a user, adding the exp and iat claims.
37
+ # Any claim in the payload except exp and iat is preserved.
38
+ #
39
+ # @param payload [Hash] claims to encode; must include "id" and "email"
40
+ # for the token to authenticate via the controller submodule
41
+ # @return [String] the signed JWT
33
42
  def issue_token(payload)
34
- exp_payload = payload.merge(exp: Time.now.to_i + @sorcery_config.session_expiry)
43
+ now = Time.now.to_i
44
+ exp_payload = payload.merge(iat: now, exp: now + @sorcery_config.session_expiry)
35
45
  JWT.encode(exp_payload, @sorcery_config.jwt_secret, @sorcery_config.jwt_algorithm)
36
46
  end
37
47
 
48
+ # Decodes and verifies a JWT with the configured secret and algorithm.
49
+ #
50
+ # @param token [String, nil] the JWT
51
+ # @return [Array<(Hash, Hash)>] payload and header, as returned by jwt
52
+ # @raise [JWT::DecodeError] if the signature, algorithm, or exp fail
38
53
  def decode_token(token)
39
- JWT.decode(token, @sorcery_config.jwt_secret, true, algorithm: @sorcery_config.jwt_algorithm)
54
+ options = { algorithm: @sorcery_config.jwt_algorithm }
55
+ options[:exp_leeway] = @sorcery_config.exp_leeway if @sorcery_config.exp_leeway
56
+ JWT.decode(token, @sorcery_config.jwt_secret, true, options)
40
57
  end
41
58
 
59
+ # Returns whether a JWT is validly signed and unexpired.
60
+ #
61
+ # @param token [String, nil]
62
+ # @return [Boolean]
42
63
  def token_valid?(token)
43
64
  !!decode_token(token)
44
65
  rescue JWT::DecodeError, JWT::ExpiredSignature
data/sorcery-jwt.gemspec CHANGED
@@ -16,6 +16,8 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = spec.homepage
18
18
  spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG.md"
19
+ spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
20
+ spec.metadata["rubygems_mfa_required"] = "true"
19
21
 
20
22
  spec.required_ruby_version = ">= 3.0"
21
23
 
@@ -32,8 +34,11 @@ Gem::Specification.new do |spec|
32
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
35
  spec.require_paths = ["lib"]
34
36
 
37
+ spec.add_development_dependency "activerecord", "~> 8.0"
38
+ spec.add_development_dependency "rails", "~> 8.0"
35
39
  spec.add_development_dependency "rake", "~> 13.0"
36
40
  spec.add_development_dependency "rspec", "~> 3.0"
41
+ spec.add_development_dependency "sqlite3", "~> 2.0"
37
42
 
38
43
  spec.add_runtime_dependency "jwt", ">= 1.0", "< 3.0"
39
44
  spec.add_runtime_dependency "sorcery", ">= 0.16.5", "< 0.19"