Skip to content

Commit e41cb95

Browse files
authored
Merge pull request #1895 from adobe/64-support-versioning
Support versioning
2 parents 5514180 + f5324b0 commit e41cb95

File tree

70 files changed

+1933
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1933
-490
lines changed

CHANGELOG.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
<!-- TOC -->
1010
* [Changelog](#changelog)
1111
* [PLANNED - 5.x - RELEASE TBD](#planned---5x---release-tbd)
12-
* [Planned changes](#planned-changes)
12+
* [Planned changes](#planned-changes)
1313
* [CURRENT - 4.x - THIS VERSION IS UNDER ACTIVE DEVELOPMENT](#current---4x---this-version-is-under-active-development)
14-
* [4.0.0](#400)
14+
* [4.1.1 - PLANNED](#411---planned)
15+
* [4.1.0 - PLANNED](#410---planned)
16+
* [4.0.0](#400)
1517
* [DEPRECATED - 3.x](#deprecated---3x)
1618
* [3.12.0](#3120)
1719
* [3.11.0](#3110)
@@ -113,11 +115,13 @@ Running S3Mock in unit tests is still supported by using [TestContainers](https:
113115

114116
**Once 5.x is released, 4.x may receive bug fixes and features, this will be best-effort only.**
115117

116-
### Planned changes
118+
## Planned changes
117119

118120
* Features and fixes
119121
* TBD
120122
* Refactorings
123+
* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.
124+
* S3Mock will remove usage of Java v1 early 2026.
121125
* Looking to Remove unit test modules. This enables
122126
* Refactoring S3Mock to a "standard" Spring Boot application.
123127
* Removal of workarounds to use `S3MockApplication#start` from a static context
@@ -133,24 +137,76 @@ Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Jav
133137

134138
**The current major version 4 will receive new features, dependency updates and bug fixes on a continuous basis.**
135139

136-
### 4.0.0
140+
## 4.1.1 - PLANNED
141+
Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration.
142+
143+
* Features and fixes
144+
* Content-Encoding: aws-chunked should not be stored (fixes #2218)
145+
* Refactorings
146+
* TBD
147+
* Version updates (deliverable dependencies)
148+
* TBD
149+
* Version updates (build dependencies)
150+
* TBD
151+
152+
## 4.1.0 - PLANNED
153+
Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration.
137154

138155
* Features and fixes
156+
* Support Browser-Based Uploads Using POST (fixes #2200)
157+
* https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-UsingHTTPPOST.html
158+
* Refactorings
159+
* TBD
160+
* Version updates (deliverable dependencies)
161+
* TBD
162+
* Version updates (build dependencies)
163+
* TBD
164+
165+
## 4.0.0
166+
Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration.
167+
168+
* Features and fixes
169+
* Basic support for versions in API (fixes #64)
139170
* Allow overriding headers in head object
140171
* Implement If-(Un)modified-Since handling (fixes #829)
141172
* Close all InputStreams and OutputStreams
173+
* Add AWS SDK V1 deprecation notice
174+
* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.
175+
* S3Mock will remove usage of Java v1 early 2026.
142176
* Refactorings
143177
* Use Tomcat instead of Jetty as the application container (fixes #2136)
144178
* "FROM" in Dockerfile did not match "as"
145179
* Delete files on shutdown using a `DisposableBean` instead of `File#deleteOnExit()`
146180
* Version updates (deliverable dependencies)
147-
* Bump spring-boot.version from 3.3.5 to 3.4.1
148-
* Version updates (build dependencies)
149-
* Bump github/codeql-action from 3.27.6 to 3.27.9
150-
* Bump actions/upload-artifact from 4.4.3 to 4.5.0
151-
* Bump actions/setup-java from 4.5.0 to 4.6.0
152-
* Bump com.puppycrawl.tools:checkstyle from 10.20.2 to 10.21.0
181+
* Bump spring-boot.version from 3.3.5 to 3.4.4
153182
* Jackson 2.18.2 to 2.17.2 (remove override, use Spring-Boot supplied version)
183+
* Bump aws-v2.version from 2.29.29 to 2.31.17
184+
* Bump aws.version from 1.12.779 to 1.12.780
185+
* Bump aws.sdk.kotlin:s3-jvm from 1.4.41 to 1.4.59
186+
* Bump kotlin.version from 2.1.0 to 2.1.20
187+
* Bump testcontainers.version from 1.20.4 to 1.20.6
188+
* Bump org.testng:testng from 7.10.2 to 7.11.0
189+
* Bump aws.version from 1.12.780 to 1.12.782
190+
* Bump alpine from 3.21.0 to 3.21.3 in /docker
191+
* Version updates (build dependencies)
192+
* Bump org.apache.maven.plugins:maven-compiler-plugin from 3.13.0 to 3.14.0
193+
* Bump org.apache.maven.plugins:maven-clean-plugin from 3.4.0 to 3.4.1
194+
* Bump org.apache.maven.plugins:maven-install-plugin from 3.1.3 to 3.1.4
195+
* Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.3 to 3.1.4
196+
* Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.5.2 to 3.5.3
197+
* Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.2 to 3.5.3
198+
* Bump io.fabric8:docker-maven-plugin from 0.45.1 to 0.46.0
199+
* Bump org.jacoco:jacoco-maven-plugin from 0.8.12 to 0.8.13
200+
* Bump license-maven-plugin-git.version from 4.6 to 5.0.0
201+
* Bump github/codeql-action from 3.27.6 to 3.28.15
202+
* Bump docker/setup-qemu-action from 3.2.0 to 3.6.0
203+
* Bump actions/upload-artifact from 4.4.3 to 4.6.2
204+
* Bump actions/setup-java from 4.5.0 to 4.7.0
205+
* Bump actions/dependency-review-action from 4.5.0 to 4.6.0
206+
* Bump step-security/harden-runner from 2.10.2 to 2.11.1
207+
* Bump ossf/scorecard-action from 2.4.0 to 2.4.1
208+
* Bump com.puppycrawl.tools:checkstyle from 10.20.2 to 10.23.0
209+
* Bump advanced-security/sbom-generator-action from 0.0.1 to 0.0.2
154210

155211

156212
# DEPRECATED - 3.x

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Of these [operations of the Amazon S3 API](https://docs.aws.amazon.com/AmazonS3/
102102
| [GetBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) | :x: | |
103103
| [GetBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html) | :x: | |
104104
| [GetBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) | :x: | |
105-
| [GetBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) | :x: | |
105+
| [GetBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) | :white_check_mark: | |
106106
| [GetBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html) | :x: | |
107107
| [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) | :white_check_mark: | |
108108
| [GetObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) | :white_check_mark: | |
@@ -143,7 +143,7 @@ Of these [operations of the Amazon S3 API](https://docs.aws.amazon.com/AmazonS3/
143143
| [PutBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) | :x: | |
144144
| [PutBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketRequestPayment.html) | :x: | |
145145
| [PutBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) | :x: | |
146-
| [PutBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) | :x: | |
146+
| [PutBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) | :white_check_mark: | |
147147
| [PutBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) | :x: | |
148148
| [PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) | :white_check_mark: | |
149149
| [PutObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html) | :white_check_mark: | |

build-config/src/main/resources/build-config/checkstyle.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright 2017-2021 Adobe.
4+
Copyright 2017-2025 Adobe.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -201,7 +201,9 @@
201201
<property name="allowedAbbreviationLength" value="4"/>
202202
</module>
203203
<module name="OverloadMethodsDeclarationOrder"/>
204-
<module name="VariableDeclarationUsageDistance"/>
204+
<module name="VariableDeclarationUsageDistance">
205+
<property name="allowedDistance" value="4"/>
206+
</module>
205207
<module name="CustomImportOrder">
206208
<property name="sortImportsInGroupAlphabetically" value="true"/>
207209
<property name="separateLineBetweenGroups" value="true"/>

integration-tests/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<groupId>com.adobe.testing</groupId>
4141
<artifactId>s3mock-docker</artifactId>
4242
<type>pom</type>
43+
<scope>test</scope>
4344
<exclusions>
4445
<exclusion>
4546
<groupId>*</groupId>
@@ -70,6 +71,7 @@
7071
<dependency>
7172
<groupId>org.awaitility</groupId>
7273
<artifactId>awaitility</artifactId>
74+
<scope>test</scope>
7375
</dependency>
7476
<dependency>
7577
<groupId>org.jetbrains.kotlin</groupId>
@@ -170,7 +172,7 @@
170172
<COM_ADOBE_TESTING_S3MOCK_DOMAIN_INITIAL_BUCKETS>bucket-a, bucket-b</COM_ADOBE_TESTING_S3MOCK_DOMAIN_INITIAL_BUCKETS>
171173
<COM_ADOBE_TESTING_S3MOCK_REGION>eu-west-1</COM_ADOBE_TESTING_S3MOCK_REGION>
172174
</env>
173-
<memory>192000000</memory>
175+
<memory>256000000</memory>
174176
</run>
175177
</image>
176178
</images>

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/BucketV1IT.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 Adobe.
2+
* Copyright 2017-2025 Adobe.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,6 +32,8 @@ import java.util.stream.Collectors
3232
/**
3333
* Test the application using the AmazonS3 SDK V1.
3434
*/
35+
@Deprecated("* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.\n" +
36+
" * S3Mock will remove usage of Java v1 early 2026.")
3537
internal class BucketV1IT : S3TestBase() {
3638

3739
private val s3Client: AmazonS3 = createS3ClientV1()

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/BucketV2IT.kt

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 Adobe.
2+
* Copyright 2017-2025 Adobe.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import software.amazon.awssdk.awscore.exception.AwsServiceException
2626
import software.amazon.awssdk.services.s3.S3Client
2727
import software.amazon.awssdk.services.s3.model.AbortIncompleteMultipartUpload
2828
import software.amazon.awssdk.services.s3.model.BucketLifecycleConfiguration
29+
import software.amazon.awssdk.services.s3.model.BucketVersioningStatus
2930
import software.amazon.awssdk.services.s3.model.CreateBucketRequest
3031
import software.amazon.awssdk.services.s3.model.DeleteBucketLifecycleRequest
3132
import software.amazon.awssdk.services.s3.model.DeleteBucketRequest
@@ -36,6 +37,8 @@ import software.amazon.awssdk.services.s3.model.HeadBucketRequest
3637
import software.amazon.awssdk.services.s3.model.LifecycleExpiration
3738
import software.amazon.awssdk.services.s3.model.LifecycleRule
3839
import software.amazon.awssdk.services.s3.model.LifecycleRuleFilter
40+
import software.amazon.awssdk.services.s3.model.MFADelete
41+
import software.amazon.awssdk.services.s3.model.MFADeleteStatus
3942
import software.amazon.awssdk.services.s3.model.NoSuchBucketException
4043
import software.amazon.awssdk.services.s3.model.PutBucketLifecycleConfigurationRequest
4144
import java.util.concurrent.TimeUnit
@@ -79,6 +82,89 @@ internal class BucketV2IT : S3TestBase() {
7982
assertThat(bucketLocation.locationConstraint().toString()).isEqualTo("eu-west-1")
8083
}
8184

85+
@Test
86+
@S3VerifiedSuccess(year = 2024)
87+
fun getDefaultBucketVersioning(testInfo: TestInfo) {
88+
val bucketName = givenBucketV2(testInfo)
89+
90+
s3ClientV2.getBucketVersioning {
91+
it.bucket(bucketName)
92+
}.also {
93+
assertThat(it.status()).isNull()
94+
assertThat(it.mfaDelete()).isNull()
95+
}
96+
}
97+
98+
@Test
99+
@S3VerifiedTodo
100+
fun putAndGetBucketVersioning(testInfo: TestInfo) {
101+
val bucketName = givenBucketV2(testInfo)
102+
s3ClientV2.putBucketVersioning {
103+
it.bucket(bucketName)
104+
it.versioningConfiguration {
105+
it.status(BucketVersioningStatus.ENABLED)
106+
}
107+
}
108+
109+
s3ClientV2.getBucketVersioning {
110+
it.bucket(bucketName)
111+
}.also {
112+
assertThat(it.status()).isEqualTo(BucketVersioningStatus.ENABLED)
113+
}
114+
}
115+
116+
@Test
117+
@S3VerifiedTodo
118+
fun putAndGetBucketVersioning_suspended(testInfo: TestInfo) {
119+
val bucketName = givenBucketV2(testInfo)
120+
s3ClientV2.putBucketVersioning {
121+
it.bucket(bucketName)
122+
it.versioningConfiguration {
123+
it.status(BucketVersioningStatus.ENABLED)
124+
}
125+
}
126+
127+
s3ClientV2.getBucketVersioning {
128+
it.bucket(bucketName)
129+
}.also {
130+
assertThat(it.status()).isEqualTo(BucketVersioningStatus.ENABLED)
131+
}
132+
133+
s3ClientV2.putBucketVersioning {
134+
it.bucket(bucketName)
135+
it.versioningConfiguration {
136+
it.status(BucketVersioningStatus.SUSPENDED)
137+
}
138+
}
139+
140+
s3ClientV2.getBucketVersioning {
141+
it.bucket(bucketName)
142+
}.also {
143+
assertThat(it.status()).isEqualTo(BucketVersioningStatus.SUSPENDED)
144+
}
145+
}
146+
147+
@Test
148+
@S3VerifiedFailure(year = 2024, reason = "No real Mfa value")
149+
fun putAndGetBucketVersioning_mfa(testInfo: TestInfo) {
150+
val bucketName = givenBucketV2(testInfo)
151+
s3ClientV2.putBucketVersioning {
152+
it.bucket(bucketName)
153+
it.mfa("fakeMfaValue")
154+
it.versioningConfiguration {
155+
it.status(BucketVersioningStatus.ENABLED)
156+
it.mfaDelete(MFADelete.ENABLED)
157+
}
158+
}
159+
160+
s3ClientV2.getBucketVersioning {
161+
it.bucket(bucketName)
162+
}.also {
163+
assertThat(it.status()).isEqualTo(BucketVersioningStatus.ENABLED)
164+
assertThat(it.mfaDelete()).isEqualTo(MFADeleteStatus.ENABLED)
165+
}
166+
}
167+
82168
@Test
83169
@S3VerifiedSuccess(year = 2024)
84170
fun duplicateBucketCreation(testInfo: TestInfo) {

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/CopyObjectV1IT.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 Adobe.
2+
* Copyright 2017-2025 Adobe.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,8 @@ import java.util.UUID
3636
/**
3737
* Test the application using the AmazonS3 SDK V1.
3838
*/
39+
@Deprecated("* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.\n" +
40+
" * S3Mock will remove usage of Java v1 early 2026.")
3941
internal class CopyObjectV1IT : S3TestBase() {
4042

4143
private val s3Client: AmazonS3 = createS3ClientV1()

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/ErrorResponsesV1IT.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 Adobe.
2+
* Copyright 2017-2025 Adobe.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,6 +41,8 @@ import java.util.UUID
4141
* Test the application using the AmazonS3 SDK V1.
4242
* Verifies S3 Mocks Error Responses.
4343
*/
44+
@Deprecated("* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.\n" +
45+
" * S3Mock will remove usage of Java v1 early 2026.")
4446
internal class ErrorResponsesV1IT : S3TestBase() {
4547

4648
private val s3Client: AmazonS3 = createS3ClientV1()

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectV1IT.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 Adobe.
2+
* Copyright 2017-2025 Adobe.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,6 +51,8 @@ import kotlin.math.min
5151
/**
5252
* Test the application using the AmazonS3 SDK V1.
5353
*/
54+
@Deprecated("* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.\n" +
55+
" * S3Mock will remove usage of Java v1 early 2026.")
5456
internal class GetPutDeleteObjectV1IT : S3TestBase() {
5557

5658
private val httpClient: CloseableHttpClient = createHttpClient()

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/ListObjectV1IT.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2024 Adobe.
2+
* Copyright 2017-2025 Adobe.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,8 @@ import java.util.stream.Collectors
3333
/**
3434
* Test the application using the AmazonS3 SDK V1.
3535
*/
36+
@Deprecated("* AWS has deprecated SDK for Java v1, and will remove support EOY 2025.\n" +
37+
" * S3Mock will remove usage of Java v1 early 2026.")
3638
internal class ListObjectV1IT : S3TestBase() {
3739

3840
val s3Client: AmazonS3 = createS3ClientV1()

0 commit comments

Comments
 (0)