Class: EVSS::AuthHeaders

Inherits:
BaseHeaders show all
Defined in:
lib/evss/auth_headers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ AuthHeaders

Returns a new instance of AuthHeaders.



10
11
12
13
# File 'lib/evss/auth_headers.rb', line 10

def initialize(user)
  @transaction_id = create_transaction_id
  super(user)
end

Instance Attribute Details

#transaction_idObject (readonly)

Returns the value of attribute transaction_id.



8
9
10
# File 'lib/evss/auth_headers.rb', line 8

def transaction_id
  @transaction_id
end

Instance Method Details

#to_hObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/evss/auth_headers.rb', line 15

def to_h
  @headers ||= sanitize(
    'va_eauth_csid' => 'DSLogon',
    # TODO: Change va_eauth_authenticationmethod to vets.gov
    # once the EVSS team is ready for us to use it
    'va_eauth_authenticationmethod' => 'DSLogon',
    'va_eauth_pnidtype' => 'SSN',
    'va_eauth_assurancelevel' => @user.loa[:current].to_s,
    'va_eauth_firstName' => @user.first_name,
    'va_eauth_lastName' => @user.last_name,
    'va_eauth_issueinstant' => @user.last_signed_in&.iso8601,
    'va_eauth_dodedipnid' => @user.edipi,
    'va_eauth_birlsfilenumber' => @user.birls_id,
    'va_eauth_pid' => @user.participant_id,
    'va_eauth_pnid' => @user.ssn,
    'va_eauth_birthdate' => Formatters::DateFormatter.format_date(@user.birth_date, :datetime_iso8601),
    'va_eauth_authorization' => eauth_json,
    'va_eauth_authenticationauthority' => 'eauth',
    'va_eauth_service_transaction_id' => @transaction_id
  )
end