Class: SignIn::AttributeValidator

Inherits:
Object
  • Object
show all
Defined in:
app/services/sign_in/attribute_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_attributes:) ⇒ AttributeValidator

Returns a new instance of AttributeValidator.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/services/sign_in/attribute_validator.rb', line 20

def initialize(user_attributes:)
  @idme_uuid = user_attributes[:idme_uuid]
  @logingov_uuid = user_attributes[:logingov_uuid]
  @auto_uplevel = user_attributes[:auto_uplevel]
  @current_ial = user_attributes[:current_ial]
  @service_name = user_attributes[:service_name]
  @first_name = user_attributes[:first_name]
  @last_name = user_attributes[:last_name]
  @birth_date = user_attributes[:birth_date]
  @credential_email = user_attributes[:csp_email]
  @address = user_attributes[:address]
  @ssn = user_attributes[:ssn]
  @mhv_icn = user_attributes[:mhv_icn]
  @edipi = user_attributes[:edipi]
  @mhv_correlation_id = user_attributes[:mhv_correlation_id]
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def address
  @address
end

#auto_uplevelObject (readonly)

Returns the value of attribute auto_uplevel.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def auto_uplevel
  @auto_uplevel
end

#birth_dateObject (readonly)

Returns the value of attribute birth_date.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def birth_date
  @birth_date
end

#credential_emailObject (readonly)

Returns the value of attribute credential_email.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def credential_email
  @credential_email
end

#current_ialObject (readonly)

Returns the value of attribute current_ial.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def current_ial
  @current_ial
end

#edipiObject (readonly)

Returns the value of attribute edipi.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def edipi
  @edipi
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def first_name
  @first_name
end

#idme_uuidObject (readonly)

Returns the value of attribute idme_uuid.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def idme_uuid
  @idme_uuid
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def last_name
  @last_name
end

#logingov_uuidObject (readonly)

Returns the value of attribute logingov_uuid.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def logingov_uuid
  @logingov_uuid
end

#mhv_correlation_idObject (readonly)

Returns the value of attribute mhv_correlation_id.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def mhv_correlation_id
  @mhv_correlation_id
end

#mhv_icnObject (readonly)

Returns the value of attribute mhv_icn.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def mhv_icn
  @mhv_icn
end

#service_nameObject (readonly)

Returns the value of attribute service_name.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def service_name
  @service_name
end

#ssnObject (readonly)

Returns the value of attribute ssn.



5
6
7
# File 'app/services/sign_in/attribute_validator.rb', line 5

def ssn
  @ssn
end

Instance Method Details

#performObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/services/sign_in/attribute_validator.rb', line 37

def perform
  return unless verified_credential?

  validate_credential_attributes

  if mhv_auth?
    mhv_set_user_attributes_from_mpi
    add_mpi_user
    validate_existing_mpi_attributes
  elsif mpi_record_exists?
    validate_existing_mpi_attributes
    update_mpi_correlation_record
  else
    add_mpi_user
    validate_existing_mpi_attributes
  end

  verified_icn
end