🐛 server: select valid document when multiple same-class ids exist#706
🐛 server: select valid document when multiple same-class ids exist#706cruzdanilo merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 9be9db9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello @mainqueg, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the server's document evaluation logic. Previously, when multiple identity documents shared the same classification, the system might fail to identify the most complete and valid document. The changes ensure that the server now correctly processes all relevant documents of a given class, guaranteeing that the appropriate document is selected for further processing, thereby improving the robustness of the identity verification workflow. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
WalkthroughThis PR fixes document selection logic when multiple ID documents of the same class exist. The implementation now filters all documents matching an ID class and validates photo presence before selection. Comprehensive test coverage verifies the corrected behavior. Changes
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request addresses a bug by ensuring all documents of a given class are considered for selection, rather than just the first. However, it introduces a potential Server-Side Request Forgery (SSRF) vulnerability due to unsanitized id_document_id values being used in API calls, which could lead to path traversal on the Persona API. Additionally, a performance improvement for fetching document details in parallel has been suggested.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #706 +/- ##
==========================================
- Coverage 65.42% 64.60% -0.83%
==========================================
Files 173 173
Lines 5539 5385 -154
Branches 1567 1505 -62
==========================================
- Hits 3624 3479 -145
+ Misses 1730 1726 -4
+ Partials 185 180 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.