fb-jwt-auth 0.2.0 → 0.2.1
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/Changelog.md +3 -0
- data/lib/fb/jwt/auth.rb +5 -5
- data/lib/fb/jwt/auth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e1e914f5fe455e0675c3cf5554ec67b56eae840636fb86d5a2011282178b572
|
4
|
+
data.tar.gz: '033953fb853d0888f51433df058074191385f52e6b7188295039bc57a8b3a433'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9285fec02370d269e6d316acea514831e58c5c066327f4066d13a6a164182fdba406d396b778ac2e97210bef0f9bfc1bd72e8d70c0c4f5e7fa0439230413486
|
7
|
+
data.tar.gz: e55416266083dd9e90bb5a74124d0663b12e0ab835fc1023e48ac1bf5309df5eede27ea69862e166111ec0bb8c7577892c478019286d25adebbad105c1f61f24
|
data/Changelog.md
CHANGED
data/lib/fb/jwt/auth.rb
CHANGED
@@ -39,7 +39,7 @@ module Fb
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def verify!
|
42
|
-
raise TokenNotPresentError if token.nil?
|
42
|
+
raise TokenNotPresentError.new('Token is not present') if token.nil?
|
43
43
|
|
44
44
|
application_details = find_application_info
|
45
45
|
|
@@ -47,7 +47,7 @@ module Fb
|
|
47
47
|
hmac_secret = public_key(application_details)
|
48
48
|
payload, _header = decode(hmac_secret: hmac_secret)
|
49
49
|
rescue StandardError => e
|
50
|
-
error_message = "
|
50
|
+
error_message = "Token is not valid: error #{e}"
|
51
51
|
logger.debug(error_message)
|
52
52
|
raise TokenNotValidError.new(error_message)
|
53
53
|
end
|
@@ -57,7 +57,7 @@ module Fb
|
|
57
57
|
iat_skew = payload['iat'].to_i - Time.zone.now.to_i
|
58
58
|
|
59
59
|
if iat_skew.abs > leeway.to_i
|
60
|
-
error_message = "iat skew is #{iat_skew}, max is #{leeway}
|
60
|
+
error_message = "Token has expired: iat skew is #{iat_skew}, max is #{leeway}"
|
61
61
|
logger.debug(error_message)
|
62
62
|
|
63
63
|
raise TokenExpiredError.new(error_message)
|
@@ -84,8 +84,8 @@ module Fb
|
|
84
84
|
application = payload['iss']
|
85
85
|
namespace = payload['namespace']
|
86
86
|
|
87
|
-
raise IssuerNotPresentError unless application
|
88
|
-
raise NamespaceNotPresentError unless namespace
|
87
|
+
raise IssuerNotPresentError.new('Issuer is not present in the token') unless application
|
88
|
+
raise NamespaceNotPresentError.new('Namespace is not present in the token') unless namespace
|
89
89
|
|
90
90
|
{ application: application, namespace: namespace}
|
91
91
|
end
|
data/lib/fb/jwt/auth/version.rb
CHANGED