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

feat!: Flexible checksum v2 #1803

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

feat!: Flexible checksum v2 #1803

wants to merge 32 commits into from

Conversation

sichanyoo
Copy link
Contributor

Issue #

1516

Description of changes

New/existing dependencies impact assessment, if applicable

Conventional Commits

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sichan Yoo added 18 commits October 23, 2024 10:24
… & AWSChecksumCalculationMode enum type for both config options.
… to codegen side; add type info for AWSChecksumCalculationMode to codegen side.
…ow and add in default algorithm selection logic.
…nd responseChecksumValidation config is .whenRequired.
…shold, hence checksum header must be sent in original request rather than in trailing header.
@@ -84,6 +85,40 @@ public class AWSClientConfigDefaultsProvider {
return resolvedAppID
}

public static func requestChecksumCalculation(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to add comment strings explaining what these functions do / how theyre used

logger.info("Checksum validation should not be performed! Skipping workflow...")
return
}

let checksumHeaderIsPresent = priorityList.first {
response.headers.value(for: "x-amz-checksum-\($0)") != nil
response.headers.value(for: "x-amz-checksum-\($0)") != nil &&
// Checksum of checksums has "-#" at the end and should be ignored.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a new requirement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily a new requirement, it was just something that was left out from V1 SEP. S3 can return checksum of checksum, which ends with -# and should be ignored when validating response checksum.

// SPDX-License-Identifier: Apache-2.0
//

public enum AWSChecksumCalculationMode: String {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea of whenRequired vs whenSupported

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addition to config is part of the V2 SEP 👍

Copy link
Collaborator

@dayaffe dayaffe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! I like the addition of whenRequired vs whenSupported and adding information on whether validations should be performed to the context. It also looks to me like this isn't a breaking a change so our integration tests should be pretty good.

Approving but please:

  • Add comments around methods, especially public ones, where there are none right now
  • An integration test that covers a flexible checksum request less than the size of 1 chunk if one doesn't exist already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants