authentic-rb 1.3.0 → 1.4.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.
- checksums.yaml +4 -4
- data/lib/authentic/validator.rb +5 -7
- 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: a3bf855bc1bfdbfd62bbd4e90a732b07688e61101c9fff9843420a9abe323b5d
|
|
4
|
+
data.tar.gz: 8e7475250fcafea16a30b8c57148c8e9e906cdbe8bb96c25d650e42b9d2bb529
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e827e1dbc9eb13ce8cc7f2fa61eae4528b22dd9c520b463ca399fbb432d1547ae25a864bd8ca02e846507eed7cd2fc954f5fee5aa91c23f8f54ec43030b3526d
|
|
7
|
+
data.tar.gz: 807f3979f35aec91ab0d060d04e392ac32530d03a7614f76995107ea0826c84fea4a14ebc016b1e2c72cf09a6c4277237057170feba1e8b7a0b9a75c84c07105
|
data/lib/authentic/validator.rb
CHANGED
|
@@ -36,9 +36,7 @@ module Authentic
|
|
|
36
36
|
#
|
|
37
37
|
# Returns nothing.
|
|
38
38
|
def ensure_valid(token)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
begin
|
|
39
|
+
decode_jwt(token).tap do |jwt|
|
|
42
40
|
key = manager.get(jwt)
|
|
43
41
|
|
|
44
42
|
# Slightly more accurate to raise a key error here for nil key,
|
|
@@ -46,11 +44,11 @@ module Authentic
|
|
|
46
44
|
raise InvalidKey, 'invalid JWK' if key.nil?
|
|
47
45
|
|
|
48
46
|
jwt.verify!(key)
|
|
49
|
-
rescue JSON::JWT::UnexpectedAlgorithm, JSON::JWT::VerificationFailed
|
|
50
|
-
raise InvalidToken, 'failed to validate token against JWK'
|
|
51
|
-
rescue OpenSSL::PKey::PKeyError
|
|
52
|
-
raise InvalidKey, 'invalid JWK'
|
|
53
47
|
end
|
|
48
|
+
rescue JSON::JWT::UnexpectedAlgorithm, JSON::JWT::VerificationFailed
|
|
49
|
+
raise InvalidToken, 'failed to validate token against JWK'
|
|
50
|
+
rescue OpenSSL::PKey::PKeyError
|
|
51
|
+
raise InvalidKey, 'invalid JWK'
|
|
54
52
|
end
|
|
55
53
|
|
|
56
54
|
# Decodes and does basic validation of JWT.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: authentic-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Articulate
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2019-01-
|
|
12
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: json-jwt
|