Skip to content

Commit

Permalink
update comments, test builder options
Browse files Browse the repository at this point in the history
  • Loading branch information
kessplas committed Oct 28, 2024
1 parent d31b94c commit 9ae89d1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public Builder disableMultiRegionAccessPoints(Boolean disableMultiRegionAccessPo
}

@Override
public S3AsyncClientBuilder disableS3ExpressSessionAuth(Boolean disableS3ExpressSessionAuth) {
public Builder disableS3ExpressSessionAuth(Boolean disableS3ExpressSessionAuth) {
_disableS3ExpressSessionAuth = disableS3ExpressSessionAuth;
return this;
}
Expand Down Expand Up @@ -742,9 +742,9 @@ public Builder useArnRegion(Boolean useArnRegion) {
}

/**
* Multipart is NOT currently supported by the S3 Encryption Client.
* Do not enable this option, and do not pass in a wrapped client
* with multipart enabled, GET requests could be corrupted.
* Multipart via the wrapped client is currently NOT supported by the S3 Encryption Client.
* Use the {@link this.enableMultipartPutObject()} option instead for high-level multipart uploads.
* Multipart downloads are currently NOT supported.
* @param enabled MUST be false
* @return
*/
Expand All @@ -758,7 +758,7 @@ public Builder multipartEnabled(Boolean enabled) {
}

@Override
public S3AsyncClientBuilder multipartConfiguration(MultipartConfiguration multipartConfiguration) {
public Builder multipartConfiguration(MultipartConfiguration multipartConfiguration) {
_multipartConfiguration = multipartConfiguration;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,6 @@ public S3EncryptionClient build() {
.httpClientBuilder(_asyncHttpClientBuilder)
.disableS3ExpressSessionAuth(_disableS3ExpressSessionAuth)
.crossRegionAccessEnabled(_crossRegionAccessEnabled)
// TODO: Add MPU stuff here too
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import software.amazon.awssdk.services.s3.model.ObjectIdentifier;
import software.amazon.awssdk.services.s3.model.PutObjectResponse;
import software.amazon.awssdk.services.s3.model.S3Exception;
import software.amazon.awssdk.services.s3.multipart.MultipartConfiguration;
import software.amazon.encryption.s3.internal.InstructionFileConfig;
import software.amazon.encryption.s3.materials.KmsKeyring;
import software.amazon.encryption.s3.utils.BoundedInputStream;
Expand Down Expand Up @@ -161,6 +162,11 @@ public void asyncTopLevelConfigurationAllOptions() {
.useArnRegion(null)
.httpClient(null)
.httpClientBuilder(null)
.multipartEnabled(false)
.multipartConfiguration(MultipartConfiguration.builder().build()) // null is ambiguous
.disableS3ExpressSessionAuth(null)
.crossRegionAccessEnabled(null)
.instructionFileConfig(InstructionFileConfig.builder().instructionFileClient(S3Client.create()).build())
.build();
final String input = "SimpleTestOfV3EncryptionClientAsync";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ public void AesCbcV1toV3FailsRangeExceededObjectLength() {
}

@Test
public void AsyncAesGcmV3toV3LargeObject() throws IOException {
final String objectKey = appendTestSuffix("async-aes-gcm-v3-to-v3-large-object");
public void AsyncAesGcmV3toV3LargeObjectCRT() throws IOException {
final String objectKey = appendTestSuffix("async-aes-gcm-v3-to-v3-large-object-crt");

final long fileSizeLimit = 1024 * 1024 * 100;
final InputStream inputStream = new BoundedInputStream(fileSizeLimit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,9 @@ public void s3EncryptionClientTopLevelAllOptions() {
.httpClientBuilder(null)
.asyncHttpClient(null)
.asyncHttpClientBuilder(null)
.disableS3ExpressSessionAuth(null)
.crossRegionAccessEnabled(null)
.instructionFileConfig(InstructionFileConfig.builder().instructionFileClient(S3Client.create()).build())
.build();

simpleV3RoundTrip(s3Client, objectKey);
Expand Down

0 comments on commit 9ae89d1

Please sign in to comment.