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

Update supported httpChecksum algorithms #2386

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
public final class HttpChecksumTrait extends AbstractTrait implements ToSmithyBuilder<HttpChecksumTrait> {
public static final ShapeId ID = ShapeId.from("aws.protocols#httpChecksum");
public static final String CHECKSUM_PREFIX = "x-amz-checksum-";
public static final List<String> CHECKSUM_ALGORITHMS = ListUtils.of("CRC32C", "CRC32", "SHA1", "SHA256");
public static final List<String> CHECKSUM_ALGORITHMS = ListUtils.of("CRC64NVME", "CRC32C", "CRC32",
"SHA1", "SHA256");
public static final List<String> VALIDATION_MODES = ListUtils.of("ENABLED");

public static final String REQUEST_CHECKSUM_REQUIRED = "requestChecksumRequired";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class HttpChecksumTraitTest {
public void loadsTrait() {
TraitFactory provider = TraitFactory.createServiceFactory();

List<String> algorithms = new ArrayList<>(Arrays.asList("CRC32C", "CRC32", "SHA1", "SHA256"));
List<String> algorithms = new ArrayList<>(Arrays.asList("CRC64NVME", "CRC32C", "CRC32", "SHA1", "SHA256"));
List<Node> responseAlgorithmNodes = new ArrayList<>();
for (String algorithm: algorithms) {
responseAlgorithmNodes.add(Node.from(algorithm));
Expand All @@ -62,7 +62,8 @@ public void loadsTrait() {
assertThat(checksumTrait.isRequestChecksumRequired(), is(true));
assertThat(checksumTrait.getRequestAlgorithmMember().get(), equalTo("ChecksumAlgorithm"));
assertThat(checksumTrait.getRequestValidationModeMember().get(), equalTo("ChecksumMode"));
assertThat(checksumTrait.getResponseAlgorithms(), containsInRelativeOrder("CRC32C", "CRC32", "SHA1", "SHA256"));
assertThat(checksumTrait.getResponseAlgorithms(), containsInRelativeOrder("CRC64NVME", "CRC32C", "CRC32",
"SHA1", "SHA256"));

assertThat(node.expectBooleanMember("requestChecksumRequired"), equalTo(BooleanNode.from(true)));
assertThat(node.expectStringMember("requestAlgorithmMember"), equalTo(Node.from("ChecksumAlgorithm")));
Expand Down
Loading