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

Merged
merged 3 commits into from
Feb 27, 2025

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.73%. Comparing base (e7e8155) to head (e53e274).
Report is 21 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5100   +/-   ##
=======================================
  Coverage   96.73%   96.73%           
=======================================
  Files         775      775           
  Lines       26662    26666    +4     
  Branches     3468     3469    +1     
=======================================
+ Hits        25792    25796    +4     
  Misses        608      608           
  Partials      262      262           

☔ 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

@robinmolen
Copy link
Contributor Author

Regarding the Content-Disposition header in the SDK (the download link citizens will receive after submitting a form):

I assume the test findings were from a pre-2.8.0 environment. In the release of 2.8.0 the download link shown in the SDK was changed. From that point the correct Content-Disposition header were used (change was made in ticket #4488).

@robinmolen robinmolen force-pushed the issue/read-only-submission-report-content branch from 8973645 to 4c00602 Compare February 24, 2025 14:55
@robinmolen robinmolen force-pushed the issue/read-only-submission-report-content branch from 4c00602 to ae3a4f6 Compare February 25, 2025 12:24
@sergei-maertens
Copy link
Member

I'll take a look at django-privates now for the readonly field :)

…ttachment` headers to submission report

When accessing submission reports from the admin, download them instead of opening in a new tab.
@robinmolen robinmolen force-pushed the issue/read-only-submission-report-content branch from a78caef to e53e274 Compare February 27, 2025 09:48
@sergei-maertens sergei-maertens merged commit f680b72 into master Feb 27, 2025
32 checks passed
@sergei-maertens sergei-maertens deleted the issue/read-only-submission-report-content branch February 27, 2025 11:31
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