diff --git a/.changes/1.36.0.json b/.changes/1.36.0.json new file mode 100644 index 0000000000..07991f8408 --- /dev/null +++ b/.changes/1.36.0.json @@ -0,0 +1,67 @@ +[ + { + "category": "``apigateway``", + "description": "[``botocore``] Documentation updates for Amazon API Gateway", + "type": "api-change" + }, + { + "category": "``bedrock-agent-runtime``", + "description": "[``botocore``] Now supports streaming for inline agents.", + "type": "api-change" + }, + { + "category": "``cognito-identity``", + "description": "[``botocore``] corrects the dual-stack endpoint configuration", + "type": "api-change" + }, + { + "category": "``partnercentral-selling``", + "description": "[``botocore``] Add Tagging support for ResourceSnapshotJob resources", + "type": "api-change" + }, + { + "category": "``s3``", + "description": "[``botocore``] This change enhances integrity protections for new SDK requests to S3. S3 SDKs now support the CRC64NVME checksum algorithm, full object checksums for multipart S3 objects, and new default integrity protections for S3 requests.", + "type": "api-change" + }, + { + "category": "``security-ir``", + "description": "[``botocore``] Increase minimum length of Threat Actor IP 'userAgent' to 1.", + "type": "api-change" + }, + { + "category": "``sesv2``", + "description": "[``botocore``] This release introduces a new recommendation in Virtual Deliverability Manager Advisor, which detects elevated complaint rates for customer sending identities.", + "type": "api-change" + }, + { + "category": "``workspaces``", + "description": "[``botocore``] Added GeneralPurpose.4xlarge & GeneralPurpose.8xlarge ComputeTypes.", + "type": "api-change" + }, + { + "category": "``workspaces-thin-client``", + "description": "[``botocore``] Mark type in MaintenanceWindow as required.", + "type": "api-change" + }, + { + "category": "AWSCRT", + "description": "[``botocore``] Update awscrt version to 0.23.4", + "type": "enhancement" + }, + { + "category": "``s3``", + "description": "[``botocore``] The S3 client attempts to validate response checksums for all S3 API operations that support checksums. However, if the SDK has not implemented the specified checksum algorithm then this validation is skipped. Checksum validation behavior can be configured using the ``when_supported`` and ``when_required`` options - in code using the ``response_checksum_validation`` parameter for ``botocore.config.Config``, in the shared AWS config file using ``response_checksum_validation``, or as an env variable using ``AWS_RESPONSE_CHECKSUM_VALIDATION``.", + "type": "feature" + }, + { + "category": "``s3``", + "description": "[``botocore``] Added support for the CRC64NVME checksum algorithm in the S3 client through the optional AWS CRT (``awscrt``) dependency.", + "type": "feature" + }, + { + "category": "``s3``", + "description": "[``botocore``] S3 client behavior is updated to always calculate a CRC32 checksum by default for operations that support it (such as PutObject or UploadPart), or require it (such as DeleteObjects). Checksum behavior can be configured using ``when_supported`` and ``when_required`` options - in code using the ``request_checksum_calculation`` parameter for ``botocore.config.Config``, in the shared AWS config file using ``request_checksum_calculation``, or as an env variable using ``AWS_REQUEST_CHECKSUM_CALCULATION``. Note: Botocore will no longer automatically compute and populate the Content-MD5 header.", + "type": "feature" + } +] \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bb41683f24..f147e8d9d2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,24 @@ CHANGELOG ========= +1.36.0 +====== + +* api-change:``apigateway``: [``botocore``] Documentation updates for Amazon API Gateway +* api-change:``bedrock-agent-runtime``: [``botocore``] Now supports streaming for inline agents. +* api-change:``cognito-identity``: [``botocore``] corrects the dual-stack endpoint configuration +* api-change:``partnercentral-selling``: [``botocore``] Add Tagging support for ResourceSnapshotJob resources +* api-change:``s3``: [``botocore``] This change enhances integrity protections for new SDK requests to S3. S3 SDKs now support the CRC64NVME checksum algorithm, full object checksums for multipart S3 objects, and new default integrity protections for S3 requests. +* api-change:``security-ir``: [``botocore``] Increase minimum length of Threat Actor IP 'userAgent' to 1. +* api-change:``sesv2``: [``botocore``] This release introduces a new recommendation in Virtual Deliverability Manager Advisor, which detects elevated complaint rates for customer sending identities. +* api-change:``workspaces``: [``botocore``] Added GeneralPurpose.4xlarge & GeneralPurpose.8xlarge ComputeTypes. +* api-change:``workspaces-thin-client``: [``botocore``] Mark type in MaintenanceWindow as required. +* enhancement:AWSCRT: [``botocore``] Update awscrt version to 0.23.4 +* feature:``s3``: [``botocore``] The S3 client attempts to validate response checksums for all S3 API operations that support checksums. However, if the SDK has not implemented the specified checksum algorithm then this validation is skipped. Checksum validation behavior can be configured using the ``when_supported`` and ``when_required`` options - in code using the ``response_checksum_validation`` parameter for ``botocore.config.Config``, in the shared AWS config file using ``response_checksum_validation``, or as an env variable using ``AWS_RESPONSE_CHECKSUM_VALIDATION``. +* feature:``s3``: [``botocore``] Added support for the CRC64NVME checksum algorithm in the S3 client through the optional AWS CRT (``awscrt``) dependency. +* feature:``s3``: [``botocore``] S3 client behavior is updated to always calculate a CRC32 checksum by default for operations that support it (such as PutObject or UploadPart), or require it (such as DeleteObjects). Checksum behavior can be configured using ``when_supported`` and ``when_required`` options - in code using the ``request_checksum_calculation`` parameter for ``botocore.config.Config``, in the shared AWS config file using ``request_checksum_calculation``, or as an env variable using ``AWS_REQUEST_CHECKSUM_CALCULATION``. Note: Botocore will no longer automatically compute and populate the Content-MD5 header. + + 1.35.99 ======= diff --git a/boto3/__init__.py b/boto3/__init__.py index 3924854d11..b39090eec2 100644 --- a/boto3/__init__.py +++ b/boto3/__init__.py @@ -17,7 +17,7 @@ from boto3.session import Session __author__ = 'Amazon Web Services' -__version__ = '1.35.99' +__version__ = '1.36.0' # The default Boto3 session; autoloaded when needed. diff --git a/docs/source/guide/configuration.rst b/docs/source/guide/configuration.rst index 12877debcb..b13b87b761 100644 --- a/docs/source/guide/configuration.rst +++ b/docs/source/guide/configuration.rst @@ -236,6 +236,15 @@ You can set configuration settings using system-wide environment variables. Thes A comma-delimited list of regions to sign when signing with SigV4a. For more information, see the ``sigv4a_signing_region_set`` configuration file section. +``AWS_REQUEST_CHECKSUM_CALCULATION`` + Determines when a checksum will be calculated for request payloads. For more + information, see the ``request_checksum_calculation`` configuration file section. + + +``AWS_RESPONSE_CHECKSUM_VALIDATION`` + Determines when checksum validation will be performed on response payloads. For more + information, see the ``response_checksum_validation`` configuration file section. + Using a configuration file -------------------------- @@ -476,6 +485,31 @@ in the ``~/.aws/config`` file. the SDK will check if the service has modeled a default; if none is found, this will default to ``*``. +``request_checksum_calculation`` + Determines when a checksum will be calculated for request payloads. Valid values are: + + * ``when_supported`` -- When set, a checksum will be calculated for + all request payloads of operations modeled with the ``httpChecksum`` + trait where ``requestChecksumRequired`` is ``true`` or a + ``requestAlgorithmMember`` is modeled. + + * ``when_required`` -- When set, a checksum will only be calculated + for request payloads of operations modeled with the ``httpChecksum`` + trait where ``requestChecksumRequired`` is ``true`` or where a + ``requestAlgorithmMember`` is modeled and supplied. + +``response_checksum_validation`` + Determines when checksum validation will be performed on response payloads. Valid values are: + + * ``when_supported`` -- When set, checksum validation is performed on + all response payloads of operations modeled with the ``httpChecksum`` + trait where ``responseAlgorithms`` is modeled, except when no modeled + checksum algorithms are supported. + + * ``when_required`` -- When set, checksum validation is not performed + on response payloads of operations unless the checksum algorithm is + supported and the ``requestValidationModeMember`` member is set to ``ENABLED``. + .. _IAM Roles for Amazon EC2: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html .. _Using IAM Roles: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html .. _Sourcing Credentials with an External Process: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html diff --git a/setup.cfg b/setup.cfg index ec4b2aff95..f26fdc0fd8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,9 +3,9 @@ universal = 0 [metadata] requires_dist = - botocore>=1.35.99,<1.36.0 + botocore>=1.36.0,<1.37.0 jmespath>=0.7.1,<2.0.0 - s3transfer>=0.10.0,<0.11.0 + s3transfer>=0.11.0,<0.12.0 [options.extras_require] crt = botocore[crt]>=1.21.0,<2.0a0 diff --git a/setup.py b/setup.py index 355ed84714..a32e1c294f 100644 --- a/setup.py +++ b/setup.py @@ -14,9 +14,9 @@ requires = [ - 'botocore>=1.35.99,<1.36.0', + 'botocore>=1.36.0,<1.37.0', 'jmespath>=0.7.1,<2.0.0', - 's3transfer>=0.10.0,<0.11.0', + 's3transfer>=0.11.0,<0.12.0', ] diff --git a/tests/functional/test_s3.py b/tests/functional/test_s3.py index 0a7fd2466d..92985be93d 100644 --- a/tests/functional/test_s3.py +++ b/tests/functional/test_s3.py @@ -16,6 +16,7 @@ import botocore.stub import pytest from botocore.config import Config +from botocore.httpchecksum import DEFAULT_CHECKSUM_ALGORITHM from botocore.stub import Stubber import boto3.session @@ -86,7 +87,10 @@ def stub_head(self, content_length=4, expected_params=None): expected_params=expected_params, ) - def stub_create_multipart_upload(self): + def stub_create_multipart_upload( + self, + extra_expected_params=None, + ): # Add the response and assert params for CreateMultipartUpload create_upload_response = { "Bucket": self.bucket, @@ -97,13 +101,17 @@ def stub_create_multipart_upload(self): "Bucket": self.bucket, "Key": self.key, } + if extra_expected_params: + expected_params.update(extra_expected_params) self.stubber.add_response( method='create_multipart_upload', service_response=create_upload_response, expected_params=expected_params, ) - def stub_complete_multipart_upload(self, parts): + def stub_complete_multipart_upload( + self, parts, extra_expected_params=None + ): complete_upload_response = { "Location": "us-west-2", "Bucket": self.bucket, @@ -116,6 +124,8 @@ def stub_complete_multipart_upload(self, parts): "MultipartUpload": {"Parts": parts}, "UploadId": self.upload_id, } + if extra_expected_params: + expected_params.update(extra_expected_params) self.stubber.add_response( method='complete_multipart_upload', @@ -256,6 +266,7 @@ def stub_put_object(self): "Bucket": self.bucket, "Key": self.key, "Body": botocore.stub.ANY, + "ChecksumAlgorithm": DEFAULT_CHECKSUM_ALGORITHM, } self.stubber.add_response( method='put_object', @@ -267,6 +278,7 @@ def stub_upload_part(self, part_number): upload_part_response = { 'ETag': self.etag, 'ResponseMetadata': {'HTTPStatusCode': 200}, + 'ChecksumCRC32': f'sum{part_number}==', } expected_params = { "Bucket": self.bucket, @@ -274,6 +286,7 @@ def stub_upload_part(self, part_number): "Body": botocore.stub.ANY, "PartNumber": part_number, "UploadId": self.upload_id, + 'ChecksumAlgorithm': 'CRC32', } self.stubber.add_response( method='upload_part', @@ -282,7 +295,11 @@ def stub_upload_part(self, part_number): ) def stub_multipart_upload(self, num_parts): - self.stub_create_multipart_upload() + self.stub_create_multipart_upload( + extra_expected_params={ + "ChecksumAlgorithm": DEFAULT_CHECKSUM_ALGORITHM, + } + ) # Add the responses for each UploadPartCopy parts = [] @@ -290,7 +307,13 @@ def stub_multipart_upload(self, num_parts): # Fill in the parts part_number = i + 1 self.stub_upload_part(part_number=part_number) - parts.append({'ETag': self.etag, 'PartNumber': part_number}) + parts.append( + { + 'ETag': self.etag, + 'PartNumber': part_number, + 'ChecksumCRC32': f'sum{part_number}==', + } + ) self.stub_complete_multipart_upload(parts)