-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
78001 - Representative User validation #16084
Changes from all commits
17bd8dc
4f1c0bb
6fc6172
098c14f
329cdf5
6de1def
c5f92cf
948232e
1c34dec
c7eef63
c22ffe7
ca92149
0910c23
ddb4ec4
d4a1ff1
6e33196
4926896
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,25 @@ def find_valid_user | |
|
||
def reload_user | ||
validate_account_and_session | ||
validate_representative_status | ||
current_user | ||
end | ||
|
||
def validate_account_and_session | ||
raise SignIn::Errors::SessionNotFoundError.new message: 'Invalid Session Handle' unless session | ||
end | ||
|
||
def validate_representative_status | ||
mpi_profile = mpi_service.find_profile_by_identifier(identifier: session.user_account.icn, | ||
identifier_type: MPI::Constants::ICN).profile | ||
representative = Veteran::Service::Representative.for_user(first_name: session.user_attributes_hash['first_name'], | ||
last_name: session.user_attributes_hash['last_name'], | ||
ssn: mpi_profile.ssn, | ||
dob: mpi_profile.birth_date) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ARP engine will likely use a VS::Representative's OGC number to get their POA codes, which is currently stored in vets-api's representative_id. This will not be used for validation, but to get the poa_codes associated with a Representative. See this Zenhub issue exploring ARP engine RepresentativeUser validation/authentication. Summary below. RepresentativeUser Authentication/Validation Exploration SummaryInterim, Pilot Solution@amprokop, @nihil2501, and I explored the hypotheses outlined in the above issue. The most feasible pilot alternative seems to be to add an Other Explored Alternatives
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bosawt, what are your thoughts on pushing forward with the above interim solution for the ARP pilot? |
||
|
||
raise SignIn::Errors::RecordNotFoundError.new message: 'User is not a VA representative' if representative.blank? | ||
end | ||
|
||
def loa | ||
current_loa = user_is_verified? ? SignIn::Constants::Auth::LOA_THREE : SignIn::Constants::Auth::LOA_ONE | ||
{ current: current_loa, highest: SignIn::Constants::Auth::LOA_THREE } | ||
|
@@ -84,5 +96,9 @@ def current_user | |
|
||
@current_user = user | ||
end | ||
|
||
def mpi_service | ||
@service ||= MPI::Service.new | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARP will use session.user_verification and have a join table between UserVerification (credential someone logged in as) <> VS::Representative, which will get used to set a RepresentativeUser's poa_codes here.