Class: InheritedProofing::Logingov::Configuration

Inherits:
Common::Client::Configuration::REST show all
Defined in:
lib/inherited_proofing/logingov/configuration.rb

Instance Attribute Summary

Attributes inherited from Common::Client::Configuration::Base

#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent

Instance Method Summary collapse

Methods inherited from Common::Client::Configuration::Base

#breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #request_options, #service_exception

Instance Method Details

#auth_pathObject



40
41
42
# File 'lib/inherited_proofing/logingov/configuration.rb', line 40

def auth_path
  'openid_connect/authorize'
end

#base_pathObject



8
9
10
# File 'lib/inherited_proofing/logingov/configuration.rb', line 8

def base_path
  Settings.logingov.oauth_url
end

#client_assertion_expiration_secondsObject



28
29
30
# File 'lib/inherited_proofing/logingov/configuration.rb', line 28

def client_assertion_expiration_seconds
  1000
end

#client_cert_pathObject



24
25
26
# File 'lib/inherited_proofing/logingov/configuration.rb', line 24

def client_cert_path
  Settings.logingov.client_cert_path
end

#client_idObject



12
13
14
# File 'lib/inherited_proofing/logingov/configuration.rb', line 12

def client_id
  Settings.logingov.client_id
end

#client_key_pathObject



20
21
22
# File 'lib/inherited_proofing/logingov/configuration.rb', line 20

def client_key_path
  Settings.logingov.client_key_path
end

#connectionObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/inherited_proofing/logingov/configuration.rb', line 56

def connection
  @connection ||= Faraday.new(
    base_path,
    headers: base_request_headers,
    request: request_options,
    ssl: { client_cert: ssl_cert,
           client_key: ssl_key }
  ) do |conn|
    conn.use :breakers
    conn.use Faraday::Response::RaiseError
    conn.response :snakecase
    conn.response :json, content_type: /\bjson$/
    conn.adapter Faraday.default_adapter
  end
end

#promptObject



32
33
34
# File 'lib/inherited_proofing/logingov/configuration.rb', line 32

def prompt
  'select_account'
end

#redirect_uriObject



16
17
18
# File 'lib/inherited_proofing/logingov/configuration.rb', line 16

def redirect_uri
  Settings.logingov.inherited_proofing_redirect_uri
end

#response_typeObject



36
37
38
# File 'lib/inherited_proofing/logingov/configuration.rb', line 36

def response_type
  'code'
end

#service_nameObject



52
53
54
# File 'lib/inherited_proofing/logingov/configuration.rb', line 52

def service_name
  'logingov_inherited_proofing'
end

#ssl_certObject



48
49
50
# File 'lib/inherited_proofing/logingov/configuration.rb', line 48

def ssl_cert
  OpenSSL::X509::Certificate.new(File.read(client_cert_path))
end

#ssl_keyObject



44
45
46
# File 'lib/inherited_proofing/logingov/configuration.rb', line 44

def ssl_key
  OpenSSL::PKey::RSA.new(File.read(client_key_path))
end