zaikio-jwt_auth 0.4.2 → 0.4.3
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/README.md +12 -1
- data/lib/zaikio/jwt_auth.rb +1 -1
- data/lib/zaikio/jwt_auth/version.rb +1 -1
- 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: 4ac13b8d1a727e9aefeef7e1da082a3eec4bf48ac8f149ef4cc89ac44ee35d49
|
4
|
+
data.tar.gz: 323355b6f5180bf9662b715c8d2cf8ed94311fa1095e5da2627c8a71cd0f442a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386ec7f2a8f1bc0a0d2f29495cc4b5754cd2eadce857555eb68a72f9546f76095ba2f0f0c3fdbaa5982a2503ee400480e81418dea5a06e85265380384843e350
|
7
|
+
data.tar.gz: 044a91585bf67a5ba411716ea361a1c85eeab91ef06cbe17b1cd1f03c83a261c0a4e8ef5ebe1e87e3c9e550678fdbcae45859448031c5e5b2983affbb829fd0f
|
data/README.md
CHANGED
@@ -152,7 +152,18 @@ class MyRackMiddleware < Rack::Middleware
|
|
152
152
|
...
|
153
153
|
```
|
154
154
|
|
155
|
-
This function expects to receive the string in the format `"Bearer $token"`.
|
155
|
+
This function expects to receive the string in the format `"Bearer $token"`. If the JWT is
|
156
|
+
invalid, expired, or has some other fundamental issues, the JWT library may throw
|
157
|
+
[additional errors](https://github.com/jwt/ruby-jwt/blob/v2.2.2/lib/jwt/error.rb), and you
|
158
|
+
should be prepared to handle these, for example:
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
def call(env)
|
162
|
+
token = Zaikio::JWTAuth.extract("definitely.not.jwt")
|
163
|
+
rescue JWT::DecodeError, JWT::ExpiredSignature
|
164
|
+
[401, {}, ["Unauthorized"]]
|
165
|
+
end
|
166
|
+
```
|
156
167
|
|
157
168
|
## Contributing
|
158
169
|
|
data/lib/zaikio/jwt_auth.rb
CHANGED
@@ -18,7 +18,7 @@ module Zaikio
|
|
18
18
|
def self.configure
|
19
19
|
self.configuration ||= Configuration.new
|
20
20
|
|
21
|
-
if Zaikio.const_defined?("Webhooks")
|
21
|
+
if Zaikio.const_defined?("Webhooks", false)
|
22
22
|
Zaikio::Webhooks.on "directory.revoked_access_token", Zaikio::JWTAuth::RevokeAccessTokenJob,
|
23
23
|
perform_now: true
|
24
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaikio-jwt_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- crispymtn
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: oj
|