diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 44f3cf2c1..c0bcafe98 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,2 +1,3 @@ +wrapperVersion=3.3.4 distributionType=only-script distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index cdcfc0919..bb802b45d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Whenever a 3rd party library is updated, S3Mock will update it's MINOR version. * [PLANNED - 5.x - RELEASE TBD](#planned---5x---release-tbd) * [Planned changes](#planned-changes) * [CURRENT - 4.x - THIS VERSION IS UNDER ACTIVE DEVELOPMENT](#current---4x---this-version-is-under-active-development) - * [4.11.0 - PLANNED](#4110---planned) + * [4.11.0](#4110) * [4.10.0](#4100) * [4.9.1](#491) * [4.9.0](#490) @@ -152,21 +152,27 @@ Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Jav **The current major version 4 will receive new features, dependency updates and bug fixes on a continuous basis. We usually follow the Spring Boot release cycle.** -## 4.11.0 - PLANNED +## 4.11.0 Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration. -**This is currently the last planned minor release of 4.x.** +**This is the last planned minor release of 4.x.** * Features and fixes - * TBD + * Support quiet parameter in DeleteObjects (fixes #2756) * Refactorings * TBD * Version updates (deliverable dependencies) - * Update to Spring Boot 3.5.8 - * Planned release November 20th 2025 - * https://github.com/spring-projects/spring-boot/milestone/401 + * Bump spring-boot.version from 3.5.7 to 3.5.8 + * Bump org.apache.commons:commons-lang3 from 3.19.0 to 3.20.0 * Version updates (build dependencies) - * TBD + * Bump io.fabric8:docker-maven-plugin from 0.47.0 to 0.48.0 + * Bump org.apache.maven.plugins:maven-release-plugin from 3.1.1 to 3.2.0 + * Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.2 to 3.5.0 + * Bump actions/dependency-review-action from 4.8.1 to 4.8.2 + * Bump com.puppycrawl.tools:checkstyle from 12.1.1 to 12.1.2 + * Bump actions/checkout from 5.0.0 to 6.0.0 + * Bump github/codeql-action from 4.31.2 to 4.31.5 + * Bump maven wrapper from 3.3.3 to 3.3.4 ## 4.10.0 Version 4.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration. diff --git a/docker/pom.xml b/docker/pom.xml index 67926cd68..67b539747 100644 --- a/docker/pom.xml +++ b/docker/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-docker diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 4c0c96f19..af23c66cb 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-integration-tests diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt index 4e7e1f3f3..db31228b5 100644 --- a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt +++ b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/GetPutDeleteObjectIT.kt @@ -97,6 +97,46 @@ internal class GetPutDeleteObjectIT : S3TestBase() { }.isInstanceOf(NoSuchKeyException::class.java) } + @Test + @S3VerifiedSuccess(year = 2025) + fun testPutGetHeadDeleteObject_pathSegments(testInfo: TestInfo) { + val key = "/.././$UPLOAD_FILE_NAME" + val bucketName = givenBucket(testInfo) + + s3Client.putObject( + { + it.bucket(bucketName) + it.key(key) + }, + RequestBody.fromFile(UPLOAD_FILE), + ) + + s3Client.headObject { + it.bucket(bucketName) + it.key(key) + } + + s3Client + .getObject { + it.bucket(bucketName) + it.key(key) + }.use { + assertThat(it.response().contentLength()).isEqualTo(UPLOAD_FILE_LENGTH) + } + + s3Client.deleteObject { + it.bucket(bucketName) + it.key(key) + } + + assertThatThrownBy { + s3Client.getObject { + it.bucket(bucketName) + it.key(key) + } + }.isInstanceOf(NoSuchKeyException::class.java) + } + @Test @S3VerifiedSuccess(year = 2025) fun testPutGetHeadDeleteObjects(testInfo: TestInfo) { @@ -1559,6 +1599,29 @@ internal class GetPutDeleteObjectIT : S3TestBase() { } } + @Test + @S3VerifiedSuccess(year = 2025) + fun testGetObject_rangeDownloads_fail_emptyObject(testInfo: TestInfo) { + val bucketName = givenBucket(testInfo) + s3Client.putObject( + { + it.bucket(bucketName) + it.key(UPLOAD_FILE_NAME) + }, + RequestBody.fromBytes(ByteArray(0)), + ) + val smallRequestEndBytes = 2L + + assertThatThrownBy { + s3Client.getObject { + it.bucket(bucketName) + it.key(UPLOAD_FILE_NAME) + it.range("bytes=-$smallRequestEndBytes") + } + }.isInstanceOf(S3Exception::class.java) + .hasMessageContaining("Service: S3, Status Code: 416") + } + @Test @S3VerifiedSuccess(year = 2025) fun testGetObject_rangeDownloads_finalBytes_prefixOffset(testInfo: TestInfo) { diff --git a/mvnw b/mvnw index e9cf8d330..bd8896bf2 100755 --- a/mvnw +++ b/mvnw @@ -19,7 +19,7 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.3.3 +# Apache Maven Wrapper startup batch script, version 3.3.4 # # Optional ENV vars # ----------------- diff --git a/mvnw.cmd b/mvnw.cmd index 2e2dbe039..92450f932 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -19,7 +19,7 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.3.3 +@REM Apache Maven Wrapper startup batch script, version 3.3.4 @REM @REM Optional ENV vars @REM MVNW_REPOURL - repo url base for downloading maven distribution diff --git a/pom.xml b/pom.xml index 2e953eae4..79618f2b8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.adobe.testing s3mock-parent - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT pom S3Mock - Parent @@ -129,7 +129,7 @@ false 4.0.0 - 3.5.7 + 3.5.8 1.21.3 7.11.0 2.11.0 diff --git a/server/pom.xml b/server/pom.xml index 40426456d..96cacb8c7 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock diff --git a/server/src/test/kotlin/com/adobe/testing/s3mock/ObjectControllerTest.kt b/server/src/test/kotlin/com/adobe/testing/s3mock/ObjectControllerTest.kt index fed00d072..72681128c 100644 --- a/server/src/test/kotlin/com/adobe/testing/s3mock/ObjectControllerTest.kt +++ b/server/src/test/kotlin/com/adobe/testing/s3mock/ObjectControllerTest.kt @@ -146,6 +146,59 @@ internal class ObjectControllerTest : BaseControllerTest() { } + @Test + @Throws(Exception::class) + fun testPutObject_withPathsegments_Ok() { + givenBucket() + val key = ".././sampleFile.txt" + + val testFile = File(UPLOAD_FILE_NAME) + val digest = DigestUtil.hexDigest(Files.newInputStream(testFile.toPath())) + val tempFile = Files.createTempFile("testPutObject_Ok", "").also { + testFile.copyTo(it.toFile(), overwrite = true) + } + whenever( + objectService.toTempFile( + any( + InputStream::class.java + ), any(HttpHeaders::class.java) + ) + ) + .thenReturn( + FileChecksum( + tempFile, + DigestUtil.checksumFor(testFile.toPath(), DefaultChecksumAlgorithm.CRC32) + ) + ) + + whenever( + objectService.putS3Object( + eq(TEST_BUCKET_NAME), + eq(key), + contains(MediaType.TEXT_PLAIN_VALUE), + anyMap(), + any(Path::class.java), + anyMap(), + anyMap(), + isNull(), + isNull(), + isNull(), + eq(Owner.DEFAULT_OWNER), + eq(StorageClass.STANDARD) + ) + ).thenReturn(s3ObjectMetadata(key, digest)) + + mockMvc.perform( + put("/test-bucket/$key") + .content(testFile.readBytes()) + .contentType(MediaType.TEXT_PLAIN) + .accept(MediaType.APPLICATION_XML) + ) + .andExpect(status().isOk) + .andExpect(header().string(HttpHeaders.ETAG, "\"$digest\"")) + } + + @Test @Throws(Exception::class) fun testPutObject_Options() { diff --git a/testsupport/common/pom.xml b/testsupport/common/pom.xml index 81269ea6a..7b7c082d5 100644 --- a/testsupport/common/pom.xml +++ b/testsupport/common/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-testsupport-common diff --git a/testsupport/junit4/pom.xml b/testsupport/junit4/pom.xml index c1d884ef4..3fc3620a0 100644 --- a/testsupport/junit4/pom.xml +++ b/testsupport/junit4/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-junit4 diff --git a/testsupport/junit5/pom.xml b/testsupport/junit5/pom.xml index b894bfe10..bfcb5b3d3 100644 --- a/testsupport/junit5/pom.xml +++ b/testsupport/junit5/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-junit5 diff --git a/testsupport/pom.xml b/testsupport/pom.xml index bbb9cbb54..1a4115cb0 100644 --- a/testsupport/pom.xml +++ b/testsupport/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-parent - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-testsupport-reactor diff --git a/testsupport/testcontainers/pom.xml b/testsupport/testcontainers/pom.xml index 8a0a1f2fb..0e525e763 100644 --- a/testsupport/testcontainers/pom.xml +++ b/testsupport/testcontainers/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-testcontainers diff --git a/testsupport/testng/pom.xml b/testsupport/testng/pom.xml index b92fae89a..64e2de769 100644 --- a/testsupport/testng/pom.xml +++ b/testsupport/testng/pom.xml @@ -22,7 +22,7 @@ com.adobe.testing s3mock-testsupport-reactor - 4.10.1-SNAPSHOT + 4.11.0-SNAPSHOT s3mock-testng