json-jwt 1.16.7 → 1.17.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/.github/workflows/spec.yml +7 -8
- data/VERSION +1 -1
- data/lib/json/jwk/set/fetcher.rb +14 -7
- data/lib/json/jwk/set.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5e686d5323ee2afed6b3d1833cd119c22ba05c3a2710f1941609401eec29681
|
4
|
+
data.tar.gz: cbdc73267f4afb245c8f0b155557201734f4a8a73fb91ca92b9754db461926c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef8be34c81199d13566f451ed487f5e002502918bb478f7589ae69a0409ae0eeef1a566666ef26e175c57d891541addd3101f34d8522bd3ea965178654425f5
|
7
|
+
data.tar.gz: d0e7d0764084f8a1e6f4a632c039b4661a2530409d817bf7dc9e42672041b30fa7cfdecf046034ec94c33d2cb145ecae94c06a97b87baeefd6e76983d29659a1
|
data/.github/workflows/spec.yml
CHANGED
@@ -11,21 +11,20 @@ permissions:
|
|
11
11
|
|
12
12
|
jobs:
|
13
13
|
spec:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
name: Ruby ${{ matrix.ruby }}
|
14
16
|
strategy:
|
15
17
|
matrix:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
ruby-version: '3.0'
|
21
|
-
runs-on: ${{ matrix.os }}
|
22
|
-
|
18
|
+
ruby:
|
19
|
+
- '3.2'
|
20
|
+
- '3.3'
|
21
|
+
- '3.4'
|
23
22
|
steps:
|
24
23
|
- uses: actions/checkout@v3
|
25
24
|
- name: Set up Ruby
|
26
25
|
uses: ruby/setup-ruby@v1
|
27
26
|
with:
|
28
|
-
ruby-version: ${{ matrix.ruby
|
27
|
+
ruby-version: ${{ matrix.ruby }}
|
29
28
|
bundler-cache: true
|
30
29
|
- name: Run Specs
|
31
30
|
run: bundle exec rake spec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.17.0
|
data/lib/json/jwk/set/fetcher.rb
CHANGED
@@ -2,6 +2,8 @@ module JSON
|
|
2
2
|
class JWK
|
3
3
|
class Set
|
4
4
|
module Fetcher
|
5
|
+
class UnexpectedFormat < JWT::Exception; end
|
6
|
+
|
5
7
|
class Cache
|
6
8
|
def fetch(cache_key, options = {})
|
7
9
|
yield
|
@@ -65,13 +67,18 @@ module JSON
|
|
65
67
|
kid
|
66
68
|
].collect(&:to_s).join(':')
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
73
|
-
)
|
70
|
+
parsed_jwks = JSON.parse(
|
71
|
+
cache.fetch(cache_key, options) do
|
72
|
+
http_client.get(jwks_uri).body
|
73
|
+
end
|
74
74
|
)
|
75
|
+
|
76
|
+
unless parsed_jwks.is_a?(Hash) && parsed_jwks['keys'].is_a?(Array)
|
77
|
+
cache.delete(cache_key, options)
|
78
|
+
raise UnexpectedFormat
|
79
|
+
end
|
80
|
+
|
81
|
+
jwks = Set.new(parsed_jwks)
|
75
82
|
cache.delete(cache_key, options) if jwks[kid].blank?
|
76
83
|
|
77
84
|
if auto_detect
|
@@ -83,4 +90,4 @@ module JSON
|
|
83
90
|
end
|
84
91
|
end
|
85
92
|
end
|
86
|
-
end
|
93
|
+
end
|
data/lib/json/jwk/set.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activesupport
|
@@ -196,7 +195,6 @@ homepage: https://github.com/nov/json-jwt
|
|
196
195
|
licenses:
|
197
196
|
- MIT
|
198
197
|
metadata: {}
|
199
|
-
post_install_message:
|
200
198
|
rdoc_options: []
|
201
199
|
require_paths:
|
202
200
|
- lib
|
@@ -211,8 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
209
|
- !ruby/object:Gem::Version
|
212
210
|
version: '0'
|
213
211
|
requirements: []
|
214
|
-
rubygems_version: 3.
|
215
|
-
signing_key:
|
212
|
+
rubygems_version: 3.6.7
|
216
213
|
specification_version: 4
|
217
214
|
summary: JSON Web Token and its family (JSON Web Signature, JSON Web Encryption and
|
218
215
|
JSON Web Key) in Ruby
|