Skip to content

LG-16389 MRZ validation only performed if passport is requested and submitted#12316

Merged
theabrad merged 5 commits intomainfrom
abrad-lg-16389-mrz-validation-check
Jul 14, 2025
Merged

LG-16389 MRZ validation only performed if passport is requested and submitted#12316
theabrad merged 5 commits intomainfrom
abrad-lg-16389-mrz-validation-check

Conversation

@theabrad
Copy link
Copy Markdown
Contributor

@theabrad theabrad commented Jul 7, 2025

🎫 Ticket

Link to the relevant ticket:
LG-16389

🛠 Summary of changes

Ensure that DOS MRZ validation is only performed if a passport is requested at the "choose your id" step and that it only occurs if the document uploaded is a passport.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Go through IdV and select Passport
  • Verify that a passing passport yml succeeds and lets you go to the SSN step
  • Start over and try using a driver's license and verify that it does not let you pass to the SSN step.

theabrad added 2 commits July 7, 2025 12:22
changelog: Internal, Doc Auth, ensure MRZ validation only occurs when passport is requested and submitted
Copy link
Copy Markdown
Contributor

@Mawar2 Mawar2 left a comment

Choose a reason for hiding this comment

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

LGTM!

Minor note for future consideration -- we could add test coverage for edge cases (passport submitted when not requested, passport requested but not submitted), but not blocking.

end

def passport_requested?
document_capture_session&.passport_requested?
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
document_capture_session&.passport_requested?
!!document_capture_session&.passport_requested?

@amirbey
Copy link
Copy Markdown
Contributor

amirbey commented Jul 9, 2025

LGTM!

Minor note for future consideration -- we could add test coverage for edge cases (passport submitted when not requested, passport requested but not submitted), but not blocking.

Adding on to @Mawar2 suggestion , can we add specs to ensure do not perform MRZ validation for these scenarios?

@theabrad
Copy link
Copy Markdown
Contributor Author

LGTM!
Minor note for future consideration -- we could add test coverage for edge cases (passport submitted when not requested, passport requested but not submitted), but not blocking.

Adding on to @Mawar2 suggestion , can we add specs to ensure do not perform MRZ validation for these scenarios?

Added a test for passport submitted when not requested. There is already a test for passport requested, but not submitted https://github.com/18F/identity-idp/blob/main/spec/forms/idv/api_image_upload_form_spec.rb#L1001

@theabrad theabrad merged commit ab61bbb into main Jul 14, 2025
1 check passed
@theabrad theabrad deleted the abrad-lg-16389-mrz-validation-check branch July 14, 2025 18:50
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.

3 participants