Class: SignIn::Logingov::Configuration

Inherits:
Common::Client::Configuration::REST show all
Defined in:
lib/sign_in/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, #current_module, #request_options, #service_exception

Instance Method Details

#auth_pathObject



57
58
59
# File 'lib/sign_in/logingov/configuration.rb', line 57

def auth_path
  'openid_connect/authorize'
end

#base_pathObject



9
10
11
# File 'lib/sign_in/logingov/configuration.rb', line 9

def base_path
  Settings.logingov.oauth_url
end

#client_assertion_expiration_secondsObject



45
46
47
# File 'lib/sign_in/logingov/configuration.rb', line 45

def client_assertion_expiration_seconds
  1000
end

#client_assertion_typeObject



37
38
39
# File 'lib/sign_in/logingov/configuration.rb', line 37

def client_assertion_type
  'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
end

#client_cert_pathObject



29
30
31
# File 'lib/sign_in/logingov/configuration.rb', line 29

def client_cert_path
  Settings.logingov.client_cert_path
end

#client_idObject



13
14
15
# File 'lib/sign_in/logingov/configuration.rb', line 13

def client_id
  Settings.logingov.client_id
end

#client_key_pathObject



25
26
27
# File 'lib/sign_in/logingov/configuration.rb', line 25

def client_key_path
  Settings.logingov.client_key_path
end

#connectionObject



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/sign_in/logingov/configuration.rb', line 109

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

#grant_typeObject



41
42
43
# File 'lib/sign_in/logingov/configuration.rb', line 41

def grant_type
  'authorization_code'
end

#jwks_cache_expirationObject



101
102
103
# File 'lib/sign_in/logingov/configuration.rb', line 101

def jwks_cache_expiration
  30.minutes
end

#jwks_cache_keyObject



97
98
99
# File 'lib/sign_in/logingov/configuration.rb', line 97

def jwks_cache_key
  'logingov_public_jwks'
end

#jwt_decode_algorithmObject



77
78
79
# File 'lib/sign_in/logingov/configuration.rb', line 77

def jwt_decode_algorithm
  'RS256'
end

#log_credentialObject



89
90
91
# File 'lib/sign_in/logingov/configuration.rb', line 89

def log_credential
  false
end

#log_prefixObject



105
106
107
# File 'lib/sign_in/logingov/configuration.rb', line 105

def log_prefix
  '[SignIn][Logingov][Service]'
end

#logout_pathObject



65
66
67
# File 'lib/sign_in/logingov/configuration.rb', line 65

def logout_path
  'openid_connect/logout'
end

#logout_redirect_uriObject



21
22
23
# File 'lib/sign_in/logingov/configuration.rb', line 21

def logout_redirect_uri
  Settings.logingov.logout_redirect_uri
end

#promptObject



49
50
51
# File 'lib/sign_in/logingov/configuration.rb', line 49

def prompt
  'select_account'
end

#public_jwks_pathObject



73
74
75
# File 'lib/sign_in/logingov/configuration.rb', line 73

def public_jwks_path
  '/api/openid_connect/certs'
end

#redirect_uriObject



17
18
19
# File 'lib/sign_in/logingov/configuration.rb', line 17

def redirect_uri
  Settings.logingov.redirect_uri
end

#response_typeObject



53
54
55
# File 'lib/sign_in/logingov/configuration.rb', line 53

def response_type
  'code'
end

#service_nameObject



93
94
95
# File 'lib/sign_in/logingov/configuration.rb', line 93

def service_name
  'logingov'
end

#single_sign_out_uriObject



33
34
35
# File 'lib/sign_in/logingov/configuration.rb', line 33

def single_sign_out_uri
  Settings.logingov.sign_out_uri
end

#ssl_certObject



85
86
87
# File 'lib/sign_in/logingov/configuration.rb', line 85

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

#ssl_keyObject



81
82
83
# File 'lib/sign_in/logingov/configuration.rb', line 81

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

#token_pathObject



61
62
63
# File 'lib/sign_in/logingov/configuration.rb', line 61

def token_path
  'api/openid_connect/token'
end

#userinfo_pathObject



69
70
71
# File 'lib/sign_in/logingov/configuration.rb', line 69

def userinfo_path
  'api/openid_connect/userinfo'
end