@@ -103,7 +103,7 @@ public class SqsMd5ChecksumValidationInterceptor(
103103 sendMessageRequest : SendMessageRequest ,
104104 sendMessageResponse : SendMessageResponse ,
105105 ) {
106- if (validationScopes.contains(ValidationScope .MESSAGE_BODY )) {
106+ if (validationScopes.contains(ValidationScope .MESSAGE_BODY )) {
107107 val messageBodySent = sendMessageRequest.messageBody
108108
109109 if (! messageBodySent.isNullOrEmpty()) {
@@ -117,7 +117,7 @@ public class SqsMd5ChecksumValidationInterceptor(
117117 }
118118 }
119119
120- if (validationScopes.contains(ValidationScope .MESSAGE_ATTRIBUTES )) {
120+ if (validationScopes.contains(ValidationScope .MESSAGE_ATTRIBUTES )) {
121121 val messageAttrSent = sendMessageRequest.messageAttributes
122122 if (! messageAttrSent.isNullOrEmpty()) {
123123 logger.debug { " Validating message attribute MD5 checksum for SendMessage" }
@@ -130,7 +130,7 @@ public class SqsMd5ChecksumValidationInterceptor(
130130 }
131131 }
132132
133- if (validationScopes.contains(ValidationScope .MESSAGE_SYSTEM_ATTRIBUTES )) {
133+ if (validationScopes.contains(ValidationScope .MESSAGE_SYSTEM_ATTRIBUTES )) {
134134 val messageSysAttrSent = sendMessageRequest.messageSystemAttributes
135135 if (! messageSysAttrSent.isNullOrEmpty()) {
136136 logger.debug { " Validating message system attribute MD5 checksum for SendMessage" }
@@ -148,7 +148,7 @@ public class SqsMd5ChecksumValidationInterceptor(
148148 val messages = receiveMessageResponse.messages
149149 if (messages != null ) {
150150 for (messageReceived in messages) {
151- if (validationScopes.contains(ValidationScope .MESSAGE_BODY )) {
151+ if (validationScopes.contains(ValidationScope .MESSAGE_BODY )) {
152152 val messageBody = messageReceived.body
153153 if (! messageBody.isNullOrEmpty()) {
154154 logger.debug { " Validating message body MD5 checksum for ReceiveMessage" }
@@ -161,7 +161,7 @@ public class SqsMd5ChecksumValidationInterceptor(
161161 }
162162 }
163163
164- if (validationScopes.contains(ValidationScope .MESSAGE_ATTRIBUTES )) {
164+ if (validationScopes.contains(ValidationScope .MESSAGE_ATTRIBUTES )) {
165165 val messageAttr = messageReceived.messageAttributes
166166
167167 if (! messageAttr.isNullOrEmpty()) {
@@ -191,7 +191,7 @@ public class SqsMd5ChecksumValidationInterceptor(
191191 }
192192
193193 for (entry in sendMessageBatchResponse.successful) {
194- if (validationScopes.contains(ValidationScope .MESSAGE_BODY )) {
194+ if (validationScopes.contains(ValidationScope .MESSAGE_BODY )) {
195195 val messageBody = idToRequestEntryMap[entry.id]?.messageBody
196196
197197 if (! messageBody.isNullOrEmpty()) {
@@ -205,7 +205,7 @@ public class SqsMd5ChecksumValidationInterceptor(
205205 }
206206 }
207207
208- if (validationScopes.contains(ValidationScope .MESSAGE_ATTRIBUTES )) {
208+ if (validationScopes.contains(ValidationScope .MESSAGE_ATTRIBUTES )) {
209209 val messageAttrSent = idToRequestEntryMap[entry.id]?.messageAttributes
210210 if (! messageAttrSent.isNullOrEmpty()) {
211211 logger.debug { " Validating message attribute MD5 checksum for SendMessageBatch: ${entry.messageId} " }
@@ -218,7 +218,7 @@ public class SqsMd5ChecksumValidationInterceptor(
218218 }
219219 }
220220
221- if (validationScopes.contains(ValidationScope .MESSAGE_SYSTEM_ATTRIBUTES )) {
221+ if (validationScopes.contains(ValidationScope .MESSAGE_SYSTEM_ATTRIBUTES )) {
222222 val messageSysAttrSent = idToRequestEntryMap[entry.id]?.messageSystemAttributes
223223 if (! messageSysAttrSent.isNullOrEmpty()) {
224224 logger.debug { " Validating message system attribute MD5 checksum for SendMessageBatch: ${entry.messageId} " }
@@ -239,9 +239,9 @@ public class SqsMd5ChecksumValidationInterceptor(
239239 } catch (e: Exception ) {
240240 throw ClientException (
241241 " Unable to calculate the MD5 hash of the message body." +
242- " Potential reasons include JVM configuration or FIPS compliance issues." +
243- " To disable message MD5 validation, you can set checksumValidationEnabled" +
244- " to false when instantiating the client." + e.message,
242+ " Potential reasons include JVM configuration or FIPS compliance issues." +
243+ " To disable message MD5 validation, you can set checksumValidationEnabled" +
244+ " to false when instantiating the client." + e.message,
245245 )
246246 }
247247 val expectedMD5Hex = expectedMD5.toHexString()
@@ -300,18 +300,17 @@ public class SqsMd5ChecksumValidationInterceptor(
300300 } catch (e: Exception ) {
301301 throw ClientException (
302302 " Unable to calculate the MD5 hash of the message body." +
303- " Potential reasons include JVM configuration or FIPS compliance issues." +
304- " To disable message MD5 validation, you can set checksumValidationEnabled" +
305- " to false when instantiating the client." + e.message,
303+ " Potential reasons include JVM configuration or FIPS compliance issues." +
304+ " To disable message MD5 validation, you can set checksumValidationEnabled" +
305+ " to false when instantiating the client." + e.message,
306306 )
307307 }
308308 val expectedMD5Hex = md5Digest.digest().toHexString()
309309 return expectedMD5Hex
310310 }
311311
312312 private fun calculateMessageSystemAttributesMd5 (
313- messageSysAttrs :
314- Map <MessageSystemAttributeNameForSends , MessageSystemAttributeValue >,
313+ messageSysAttrs : Map <MessageSystemAttributeNameForSends , MessageSystemAttributeValue >,
315314 ): String {
316315 val sortedAttributeNames = messageSysAttrs.keys.sortedBy { it.value }
317316 val md5Digest = Md5 ()
@@ -359,9 +358,9 @@ public class SqsMd5ChecksumValidationInterceptor(
359358 } catch (e: Exception ) {
360359 throw ClientException (
361360 " Unable to calculate the MD5 hash of the message body." +
362- " Potential reasons include JVM configuration or FIPS compliance issues." +
363- " To disable message MD5 validation, you can set checksumValidationEnabled" +
364- " to false when instantiating the client." + e.message,
361+ " Potential reasons include JVM configuration or FIPS compliance issues." +
362+ " To disable message MD5 validation, you can set checksumValidationEnabled" +
363+ " to false when instantiating the client." + e.message,
365364 )
366365 }
367366 val expectedMD5Hex = md5Digest.digest().toHexString()
0 commit comments