openid_connect 1.3.0 → 2.3.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/FUNDING.yml +3 -0
- data/.github/workflows/spec.yml +31 -0
- data/CHANGELOG.md +23 -0
- data/README.rdoc +0 -2
- data/VERSION +1 -1
- data/lib/openid_connect/access_token/mtls.rb +9 -0
- data/lib/openid_connect/access_token.rb +11 -2
- data/lib/openid_connect/client/registrar.rb +1 -1
- data/lib/openid_connect/client.rb +1 -3
- data/lib/openid_connect/discovery/provider/config/response.rb +6 -3
- data/lib/openid_connect/request_object.rb +1 -1
- data/lib/openid_connect/response_object/id_token.rb +8 -3
- data/lib/openid_connect.rb +12 -13
- data/openid_connect.gemspec +9 -5
- data/spec/helpers/webmock_helper.rb +7 -1
- data/spec/mock_response/errors/unknown.json +3 -1
- data/spec/mock_response/public_keys/jwks_with_private_key.json +8 -0
- data/spec/mock_response/public_keys/private_key.pem +27 -0
- data/spec/openid_connect/client/registrar_spec.rb +1 -1
- data/spec/openid_connect/client_spec.rb +0 -10
- data/spec/openid_connect/response_object/id_token_spec.rb +48 -0
- data/spec/openid_connect_spec.rb +2 -2
- metadata +84 -25
- data/.travis.yml +0 -8
- data/lib/openid_connect/debugger/request_filter.rb +0 -28
- data/lib/openid_connect/debugger.rb +0 -3
- data/spec/openid_connect/debugger/request_filter_spec.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f06997a441c5c602002a3b24896e9abd6036b376746124ad25743bf7b1b64e2
|
4
|
+
data.tar.gz: 6456f15afc0c4a58926887765caa3c388f12a55f4afa37f52d4483dc9c5139e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fb6ecdd315275864320503e3c6287c03be8a8239bfcc1abe7d652896d2d015d0289b838a691e6711f7c96385e207ab9fafb6628de203327808a8b5568125e25
|
7
|
+
data.tar.gz: 89496d0a2d23455b40099ac2c71137771b43230e40c2f40a2758a315d10b32c9803e012cc6358bc3564d38d968c8fd1e5e4e37031969c526f96c37412804c289
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Spec
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
spec:
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
os: ['ubuntu-20.04', 'ubuntu-22.04']
|
17
|
+
ruby-version: ['3.1', '3.2', '3.3']
|
18
|
+
include:
|
19
|
+
- os: 'ubuntu-20.04'
|
20
|
+
ruby-version: '3.0'
|
21
|
+
runs-on: ${{ matrix.os }}
|
22
|
+
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v3
|
25
|
+
- name: Set up Ruby
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby-version }}
|
29
|
+
bundler-cache: true
|
30
|
+
- name: Run Specs
|
31
|
+
run: bundle exec rake spec
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
## [Unreleased]
|
2
|
+
|
3
|
+
## [2.2.0] - 2022-10-11
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
|
7
|
+
- automatic json response decoding by @nov in https://github.com/nov/openid_connect/pull/77
|
8
|
+
|
9
|
+
## [2.1.0] - 2022-10-10
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- mTLS access token by @nov in https://github.com/nov/openid_connect/pull/76
|
14
|
+
|
15
|
+
## [2.0.0] - 2022-10-09
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
- start recording CHANGELOG
|
20
|
+
|
21
|
+
### Changed
|
22
|
+
|
23
|
+
- replace httpclient with faraday v2 by @nov in https://github.com/nov/openid_connect/pull/75
|
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.3.0
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module OpenIDConnect
|
2
|
+
class AccessToken::MTLS < AccessToken
|
3
|
+
def initialize(attributes = {})
|
4
|
+
super
|
5
|
+
http_client.ssl.client_key = attributes[:private_key] || client.private_key
|
6
|
+
http_client.ssl.client_cert = attributes[:certificate] || client.certificate
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -15,13 +15,20 @@ module OpenIDConnect
|
|
15
15
|
ResponseObject::UserInfo.new hash
|
16
16
|
end
|
17
17
|
|
18
|
+
def to_mtls(attributes = {})
|
19
|
+
(required_attributes + optional_attributes).each do |key|
|
20
|
+
attributes[key] = self.send(key)
|
21
|
+
end
|
22
|
+
MTLS.new attributes
|
23
|
+
end
|
24
|
+
|
18
25
|
private
|
19
26
|
|
20
27
|
def resource_request
|
21
28
|
res = yield
|
22
29
|
case res.status
|
23
30
|
when 200
|
24
|
-
|
31
|
+
res.body.with_indifferent_access
|
25
32
|
when 400
|
26
33
|
raise BadRequest.new('API Access Faild', res)
|
27
34
|
when 401
|
@@ -33,4 +40,6 @@ module OpenIDConnect
|
|
33
40
|
end
|
34
41
|
end
|
35
42
|
end
|
36
|
-
end
|
43
|
+
end
|
44
|
+
|
45
|
+
require 'openid_connect/access_token/mtls'
|
@@ -170,7 +170,7 @@ module OpenIDConnect
|
|
170
170
|
end
|
171
171
|
|
172
172
|
def handle_success_response(response)
|
173
|
-
credentials =
|
173
|
+
credentials = response.body.with_indifferent_access
|
174
174
|
Client.new(
|
175
175
|
identifier: credentials[:client_id],
|
176
176
|
secret: credentials[:client_secret],
|
@@ -26,7 +26,7 @@ module OpenIDConnect
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def handle_success_response(response)
|
29
|
-
token_hash =
|
29
|
+
token_hash = response.body.with_indifferent_access
|
30
30
|
token_type = (@forced_token_type || token_hash[:token_type]).try(:downcase)
|
31
31
|
case token_type
|
32
32
|
when 'bearer'
|
@@ -34,8 +34,6 @@ module OpenIDConnect
|
|
34
34
|
else
|
35
35
|
raise Exception.new("Unexpected Token Type: #{token_type}")
|
36
36
|
end
|
37
|
-
rescue JSON::ParserError
|
38
|
-
raise Exception.new("Unknown Token Type")
|
39
37
|
end
|
40
38
|
end
|
41
39
|
end
|
@@ -81,12 +81,15 @@ module OpenIDConnect
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def jwks
|
84
|
-
@jwks ||=
|
85
|
-
OpenIDConnect.http_client.get_content(jwks_uri)
|
86
|
-
).with_indifferent_access
|
84
|
+
@jwks ||= OpenIDConnect.http_client.get(jwks_uri).body.with_indifferent_access
|
87
85
|
JSON::JWK::Set.new @jwks[:keys]
|
88
86
|
end
|
89
87
|
|
88
|
+
def jwk(kid)
|
89
|
+
@jwks ||= {}
|
90
|
+
@jwks[kid] ||= JSON::JWK::Set::Fetcher.fetch(jwks_uri, kid: kid)
|
91
|
+
end
|
92
|
+
|
90
93
|
def public_keys
|
91
94
|
@public_keys ||= jwks.collect(&:to_key)
|
92
95
|
end
|
@@ -63,11 +63,16 @@ module OpenIDConnect
|
|
63
63
|
end
|
64
64
|
|
65
65
|
class << self
|
66
|
-
def decode(jwt_string,
|
67
|
-
|
66
|
+
def decode(jwt_string, key_or_config)
|
67
|
+
case key_or_config
|
68
|
+
when :self_issued
|
68
69
|
decode_self_issued jwt_string
|
70
|
+
when OpenIDConnect::Discovery::Provider::Config::Response
|
71
|
+
jwt = JSON::JWT.decode jwt_string, :skip_verification
|
72
|
+
jwt.verify! key_or_config.jwk(jwt.kid)
|
73
|
+
new jwt
|
69
74
|
else
|
70
|
-
new JSON::JWT.decode jwt_string,
|
75
|
+
new JSON::JWT.decode jwt_string, key_or_config
|
71
76
|
end
|
72
77
|
end
|
73
78
|
|
data/lib/openid_connect.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'logger'
|
3
|
+
require 'faraday'
|
4
|
+
require 'faraday/follow_redirects'
|
3
5
|
require 'swd'
|
4
6
|
require 'webfinger'
|
5
7
|
require 'active_model'
|
6
8
|
require 'tzinfo'
|
7
9
|
require 'validate_url'
|
8
|
-
require '
|
10
|
+
require 'email_validator/strict'
|
11
|
+
require 'mail'
|
9
12
|
require 'attr_required'
|
10
13
|
require 'attr_optional'
|
11
14
|
require 'json/jwt'
|
@@ -64,17 +67,14 @@ module OpenIDConnect
|
|
64
67
|
self.debugging = false
|
65
68
|
|
66
69
|
def self.http_client
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
_http_client_.request_filter << Debugger::RequestFilter.new if debugging?
|
76
|
-
http_config.try(:call, _http_client_)
|
77
|
-
_http_client_
|
70
|
+
Faraday.new(headers: {user_agent: "OpenIDConnect (#{VERSION})"}) do |faraday|
|
71
|
+
faraday.request :url_encoded
|
72
|
+
faraday.request :json
|
73
|
+
faraday.response :json
|
74
|
+
faraday.adapter Faraday.default_adapter
|
75
|
+
http_config&.call(faraday)
|
76
|
+
faraday.response :logger, OpenIDConnect.logger, {bodies: true} if debugging?
|
77
|
+
end
|
78
78
|
end
|
79
79
|
def self.http_config(&block)
|
80
80
|
@sub_protocols.each do |klass|
|
@@ -100,4 +100,3 @@ require 'openid_connect/access_token'
|
|
100
100
|
require 'openid_connect/jwtnizable'
|
101
101
|
require 'openid_connect/connect_object'
|
102
102
|
require 'openid_connect/discovery'
|
103
|
-
require 'openid_connect/debugger'
|
data/openid_connect.gemspec
CHANGED
@@ -16,14 +16,18 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_runtime_dependency "attr_required", ">= 1.0.0"
|
17
17
|
s.add_runtime_dependency "activemodel"
|
18
18
|
s.add_runtime_dependency "validate_url"
|
19
|
-
s.add_runtime_dependency "
|
20
|
-
s.add_runtime_dependency "
|
21
|
-
s.add_runtime_dependency
|
22
|
-
s.add_runtime_dependency
|
23
|
-
s.add_runtime_dependency "
|
19
|
+
s.add_runtime_dependency "email_validator"
|
20
|
+
s.add_runtime_dependency "mail"
|
21
|
+
s.add_runtime_dependency 'faraday', '~> 2.0'
|
22
|
+
s.add_runtime_dependency 'faraday-follow_redirects'
|
23
|
+
s.add_runtime_dependency "json-jwt", ">= 1.16"
|
24
|
+
s.add_runtime_dependency "swd", "~> 2.0"
|
25
|
+
s.add_runtime_dependency "webfinger", "~> 2.0"
|
26
|
+
s.add_runtime_dependency "rack-oauth2", "~> 2.2"
|
24
27
|
s.add_development_dependency "rake"
|
25
28
|
s.add_development_dependency "rspec"
|
26
29
|
s.add_development_dependency "rspec-its"
|
27
30
|
s.add_development_dependency "webmock"
|
28
31
|
s.add_development_dependency "simplecov"
|
32
|
+
s.add_development_dependency "rexml"
|
29
33
|
end
|
@@ -32,7 +32,13 @@ module WebMockHelper
|
|
32
32
|
|
33
33
|
def response_for(response_file, options = {})
|
34
34
|
response = {}
|
35
|
-
|
35
|
+
format = options[:format] || :json
|
36
|
+
if format == :json
|
37
|
+
response[:headers] = {
|
38
|
+
'Content-Type': 'application/json'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
response[:body] = File.new(File.join(File.dirname(__FILE__), '../mock_response', "#{response_file}.#{format}"))
|
36
42
|
if options[:status]
|
37
43
|
response[:status] = options[:status]
|
38
44
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{
|
2
|
+
"keys": [{
|
3
|
+
"kty": "RSA",
|
4
|
+
"e": "AQAB",
|
5
|
+
"n": "vWr1S4T0jBnYU9PIpUYxT48Ca8HK8aitbmqbTM3t3Zzl1GNpIlyePnwXSL6SgNcVbeRhTfvXZUzH4pP8HzPJdpUHnAeYyCzjz9UNykdFCp2YW676wpLDzMkaU7bYLJxGjZlpHU-UJVIm5K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TOR/gIbfxBlUOs0BN37xhw==
|
27
|
+
-----END RSA PRIVATE KEY-----
|
@@ -162,16 +162,6 @@ describe OpenIDConnect::Client do
|
|
162
162
|
end
|
163
163
|
end
|
164
164
|
|
165
|
-
context 'when invalid JSON is returned' do
|
166
|
-
it 'should raise OpenIDConnect::Exception' do
|
167
|
-
mock_json :post, client.token_endpoint, 'access_token/invalid_json', request_header: header_params, params: protocol_params do
|
168
|
-
expect do
|
169
|
-
access_token
|
170
|
-
end.to raise_error OpenIDConnect::Exception, 'Unknown Token Type'
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
165
|
context 'otherwise' do
|
176
166
|
it 'should raise Unexpected Token Type exception' do
|
177
167
|
mock_json :post, client.token_endpoint, 'access_token/mac', request_header: header_params, params: protocol_params do
|
@@ -251,6 +251,54 @@ describe OpenIDConnect::ResponseObject::IdToken do
|
|
251
251
|
its(:exp) { should == attributes[:exp].to_i }
|
252
252
|
its(:raw_attributes) { should be_instance_of JSON::JWS }
|
253
253
|
|
254
|
+
context 'when IdP config is given' do
|
255
|
+
subject { klass.decode id_token.to_jwt(private_key), idp_config }
|
256
|
+
let(:jwks) do
|
257
|
+
jwk_str = File.read(File.join(__dir__, '../../mock_response/public_keys/jwks_with_private_key.json'))
|
258
|
+
jwk = JSON::JWK::Set.new JSON.parse(jwk_str)
|
259
|
+
end
|
260
|
+
let(:idp_config) do
|
261
|
+
OpenIDConnect::Discovery::Provider::Config::Response.new(
|
262
|
+
issuer: attributes[:issuer],
|
263
|
+
authorization_endpoint: File.join(attributes[:iss], 'authorize'),
|
264
|
+
jwks_uri: File.join(attributes[:iss], 'jwks'),
|
265
|
+
response_types_supported: ['code'],
|
266
|
+
subject_types_supported: ['public'],
|
267
|
+
id_token_signing_alg_values_supported: ['RS256']
|
268
|
+
)
|
269
|
+
end
|
270
|
+
|
271
|
+
context 'when id_token has kid' do
|
272
|
+
let(:private_key) do
|
273
|
+
OpenSSL::PKey::RSA.new(
|
274
|
+
File.read(File.join(__dir__, '../../mock_response/public_keys/private_key.pem'))
|
275
|
+
).to_jwk
|
276
|
+
end
|
277
|
+
|
278
|
+
it do
|
279
|
+
mock_json :get, idp_config.jwks_uri, 'public_keys/jwks_with_private_key' do
|
280
|
+
should be_a klass
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
context 'otherwise' do
|
286
|
+
let(:private_key) do
|
287
|
+
OpenSSL::PKey::RSA.new(
|
288
|
+
File.read(File.join(__dir__, '../../mock_response/public_keys/private_key.pem'))
|
289
|
+
)
|
290
|
+
end
|
291
|
+
|
292
|
+
it do
|
293
|
+
mock_json :get, idp_config.jwks_uri, 'public_keys/jwks_with_private_key' do
|
294
|
+
expect do
|
295
|
+
should
|
296
|
+
end.to raise_error JSON::JWK::Set::KidNotFound
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
254
302
|
context 'when self-issued' do
|
255
303
|
context 'when valid' do
|
256
304
|
let(:self_issued) do
|
data/spec/openid_connect_spec.rb
CHANGED
@@ -46,12 +46,12 @@ describe OpenIDConnect do
|
|
46
46
|
context 'with http_config' do
|
47
47
|
before do
|
48
48
|
OpenIDConnect.http_config do |config|
|
49
|
-
config.
|
49
|
+
config.ssl.verify = false
|
50
50
|
end
|
51
51
|
end
|
52
52
|
it 'should configure OpenIDConnect, SWD and Rack::OAuth2\'s http_client' do
|
53
53
|
[OpenIDConnect, SWD, WebFinger, Rack::OAuth2].each do |klass|
|
54
|
-
klass.http_client.
|
54
|
+
klass.http_client.ssl.verify.should be_falsy
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openid_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.3.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: 2024-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: email_validator
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,61 +81,103 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: mail
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: faraday
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: faraday-follow_redirects
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: '0'
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: json-jwt
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - ">="
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
131
|
+
version: '1.16'
|
118
132
|
type: :runtime
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
138
|
+
version: '1.16'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: swd
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '2.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: webfinger
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '2.0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '2.0'
|
125
167
|
- !ruby/object:Gem::Dependency
|
126
168
|
name: rack-oauth2
|
127
169
|
requirement: !ruby/object:Gem::Requirement
|
128
170
|
requirements:
|
129
|
-
- - "
|
171
|
+
- - "~>"
|
130
172
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
173
|
+
version: '2.2'
|
132
174
|
type: :runtime
|
133
175
|
prerelease: false
|
134
176
|
version_requirements: !ruby/object:Gem::Requirement
|
135
177
|
requirements:
|
136
|
-
- - "
|
178
|
+
- - "~>"
|
137
179
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
180
|
+
version: '2.2'
|
139
181
|
- !ruby/object:Gem::Dependency
|
140
182
|
name: rake
|
141
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,6 +248,20 @@ dependencies:
|
|
206
248
|
- - ">="
|
207
249
|
- !ruby/object:Gem::Version
|
208
250
|
version: '0'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: rexml
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
209
265
|
description: OpenID Connect Server & Client Library
|
210
266
|
email:
|
211
267
|
- nov@matake.jp
|
@@ -213,9 +269,11 @@ executables: []
|
|
213
269
|
extensions: []
|
214
270
|
extra_rdoc_files: []
|
215
271
|
files:
|
272
|
+
- ".github/FUNDING.yml"
|
273
|
+
- ".github/workflows/spec.yml"
|
216
274
|
- ".gitignore"
|
217
275
|
- ".rspec"
|
218
|
-
-
|
276
|
+
- CHANGELOG.md
|
219
277
|
- Gemfile
|
220
278
|
- LICENSE
|
221
279
|
- README.rdoc
|
@@ -224,11 +282,10 @@ files:
|
|
224
282
|
- VERSION
|
225
283
|
- lib/openid_connect.rb
|
226
284
|
- lib/openid_connect/access_token.rb
|
285
|
+
- lib/openid_connect/access_token/mtls.rb
|
227
286
|
- lib/openid_connect/client.rb
|
228
287
|
- lib/openid_connect/client/registrar.rb
|
229
288
|
- lib/openid_connect/connect_object.rb
|
230
|
-
- lib/openid_connect/debugger.rb
|
231
|
-
- lib/openid_connect/debugger/request_filter.rb
|
232
289
|
- lib/openid_connect/discovery.rb
|
233
290
|
- lib/openid_connect/discovery/provider.rb
|
234
291
|
- lib/openid_connect/discovery/provider/config.rb
|
@@ -275,13 +332,14 @@ files:
|
|
275
332
|
- spec/mock_response/errors/unknown.json
|
276
333
|
- spec/mock_response/id_token.json
|
277
334
|
- spec/mock_response/public_keys/jwks.json
|
335
|
+
- spec/mock_response/public_keys/jwks_with_private_key.json
|
336
|
+
- spec/mock_response/public_keys/private_key.pem
|
278
337
|
- spec/mock_response/request_object/signed.jwt
|
279
338
|
- spec/mock_response/userinfo/openid.json
|
280
339
|
- spec/openid_connect/access_token_spec.rb
|
281
340
|
- spec/openid_connect/client/registrar_spec.rb
|
282
341
|
- spec/openid_connect/client_spec.rb
|
283
342
|
- spec/openid_connect/connect_object_spec.rb
|
284
|
-
- spec/openid_connect/debugger/request_filter_spec.rb
|
285
343
|
- spec/openid_connect/discovery/provider/config/resource_spec.rb
|
286
344
|
- spec/openid_connect/discovery/provider/config/response_spec.rb
|
287
345
|
- spec/openid_connect/discovery/provider/config_spec.rb
|
@@ -304,7 +362,7 @@ homepage: https://github.com/nov/openid_connect
|
|
304
362
|
licenses:
|
305
363
|
- MIT
|
306
364
|
metadata: {}
|
307
|
-
post_install_message:
|
365
|
+
post_install_message:
|
308
366
|
rdoc_options: []
|
309
367
|
require_paths:
|
310
368
|
- lib
|
@@ -319,8 +377,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
377
|
- !ruby/object:Gem::Version
|
320
378
|
version: '0'
|
321
379
|
requirements: []
|
322
|
-
rubygems_version: 3.
|
323
|
-
signing_key:
|
380
|
+
rubygems_version: 3.4.10
|
381
|
+
signing_key:
|
324
382
|
specification_version: 4
|
325
383
|
summary: OpenID Connect Server & Client Library
|
326
384
|
test_files:
|
@@ -347,13 +405,14 @@ test_files:
|
|
347
405
|
- spec/mock_response/errors/unknown.json
|
348
406
|
- spec/mock_response/id_token.json
|
349
407
|
- spec/mock_response/public_keys/jwks.json
|
408
|
+
- spec/mock_response/public_keys/jwks_with_private_key.json
|
409
|
+
- spec/mock_response/public_keys/private_key.pem
|
350
410
|
- spec/mock_response/request_object/signed.jwt
|
351
411
|
- spec/mock_response/userinfo/openid.json
|
352
412
|
- spec/openid_connect/access_token_spec.rb
|
353
413
|
- spec/openid_connect/client/registrar_spec.rb
|
354
414
|
- spec/openid_connect/client_spec.rb
|
355
415
|
- spec/openid_connect/connect_object_spec.rb
|
356
|
-
- spec/openid_connect/debugger/request_filter_spec.rb
|
357
416
|
- spec/openid_connect/discovery/provider/config/resource_spec.rb
|
358
417
|
- spec/openid_connect/discovery/provider/config/response_spec.rb
|
359
418
|
- spec/openid_connect/discovery/provider/config_spec.rb
|
data/.travis.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
module OpenIDConnect
|
2
|
-
module Debugger
|
3
|
-
class RequestFilter
|
4
|
-
# Callback called in HTTPClient (before sending a request)
|
5
|
-
# request:: HTTP::Message
|
6
|
-
def filter_request(request)
|
7
|
-
started = "======= [OpenIDConnect] HTTP REQUEST STARTED ======="
|
8
|
-
log started, request.dump
|
9
|
-
end
|
10
|
-
|
11
|
-
# Callback called in HTTPClient (after received a response)
|
12
|
-
# request:: HTTP::Message
|
13
|
-
# response:: HTTP::Message
|
14
|
-
def filter_response(request, response)
|
15
|
-
finished = "======= [OpenIDConnect] HTTP REQUEST FINISHED ======="
|
16
|
-
log '-' * 50, response.dump, finished
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def log(*outputs)
|
22
|
-
outputs.each do |output|
|
23
|
-
OpenIDConnect.logger.info output
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe OpenIDConnect::Debugger::RequestFilter do
|
4
|
-
let(:resource_endpoint) { 'https://example.com/resources' }
|
5
|
-
let(:request) { HTTP::Message.new_request(:get, URI.parse(resource_endpoint)) }
|
6
|
-
let(:response) { HTTP::Message.new_response({hello: 'world'}.to_json) }
|
7
|
-
let(:request_filter) { OpenIDConnect::Debugger::RequestFilter.new }
|
8
|
-
|
9
|
-
describe '#filter_request' do
|
10
|
-
it 'should log request' do
|
11
|
-
[
|
12
|
-
"======= [OpenIDConnect] HTTP REQUEST STARTED =======",
|
13
|
-
request.dump
|
14
|
-
].each do |output|
|
15
|
-
expect(OpenIDConnect.logger).to receive(:info).with output
|
16
|
-
end
|
17
|
-
request_filter.filter_request(request)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '#filter_response' do
|
22
|
-
it 'should log response' do
|
23
|
-
[
|
24
|
-
"--------------------------------------------------",
|
25
|
-
response.dump,
|
26
|
-
"======= [OpenIDConnect] HTTP REQUEST FINISHED ======="
|
27
|
-
].each do |output|
|
28
|
-
expect(OpenIDConnect.logger).to receive(:info).with output
|
29
|
-
end
|
30
|
-
request_filter.filter_response(request, response)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|