test_openid_connect 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0783ffeb22a35325496610aaad4b2905643c3de16bf23e1d532005e252085532'
4
- data.tar.gz: 312f242cba80448608a5c53c86c56a104f170e12db03050953576b8c63b0059f
3
+ metadata.gz: a9411261ba29e4fcbf9f47bd7f38c7a66cbb3089496837d7b3686d1d1ab1ea2d
4
+ data.tar.gz: 49ee1c3f569623cb7ea231899e0d23d15854370dbccf690f6d55a07f3e6ecfef
5
5
  SHA512:
6
- metadata.gz: da71bb93986bea18b8ba5ac9ad22bec416b34952a5cf019c87202cb289af46a061c9725d72ac4d6d2c31397c065b44d0a1425c62a5f2cfcb3d12095b896c3095
7
- data.tar.gz: 1f173ee0d0e05b192f518c75c2b172d01ca3f894000c679a02fb72f2b40adb732f5b1a62e88d3a0593a824503916b66a87131b566d839d3a8fe85fe8d97b148e
6
+ metadata.gz: a3ad45715e4aabf3241f8068a6b3850e10b223917a2dcb2ca36cbb404c5dad340af35b274b9d355d01188fa199c71a183e7768e2a35fddc2cd2356ef84c77313
7
+ data.tar.gz: 3cb9fb4b65ab2e07b8e1554ad7429925e1493a2dc26f4a9bcd70dcdb0962370f77dac82b231b5863bd80f10c26ee7bf8b316bc21f1f75530f43262b29b0c01a1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- test_openid_connect (0.1.0)
4
+ test_openid_connect (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,9 +13,9 @@ module ::OmniAuth
13
13
  option :scope, "openid"
14
14
  option :discovery, true
15
15
  option :use_userinfo, true
16
- option :cache, lambda { |key, &blk| blk.call } # Default no-op cache
17
- option :error_handler, lambda { |error, message| nil } # Default no-op handler
18
- option :verbose_logger, lambda { |message| nil } # Default no-op handler
16
+ # option :cache, lambda { |key, &blk| blk.call } # Default no-op cache
17
+ # option :error_handler, lambda { |error, message| nil } # Default no-op handler
18
+ # option :verbose_logger, lambda { |message| nil } # Default no-op handler
19
19
  option :passthrough_authorize_options, [:p]
20
20
  option :passthrough_token_options, [:p]
21
21
 
@@ -27,16 +27,14 @@ module ::OmniAuth
27
27
  userinfo_endpoint: nil,
28
28
  auth_scheme: :basic_auth
29
29
 
30
- def verbose_log(message)
31
- options.verbose_logger.call(message)
32
- end
30
+ # def verbose_log(message)
31
+ # options.verbose_logger.call(message)
32
+ # end
33
33
 
34
34
  def discover!
35
- verbose_log("Fetching discovery document from #{options[:client_options][:discovery_document]}")
36
- discovery_document = options.cache.call("openid_discovery_#{options[:client_options][:discovery_document]}") do
37
- client.request(:get, options[:client_options][:discovery_document], parse: :json).parsed
38
- end
39
- verbose_log("Discovery document loaded\n\n#{discovery_document.to_yaml}")
35
+ # verbose_log("Fetching discovery document from #{options[:client_options][:discovery_document]}")
36
+ discovery_document = client.request(:get, options[:client_options][:discovery_document], parse: :json).parsed
37
+ # verbose_log("Discovery document loaded\n\n#{discovery_document.to_yaml}")
40
38
 
41
39
  discovery_params = {
42
40
  authorize_url: "authorization_endpoint",
@@ -89,8 +87,8 @@ module ::OmniAuth
89
87
  end
90
88
 
91
89
  def callback_phase
92
- if request.params["error"] && request.params["error_description"] && response = options.error_handler.call(request.params["error"], request.params["error_description"])
93
- verbose_log("Error handled, redirecting\n\n#{response.to_yaml}")
90
+ if request.params["error"] && request.params["error_description"]
91
+ # verbose_log("Error handled, redirecting\n\n#{response.to_yaml}")
94
92
  return redirect(response)
95
93
  end
96
94
 
@@ -117,7 +115,7 @@ module ::OmniAuth
117
115
  # token was acquired via a direct server-server connection to the issuer
118
116
  @id_token_info ||= begin
119
117
  decoded = JWT.decode(access_token['id_token'], nil, false).first
120
- verbose_log("Loaded JWT\n\n#{decoded.to_yaml}")
118
+ # verbose_log("Loaded JWT\n\n#{decoded.to_yaml}")
121
119
  JWT::Verify.verify_claims(decoded,
122
120
  verify_iss: true,
123
121
  iss: options[:client_options][:site],
@@ -129,7 +127,7 @@ module ::OmniAuth
129
127
  verify_iat: false,
130
128
  verify_jti: false
131
129
  )
132
- verbose_log("Verified JWT\n\n#{decoded.to_yaml}")
130
+ # verbose_log("Verified JWT\n\n#{decoded.to_yaml}")
133
131
 
134
132
  decoded
135
133
  end
@@ -138,7 +136,7 @@ module ::OmniAuth
138
136
  def userinfo_response
139
137
  @raw_info ||= begin
140
138
  info = access_token.get(options[:client_options][:userinfo_endpoint]).parsed
141
- verbose_log("Fetched userinfo response\n\n#{info.to_yaml}")
139
+ # verbose_log("Fetched userinfo response\n\n#{info.to_yaml}")
142
140
  info
143
141
  end
144
142
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "test_openid_connect"
5
- spec.version = "0.1.6"
5
+ spec.version = "0.1.7"
6
6
  spec.required_ruby_version = ">= 2.4.0"
7
7
  spec.authors = ["Burak Akça"]
8
8
  spec.email = ["burak.akca834@gmail.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_openid_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burak Akça