Skip to content

Commit

Permalink
Merge branch 'release-1.36.0'
Browse files Browse the repository at this point in the history
* release-1.36.0:
  Bumping version to 1.36.0
  Add changelog entries from botocore
  Merge customizations for S3
  • Loading branch information
aws-sdk-python-automation committed Jan 15, 2025
2 parents 74405ee + 80855f0 commit e2b2df5
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 9 deletions.
67 changes: 67 additions & 0 deletions .changes/1.36.0.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======

Expand Down
2 changes: 1 addition & 1 deletion boto3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
34 changes: 34 additions & 0 deletions docs/source/guide/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------------
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]


Expand Down
31 changes: 27 additions & 4 deletions tests/functional/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -267,13 +278,15 @@ 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,
"Key": self.key,
"Body": botocore.stub.ANY,
"PartNumber": part_number,
"UploadId": self.upload_id,
'ChecksumAlgorithm': 'CRC32',
}
self.stubber.add_response(
method='upload_part',
Expand All @@ -282,15 +295,25 @@ 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 = []
for i in range(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)

Expand Down

0 comments on commit e2b2df5

Please sign in to comment.