Skip to content

Commit

Permalink
Merge branch 'release-0.7.0'
Browse files Browse the repository at this point in the history
* release-0.7.0:
  Bumping version to 0.7.0
  Move change to feature instead of bugfix for backwards compatibility with botocore (#276)
  Add changelog for sse-c changes (#275)
  Add user provided SSE-C arguments to CompleteMultipartUpload call (#274)
  • Loading branch information
aws-sdk-python-automation committed Sep 26, 2023
2 parents d76ac93 + de78b3c commit 9d8dfbd
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changes/0.7.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"category": "``SSE-C``",
"description": "Pass SSECustomer* arguments to CompleteMultipartUpload for upload operations",
"type": "feature"
}
]
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
CHANGELOG
=========

0.7.0
=====

* feature:``SSE-C``: Pass SSECustomer* arguments to CompleteMultipartUpload for upload operations


0.6.2
=====

Expand Down
2 changes: 1 addition & 1 deletion s3transfer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __call__(self, bytes_amount):
from s3transfer.exceptions import RetriesExceededError, S3UploadFailedError

__author__ = 'Amazon Web Services'
__version__ = '0.6.2'
__version__ = '0.7.0'


class NullHandler(logging.Handler):
Expand Down
8 changes: 7 additions & 1 deletion s3transfer/copies.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ class CopySubmissionTask(SubmissionTask):
'TaggingDirective',
]

COMPLETE_MULTIPART_ARGS = ['RequestPayer', 'ExpectedBucketOwner']
COMPLETE_MULTIPART_ARGS = [
'SSECustomerKey',
'SSECustomerAlgorithm',
'SSECustomerKeyMD5',
'RequestPayer',
'ExpectedBucketOwner',
]

def _submit(
self, client, config, osutil, request_executor, transfer_future
Expand Down
8 changes: 7 additions & 1 deletion s3transfer/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,13 @@ class UploadSubmissionTask(SubmissionTask):
'ExpectedBucketOwner',
]

COMPLETE_MULTIPART_ARGS = ['RequestPayer', 'ExpectedBucketOwner']
COMPLETE_MULTIPART_ARGS = [
'SSECustomerKey',
'SSECustomerAlgorithm',
'SSECustomerKeyMD5',
'RequestPayer',
'ExpectedBucketOwner',
]

def _get_upload_input_manager_cls(self, transfer_future):
"""Retrieves a class for managing input for an upload based on file type
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/test_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,9 @@ def test_copy_passes_args_to_create_multipart_and_upload_part(self):
self.add_head_object_response(expected_params=head_params)

self._add_params_to_expected_params(
add_copy_kwargs, ['create_mpu', 'copy'], self.extra_args
add_copy_kwargs,
['create_mpu', 'copy', 'complete_mpu'],
self.extra_args,
)
self.add_successful_copy_responses(**add_copy_kwargs)

Expand Down
25 changes: 25 additions & 0 deletions tests/functional/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,3 +599,28 @@ def test_multipart_upload_passes_checksums(self):
)
future.result()
self.assert_expected_client_calls_were_correct()

def test_multipart_upload_with_ssec_args(self):
params = {
'RequestPayer': 'requester',
'SSECustomerKey': 'key',
'SSECustomerAlgorithm': 'AES256',
'SSECustomerKeyMD5': 'key-hash',
}
self.extra_args.update(params)

self.add_create_multipart_response_with_default_expected_params(
extra_expected_params=params
)

self.add_upload_part_responses_with_default_expected_params(
extra_expected_params=params
)
self.add_complete_multipart_response_with_default_expected_params(
extra_expected_params=params
)
future = self.manager.upload(
self.filename, self.bucket, self.key, self.extra_args
)
future.result()
self.assert_expected_client_calls_were_correct()

0 comments on commit 9d8dfbd

Please sign in to comment.