-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
Warn about upcoming change to AWS_DEFAULT_ACL; allow None in AWS_DEFAULT_ACL #535
Conversation
If bucket already exists, do not try to override permissions of objects. same for bucket creation, let defaults configured on AWS takes precedence.
46ab21e
to
cf3f374
Compare
well done |
@sww314, just a nudge -- is there anything else I can do to assist with getting this merged? Thanks! |
@jcushman Looks ok to me, but I am not actively using the AWS storages, so I would like someone that uses the boto/boto3 to chime in. |
Thanks so much. I've come to the conclusion that my decision earlier on this was wrong and it should have been addressed immediately. Going to merge and cut 2.0 with this fixed on Friday. For some of the other changes I want to make we can wait to 3.0 which can always come quicker. |
Should we also be warning on the s3boto and gs backends? I know those are legacy but I'm not going to remove them in 1.6.7 |
cf3f374
to
6ba7202
Compare
- Refer to jschneier/django-storages#535 - Set AWS_DEFAULT_ACL = None
Background
As discussed in #381, the default setting of "public-read" for
AWS_DEFAULT_ACL
is insecure -- if a user sets up a bucket that is private by default, they should have to explicitly opt in for django-storages to override that choice and upload globally readable files. By default uploads should use the bucket's settings.@jschneier suggested in that bug that the change should be made in django-storages 2.0, since it would be a breaking change for many users.
@robatwave commented that one can currently opt into the proposed behavior by setting
AWS_DEFAULT_ACL=None
explicitly. This does not work for me; with that setting I get'NoneType' object has no attribute 'parts'
inS3Boto3StorageFile.close
.@ticosax sent a pull request last year, #429, that implements the breaking change but currently has some tests failing.
It would be great to take action on this without waiting for the decision to ship django-storages 2.0. It's likely that lots of users are currently using django-storages in a way that unintentionally leaks data -- it's not something where it's harmless to wait.
This PR
This is a change that can be made immediately without waiting for 2.0. It gets
AWS_DEFAULT_ACL=None
working, and adds a warning that the default behavior will be changing in 2.0.This PR is based on the work @ticosax did and includes 3 commits:
None
and tweaking a test. This getsAWS_DEFAULT_ACL=None
working for me.AWS_DEFAULT_ACL
setting. The warning includes instructions for how (and why) a user can either explicitly retain the existing behavior if it's actually what they want, withAWS_DEFAULT_ACL="public-read"
, or prepare for 2.0 by opting into the new behavior withAWS_DEFAULT_ACL=None
.