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

Add ability to protect media folder #1476

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

bartjkdp
Copy link
Contributor

@bartjkdp bartjkdp commented Nov 4, 2024

Description

This app provides the possibility to protect the media folder. To use this functionality in production, make sure to configure the PROTECTED_FILE_SYSTEM_STORAGE setting.

Checklist

  • Keep the PR, and the amount of commits to a minimum
  • The commit messages are meaningful and descriptive
  • The change/fix is well documented, particularly in hard-to-understand areas of the code / unit tests
  • Are there any breaking changes in the code, if so are they discussed and did the team agreed to these changes
  • Check that the branch is based on main and is up to date with main
  • Check that the PR targets main
  • There are no merge conflicts and no conflicting Django migrations
  • PR was created with the "Allow edits and access to secrets by maintainers" checkbox checked

How has this been tested?

  • Provided unit tests that will prove the change/fix works as intended
  • Tested the change/fix locally and all unit tests still pass
  • Code coverage is at least 85% (the higher the better)
  • No iSort, Flake8 and SPDX issues are present in the code

Dockerfile Show resolved Hide resolved
app/signals/apps/media/storages.py Outdated Show resolved Hide resolved
app/signals/apps/media/storages.py Show resolved Hide resolved
app/signals/apps/media/storages.py Outdated Show resolved Hide resolved
app/signals/apps/media/README.md Show resolved Hide resolved
app/signals/apps/media/storages.py Outdated Show resolved Hide resolved
app/signals/apps/media/views.py Outdated Show resolved Hide resolved
app/signals/apps/media/tests.py Show resolved Hide resolved
app/signals/apps/media/views.py Outdated Show resolved Hide resolved
app/signals/urls.py Show resolved Hide resolved
app/signals/apps/media/tests.py Outdated Show resolved Hide resolved
@bartjkdp bartjkdp force-pushed the feat/protected-media branch from b6d8092 to fce3721 Compare December 31, 2024 10:15
return HttpResponse('No signature provided', status=401)

try:
signer.unsign(f'{path}:{t}:{s}', max_age=timedelta(hours=1))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make this timedelta value configurable through the settings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants