fix: add input validation for CSV import (#554)#751
Conversation
|
@northdpole would appreciate any feedback on the approach here happy to make changes based on your review. |
|
Hi @AyeshaaRafaqat , thanks for working on this! Just a heads up , this issue is also being addressed in PR #682 and PR #683 , which is currently under maintainer review. I hadn’t linked it to the issue earlier while working on it, because it was part of while I was working on MyOpenCRE milestone and was suggested by @northdpole to move my logic into "spreadsheet_parsers.py" with a new function U can refer to this for more information -> #584 (comment) Flagging this here so maintainers are aware of the overlap and can decide the best path forward. Appreciate the effort on this! |
Rebase OWASP#751 onto current main: UTF-8/triple-quote/csv.Error checks in web_main, CRE XXX-XXX|Name validation in myopencre_parser, plus tests. Co-authored-by: Ayesha Rafaqat <ayesharafaqat14@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
ef25746 to
f8a5273
Compare
northdpole
left a comment
There was a problem hiding this comment.
Thanks @AyeshaaRafaqat for the original #554 CSV validation work.
This updates #751 by rebasing onto current main and rewriting the checks onto the live MyOpenCRE import path (myopencre_parser / cre_csv_import). The legacy spreadsheet_parsers path from the earlier PR no longer applies after the import pipeline move.
What landed:
web_main: UTF-8 decode errors, triple-quote rejection (bogus root CREs), andcsv.Error→ HTTP 400myopencre_parser.validate_cre_csv_rows: require\d{3}-\d{3}|Namefor non-empty CRE cells- Tests covering parser validation plus the CSV import endpoint
Targeted tests for the new cases passed locally. CI should go green on this head — CODEOWNERS, please take a look if needed.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Summary by CodeRabbit
WalkthroughChangesCRE CSV validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Fixes #554
Tested locally by reproducing both cases from the issue.