-
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
Conversation
7ec4060
to
6897db9
Compare
handle_error('User is not a VA representative', | ||
Constants::ErrorCode::GENERIC_EXTERNAL_ISSUE, | ||
error: Errors::RepresentativeRecordNotFoundError) |
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.
😎
ef89607
to
ab5dcd5
Compare
ab5dcd5
to
825dfef
Compare
825dfef
to
95761e4
Compare
2332822
to
44011a0
Compare
2b8051c
to
24468b2
Compare
7e5270f
to
a57bfd2
Compare
6354edc
to
0910c23
Compare
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 comment
The 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 Summary
Interim, 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 enabled: bool
attribute to the RepresentativeUser model, with ARF engineers setting this in a static JSON file within vets-api. This would be a whitelisting approach.
Other Explored Alternatives
- Is there a private OGC registration number that is treated as a secret?
- Per the OGC API's
v1/accreditations/Representatives/{id}
endpoint, there are two returned IDs (in UUID format),repVSoid
andaccrRepId
, that could potentially be used for this. ARF is unsure if these OGC API IDs are treated as a secret or are IDs meant for internal use, and OGC<>ARF coordination will be necessary around that. Even then, thought would need to be given to how ARF would get these identifiers to Representatives. Additionally, given that these identifiers are in UUID format, it would be cumbersome for VSReps to enter them manually in ARP.
- Per the OGC API's
- Could ARP require users to perform one-time authentication using the email address OGC already has on file? (this will probably block some users from access, as ARM found data quality issues with rep contact data, but it may be a sound long-term incentive to keep that data correct?)
- This is possible, but it may be a heavy lift for the ARP Pilot. Additionally, there would be friction to this alternative, given OGC data quality issues around emails.
- Could we match on SSN, DOB first name, and last name and have that be enough? (SSN is found in OGC's internal dataset, though we need to verify how reliably it is present)
- The OGC API's
/api/v1/accreditations/Representatives/active
endpoint returns DOB and SSN as fields in the response body, but all values are currently empty. The ARF Team would have to check with OGC if they plan on returning populated DOBs and SSNs in their responses. This is a promising alternative if OGC plans to return non-nil values for DOB and SSN.
- The OGC API's
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.
@bosawt, what are your thoughts on pushing forward with the above interim solution for the ARP pilot?
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, |
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.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR has been closed because it has had no activity for 37 days |
Summary
AccreditedRepresentativePortal::RepresentativeUserLoader
to validateVeteran::Service::Representative
recordRecordNotFoundError
Related issue(s)
Testing done
Veteran::Service::Representative
with the attributes of the test user you have chosen:[email protected]
Logs
Rails -- User is not a VA representative : {:access_token_authorization_header=><access_token>}
Acceptance criteria