JSv4 / OpenContracts

Mass document analytics platform based on LlamaIndex, Pgvector, React and Django.
https://JSv4.github.io/OpenContracts/
Apache License 2.0
706 stars 56 forks source link

File inspection and Mimetype Limits on Document Upload Mutation. #144

Closed JSv4 closed 3 months ago

JSv4 commented 3 months ago

Introduce File Type Checking for Document Uploads

Summary

This PR introduces MIME type and file type checking to the UploadDocument mutation. This new feature enhances security and ensures that only allowed file types can be uploaded through our system.

Changes

UploadDocument Mutation

New Test Case (UploadDocumentMutationTestCase)

Rationale

File type checking is crucial for:

  1. Security: Preventing potential security vulnerabilities from malicious file uploads
  2. Data Integrity: Ensuring only desired file types are stored in our system
  3. User Experience: Providing immediate feedback to users about acceptable file types

Implementation Details

Testing

Configuration

Next Steps

Breaking Changes

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.18%. Comparing base (55d5525) to head (24ebca3).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #144 +/- ## ======================================= Coverage 70.18% 70.18% ======================================= Files 59 59 Lines 2700 2700 ======================================= Hits 1895 1895 Misses 805 805 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.