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

Read only submission report content #5100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robinmolen
Copy link
Contributor

Closes open-formulieren/security-issues#34

Changes

The submission report content is now read-only in the admin

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.74%. Comparing base (a1a1b00) to head (8973645).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5100   +/-   ##
=======================================
  Coverage   96.74%   96.74%           
=======================================
  Files         771      771           
  Lines       26636    26638    +2     
  Branches     3467     3467           
=======================================
+ Hits        25770    25772    +2     
  Misses        605      605           
  Partials      261      261           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robinmolen robinmolen requested review from sergei-maertens and vaszig and removed request for sergei-maertens February 20, 2025 10:30
Copy link
Member

@sergei-maertens sergei-maertens left a comment

Choose a reason for hiding this comment

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

Additionally I'd configure the PrivateMediaMixin so that the files are not downloaded with inline directives in the Content-Disposition header. I think you should be able to get there with:

The sendfile options are consumed here: https://github.com/sergei-maertens/django-privates/blob/27c7391ef82479f5d99fb6542647ab999b3ebd2a/privates/views.py#L38

Comment on lines +501 to +507
fields = (
"title",
"content",
"submission",
"last_accessed",
"task_id",
)
Copy link
Member

Choose a reason for hiding this comment

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

why do you specify these explicitly? by default all model fields are used iirc. I'd expect this not to be necessary.

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.

2 participants