jwt-authorizer 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +21 -21
- data/bin/console +1 -1
- data/lib/jwt/authorizer/version.rb +1 -1
- data/lib/jwt/token/builder.rb +8 -0
- data/lib/jwt/token/claim.rb +3 -2
- data/lib/jwt/token/configuration.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: da278a5363a0e712c081dfd198e3c8d362a27517
|
4
|
+
data.tar.gz: 776cdc715d65c216e2a0e304b819100057eb23bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ece519741eae0ef0553e7bda0e893d29e06b88e719925273fc44e047346bb19ce2045d403e550ab21acc07cd24cc8a92d31932748b4181e368431813131490
|
7
|
+
data.tar.gz: a645a4f334fdf3d72b6e877af6660c818dc159b376859d712779cfec2dbf7e0f4c6da900d2d4a1f49140cd5d88ecbaea7db4e1355c3ab2bbc0bd6e606daf5610
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
|
+
## 2.0.1
|
2
|
+
|
3
|
+
- Improved error when token configuration is missing private key while signing
|
4
|
+
- Allowed empty verifier during claim definition
|
5
|
+
|
1
6
|
## 2.0.0
|
2
|
-
|
7
|
+
|
8
|
+
- Changed the way public and private keys are configured, allowing checking JWT signatures against multiple public keys in RSA and ECDSA strategies
|
3
9
|
|
4
10
|
## 1.0.0
|
5
11
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jwt-authorizer (2.0.
|
4
|
+
jwt-authorizer (2.0.1)
|
5
5
|
jwt (~> 2.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -14,39 +14,39 @@ GEM
|
|
14
14
|
jaro_winkler (1.5.1)
|
15
15
|
json (2.1.0)
|
16
16
|
jwt (2.1.0)
|
17
|
-
method_source (0.9.
|
17
|
+
method_source (0.9.2)
|
18
18
|
parallel (1.12.1)
|
19
|
-
parser (2.5.
|
19
|
+
parser (2.5.3.0)
|
20
20
|
ast (~> 2.4.0)
|
21
21
|
powerpack (0.1.2)
|
22
|
-
pry (0.
|
22
|
+
pry (0.12.0)
|
23
23
|
coderay (~> 1.1.0)
|
24
24
|
method_source (~> 0.9.0)
|
25
|
-
rack (2.0.
|
25
|
+
rack (2.0.6)
|
26
26
|
rainbow (3.0.0)
|
27
27
|
rake (12.3.1)
|
28
|
-
rspec (3.
|
29
|
-
rspec-core (~> 3.
|
30
|
-
rspec-expectations (~> 3.
|
31
|
-
rspec-mocks (~> 3.
|
32
|
-
rspec-core (3.
|
33
|
-
rspec-support (~> 3.
|
34
|
-
rspec-expectations (3.
|
28
|
+
rspec (3.8.0)
|
29
|
+
rspec-core (~> 3.8.0)
|
30
|
+
rspec-expectations (~> 3.8.0)
|
31
|
+
rspec-mocks (~> 3.8.0)
|
32
|
+
rspec-core (3.8.0)
|
33
|
+
rspec-support (~> 3.8.0)
|
34
|
+
rspec-expectations (3.8.2)
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-mocks (3.
|
36
|
+
rspec-support (~> 3.8.0)
|
37
|
+
rspec-mocks (3.8.0)
|
38
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-support (3.
|
41
|
-
rubocop (0.
|
39
|
+
rspec-support (~> 3.8.0)
|
40
|
+
rspec-support (3.8.0)
|
41
|
+
rubocop (0.60.0)
|
42
42
|
jaro_winkler (~> 1.5.1)
|
43
43
|
parallel (~> 1.10)
|
44
|
-
parser (>= 2.5)
|
44
|
+
parser (>= 2.5, != 2.5.1.1)
|
45
45
|
powerpack (~> 0.1)
|
46
46
|
rainbow (>= 2.2.2, < 4.0)
|
47
47
|
ruby-progressbar (~> 1.7)
|
48
|
-
unicode-display_width (~> 1.
|
49
|
-
ruby-progressbar (1.
|
48
|
+
unicode-display_width (~> 1.4.0)
|
49
|
+
ruby-progressbar (1.10.0)
|
50
50
|
simplecov (0.16.1)
|
51
51
|
docile (~> 1.1)
|
52
52
|
json (>= 1.8, < 3)
|
@@ -70,4 +70,4 @@ DEPENDENCIES
|
|
70
70
|
timecop (~> 0.9)
|
71
71
|
|
72
72
|
BUNDLED WITH
|
73
|
-
1.
|
73
|
+
1.17.1
|
data/bin/console
CHANGED
data/lib/jwt/token/builder.rb
CHANGED
@@ -2,12 +2,20 @@
|
|
2
2
|
|
3
3
|
module JWT
|
4
4
|
class Token
|
5
|
+
class MissingPrivateKey < StandardError
|
6
|
+
def initialize
|
7
|
+
super("Private key required for signing tokens is missing!")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
5
11
|
module Builder
|
6
12
|
def initialize(claims = {})
|
7
13
|
claims.each { |claim, value| send("#{claim}=", value) }
|
8
14
|
end
|
9
15
|
|
10
16
|
def to_jwt
|
17
|
+
raise MissingPrivateKey unless private_key
|
18
|
+
|
11
19
|
JWT.encode claims.compact, private_key, algorithm
|
12
20
|
end; alias to_s to_jwt
|
13
21
|
end
|
data/lib/jwt/token/claim.rb
CHANGED
@@ -24,8 +24,9 @@ module JWT
|
|
24
24
|
def verify(token, context = nil)
|
25
25
|
value = token.send(name)
|
26
26
|
|
27
|
-
raise(MissingClaim, key)
|
28
|
-
|
27
|
+
raise(MissingClaim, key) if required && value.nil?
|
28
|
+
|
29
|
+
verifier.call(value, context) if value && verifier
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jwt-authorizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Begejowicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
193
|
rubyforge_project:
|
194
|
-
rubygems_version: 2.
|
194
|
+
rubygems_version: 2.6.14.1
|
195
195
|
signing_key:
|
196
196
|
specification_version: 4
|
197
197
|
summary: Authorization of requests for microservices based on JWT
|