json-jwt 1.15.3.1 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of json-jwt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/{test_ruby.yml → spec.yml} +6 -4
- data/README.md +0 -2
- data/VERSION +1 -1
- data/json-jwt.gemspec +2 -1
- data/lib/json/jwk/set/fetcher.rb +8 -12
- data/lib/json/jwt.rb +4 -8
- metadata +22 -10
- data/.travis.yml +0 -12
- data/lib/json/jwk/set/fetcher/debugger/request_filter.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2097e754332fbc0d82af414efcce07c63da2bbd7cc3f2976a8df1c770dffb9b8
|
4
|
+
data.tar.gz: a7a9950a0501b58b249bb39d2c369ea315cd40d4f9297b6e19f66d82763ec2ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0092471b468de8a24909cafa45a86c934ee67c0eedf40ae962427f72007d038e1a2dde5a1d32c39465e9594b0c06e634bed8f8bade183a7919f5a12222ee916
|
7
|
+
data.tar.gz: 5b5ff6abbd60b781b7d9d291153a80f83a108fe37d9358dfac8463ff810b0016c5224f849baac3a4720d0bdc8b6d8bbdc0131780b8fba29c6e4d49c72fa2c034
|
@@ -1,14 +1,16 @@
|
|
1
|
-
name:
|
1
|
+
name: Spec
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
+
branches:
|
6
|
+
- master
|
5
7
|
pull_request:
|
6
8
|
|
7
9
|
permissions:
|
8
10
|
contents: read
|
9
11
|
|
10
12
|
jobs:
|
11
|
-
|
13
|
+
spec:
|
12
14
|
strategy:
|
13
15
|
matrix:
|
14
16
|
os: ['ubuntu-20.04']
|
@@ -26,5 +28,5 @@ jobs:
|
|
26
28
|
with:
|
27
29
|
ruby-version: ${{ matrix.ruby-version }}
|
28
30
|
bundler-cache: true
|
29
|
-
- name: Run
|
30
|
-
run: bundle exec rake
|
31
|
+
- name: Run Specs
|
32
|
+
run: bundle exec rake spec
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.16.0
|
data/json-jwt.gemspec
CHANGED
@@ -16,7 +16,8 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.add_runtime_dependency 'activesupport', '>= 4.2'
|
17
17
|
gem.add_runtime_dependency 'bindata'
|
18
18
|
gem.add_runtime_dependency 'aes_key_wrap'
|
19
|
-
gem.add_runtime_dependency '
|
19
|
+
gem.add_runtime_dependency 'faraday', '~> 2.0'
|
20
|
+
gem.add_runtime_dependency 'faraday-follow_redirects'
|
20
21
|
gem.add_development_dependency 'rake'
|
21
22
|
gem.add_development_dependency 'simplecov'
|
22
23
|
gem.add_development_dependency 'webmock'
|
data/lib/json/jwk/set/fetcher.rb
CHANGED
@@ -36,17 +36,13 @@ module JSON
|
|
36
36
|
self.debugging = false
|
37
37
|
|
38
38
|
def self.http_client
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
_http_client_.request_filter << Debugger::RequestFilter.new if debugging?
|
48
|
-
http_config.try(:call, _http_client_)
|
49
|
-
_http_client_
|
39
|
+
Faraday.new(headers: {user_agent: "JSON::JWK::Set::Fetcher #{VERSION}"}) do |faraday|
|
40
|
+
faraday.response :raise_error
|
41
|
+
faraday.response :follow_redirects
|
42
|
+
faraday.response :logger, JSON::JWK::Set::Fetcher.logger if debugging?
|
43
|
+
faraday.adapter Faraday.default_adapter
|
44
|
+
http_config.try(:call, faraday)
|
45
|
+
end
|
50
46
|
end
|
51
47
|
def self.http_config(&block)
|
52
48
|
@@http_config ||= block
|
@@ -70,7 +66,7 @@ module JSON
|
|
70
66
|
jwks = Set.new(
|
71
67
|
JSON.parse(
|
72
68
|
cache.fetch(cache_key, options) do
|
73
|
-
http_client.
|
69
|
+
http_client.get(jwks_uri).body
|
74
70
|
end
|
75
71
|
)
|
76
72
|
)
|
data/lib/json/jwt.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'openssl'
|
2
2
|
require 'base64'
|
3
|
-
require '
|
3
|
+
require 'faraday'
|
4
|
+
require 'faraday/follow_redirects'
|
4
5
|
require 'active_support'
|
5
6
|
require 'active_support/core_ext'
|
6
7
|
require 'json/jose'
|
@@ -108,11 +109,7 @@ module JSON
|
|
108
109
|
when JWS::NUM_OF_SEGMENTS
|
109
110
|
JWS.decode_compact_serialized jwt_string, key_or_secret, algorithms, allow_blank_payload
|
110
111
|
when JWE::NUM_OF_SEGMENTS
|
111
|
-
|
112
|
-
raise InvalidFormat.new("JWE w/ blank payload is not supported.")
|
113
|
-
else
|
114
|
-
JWE.decode_compact_serialized jwt_string, key_or_secret, algorithms, encryption_methods
|
115
|
-
end
|
112
|
+
JWE.decode_compact_serialized jwt_string, key_or_secret, algorithms, encryption_methods
|
116
113
|
else
|
117
114
|
raise InvalidFormat.new("Invalid JWT Format. JWT should include #{JWS::NUM_OF_SEGMENTS} or #{JWE::NUM_OF_SEGMENTS} segments.")
|
118
115
|
end
|
@@ -141,5 +138,4 @@ require 'json/jwe'
|
|
141
138
|
require 'json/jwk'
|
142
139
|
require 'json/jwk/jwkizable'
|
143
140
|
require 'json/jwk/set'
|
144
|
-
require 'json/jwk/set/fetcher'
|
145
|
-
require 'json/jwk/set/fetcher/debugger/request_filter'
|
141
|
+
require 'json/jwk/set/fetcher'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -53,7 +53,21 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday-follow_redirects
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - ">="
|
@@ -145,11 +159,10 @@ extensions: []
|
|
145
159
|
extra_rdoc_files: []
|
146
160
|
files:
|
147
161
|
- ".github/FUNDING.yml"
|
148
|
-
- ".github/workflows/
|
162
|
+
- ".github/workflows/spec.yml"
|
149
163
|
- ".gitignore"
|
150
164
|
- ".gitmodules"
|
151
165
|
- ".rspec"
|
152
|
-
- ".travis.yml"
|
153
166
|
- Gemfile
|
154
167
|
- LICENSE
|
155
168
|
- README.md
|
@@ -162,14 +175,13 @@ files:
|
|
162
175
|
- lib/json/jwk/jwkizable.rb
|
163
176
|
- lib/json/jwk/set.rb
|
164
177
|
- lib/json/jwk/set/fetcher.rb
|
165
|
-
- lib/json/jwk/set/fetcher/debugger/request_filter.rb
|
166
178
|
- lib/json/jws.rb
|
167
179
|
- lib/json/jwt.rb
|
168
180
|
homepage: https://github.com/nov/json-jwt
|
169
181
|
licenses:
|
170
182
|
- MIT
|
171
183
|
metadata: {}
|
172
|
-
post_install_message:
|
184
|
+
post_install_message:
|
173
185
|
rdoc_options: []
|
174
186
|
require_paths:
|
175
187
|
- lib
|
@@ -184,8 +196,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
196
|
- !ruby/object:Gem::Version
|
185
197
|
version: '0'
|
186
198
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
188
|
-
signing_key:
|
199
|
+
rubygems_version: 3.1.6
|
200
|
+
signing_key:
|
189
201
|
specification_version: 4
|
190
202
|
summary: JSON Web Token and its family (JSON Web Signature, JSON Web Encryption and
|
191
203
|
JSON Web Key) in Ruby
|
data/.travis.yml
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
module JSON
|
2
|
-
class JWK
|
3
|
-
class Set
|
4
|
-
module Fetcher
|
5
|
-
module Debugger
|
6
|
-
class RequestFilter
|
7
|
-
# Callback called in HTTPClient (before sending a request)
|
8
|
-
# request:: HTTP::Message
|
9
|
-
def filter_request(request)
|
10
|
-
started = "======= [JSON::JWK::Set::Fetcher] HTTP REQUEST STARTED ======="
|
11
|
-
log started, request.dump
|
12
|
-
end
|
13
|
-
|
14
|
-
# Callback called in HTTPClient (after received a response)
|
15
|
-
# request:: HTTP::Message
|
16
|
-
# response:: HTTP::Message
|
17
|
-
def filter_response(request, response)
|
18
|
-
finished = "======= [JSON::JWK::Set::Fetcher] HTTP REQUEST FINISHED ======="
|
19
|
-
log '-' * 50, response.dump, finished
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def log(*outputs)
|
25
|
-
outputs.each do |output|
|
26
|
-
JSON::JWK::Set::Fetcher.logger.info output
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|