rack-cloudflare-jwt 0.0.7 → 0.0.8
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/rack/cloudflare_jwt/auth.rb +2 -1
- data/lib/rack/cloudflare_jwt/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: 8807abffbb32199316aeb4f761ed8a02121fae0d9266f089e26c36915dae4e68
|
|
4
|
+
data.tar.gz: a8b9aab3800fdd456756db97879e68f00b038ee859cef52651cba6a94a6c83fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3174c2404f6ee89b0bb490e46096032bcddc3363d861f68770b3aa283fbbc5a5ba965d2e22d1c4f884dfe8234ad46906e366aed53109748a2b9e42a3c2dbd60
|
|
7
|
+
data.tar.gz: cd693b7384c191681b9a5f02685677cacd386cd72b1b8dc3ab48f945b995bb4114e51390958970316c5801702a4d9d68f60f0bd07b29b329e7014c32e8a95e8b
|
|
@@ -172,7 +172,8 @@ module Rack
|
|
|
172
172
|
# @return [Array<OpenSSL::PKey::RSA>] the public keys.
|
|
173
173
|
def public_keys(env)
|
|
174
174
|
host = env[HEADER_HTTP_HOST]
|
|
175
|
-
keys
|
|
175
|
+
# Store a keys in the cache only 10 minutes.
|
|
176
|
+
keys = cache.fetch([self.class.name, '#secrets', host], expires_in: 600) { fetch_public_keys(host) }
|
|
176
177
|
keys.map do |jwk_data|
|
|
177
178
|
::JWT::JWK.import(jwk_data).keypair
|
|
178
179
|
end
|