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

Sign CloudFront urls only in case querystring_auth is enabled #885

Merged
merged 2 commits into from
May 31, 2020

Conversation

al-muammar
Copy link
Contributor

@al-muammar al-muammar commented May 29, 2020

Summary

At the moment, all URLs are being signed, even if querystring_auth is set to False.
This is needed in a scenario when a user have a mix of private and public content distributed via CloudFront and they don't want to sign public urls.

Test Plan

Updated tests to cover the scenario.

@al-muammar
Copy link
Contributor Author

al-muammar commented May 29, 2020

@terencehonles, could you take a look at the PR?
@jschneier, I would be happy if we could quickly merge this fix and maybe make a new release?

@jschneier jschneier merged commit 1388e6c into jschneier:master May 31, 2020
@terencehonles
Copy link
Contributor

@jihadik I don't personally have a mix of private and public objects that use the same storage object. For my use case I have another storage object that does not have a cloudfront signer configured. For your PR how are you turning off and on the cloudfront signing? Is there a reason you don't just not configure the signer? If you still feel strongly that the signing should be turned on/off by a boolean setting I'm not sure it should be re-using the querystring_auth property.

@al-muammar
Copy link
Contributor Author

@terencehonles, it's exactly the same logic as it was before: https://github.com/jschneier/django-storages/blob/master/storages/backends/s3boto3.py#L755-L757 So I think it's quite consistent.

@terencehonles
Copy link
Contributor

@jihadik looks like I didn't notice this was already merged when I replied 😅 otherwise I wouldn't have commented on it.

mlazowik pushed a commit to qedsoftware/django-storages that referenced this pull request Mar 9, 2022
…ier#885)

* Sign CloudFront urls only in case querystring_auth is enabled

* Fix test
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