Class: MAP::SecurityToken::Configuration

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

#appointments_client_idObject



25
26
27
# File 'lib/map/security_token/configuration.rb', line 25

def appointments_client_id
  Settings.map_services.appointments_client_id
end

#base_pathObject



9
10
11
# File 'lib/map/security_token/configuration.rb', line 9

def base_path
  Settings.map_services.oauth_url
end

#chatbot_client_idObject



13
14
15
# File 'lib/map/security_token/configuration.rb', line 13

def chatbot_client_id
  Settings.map_services.chatbot_client_id
end

#check_in_client_idObject



21
22
23
# File 'lib/map/security_token/configuration.rb', line 21

def check_in_client_id
  Settings.map_services.check_in_client_id
end

#client_assertion_certificateObject



77
78
79
# File 'lib/map/security_token/configuration.rb', line 77

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

#client_assertion_encode_algorithmObject



57
58
59
# File 'lib/map/security_token/configuration.rb', line 57

def client_assertion_encode_algorithm
  'RS512'
end

#client_assertion_expiration_secondsObject



53
54
55
# File 'lib/map/security_token/configuration.rb', line 53

def client_assertion_expiration_seconds
  300
end

#client_assertion_patient_id_typeObject



65
66
67
# File 'lib/map/security_token/configuration.rb', line 65

def client_assertion_patient_id_type
  'icn'
end

#client_assertion_private_keyObject



73
74
75
# File 'lib/map/security_token/configuration.rb', line 73

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

#client_assertion_roleObject



61
62
63
# File 'lib/map/security_token/configuration.rb', line 61

def client_assertion_role
  'veteran'
end

#client_assertion_typeObject



45
46
47
# File 'lib/map/security_token/configuration.rb', line 45

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

#client_cert_pathObject



33
34
35
# File 'lib/map/security_token/configuration.rb', line 33

def client_cert_path
  Settings.map_services.client_cert_path
end

#client_key_pathObject



29
30
31
# File 'lib/map/security_token/configuration.rb', line 29

def client_key_path
  Settings.map_services.client_key_path
end

#connectionObject



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/map/security_token/configuration.rb', line 81

def connection
  @connection ||= Faraday.new(
    base_path,
    headers: base_request_headers,
    request: request_options
  ) do |conn|
    conn.use :breakers
    conn.use Faraday::Response::RaiseError
    conn.adapter Faraday.default_adapter
    conn.response :json, content_type: /\bjson/
    conn.response :betamocks if Settings.map_services.secure_token_service.mock
  end
end

#grant_typeObject



49
50
51
# File 'lib/map/security_token/configuration.rb', line 49

def grant_type
  'client_credentials'
end

#logging_prefixObject



69
70
71
# File 'lib/map/security_token/configuration.rb', line 69

def logging_prefix
  '[MAP][SecurityToken][Service]'
end

#service_nameObject



37
38
39
# File 'lib/map/security_token/configuration.rb', line 37

def service_name
  'map_security_token_service'
end

#sign_up_service_client_idObject



17
18
19
# File 'lib/map/security_token/configuration.rb', line 17

def 
  Settings.map_services.
end

#token_pathObject



41
42
43
# File 'lib/map/security_token/configuration.rb', line 41

def token_path
  'sts/oauth/v1/token'
end