Skip to content

Commit d83262f

Browse files
committed
Merge branch 'main' of github.com:aws/amazon-s3-encryption-client-java into transfer-manager-tests
2 parents a26d4a4 + 2db1784 commit d83262f

25 files changed

+1430
-100
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# Changelog
22

3+
## [3.3.5](https://github.com/aws/aws-s3-encryption-client-java/compare/v3.3.4...v3.3.5) (2025-05-21)
4+
5+
### Fixes
6+
7+
* determine effective contentLength, account for tagLength on decrypt ([#463](https://github.com/aws/aws-s3-encryption-client-java/issues/463)) ([969d721](https://github.com/aws/aws-s3-encryption-client-java/commit/969d7213b7bd6250fbce159bd5705a19ee439f23))
8+
* disable low-level Multipart Upload in Async client ([#461](https://github.com/aws/aws-s3-encryption-client-java/issues/461)) ([599f941](https://github.com/aws/aws-s3-encryption-client-java/commit/599f9417335efac4cf952e555a99bbc6d7d8cc0f))
9+
* support PutObjectResponse fields ([#462](https://github.com/aws/aws-s3-encryption-client-java/issues/462)) ([dec503b](https://github.com/aws/aws-s3-encryption-client-java/commit/dec503b49f3e57113de16fcc861ee1ecedbd2ff6))
10+
11+
### Maintenance
12+
13+
* Revert "Amazon S3 Encryption Client 3.3.5 Release -- 2025-05-20" ([#465](https://github.com/aws/aws-s3-encryption-client-java/issues/465)) ([3f9ac8e](https://github.com/aws/aws-s3-encryption-client-java/commit/3f9ac8e419f5ed55f59fb0daf742fc2945eea9d0))
14+
* update dependency needed for semantic-release ([#464](https://github.com/aws/aws-s3-encryption-client-java/issues/464)) ([0fd3b58](https://github.com/aws/aws-s3-encryption-client-java/commit/0fd3b5826964b41a07a4c004fd0500404e347360))
15+
16+
## [3.3.4](https://github.com/aws/aws-s3-encryption-client-java/compare/v3.3.3...v3.3.4) (2025-05-12)
17+
18+
### Fixes
19+
20+
* Add details to error message ([#459](https://github.com/aws/aws-s3-encryption-client-java/issues/459)) ([0d32b4a](https://github.com/aws/aws-s3-encryption-client-java/commit/0d32b4a81662c5dc8ca85cf6f5dd09252f014b6e)), closes [#458](https://github.com/aws/aws-s3-encryption-client-java/issues/458)
21+
* Support all PutObjectRequest fields ([#458](https://github.com/aws/aws-s3-encryption-client-java/issues/458)) ([99cce95](https://github.com/aws/aws-s3-encryption-client-java/commit/99cce95ab8e376f4a096401e56a88d6fc34ace44))
22+
23+
## [3.3.3](https://github.com/aws/aws-s3-encryption-client-java/compare/v3.3.2...v3.3.3) (2025-05-05)
24+
25+
### Fixes
26+
27+
* fix CipherSubscriber to only call onNext once per request ([#456](https://github.com/aws/aws-s3-encryption-client-java/issues/456)) ([646b735](https://github.com/aws/aws-s3-encryption-client-java/commit/646b735b052ced18a5c01f9d369ac6a81c8e2ce1))
28+
29+
## [3.3.2](https://github.com/aws/aws-s3-encryption-client-java/compare/v3.3.1...v3.3.2) (2025-04-16)
30+
31+
### Fixes
32+
33+
* add builders to S3EncryptionClientException class ([#450](https://github.com/aws/aws-s3-encryption-client-java/issues/450)) ([647c809](https://github.com/aws/aws-s3-encryption-client-java/commit/647c809a0e0cc44abdd0c9bd192a3c78d29fdc71))
34+
* allow CipherSubscriber to determine if the part is last part ([#453](https://github.com/aws/aws-s3-encryption-client-java/issues/453)) ([12355a1](https://github.com/aws/aws-s3-encryption-client-java/commit/12355a11e29e81ebc3c903aaa7caee5a271a0ea8))
35+
36+
## [3.3.1](https://github.com/aws/aws-s3-encryption-client-java/compare/v3.3.0...v3.3.1) (2025-01-24)
37+
38+
### Fixes
39+
40+
* KMS Dependency is required ([44e9886](https://github.com/aws/aws-s3-encryption-client-java/commit/44e988677505bdc207936d0a981a0ca67dfd1a8a))
41+
* treat null matdesc as empty ([#448](https://github.com/aws/aws-s3-encryption-client-java/issues/448)) ([bcd711e](https://github.com/aws/aws-s3-encryption-client-java/commit/bcd711eb65707bac99775a011e3e159c6e3a79e6))
42+
* unbounded streams are not supported ([#422](https://github.com/aws/aws-s3-encryption-client-java/issues/422)) ([034bb89](https://github.com/aws/aws-s3-encryption-client-java/commit/034bb89ae5933b4d56e9892f19bb1e8f1f27010e))
43+
344
## [3.3.0](https://github.com/aws/aws-s3-encryption-client-java/compare/v3.2.3...v3.3.0) (2024-10-30)
445

546
### Features

codebuild/release/version.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ phases:
1919
- npm install @semantic-release/changelog -d
2020
- npm install @semantic-release/exec -d
2121
- npm install @semantic-release/git -d
22+
- npm install conventional-changelog-conventionalcommits -d
2223
- npm install --save conventional-changelog
2324
runtime-versions:
2425
nodejs: 16
@@ -30,4 +31,4 @@ phases:
3031
build:
3132
commands:
3233
# semantic-release uses config stored in ~/.releaserc
33-
- npx semantic-release --branches $BRANCH --no-ci
34+
- npx semantic-release --branches $BRANCH --no-ci

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.amazon.encryption.s3</groupId>
88
<artifactId>amazon-s3-encryption-client-java</artifactId>
9-
<version>3.3.0</version>
9+
<version>3.3.5</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Amazon S3 Encryption Client</name>
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>software.amazon.awssdk</groupId>
5858
<artifactId>bom</artifactId>
59-
<version>2.29.29</version>
59+
<version>2.31.14</version>
6060
<optional>true</optional>
6161
<type>pom</type>
6262
<scope>import</scope>
@@ -68,21 +68,21 @@
6868
<dependency>
6969
<groupId>software.amazon.awssdk</groupId>
7070
<artifactId>s3</artifactId>
71-
<version>2.29.29</version>
71+
<version>2.31.14</version>
7272
</dependency>
7373

7474
<dependency>
7575
<groupId>software.amazon.awssdk</groupId>
7676
<artifactId>kms</artifactId>
77-
<version>2.29.29</version>
77+
<version>2.31.14</version>
7878
</dependency>
7979

8080
<!-- Used when enableMultipartPutObject is configured -->
8181
<dependency>
8282
<groupId>software.amazon.awssdk.crt</groupId>
8383
<artifactId>aws-crt</artifactId>
8484
<optional>true</optional>
85-
<version>0.33.5</version>
85+
<version>0.37.0</version>
8686
</dependency>
8787

8888
<dependency>
@@ -171,7 +171,7 @@
171171
<dependency>
172172
<groupId>software.amazon.awssdk</groupId>
173173
<artifactId>sts</artifactId>
174-
<version>2.29.29</version>
174+
<version>2.31.14</version>
175175
<optional>true</optional>
176176
<scope>test</scope>
177177
</dependency>

src/examples/java/software/amazon/encryption/s3/examples/MultipartUploadExample.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package software.amazon.encryption.s3.examples;
22

3-
import static org.junit.jupiter.api.Assertions.assertTrue;
4-
import static software.amazon.encryption.s3.S3EncryptionClient.withAdditionalConfiguration;
5-
import static software.amazon.encryption.s3.utils.S3EncryptionClientTestResources.KMS_KEY_ID;
6-
import static software.amazon.encryption.s3.utils.S3EncryptionClientTestResources.appendTestSuffix;
7-
3+
import org.apache.commons.io.IOUtils;
84
import software.amazon.awssdk.core.ResponseInputStream;
95
import software.amazon.awssdk.core.sync.RequestBody;
106
import software.amazon.awssdk.services.s3.S3Client;
@@ -26,7 +22,10 @@
2622
import java.util.List;
2723
import java.util.Map;
2824

29-
import org.apache.commons.io.IOUtils;
25+
import static org.junit.jupiter.api.Assertions.assertTrue;
26+
import static software.amazon.encryption.s3.S3EncryptionClient.withAdditionalConfiguration;
27+
import static software.amazon.encryption.s3.utils.S3EncryptionClientTestResources.KMS_KEY_ID;
28+
import static software.amazon.encryption.s3.utils.S3EncryptionClientTestResources.appendTestSuffix;
3029

3130
public class MultipartUploadExample {
3231
public static String BUCKET;

src/main/java/software/amazon/encryption/s3/S3AsyncEncryptionClient.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
import software.amazon.awssdk.services.s3.S3AsyncClientBuilder;
2121
import software.amazon.awssdk.services.s3.S3Configuration;
2222
import software.amazon.awssdk.services.s3.internal.crt.S3CrtAsyncClient;
23+
import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadRequest;
24+
import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadResponse;
25+
import software.amazon.awssdk.services.s3.model.CreateMultipartUploadRequest;
26+
import software.amazon.awssdk.services.s3.model.CreateMultipartUploadResponse;
2327
import software.amazon.awssdk.services.s3.model.DeleteObjectRequest;
2428
import software.amazon.awssdk.services.s3.model.DeleteObjectResponse;
2529
import software.amazon.awssdk.services.s3.model.DeleteObjectsRequest;
@@ -30,6 +34,8 @@
3034
import software.amazon.awssdk.services.s3.model.PutObjectRequest;
3135
import software.amazon.awssdk.services.s3.model.PutObjectResponse;
3236
import software.amazon.awssdk.services.s3.model.S3Request;
37+
import software.amazon.awssdk.services.s3.model.UploadPartRequest;
38+
import software.amazon.awssdk.services.s3.model.UploadPartResponse;
3339
import software.amazon.awssdk.services.s3.multipart.MultipartConfiguration;
3440
import software.amazon.encryption.s3.internal.GetEncryptedObjectPipeline;
3541
import software.amazon.encryption.s3.internal.InstructionFileConfig;
@@ -256,6 +262,24 @@ public CompletableFuture<DeleteObjectsResponse> deleteObjects(DeleteObjectsReque
256262
.build());
257263
}
258264

265+
@Override
266+
public CompletableFuture<CreateMultipartUploadResponse> createMultipartUpload(CreateMultipartUploadRequest createMultipartUploadRequest) {
267+
throw new UnsupportedOperationException("The S3 Async Encryption Client does not support low-level multipart uploads. " +
268+
"Please use Multipart PutObject or the default (synchronous) client to use this API.");
269+
}
270+
271+
@Override
272+
public CompletableFuture<UploadPartResponse> uploadPart(UploadPartRequest uploadPartRequest, AsyncRequestBody asyncRequestBody) {
273+
throw new UnsupportedOperationException("The S3 Async Encryption Client does not support low-level multipart uploads. " +
274+
"Please use Multipart PutObject or the default (synchronous) client to use this API.");
275+
}
276+
277+
@Override
278+
public CompletableFuture<CompleteMultipartUploadResponse> completeMultipartUpload(CompleteMultipartUploadRequest completeMultipartUploadRequest) {
279+
throw new UnsupportedOperationException("The S3 Async Encryption Client does not support low-level multipart uploads. " +
280+
"Please use Multipart PutObject or the default (synchronous) client to use this API.");
281+
}
282+
259283
/**
260284
* Closes the wrapped {@link S3AsyncClient} instance.
261285
*/

src/main/java/software/amazon/encryption/s3/S3EncryptionClient.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import software.amazon.awssdk.services.s3.model.UploadPartRequest;
4747
import software.amazon.awssdk.services.s3.model.UploadPartResponse;
4848
import software.amazon.encryption.s3.algorithms.AlgorithmSuite;
49+
import software.amazon.encryption.s3.internal.ConvertSDKRequests;
4950
import software.amazon.encryption.s3.internal.GetEncryptedObjectPipeline;
5051
import software.amazon.encryption.s3.internal.InstructionFileConfig;
5152
import software.amazon.encryption.s3.internal.MultiFileOutputStream;
@@ -192,11 +193,7 @@ public PutObjectResponse putObject(PutObjectRequest putObjectRequest, RequestBod
192193

193194
if (_enableMultipartPutObject) {
194195
try {
195-
CompleteMultipartUploadResponse completeResponse = multipartPutObject(putObjectRequest, requestBody);
196-
PutObjectResponse response = PutObjectResponse.builder()
197-
.eTag(completeResponse.eTag())
198-
.build();
199-
return response;
196+
return multipartPutObject(putObjectRequest, requestBody);
200197
} catch (Throwable e) {
201198
throw new S3EncryptionClientException("Exception while performing Multipart Upload PutObject", e);
202199
}
@@ -274,7 +271,7 @@ public <T> T getObject(GetObjectRequest getObjectRequest,
274271
}
275272
}
276273

277-
private CompleteMultipartUploadResponse multipartPutObject(PutObjectRequest request, RequestBody requestBody) throws Throwable {
274+
private PutObjectResponse multipartPutObject(PutObjectRequest request, RequestBody requestBody) throws Throwable {
278275
// Similar logic exists in the MultipartUploadObjectPipeline,
279276
// but the request types do not match so refactoring is not possible
280277
final long contentLength;
@@ -354,7 +351,7 @@ private CompleteMultipartUploadResponse multipartPutObject(PutObjectRequest requ
354351
outputStream.cleanup();
355352
}
356353
// Complete upload
357-
return observer.onCompletion(partETags);
354+
return ConvertSDKRequests.convertResponse(observer.onCompletion(partETags));
358355
}
359356

360357
private <T extends Throwable> T onAbort(UploadObjectObserver observer, T t) {

src/main/java/software/amazon/encryption/s3/S3EncryptionClientException.java

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,65 @@
66

77
public class S3EncryptionClientException extends SdkClientException {
88

9+
private S3EncryptionClientException(Builder b) {
10+
super(b);
11+
}
12+
913
public S3EncryptionClientException(String message) {
10-
super(SdkClientException.builder()
14+
super(S3EncryptionClientException.builder()
1115
.message(message));
1216
}
1317

1418
public S3EncryptionClientException(String message, Throwable cause) {
15-
super(SdkClientException.builder()
19+
super(S3EncryptionClientException.builder()
1620
.message(message)
1721
.cause(cause));
1822
}
23+
24+
@Override
25+
public Builder toBuilder() {
26+
return new BuilderImpl(this);
27+
}
28+
29+
public static Builder builder() {
30+
return new BuilderImpl();
31+
}
32+
33+
public interface Builder extends SdkClientException.Builder {
34+
@Override
35+
Builder message(String message);
36+
37+
@Override
38+
Builder cause(Throwable cause);
39+
40+
@Override
41+
S3EncryptionClientException build();
42+
}
43+
44+
protected static final class BuilderImpl extends SdkClientException.BuilderImpl implements Builder {
45+
46+
protected BuilderImpl() {
47+
}
48+
49+
protected BuilderImpl(S3EncryptionClientException ex) {
50+
super(ex);
51+
}
52+
53+
@Override
54+
public Builder message(String message) {
55+
this.message = message;
56+
return this;
57+
}
58+
59+
@Override
60+
public Builder cause(Throwable cause) {
61+
this.cause = cause;
62+
return this;
63+
}
64+
65+
@Override
66+
public S3EncryptionClientException build() {
67+
return new S3EncryptionClientException(this);
68+
}
69+
}
1970
}

src/main/java/software/amazon/encryption/s3/internal/CipherAsyncRequestBody.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ public class CipherAsyncRequestBody implements AsyncRequestBody {
2020
private final Long ciphertextLength;
2121
private final CryptographicMaterials materials;
2222
private final byte[] iv;
23+
private final boolean isLastPart;
2324

2425
public CipherAsyncRequestBody(final AsyncRequestBody wrappedAsyncRequestBody, final Long ciphertextLength, final CryptographicMaterials materials, final byte[] iv, final boolean isLastPart) {
2526
this.wrappedAsyncRequestBody = wrappedAsyncRequestBody;
2627
this.ciphertextLength = ciphertextLength;
2728
this.materials = materials;
2829
this.iv = iv;
30+
this.isLastPart = isLastPart;
2931
}
3032

3133
public CipherAsyncRequestBody(final AsyncRequestBody wrappedAsyncRequestBody, final Long ciphertextLength, final CryptographicMaterials materials, final byte[] iv) {
@@ -38,7 +40,7 @@ public CipherAsyncRequestBody(final AsyncRequestBody wrappedAsyncRequestBody, fi
3840
public void subscribe(Subscriber<? super ByteBuffer> subscriber) {
3941
wrappedAsyncRequestBody.subscribe(new CipherSubscriber(subscriber,
4042
contentLength().orElseThrow(() -> new S3EncryptionClientException("Unbounded streams are currently not supported.")),
41-
materials, iv));
43+
materials, iv, isLastPart));
4244
}
4345

4446
@Override

0 commit comments

Comments
 (0)