Module: OpenIDConnect
- Defined in:
- lib/openid_connect.rb,
lib/openid_connect/client.rb,
lib/openid_connect/discovery.rb,
lib/openid_connect/exception.rb,
lib/openid_connect/jwtnizable.rb,
lib/openid_connect/access_token.rb,
lib/openid_connect/connect_object.rb,
lib/openid_connect/request_object.rb,
lib/openid_connect/response_object.rb,
lib/openid_connect/client/registrar.rb,
lib/openid_connect/access_token/mtls.rb,
lib/openid_connect/discovery/provider.rb,
lib/openid_connect/request_object/id_token.rb,
lib/openid_connect/request_object/claimable.rb,
lib/openid_connect/request_object/user_info.rb,
lib/openid_connect/response_object/id_token.rb,
lib/openid_connect/discovery/provider/config.rb,
lib/openid_connect/response_object/user_info.rb,
lib/openid_connect/response_object/user_info/address.rb,
lib/openid_connect/discovery/provider/config/resource.rb,
lib/openid_connect/discovery/provider/config/response.rb
Defined Under Namespace
Modules: Discovery, JWTnizable
Classes: AccessToken, BadRequest, Client, ConnectObject, Exception, Forbidden, HttpError, RequestObject, ResponseObject, Unauthorized, ValidationFailed
Constant Summary
collapse
- VERSION =
::File.read(
::File.join(::File.dirname(__FILE__), '../VERSION')
).chomp
Class Method Summary
collapse
Class Method Details
.debug(&block) ⇒ Object
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/openid_connect.rb', line 53
def self.debug(&block)
sub_protocol_originals = @sub_protocols.inject({}) do |sub_protocol_originals, klass|
sub_protocol_originals.merge!(klass => klass.debugging?)
end
original = self.debugging?
debug!
yield
ensure
@sub_protocols.each do |klass|
klass.debugging = sub_protocol_originals[klass]
end
self.debugging = original
end
|
.debug! ⇒ Object
47
48
49
50
51
52
|
# File 'lib/openid_connect.rb', line 47
def self.debug!
@sub_protocols.each do |klass|
klass.debug!
end
self.debugging = true
end
|
.debugging=(boolean) ⇒ Object
41
42
43
44
45
46
|
# File 'lib/openid_connect.rb', line 41
def self.debugging=(boolean)
@sub_protocols.each do |klass|
klass.debugging = boolean
end
@@debugging = boolean
end
|
.debugging? ⇒ Boolean
38
39
40
|
# File 'lib/openid_connect.rb', line 38
def self.debugging?
@@debugging
end
|
.http_client ⇒ Object
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/openid_connect.rb', line 68
def self.http_client
Faraday.new(headers: {user_agent: "OpenIDConnect (#{VERSION})"}) do |faraday|
faraday.request :url_encoded
faraday.request :json
faraday.response :json
faraday.response :logger, OpenIDConnect.logger, {bodies: true} if debugging?
faraday.adapter Faraday.default_adapter
http_config&.call(faraday)
end
end
|
.http_config(&block) ⇒ Object
78
79
80
81
82
83
|
# File 'lib/openid_connect.rb', line 78
def self.http_config(&block)
@sub_protocols.each do |klass|
klass.http_config(&block) unless klass.http_config
end
@@http_config ||= block
end
|
.logger ⇒ Object
24
25
26
|
# File 'lib/openid_connect.rb', line 24
def self.logger
@@logger
end
|
.logger=(logger) ⇒ Object
27
28
29
|
# File 'lib/openid_connect.rb', line 27
def self.logger=(logger)
@@logger = logger
end
|
.validate_discovery_issuer ⇒ Object
89
90
91
|
# File 'lib/openid_connect.rb', line 89
def self.validate_discovery_issuer
@@validate_discovery_issuer
end
|
.validate_discovery_issuer=(boolean) ⇒ Object
85
86
87
|
# File 'lib/openid_connect.rb', line 85
def self.validate_discovery_issuer=(boolean)
@@validate_discovery_issuer = boolean
end
|