Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: reject encrypted pdf #436

Merged
merged 4 commits into from
Apr 27, 2024

Conversation

ublefo
Copy link
Contributor

@ublefo ublefo commented Apr 11, 2024

Changes

  • Introduced the pdf-reader gem for proper PDF validation, which is a much more elegant solution than looking for strings from the binary file.
  • Added a unit test with some test files to test the changes, along with three test PDF files. The password for the encrypted file is password.
  • Refactored accept_file and PDF validation methods in FileHelper in order to return validation errors to the frontend.

Tests

  • Changes have been tested manually
  • All unit tests pass

Screenshots

image
image
image

@maddernd
Copy link
Contributor

This one was approved.

@maddernd
Copy link
Contributor

@macite

@ublefo ublefo changed the title Reject encrypted pdf enhance: reject encrypted pdf Apr 16, 2024
@macite macite merged commit 18cc875 into doubtfire-lms:development Apr 27, 2024
4 checks passed
@ublefo ublefo deleted the feat/reject-encrypted-pdf branch April 27, 2024 14:41
@ublefo ublefo restored the feat/reject-encrypted-pdf branch April 27, 2024 15:00
@ublefo ublefo deleted the feat/reject-encrypted-pdf branch May 2, 2024 16:32
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