-
Notifications
You must be signed in to change notification settings - Fork 0
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
Restrict media privacy until a referencing page is published #46
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ababic
force-pushed
the
feature/private-media
branch
21 times, most recently
from
December 2, 2024 17:11
3ba9bfb
to
b856066
Compare
ababic
force-pushed
the
feature/private-media
branch
from
December 3, 2024 07:14
b856066
to
9a52eb5
Compare
ababic
force-pushed
the
feature/private-media
branch
from
December 13, 2024 13:15
74dae78
to
b581823
Compare
ababic
force-pushed
the
feature/private-media
branch
from
December 13, 2024 13:23
19376c0
to
5198943
Compare
…ernate in-memory storages to reduce need for mocking in tests
ababic
force-pushed
the
feature/private-media
branch
from
December 13, 2024 15:37
021a9dd
to
faefcac
Compare
…eMixin.get_privacy_controlled_serve_urls() to return an empty iterable
* main: Remove the analysis app (#71) Fix to related content on the release page (#72) Fix for equations and embeds rendering on Methodology page(#74) Update readme with extra steps needed for pre-commit (#67) Remove the analysis models (#70) Add an articles app for statistical articles (#69) Methodology page (#57) Ensure the default DB is **always** used for writes (#68) Styling for the release page plus some refactoring (#55) Bundles: exclude Release Calendar pages with a date in the past (#66) Disable markup from megalinter (#64) Ignore vscode workspace settings files (#65)
* main: Update the embed block to be a custom video embed that uses the design system video embed template (#62) Django Migration Linter Integration (#43) Tidy up the info/warning panel and fix title/no title output (#73) Introduce Functional Tests using Playwright and Behave #31 # Conflicts: # poetry.lock # pyproject.toml
…ns as well as instances of botocore.ClientError
MebinAbraham
approved these changes
Jan 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @ababic 🎉
ababic
force-pushed
the
feature/private-media
branch
from
January 16, 2025 13:10
e47a6f3
to
ce5bb63
Compare
…r communicate what would be happening in production
MebinAbraham
approved these changes
Jan 20, 2025
zerolab
approved these changes
Jan 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the context of this PR?
This is a follow-up to #42 that focusses on addressing solely public/private status of media, without attempting to tie objects to pages to aid with permission policy customisation.
It's fully functional and has lots of tests (which are worth checking out to get a feel for the intended behaviour).
A brief summary:
When a media item's privacy changes:
file_permissions_last_set
timestamp is updated for the media item, and the object'sfile_permissions_are_outdated()
method will returnFalse
.file_permissions_last_set
is not updated, and thefile_permissions_are_outdated()
method will returnTrue
.How to review
Testing media privacy for a draft page
src
value of the image rendition should look something like/images/{secure key}/2/original/{image filename}
, which means it's being served by the 'serve' view.href
value of the document link should look something like/documents/
src
URL in new tabs (they should still work).Testing media privacy after a page has been published
src
value should have changed to something like:media/images/{image filename}.fill-446x390.format-webp-.original.png
.src
value should look the same as it did on the live version.src
value should now again look like:/images/{secure key}/2/original/{image filename}
.Testing image privacy once a draft page has been published
src
value should look something like:media/images/{image filename}.fill-446x390.format-webp-.original.png
.src
value should look the same as it did on the live version.src
value should now again look like:/images/{secure key}/2/original/{image filename}
.Follow-up Actions
PRIVATE_MEDIA_BULK_UPDATE_MAX_WORKERS
is set appropriately for all target environmentspython manage.py retry_file_permission_set_attempts
is set to run on a cron every 10 minutes in all target environments