Class: OpenIDConnect::Discovery::Provider::Config::Resource

Inherits:
SWD::Resource
  • Object
show all
Defined in:
lib/openid_connect/discovery/provider/config/resource.rb

Defined Under Namespace

Classes: Expired

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Resource

Returns a new instance of Resource.



12
13
14
15
16
17
# File 'lib/openid_connect/discovery/provider/config/resource.rb', line 12

def initialize(uri)
  @host = uri.host
  @port = uri.port unless [80, 443].include?(uri.port)
  @path = File.join uri.path, '.well-known/openid-configuration'
  attr_missing!
end

Instance Method Details

#endpointObject



19
20
21
22
23
# File 'lib/openid_connect/discovery/provider/config/resource.rb', line 19

def endpoint
  SWD.url_builder.build [nil, host, port, path, nil, nil]
rescue URI::Error => e
  raise SWD::Exception.new(e.message)
end