-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: flexible checksum updates (#2808)
* add config and change default behavior of checksum middleware * regenerate client * regenerate clients * merge protocol test code from main * merge from main * add more test cases * add changelog * modify s3 internal test * separate checksum config check and workflow * restore s3 test * remove unused md5 header * separate checksum config and workflow * change default checksum to const * add checksum unset enum and modify comment of cfg * change comment * Update aws/checksum.go * change checksum value check logic * remove old check * correct unseekable stream logic without tls and its test cases * revert extra codegen * change tmv1 upload test cases after introducing flex checksum * add error test case for crc64 * change test name * default tmv1 checksum and add flex checksum metrics tracking * regenerate client and add metrics mw test * add comment to exported type * update s3 snapshot * update tmv1 integ test * exclude default checksum from presign op * reorder feature id and simplify metric tracking test * update changelog --------- Co-authored-by: Tianyi Wang <wty@amazon.com> Co-authored-by: Luc Talatinian <102624213+lucix-aws@users.noreply.github.com>
- Loading branch information
1 parent
4ffbb7c
commit 6636822
Showing
89 changed files
with
1,520 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"id": "9ebe24c4-7915-41e0-840d-a49eab6f9d97", | ||
"type": "feature", | ||
"description": "S3 client behavior is updated to always calculate a checksum by default for operations that support it (such as PutObject or UploadPart), or require it (such as DeleteObjects). The checksum algorithm used by default now becomes CRC32. Checksum behavior can be configured using `when_supported` and `when_required` options - in code using RequestChecksumCalculation, in shared config using request_checksum_calculation, or as env variable using AWS_REQUEST_CHECKSUM_CALCULATION. 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 `when_supported` and `when_required` options - in code using ResponseChecksumValidation, in shared config using response_checksum_validation, or as env variable using AWS_RESPONSE_CHECKSUM_VALIDATION.", | ||
"modules": [ | ||
".", | ||
"config", | ||
"service/internal/checksum", | ||
"service/s3" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package aws | ||
|
||
// RequestChecksumCalculation controls request checksum calculation workflow | ||
type RequestChecksumCalculation int | ||
|
||
const ( | ||
// RequestChecksumCalculationUnset is the unset value for RequestChecksumCalculation | ||
RequestChecksumCalculationUnset RequestChecksumCalculation = iota | ||
|
||
// RequestChecksumCalculationWhenSupported indicates request checksum will be calculated | ||
// if the operation supports input checksums | ||
RequestChecksumCalculationWhenSupported | ||
|
||
// RequestChecksumCalculationWhenRequired indicates request checksum will be calculated | ||
// if required by the operation or if user elects to set a checksum algorithm in request | ||
RequestChecksumCalculationWhenRequired | ||
) | ||
|
||
// ResponseChecksumValidation controls response checksum validation workflow | ||
type ResponseChecksumValidation int | ||
|
||
const ( | ||
// ResponseChecksumValidationUnset is the unset value for ResponseChecksumValidation | ||
ResponseChecksumValidationUnset ResponseChecksumValidation = iota | ||
|
||
// ResponseChecksumValidationWhenSupported indicates response checksum will be validated | ||
// if the operation supports output checksums | ||
ResponseChecksumValidationWhenSupported | ||
|
||
// ResponseChecksumValidationWhenRequired indicates response checksum will only | ||
// be validated if the operation requires output checksum validation | ||
ResponseChecksumValidationWhenRequired | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.