Class: MAP::SignUp::Configuration

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

#agreements_version_mappingObject



45
46
47
48
49
# File 'lib/map/sign_up/configuration.rb', line 45

def agreements_version_mapping
  {
    'v1' => 3
  }
end

#authenticated_header(jwt) ⇒ Object



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

def authenticated_header(jwt)
  { 'X-VAMF-JWT' => jwt }
end

#authenticated_provisioning_headerObject



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

def authenticated_provisioning_header
  { 'X-VAMF-API-KEY' => provisioning_api_key }
end

#base_pathObject



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

def base_path
  Settings.map_services.
end

#connectionObject



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/map/sign_up/configuration.rb', line 59

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..mock
  end
end


51
52
53
# File 'lib/map/sign_up/configuration.rb', line 51

def legal_display_version
  1.0
end

#logging_prefixObject



55
56
57
# File 'lib/map/sign_up/configuration.rb', line 55

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

#patients_agreements_path(icn) ⇒ Object



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

def patients_agreements_path(icn)
  "/signup/v1/patients/#{icn}/agreements"
end

#patients_provisioning_path(icn) ⇒ Object



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

def patients_provisioning_path(icn)
  "/signup/v1/patients/#{icn}/provisioning/cerner"
end

#provisioning_acceptable_statusObject



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

def provisioning_acceptable_status
  [200, 406, 412]
end

#provisioning_api_keyObject



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

def provisioning_api_key
  Settings.map_services.
end

#service_nameObject



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

def service_name
  'map_sign_up_service'
end

#status_unauthenticated_path(icn) ⇒ Object



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

def status_unauthenticated_path(icn)
  "/signup/v1/patients/#{icn}/status/summary"
end