Class: CARMA::Client::MuleSoftAuthTokenConfiguration

Inherits:
Common::Client::Configuration::REST show all
Defined in:
lib/carma/client/mule_soft_auth_token_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

#base_pathObject (private)



28
29
30
# File 'lib/carma/client/mule_soft_auth_token_configuration.rb', line 28

def base_path
  "#{settings.token_url}/"
end

#connectionObject



6
7
8
9
10
11
12
# File 'lib/carma/client/mule_soft_auth_token_configuration.rb', line 6

def connection
  Faraday.new(base_path) do |conn|
    conn.use :breakers
    conn.request :instrumentation, name: service_name
    conn.adapter Faraday.default_adapter
  end
end

#service_nameObject



14
15
16
# File 'lib/carma/client/mule_soft_auth_token_configuration.rb', line 14

def service_name
  self.class.name
end

#settingsObject



22
23
24
# File 'lib/carma/client/mule_soft_auth_token_configuration.rb', line 22

def settings
  Settings.form_10_10cg.carma.mulesoft.auth
end

#timeoutObject



18
19
20
# File 'lib/carma/client/mule_soft_auth_token_configuration.rb', line 18

def timeout
  settings.key?(:timeout) ? settings.timeout : 30
end