Skip to content

Commit db5a488

Browse files
committed
Update comment to explain more about those tests
1 parent fb7eca9 commit db5a488

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/HttpChecksumStage.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public SdkHttpFullRequest.Builder execute(SdkHttpFullRequest.Builder request, Re
7575
return request;
7676
}
7777

78-
// If SRA is enabled, we skip flexible checksum in header, as it is not supported in the HttpSigner right now
79-
// TODO: we should remove this after it is supported
78+
// If SRA is enabled, skip flexible checksum in header, since it is handled by SRA signer
8079
if (sraSigningEnabled(context)) {
8180
return request;
8281
}
@@ -136,8 +135,7 @@ private void addMd5ChecksumInHeader(SdkHttpFullRequest.Builder request) {
136135

137136
private boolean flexibleChecksumInTrailerRequired(RequestExecutionContext context, ChecksumSpecs checksumSpecs) {
138137

139-
// If SRA is enabled and it's sync client,
140-
// skip it since flexible checksum trailer is handled in SRA signer
138+
// If SRA is enabled and it's sync client, skip flexible checksum trailer, since it is handled in SRA signer
141139
if (sraSigningEnabled(context) && clientType == ClientType.SYNC) {
142140
return false;
143141
}

services/s3/src/it/java/software/amazon/awssdk/services/s3/checksum/AsyncHttpChecksumIntegrationTest.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,16 @@ void asyncValidSignedTrailerChecksumCalculatedBySdkClient() {
233233
assertThat(response).isEqualTo("Hello world");
234234
}
235235

236+
/**
237+
* S3 clients by default don't do payload signing. But when http is used, payload signing is expected to be enforced. But
238+
* payload signing is not currently supported in async path (for both pre/post SRA signers).
239+
* However, this test passes, because of https://github
240+
* .com/aws/aws-sdk-java-v2/blob/38e221bd815af31a6c6b91557499af155103c21a/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAwsS3V4Signer.java#L279-L285.
241+
* Keeping this test enabled, to ensure moving to SRA Identity & Auth, does not break current behavior.
242+
* TODO: Update this test with right asserts when payload signing is supported in async.
243+
*/
236244
@Test
237245
public void putObject_with_bufferCreatedFromEmptyString() {
238-
239246
s3HttpAsync.putObject(PutObjectRequest.builder()
240247
.bucket(BUCKET)
241248
.key(KEY)
@@ -255,6 +262,14 @@ public void putObject_with_bufferCreatedFromEmptyString() {
255262
assertThat(response).isEqualTo("");
256263
}
257264

265+
/**
266+
* S3 clients by default don't do payload signing. But when http is used, payload signing is expected to be enforced. But
267+
* payload signing is not currently supported in async path (for both pre/post SRA signers).
268+
* However, this test passes, because of https://github
269+
* .com/aws/aws-sdk-java-v2/blob/38e221bd815af31a6c6b91557499af155103c21a/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAwsS3V4Signer.java#L279-L285.
270+
* Keeping this test enabled, to ensure moving to SRA Identity & Auth, does not break current behavior.
271+
* TODO: Update this test with right asserts when payload signing is supported in async.
272+
*/
258273
@Test
259274
public void putObject_with_bufferCreatedFromZeroCapacityByteBuffer() {
260275
ByteBuffer content = ByteBuffer.allocate(0);

0 commit comments

Comments
 (0)