jschneier / django-storages

https://django-storages.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.76k stars 863 forks source link

S3 signed URLs for object with query params #664

Open fabiovasini opened 5 years ago

fabiovasini commented 5 years ago

In order to add the auth parameter with version 4 I'm using the following settings:

AWS_QUERYSTRING_AUTH = True # add the query parameter authentication to generated URLs
AWS_S3_SIGNATURE_VERSION = 's3v4' # AWS4-HMAC-SHA256, also known as Signature Version 4

It's working fine and the auth param is added to all URLs expect for a few static files like the following: https://mybucket.s3.amazonaws.com/static/rest_framework/fonts/fontawesome-webfont.woff?v=4.0.3 That static file includes already a query parameter v=4.0.3, so I noticed that django-storage is not including the auth params.

How this issue could be fixed? I was thinking that maybe I can use a different storage backend for static files with public-read ACL. Any idea?

rodrigondec commented 4 years ago

up