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

use encryption setting for S3BotoStorageFile multipart uploads #94

Merged
merged 1 commit into from
Nov 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion storages/backends/s3boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def write(self, content, *args, **kwargs):
self._multipart = self._storage.bucket.initiate_multipart_upload(
self.key.name,
headers=upload_headers,
reduced_redundancy=self._storage.reduced_redundancy
reduced_redundancy=self._storage.reduced_redundancy,
encrypt_key=self._storage.encryption,
)
if self.buffer_size <= self._buffer_file_size:
self._flush_write_buffer()
Expand Down
3 changes: 3 additions & 0 deletions tests/test_s3boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def test_storage_open_write(self):
name = 'test_open_for_writing.txt'
content = 'new content'

# Set the encryption flag used for multipart uploads
self.storage.encryption = True
# Set the ACL header used when creating/writing data.
self.storage.bucket.connection.provider.acl_header = 'x-amz-acl'
# Set the mocked key's bucket
Expand All @@ -183,6 +185,7 @@ def test_storage_open_write(self):
'x-amz-acl': 'public-read',
},
reduced_redundancy=self.storage.reduced_redundancy,
encrypt_key=True,
)

# Save the internal file before closing
Expand Down