Skip to content

Commit bd9c80b

Browse files
committed
Changing name of validation parameter and inverting the boolean
1 parent abfc084 commit bd9c80b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

services/sqs/src/main/java/software/amazon/awssdk/services/sqs/internal/MessageMD5ChecksumInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public void afterExecution(Context.AfterExecution context, ExecutionAttributes e
101101

102102
private static boolean validateMessageMD5Enabled(ExecutionAttributes executionAttributes) {
103103
AttributeMap clientContextParams = executionAttributes.getAttribute(SdkInternalExecutionAttribute.CLIENT_CONTEXT_PARAMS);
104-
Boolean disableMd5Validation = clientContextParams.get(SqsClientContextParams.DISABLE_DEFAULT_CHECKSUM_VALIDATION);
105-
return disableMd5Validation == null || !disableMd5Validation;
104+
Boolean enableMd5Validation = clientContextParams.get(SqsClientContextParams.CHECKSUM_VALIDATION_ENABLED);
105+
return enableMd5Validation == null || enableMd5Validation;
106106
}
107107

108108
/**

services/sqs/src/main/resources/codegen-resources/customization.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"software.amazon.awssdk.services.sqs.internal.MessageMD5ChecksumInterceptor"
77
],
88
"customClientContextParams":{
9-
"disableDefaultChecksumValidation":{
10-
"documentation":"Disable default Message MD5 checksum validation. Normally, checksum validation is recommended. Only turn it off if required, for instance if your cryptographic library does not support MD5.",
9+
"checksumValidationEnabled":{
10+
"documentation":"Enable message MD5 checksum validation.<p>Checksum validation for messages defaults to true. Only set to false if required, for instance if your cryptographic library does not support MD5.<p>Supported operations are SendMessage, ReceiveMessage and SendMessageBatch.",
1111
"type":"boolean"
1212
}
1313
}

services/sqs/src/test/java/software/amazon/awssdk/services/sqs/MessageMD5ChecksumValidationDisableTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void md5ValidationDisabled_md5InResponse_Works() {
9494
SqsAsyncClient client = SqsAsyncClient.builder()
9595
.credentialsProvider(StaticCredentialsProvider.create(CLIENT_CREDENTIALS))
9696
.httpClient(asyncHttpClient)
97-
.disableDefaultChecksumValidation(true)
97+
.checksumValidationEnabled(false)
9898
.build();
9999

100100
SendMessageResponse sendMessageResponse =
@@ -109,7 +109,7 @@ public void md5ValidationDisabled_noMd5InResponse_Works() {
109109
SqsAsyncClient client = SqsAsyncClient.builder()
110110
.credentialsProvider(StaticCredentialsProvider.create(CLIENT_CREDENTIALS))
111111
.httpClient(asyncHttpClient)
112-
.disableDefaultChecksumValidation(true)
112+
.checksumValidationEnabled(false)
113113
.build();
114114

115115
SendMessageResponse sendMessageResponse =
@@ -124,7 +124,7 @@ public void sync_md5ValidationDisabled_noMd5InResponse_Works() {
124124
SqsClient client = SqsClient.builder()
125125
.credentialsProvider(StaticCredentialsProvider.create(CLIENT_CREDENTIALS))
126126
.httpClient(syncHttpClient)
127-
.disableDefaultChecksumValidation(true)
127+
.checksumValidationEnabled(false)
128128
.build();
129129

130130
SendMessageResponse sendMessageResponse =

0 commit comments

Comments
 (0)