jwt_keeper 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/jwt_keeper.gemspec +3 -2
- data/lib/jwt_keeper/token.rb +1 -0
- data/lib/jwt_keeper/version.rb +1 -1
- data/spec/lib/jwt_keeper/controller_spec.rb +1 -1
- data/spec/lib/jwt_keeper/token_spec.rb +16 -9
- data/spec/spec_helper.rb +1 -0
- metadata +28 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2c902b7848d7fe72b7ad437badc5cf549b299d4b2ae2dc9150b7f42d63855a3
|
4
|
+
data.tar.gz: 77a18a0cfeb2b198f13affa3792feaeb1235d5fa2f6ae599038bb3e2245b41b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc177da58d088bdaeeba97049628d0908f05ef9bd717674a34b511a14e70289604a87647c01853ec3aeb988fb80cd95f4c4a96d0741a1133efc72f2138b9bd98
|
7
|
+
data.tar.gz: 97dde3b11a5584357028abb7d9523d548c53ccb8e0211a4b31089f177747c1d9fca7521bf4984837a540ec2c46080a51adacd30e322fcd4408e6d8d732cad21e
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/jwt_keeper.gemspec
CHANGED
@@ -23,13 +23,14 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency 'yard'
|
24
24
|
spec.add_development_dependency 'rubocop'
|
25
25
|
spec.add_development_dependency 'dotenv'
|
26
|
+
spec.add_development_dependency 'pry'
|
26
27
|
|
27
28
|
spec.add_development_dependency 'rspec', '~> 3.8'
|
28
29
|
spec.add_development_dependency 'fuubar'
|
29
30
|
spec.add_development_dependency 'simplecov'
|
30
31
|
|
31
32
|
spec.add_dependency 'redis'
|
32
|
-
spec.add_dependency 'rails'
|
33
|
-
spec.add_dependency 'activesupport'
|
33
|
+
spec.add_dependency 'rails'
|
34
|
+
spec.add_dependency 'activesupport'
|
34
35
|
spec.add_dependency 'jwt', '>= 1.5'
|
35
36
|
end
|
data/lib/jwt_keeper/token.rb
CHANGED
data/lib/jwt_keeper/version.rb
CHANGED
@@ -4,7 +4,7 @@ RSpec.describe JWTKeeper do
|
|
4
4
|
describe 'Controller' do
|
5
5
|
include_context 'initialize config'
|
6
6
|
|
7
|
-
let(:token) { JWTKeeper::Token.create(claim: "
|
7
|
+
let(:token) { JWTKeeper::Token.create(claim: "The Earth is Flat") }
|
8
8
|
subject(:test_controller) do
|
9
9
|
cookies_klass = Class.new(Hash) do
|
10
10
|
def signed
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
module JWTKeeper
|
4
4
|
RSpec.describe Token do
|
5
5
|
include_context 'initialize config'
|
6
|
-
let(:private_claims) { { claim: "
|
6
|
+
let(:private_claims) { { claim: "The Earth is Flat" } }
|
7
7
|
let(:token) { described_class.create(private_claims) }
|
8
8
|
let(:raw_token) { token.to_jwt }
|
9
9
|
|
@@ -42,16 +42,23 @@ module JWTKeeper
|
|
42
42
|
it { is_expected.to be nil }
|
43
43
|
end
|
44
44
|
|
45
|
-
context 'with
|
46
|
-
subject { described_class.find(raw_token, 'BAD_COOKIE') }
|
47
|
-
it { is_expected.to be nil }
|
48
|
-
end
|
49
|
-
|
50
|
-
context 'with valid cookie' do
|
45
|
+
context 'describe with cookie locking' do
|
51
46
|
before { JWTKeeper.configure(JWTKeeper::Configuration.new(config.merge(cookie_lock: true))) }
|
52
|
-
subject { described_class.find(raw_token, token.cookie_secret) }
|
53
47
|
|
54
|
-
|
48
|
+
context 'with no cookie' do
|
49
|
+
subject { described_class.find(raw_token, nil) }
|
50
|
+
it { is_expected.to be nil }
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'with bad cookie' do
|
54
|
+
subject { described_class.find(raw_token, 'BAD_COOKIE') }
|
55
|
+
it { is_expected.to be nil }
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'with valid cookie' do
|
59
|
+
subject { described_class.find(raw_token, token.cookie_secret) }
|
60
|
+
it { is_expected.to be_instance_of described_class }
|
61
|
+
end
|
55
62
|
end
|
56
63
|
end
|
57
64
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jwt_keeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rivera
|
8
8
|
- Zane Wolfgang Pickett
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -81,6 +81,20 @@ dependencies:
|
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: pry
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: rspec
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,30 +155,30 @@ dependencies:
|
|
141
155
|
name: rails
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|
143
157
|
requirements:
|
144
|
-
- - "
|
158
|
+
- - ">="
|
145
159
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
160
|
+
version: '0'
|
147
161
|
type: :runtime
|
148
162
|
prerelease: false
|
149
163
|
version_requirements: !ruby/object:Gem::Requirement
|
150
164
|
requirements:
|
151
|
-
- - "
|
165
|
+
- - ">="
|
152
166
|
- !ruby/object:Gem::Version
|
153
|
-
version: '
|
167
|
+
version: '0'
|
154
168
|
- !ruby/object:Gem::Dependency
|
155
169
|
name: activesupport
|
156
170
|
requirement: !ruby/object:Gem::Requirement
|
157
171
|
requirements:
|
158
|
-
- - "
|
172
|
+
- - ">="
|
159
173
|
- !ruby/object:Gem::Version
|
160
|
-
version: '
|
174
|
+
version: '0'
|
161
175
|
type: :runtime
|
162
176
|
prerelease: false
|
163
177
|
version_requirements: !ruby/object:Gem::Requirement
|
164
178
|
requirements:
|
165
|
-
- - "
|
179
|
+
- - ">="
|
166
180
|
- !ruby/object:Gem::Version
|
167
|
-
version: '
|
181
|
+
version: '0'
|
168
182
|
- !ruby/object:Gem::Dependency
|
169
183
|
name: jwt
|
170
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +234,7 @@ homepage: https://github.com/sirwolfgang/jwt_keeper
|
|
220
234
|
licenses:
|
221
235
|
- MIT
|
222
236
|
metadata: {}
|
223
|
-
post_install_message:
|
237
|
+
post_install_message:
|
224
238
|
rdoc_options: []
|
225
239
|
require_paths:
|
226
240
|
- lib
|
@@ -235,9 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
249
|
- !ruby/object:Gem::Version
|
236
250
|
version: '0'
|
237
251
|
requirements: []
|
238
|
-
|
239
|
-
|
240
|
-
signing_key:
|
252
|
+
rubygems_version: 3.1.4
|
253
|
+
signing_key:
|
241
254
|
specification_version: 4
|
242
255
|
summary: JWT for Rails made easy
|
243
256
|
test_files:
|