Skip to content

LG-17295: store agent proofed user in Redis#13037

Open
solipet wants to merge 2 commits intomainfrom
dprice/lg-17295-store-agent-proofed-in-redis
Open

LG-17295: store agent proofed user in Redis#13037
solipet wants to merge 2 commits intomainfrom
dprice/lg-17295-store-agent-proofed-in-redis

Conversation

@solipet
Copy link
Copy Markdown
Contributor

@solipet solipet commented Apr 14, 2026

🎫 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

  • Specs pass

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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]
Copy link
Copy Markdown
Contributor

@amirbey amirbey Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add state_id_vendor and verified_attributes to a spec

Comment on lines +133 to +136
if aamva_response
session_result.aamva_verified_attributes = aamva_response.extra[:verified_attributes]
session_result.state_id_vendor = aamva_response.extra[:vendor_name]
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants