Class: EVSS::VSOSearch::Service
- Inherits:
-
Service
- Object
- Common::Client::Base
- Service
- EVSS::VSOSearch::Service
- Defined in:
- lib/evss/vso_search/service.rb
Overview
Proxy Service for VSO search
Constant Summary
Constants inherited from Service
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#get_current_info(additional_headers = {}) ⇒ Faraday::Response
Returns current info for a user by their SSN.
- #request_headers(additional_headers) ⇒ Object private
Methods inherited from Service
#handle_error, #headers, #initialize, #perform, #save_error_details, service_is_up?, #with_monitoring_and_error_handling
Methods included from Common::Client::Concerns::Monitoring
#increment, #increment_failure, #increment_total, #with_monitoring
Methods inherited from Common::Client::Base
#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Constructor Details
This class inherits a constructor from EVSS::Service
Instance Method Details
#get_current_info(additional_headers = {}) ⇒ Faraday::Response
Returns current info for a user by their SSN
23 24 25 26 27 |
# File 'lib/evss/vso_search/service.rb', line 23 def get_current_info(additional_headers = {}) with_monitoring_and_error_handling do perform(:post, 'getCurrentInfo', '', request_headers(additional_headers)).body end end |
#request_headers(additional_headers) ⇒ Object (private)
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/evss/vso_search/service.rb', line 31 def request_headers(additional_headers) edipi = additional_headers['va_eauth_dodedipnid'].presence || @user&.edipi ssn = additional_headers['va_eauth_pnid'].presence || @user&.ssn { 'ssn' => ssn, 'edipi' => edipi, 'Authorization' => "Token token=#{Settings.caseflow.app_token}", 'Content-Type' => 'application/json' }.merge(additional_headers) end |