Class: IAMSSOeOAuth::Configuration
- Inherits:
-
Common::Client::Configuration::REST
- Object
- Common::Client::Configuration::Base
- Common::Client::Configuration::REST
- IAMSSOeOAuth::Configuration
- Defined in:
- lib/iam_ssoe_oauth/configuration.rb
Overview
Configuration for the IAMSSOeOAuth::Service. A singleton class that returns a connection that can make signed requests
Constant Summary collapse
- CERT_PATH =
Settings.iam_ssoe.client_cert_path
- KEY_PATH =
Settings.iam_ssoe.client_key_path
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
-
#base_path ⇒ Object
Override the parent’s base path.
-
#connection ⇒ Object
Faraday connection object with breakers, snakecase and json response middleware.
-
#service_name ⇒ Object
Service name for breakers integration.
- #ssl_cert ⇒ Object private
- #ssl_key ⇒ Object private
- #ssl_options ⇒ Object private
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
#base_path ⇒ Object
Override the parent’s base path
21 22 23 |
# File 'lib/iam_ssoe_oauth/configuration.rb', line 21 def base_path Settings.iam_ssoe.oauth_url end |
#connection ⇒ Object
Faraday connection object with breakers, snakecase and json response middleware
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/iam_ssoe_oauth/configuration.rb', line 35 def connection @connection ||= Faraday.new( base_path, headers: base_request_headers, request: , ssl: ) 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 |
#service_name ⇒ Object
Service name for breakers integration
28 29 30 |
# File 'lib/iam_ssoe_oauth/configuration.rb', line 28 def service_name 'IAMSSOeOAuth' end |
#ssl_cert ⇒ Object (private)
58 59 60 |
# File 'lib/iam_ssoe_oauth/configuration.rb', line 58 def ssl_cert OpenSSL::X509::Certificate.new(File.read(CERT_PATH)) end |
#ssl_key ⇒ Object (private)
62 63 64 |
# File 'lib/iam_ssoe_oauth/configuration.rb', line 62 def ssl_key OpenSSL::PKey::RSA.new(File.read(KEY_PATH)) end |
#ssl_options ⇒ Object (private)
49 50 51 52 53 54 55 56 |
# File 'lib/iam_ssoe_oauth/configuration.rb', line 49 def if ssl_cert && ssl_key { client_cert: ssl_cert, client_key: ssl_key } end end |