use of software.amazon.awssdk.http.SdkHttpFullRequest in project aws-sdk-java-v2 by aws.
the class DefaultAwsCrtS3V4aSignerTest method no_payloadSigning_and_chunkedEnabled_does_not_sign_payload.
@Test
public void no_payloadSigning_and_chunkedEnabled_does_not_sign_payload() {
SigningTestCase testCase = SignerTestUtils.createBasicHeaderSigningTestCase();
ExecutionAttributes executionAttributes = SignerTestUtils.buildBasicExecutionAttributes(testCase);
executionAttributes.putAttribute(S3SignerExecutionAttribute.ENABLE_PAYLOAD_SIGNING, false);
executionAttributes.putAttribute(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, true);
SdkHttpFullRequest signedRequest = s3V4aSigner.sign(testCase.requestBuilder.build(), executionAttributes);
verifyUnsignedPayload(signedRequest);
}
use of software.amazon.awssdk.http.SdkHttpFullRequest in project aws-sdk-java-v2 by aws.
the class DefaultAwsCrtS3V4aSignerTest method no_special_configuration_does_not_sign_payload.
@Test
public void no_special_configuration_does_not_sign_payload() {
SigningTestCase testCase = SignerTestUtils.createBasicHeaderSigningTestCase();
ExecutionAttributes executionAttributes = SignerTestUtils.buildBasicExecutionAttributes(testCase);
SdkHttpFullRequest request = testCase.requestBuilder.build();
SdkHttpFullRequest signedRequest = s3V4aSigner.sign(request, executionAttributes);
verifyUnsignedPayload(signedRequest);
}
use of software.amazon.awssdk.http.SdkHttpFullRequest in project aws-sdk-java-v2 by aws.
the class DefaultAwsCrtS3V4aSignerTest method unsigned_payload_signing_with_trailer_checksums.
@Test
public void unsigned_payload_signing_with_trailer_checksums() {
SigningTestCase testCase = SignerTestUtils.createBasicHeaderSigningTestCase();
ExecutionAttributes executionAttributes = SignerTestUtils.buildBasicExecutionAttributes(testCase);
executionAttributes.putAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM, HTTP_CRC32_CHECKSUM);
SdkHttpFullRequest request = testCase.requestBuilder.build();
SdkHttpFullRequest signedRequest = s3V4aSigner.sign(request, executionAttributes);
verifyUnsignedPayloadWithTrailerChecksum(signedRequest);
}
use of software.amazon.awssdk.http.SdkHttpFullRequest in project aws-sdk-java-v2 by aws.
the class BaseSigningScopeTest method signing_withSigningRegionOnly_usesSigningRegion.
@Test
public void signing_withSigningRegionOnly_usesSigningRegion() {
SigningTestCase testCase = SignerTestUtils.createBasicHeaderSigningTestCase();
SdkHttpFullRequest signedRequest = signRequestWithScope(testCase, null, null);
String regionHeader = signedRequest.firstMatchingHeader("X-Amz-Region-Set").get();
assertThat(regionHeader).isEqualTo(Region.AWS_GLOBAL.id());
}
use of software.amazon.awssdk.http.SdkHttpFullRequest in project aws-sdk-java-v2 by aws.
the class BaseSigningScopeTest method signing_withSigningRegionAndRegionScope_usesRegionScope.
@Test
public void signing_withSigningRegionAndRegionScope_usesRegionScope() {
SigningTestCase testCase = SignerTestUtils.createBasicHeaderSigningTestCase();
SdkHttpFullRequest signedRequest = signRequestWithScope(testCase, null, RegionScope.GLOBAL);
String regionHeader = signedRequest.firstMatchingHeader("X-Amz-Region-Set").get();
assertThat(regionHeader).isEqualTo(RegionScope.GLOBAL.id());
}
Aggregations