Conversation
Adds methods to the DocumentCaptureSession to store/load the data, encrypted, for an agent-proofed user. changelog: Upcoming Features, Proofing Agent, Store received data encrypted.
| session_result.location_id = agent_proofing_result.location_id | ||
| session_result.agent_id = agent_proofing_result.agent_id | ||
| session_result.issuer = agent_proofing_result.issuer | ||
| session_result.success = agent_proofing_result.success |
There was a problem hiding this comment.
| session_result.success = agent_proofing_result.success |
dupe
| session_result = load_agent_proofed_user || | ||
| Idv::ProofingAgent::AgentProofedUser.new(id: generate_result_id) | ||
|
|
||
| session_result.success = agent_proofing_result.success |
There was a problem hiding this comment.
in LG-17293, i'm assuming that PII is proofed only docAuth and AAMVA/MRZ pass ... however, i think it could be safer (against future coding error) if success look at all 3 values. curious to hear your thoughts ... 🤔
agent_proofing_result.success? && (aamva_response.success? || mrz_response_success?) && doc_auth_response.success?
| aamva_status: :not_processed, | ||
| ) | ||
| end | ||
| end |
There was a problem hiding this comment.
| end | |
| end | |
| context 'when the mrz response is successful' do | |
| let(:mrz_response) { DocAuth::Response.new(success: true) } | |
| it 'stores mrz_status as :pass' do | |
| expect(document_capture_session.load_agent_proofed_user).to have_attributes( | |
| mrz_status: :pass, | |
| ) | |
| end | |
| end | |
| context 'when the mrz response is unsuccessful' do | |
| let(:mrz_response) { DocAuth::Response.new(success: false) } | |
| it 'stores mrz_status as :failed' do | |
| expect(document_capture_session.load_agent_proofed_user).to have_attributes( | |
| mrz_status: :failed, | |
| ) | |
| end | |
| end | |
| context 'when the mrz response is nil' do | |
| let(:mrz_response) { nil } | |
| it 'stores mrz_status as :not_processed' do | |
| expect(document_capture_session.load_agent_proofed_user).to have_attributes( | |
| mrz_status: :not_processed, | |
| ) | |
| end | |
| end |
| expect(document_capture_session.load_agent_proofed_user).to have_attributes( | ||
| success: true, | ||
| pii: agent_proofing_result.pii_from_doc.to_h, | ||
| captured_at: current_time, |
There was a problem hiding this comment.
| captured_at: current_time, | |
| proofing_components: { foo: 'bar' }, | |
| location_id: '123', | |
| agent_id: '456', | |
| issuer: 'test_issuer', | |
| captured_at: current_time, |
| session_result.aamva_status = determine_aamva_status(aamva_response) | ||
| if aamva_response | ||
| session_result.aamva_verified_attributes = aamva_response.extra[:verified_attributes] | ||
| session_result.state_id_vendor = aamva_response.extra[:vendor_name] |
There was a problem hiding this comment.
can we add state_id_vendor and verified_attributes to a spec
| if aamva_response | ||
| session_result.aamva_verified_attributes = aamva_response.extra[:verified_attributes] | ||
| session_result.state_id_vendor = aamva_response.extra[:vendor_name] | ||
| end |
There was a problem hiding this comment.
| if aamva_response | |
| session_result.aamva_verified_attributes = aamva_response.extra[:verified_attributes] | |
| session_result.state_id_vendor = aamva_response.extra[:vendor_name] | |
| end | |
| if aamva_response&.success? | |
| session_result.aamva_verified_attributes = aamva_response.extra[:verified_attributes] | |
| end | |
| session_result.state_id_vendor = aamva_response&.extra[:vendor_name] |
|
|
||
| session_result.success = agent_proofing_result.success | ||
| session_result.pii = agent_proofing_result.pii_from_doc.to_h | ||
| session_result.proofing_components = agent_proofing_result.proofing_components |
There was a problem hiding this comment.
will the proofing_components already include document_check (if doc_auth_passes) and source_check (if aamva passes)? how do we plan to handle these values?
cc @theabrad
| session_result.issuer = agent_proofing_result.issuer | ||
| session_result.success = agent_proofing_result.success | ||
| session_result.errors = agent_proofing_result.errors | ||
| session_result.doc_auth_success = agent_proofing_result.doc_auth_success |
There was a problem hiding this comment.
if storing state_id_vendor below, it seems that we should also be storing doc_auth_vendor. however, i'm not clear on the full intent of store state_id_vendor.
🎫 Ticket
Link to the relevant ticket:
LG-17295
🛠 Summary of changes
Adds methods to the DocumentCaptureSession to store/load the data, encrypted, for an agent-proofed user.
Note: The exact structure of the data stored will be determined in future PRs.
changelog: Upcoming Features, Proofing Agent, Store received data encrypted.
📜 Testing Plan