oidc 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +2 -0
  3. data/.rubocop.yml +28 -0
  4. data/CHANGELOG.md +4 -0
  5. data/CODE_OF_CONDUCT.md +84 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +46 -0
  8. data/Rakefile +12 -0
  9. data/lib/oidc/access_token/mtls.rb +9 -0
  10. data/lib/oidc/access_token.rb +45 -0
  11. data/lib/oidc/client/registrar.rb +186 -0
  12. data/lib/oidc/client.rb +43 -0
  13. data/lib/oidc/connect_object.rb +52 -0
  14. data/lib/oidc/discovery/provider/config/resource.rb +39 -0
  15. data/lib/oidc/discovery/provider/config/response.rb +112 -0
  16. data/lib/oidc/discovery/provider/config.rb +20 -0
  17. data/lib/oidc/discovery/provider.rb +34 -0
  18. data/lib/oidc/discovery.rb +8 -0
  19. data/lib/oidc/exception.rb +39 -0
  20. data/lib/oidc/jwtnizable.rb +14 -0
  21. data/lib/oidc/request_object/claimable.rb +54 -0
  22. data/lib/oidc/request_object/id_token.rb +8 -0
  23. data/lib/oidc/request_object/user_info.rb +7 -0
  24. data/lib/oidc/request_object.rb +37 -0
  25. data/lib/oidc/response_object/id_token.rb +99 -0
  26. data/lib/oidc/response_object/user_info/address.rb +10 -0
  27. data/lib/oidc/response_object/user_info.rb +65 -0
  28. data/lib/oidc/response_object.rb +8 -0
  29. data/lib/oidc/version.rb +5 -0
  30. data/lib/oidc.rb +98 -0
  31. data/lib/rack/oauth2/server/authorize/error_with_connect_ext.rb +34 -0
  32. data/lib/rack/oauth2/server/authorize/extension/code_and_id_token.rb +40 -0
  33. data/lib/rack/oauth2/server/authorize/extension/code_and_id_token_and_token.rb +36 -0
  34. data/lib/rack/oauth2/server/authorize/extension/id_token.rb +40 -0
  35. data/lib/rack/oauth2/server/authorize/extension/id_token_and_token.rb +36 -0
  36. data/lib/rack/oauth2/server/authorize/request_with_connect_params.rb +26 -0
  37. data/lib/rack/oauth2/server/id_token_response.rb +24 -0
  38. data/oidc.gemspec +46 -0
  39. data/sig/omniauth_oidc.rbs +4 -0
  40. metadata +252 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c44f542b5c5d86f83dded13bdf0256a209178610b54ba4501261506a3f2ce611
4
+ data.tar.gz: ebb8d39a32a3414b869ea9c603bc0af7175caacfe6e81971a6e3fd60fe2c14dd
5
+ SHA512:
6
+ metadata.gz: 197c2bca2194a332bd89e3740bd98141925e0cf64e88b534b477e7d02a4ad1499c7fd9751cb13eadf0c9a99b0e9b23b2af69f5d5ed6b2a956edc71ee1bf01b09
7
+ data.tar.gz: 83351e3eccbbe80ddab3265e7f37b173114f15d72bf9ee555bdbab8f4a9de893352c154bfa49e5d7a8fb0b3cada3ab3317d46b909de6252760713870c81f4814
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format=documentation
data/.rubocop.yml ADDED
@@ -0,0 +1,28 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
14
+
15
+ Metrics/ClassLength:
16
+ Max: 200
17
+
18
+ Metrics/MethodLength:
19
+ Max: 20
20
+
21
+ Metrics/AbcSize:
22
+ Max: 35
23
+
24
+ Metrics/Metrics/CyclomaticComplexity:
25
+ Max: 10
26
+
27
+ Metrics/PerceivedComplexity:
28
+ Max: 10
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## [Released]
2
+
3
+ ## [0.0.1] - 2024-07-21
4
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at slmusayev@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Suleyman Musayev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ = Oidc
2
+
3
+ OpenID Connect Server & Client Library
4
+
5
+ == Installation
6
+
7
+ gem install oidc
8
+
9
+ == Resources
10
+
11
+ * View Source on GitHub (https://github.com/nov/oidc)
12
+ * Report Issues on GitHub (https://github.com/nov/oidc/issues)
13
+ * Subscribe Update Info (https://www.facebook.com/Oidc.rb)
14
+
15
+ == Examples
16
+
17
+ === Provider
18
+
19
+ * Running on Heroku (https://connect-op.herokuapp.com)
20
+ * Source on GitHub (https://github.com/nov/oidc_sample)
21
+
22
+ * Simpler Version (https://github.com/nov/oidc_sample2)
23
+
24
+ === Relying Party
25
+
26
+ * Running on Heroku (https://connect-rp.herokuapp.com)
27
+ * Source on GitHub (https://github.com/nov/oidc_sample_rp)
28
+
29
+ There is also OpenID Foudation Certified RP implementation using this gem below.
30
+
31
+ * Running on Heroku (https://connect-rp-certified.herokuapp.com)
32
+ * Source on GitHub (https://github.com/nov/connect-rp-certified)
33
+
34
+ == Note on Patches/Pull Requests
35
+
36
+ * Fork the project.
37
+ * Make your feature addition or bug fix.
38
+ * Add tests for it. This is important so I don't break it in a
39
+ future version unintentionally.
40
+ * Commit, do not mess with rakefile, version, or history.
41
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
42
+ * Send me a pull request. Bonus points for topic branches.
43
+
44
+ == Copyright
45
+
46
+ Copyright (c) 2011 nov matake. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[test rubocop]
@@ -0,0 +1,9 @@
1
+ module Oidc
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
@@ -0,0 +1,45 @@
1
+ module Oidc
2
+ class AccessToken < Rack::OAuth2::AccessToken::Bearer
3
+ attr_required :client
4
+ attr_optional :id_token
5
+
6
+ def initialize(attributes = {})
7
+ super
8
+ @token_type = :bearer
9
+ end
10
+
11
+ def userinfo!(params = {})
12
+ hash = resource_request do
13
+ get client.userinfo_uri, params
14
+ end
15
+ ResponseObject::UserInfo.new hash
16
+ end
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
+
25
+ private
26
+
27
+ def resource_request
28
+ res = yield
29
+ case res.status
30
+ when 200
31
+ res.body.with_indifferent_access
32
+ when 400
33
+ raise BadRequest.new('API Access Faild', res)
34
+ when 401
35
+ raise Unauthorized.new('Access Token Invalid or Expired', res)
36
+ when 403
37
+ raise Forbidden.new('Insufficient Scope', res)
38
+ else
39
+ raise HttpError.new(res.status, 'Unknown HttpError', res)
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ require 'oidc/access_token/mtls'
@@ -0,0 +1,186 @@
1
+ module Oidc
2
+ class Client
3
+ class Registrar
4
+ include ActiveModel::Validations, AttrRequired, AttrOptional
5
+
6
+ class RegistrationFailed < HttpError; end
7
+
8
+ cattr_accessor :plural_uri_attributes, :metadata_attributes
9
+ singular_uri_attributes = [
10
+ :logo_uri,
11
+ :client_uri,
12
+ :policy_uri,
13
+ :tos_uri,
14
+ :jwks_uri,
15
+ :sector_identifier_uri,
16
+ :initiate_login_uri
17
+ ]
18
+ singular_attributes = [
19
+ :application_type,
20
+ :client_name,
21
+ :jwks,
22
+ :subject_type,
23
+ :id_token_signed_response_alg,
24
+ :id_token_encrypted_response_alg,
25
+ :id_token_encrypted_response_enc,
26
+ :userinfo_signed_response_alg,
27
+ :userinfo_encrypted_response_alg,
28
+ :userinfo_encrypted_response_enc,
29
+ :request_object_signing_alg,
30
+ :request_object_encryption_alg,
31
+ :request_object_encryption_enc,
32
+ :token_endpoint_auth_method,
33
+ :token_endpoint_auth_signing_alg,
34
+ :default_max_age,
35
+ :require_auth_time
36
+ ] + singular_uri_attributes
37
+ self.plural_uri_attributes = [
38
+ :redirect_uris,
39
+ :request_uris
40
+ ]
41
+ plural_attributes = [
42
+ :response_types,
43
+ :grant_types,
44
+ :contacts,
45
+ :default_acr_values,
46
+ ] + plural_uri_attributes
47
+ self.metadata_attributes = singular_attributes + plural_attributes
48
+ required_metadata_attributes = [
49
+ :redirect_uris
50
+ ]
51
+ attr_required :endpoint
52
+ attr_optional :initial_access_token
53
+ attr_required(*required_metadata_attributes)
54
+ attr_optional(*(metadata_attributes - required_metadata_attributes))
55
+
56
+ validates(*required_attributes, presence: true)
57
+ validates :sector_identifier_uri, presence: {if: :sector_identifier_required?}
58
+ validates(*singular_uri_attributes, url: true, allow_nil: true)
59
+ validate :validate_plural_uri_attributes
60
+ validate :validate_contacts
61
+
62
+ def initialize(endpoint, attributes = {})
63
+ self.endpoint = endpoint
64
+ self.initial_access_token = attributes[:initial_access_token]
65
+ self.class.metadata_attributes.each do |_attr_|
66
+ self.send "#{_attr_}=", attributes[_attr_]
67
+ end
68
+ end
69
+
70
+ def sector_identifier
71
+ if valid_uri?(sector_identifier_uri)
72
+ URI.parse(sector_identifier_uri).host
73
+ else
74
+ hosts = redirect_uris.collect do |redirect_uri|
75
+ if valid_uri?(redirect_uri, nil)
76
+ URI.parse(redirect_uri).host
77
+ else
78
+ nil
79
+ end
80
+ end.compact.uniq
81
+ if hosts.size == 1
82
+ hosts.first
83
+ else
84
+ nil
85
+ end
86
+ end
87
+ end
88
+
89
+ def as_json(options = {})
90
+ validate!
91
+ self.class.metadata_attributes.inject({}) do |hash, _attr_|
92
+ value = self.send _attr_
93
+ hash.merge! _attr_ => value unless value.nil?
94
+ hash
95
+ end
96
+ end
97
+
98
+ def register!
99
+ handle_response do
100
+ http_client.post endpoint, to_json, 'Content-Type' => 'application/json'
101
+ end
102
+ end
103
+
104
+ def read
105
+ # TODO: Do we want this feature even if we don't have rotate secret nor update metadata support?
106
+ end
107
+
108
+ def validate!
109
+ valid? or raise ValidationFailed.new(self)
110
+ end
111
+
112
+ private
113
+
114
+ def sector_identifier_required?
115
+ subject_type.to_s == 'pairwise' &&
116
+ sector_identifier.blank?
117
+ end
118
+
119
+ def valid_uri?(uri, schemes = ['http', 'https'])
120
+ # NOTE: specify nil for schemes to allow any schemes
121
+ URI::regexp(schemes).match(uri).present?
122
+ end
123
+
124
+ def validate_contacts
125
+ if contacts
126
+ include_invalid = contacts.any? do |contact|
127
+ begin
128
+ mail = Mail::Address.new(contact)
129
+ mail.address != contact || mail.domain.split(".").length <= 1
130
+ rescue
131
+ :invalid
132
+ end
133
+ end
134
+ errors.add :contacts, 'includes invalid email' if include_invalid
135
+ end
136
+ end
137
+
138
+ def validate_plural_uri_attributes
139
+ self.class.plural_uri_attributes.each do |_attr_|
140
+ if (uris = self.send(_attr_))
141
+ include_invalid = uris.any? do |uri|
142
+ !valid_uri?(uri, nil)
143
+ end
144
+ errors.add _attr_, 'includes invalid URL' if include_invalid
145
+ end
146
+ end
147
+ end
148
+
149
+ def http_client
150
+ case initial_access_token
151
+ when nil
152
+ Oidc.http_client
153
+ when Rack::OAuth2::AccessToken::Bearer
154
+ initial_access_token
155
+ else
156
+ Rack::OAuth2::AccessToken::Bearer.new(
157
+ access_token: initial_access_token
158
+ )
159
+ end
160
+ end
161
+
162
+ def handle_response
163
+ response = yield
164
+ case response.status
165
+ when 200..201
166
+ handle_success_response response
167
+ else
168
+ handle_error_response response
169
+ end
170
+ end
171
+
172
+ def handle_success_response(response)
173
+ credentials = response.body.with_indifferent_access
174
+ Client.new(
175
+ identifier: credentials[:client_id],
176
+ secret: credentials[:client_secret],
177
+ expires_in: credentials[:expires_in]
178
+ )
179
+ end
180
+
181
+ def handle_error_response(response)
182
+ raise RegistrationFailed.new(response.status, 'Client Registration Failed', response)
183
+ end
184
+ end
185
+ end
186
+ end
@@ -0,0 +1,43 @@
1
+ module Oidc
2
+ class Client < Rack::OAuth2::Client
3
+ attr_optional :userinfo_endpoint, :expires_in
4
+
5
+ def initialize(attributes = {})
6
+ super attributes
7
+ self.userinfo_endpoint ||= '/userinfo'
8
+ end
9
+
10
+ def authorization_uri(params = {})
11
+ params[:scope] = setup_required_scope params[:scope]
12
+ params[:prompt] = Array(params[:prompt]).join(' ')
13
+ super
14
+ end
15
+
16
+ def userinfo_uri
17
+ absolute_uri_for userinfo_endpoint
18
+ end
19
+
20
+ private
21
+
22
+ def setup_required_scope(scopes)
23
+ _scopes_ = Array(scopes).join(' ').split(' ')
24
+ _scopes_ << 'openid' unless _scopes_.include?('openid')
25
+ _scopes_
26
+ end
27
+
28
+ def handle_success_response(response)
29
+ token_hash = response.body.with_indifferent_access
30
+ token_type = (@forced_token_type || token_hash[:token_type]).try(:downcase)
31
+ case token_type
32
+ when 'bearer'
33
+ AccessToken.new token_hash.merge(client: self)
34
+ else
35
+ raise Exception.new("Unexpected Token Type: #{token_type}")
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ Dir[File.dirname(__FILE__) + '/client/*.rb'].each do |file|
42
+ require file
43
+ end
@@ -0,0 +1,52 @@
1
+ module Oidc
2
+ class ConnectObject
3
+ include ActiveModel::Validations, AttrRequired, AttrOptional
4
+
5
+ attr_accessor :raw_attributes
6
+
7
+ def initialize(attributes = {})
8
+ all_attributes.each do |_attr_|
9
+ self.send :"#{_attr_}=", attributes[_attr_]
10
+ end
11
+ self.raw_attributes = attributes
12
+ attr_missing!
13
+ end
14
+
15
+ def self.all_attributes
16
+ required_attributes + optional_attributes
17
+ end
18
+ def all_attributes
19
+ self.class.all_attributes
20
+ end
21
+
22
+ def require_at_least_one_attributes
23
+ all_blank = all_attributes.all? do |key|
24
+ self.send(key).blank?
25
+ end
26
+ errors.add :base, 'At least one attribute is required' if all_blank
27
+ end
28
+
29
+ def as_json(options = {})
30
+ options ||= {} # options can be nil when to_json is called without options
31
+ validate! unless options[:skip_validation]
32
+ all_attributes.inject({}) do |hash, _attr_|
33
+ value = self.send(_attr_)
34
+ hash.merge! _attr_ => case value
35
+ when ConnectObject
36
+ value.as_json options
37
+ else
38
+ value
39
+ end
40
+ end.delete_if do |key, value|
41
+ value.nil?
42
+ end
43
+ end
44
+
45
+ def validate!
46
+ valid? or raise ValidationFailed.new(self)
47
+ end
48
+ end
49
+ end
50
+
51
+ require 'oidc/request_object'
52
+ require 'oidc/response_object'
@@ -0,0 +1,39 @@
1
+ require "openssl"
2
+
3
+ module Oidc
4
+ module Discovery
5
+ module Provider
6
+ class Config
7
+ class Resource < SWD::Resource
8
+ undef_required_attributes :principal, :service
9
+
10
+ class Expired < SWD::Resource::Expired; end
11
+
12
+ def initialize(uri)
13
+ @host = uri.host
14
+ @port = uri.port unless [80, 443].include?(uri.port)
15
+ @path = File.join uri.path, '.well-known/openid-configuration'
16
+ attr_missing!
17
+ end
18
+
19
+ def endpoint
20
+ SWD.url_builder.build [nil, host, port, path, nil, nil]
21
+ rescue URI::Error => e
22
+ raise SWD::Exception.new(e.message)
23
+ end
24
+
25
+ private
26
+
27
+ def to_response_object(hash)
28
+ Response.new(hash)
29
+ end
30
+
31
+ def cache_key
32
+ sha256 = OpenSSL::Digest::SHA256.hexdigest host
33
+ "swd:resource:opneid-conf:#{sha256}"
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end