[xwiki/xwiki-commons] 9cbe01: XCOMMONS-3823: Allow using the S3 blob store with ...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-commons Commit: 9cbe0198de267acd40a9ae4cfbaba75e25935a33 https://github.com/xwiki/xwiki-commons/commit/9cbe0198de267acd40a9ae4cfbaba7... Author: ciaens <[email protected]> Date: 2026-10-15 (Thu, 15 Oct 2026) Changed paths: M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-api/src/main/java/org/xwiki/store/blob/BlobWriteMode.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/pom.xml M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/main/java/org/xwiki/store/blob/internal/S3Blob.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/main/java/org/xwiki/store/blob/internal/S3BlobOutputStream.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/main/java/org/xwiki/store/blob/internal/S3BlobStore.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/main/java/org/xwiki/store/blob/internal/S3BlobStoreConfiguration.java A xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/main/java/org/xwiki/store/blob/internal/S3ConditionalWriteSupport.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/main/java/org/xwiki/store/blob/internal/S3CopyOperations.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/main/java/org/xwiki/store/blob/internal/S3MultipartUploadHelper.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/test/java/org/xwiki/store/blob/internal/S3BlobOutputStreamTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/test/java/org/xwiki/store/blob/internal/S3BlobStoreConfigurationTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/test/java/org/xwiki/store/blob/internal/S3BlobStoreTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/test/java/org/xwiki/store/blob/internal/S3BlobTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/test/java/org/xwiki/store/blob/internal/S3CopyOperationsTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-s3/src/test/java/org/xwiki/store/blob/internal/S3MultipartUploadHelperTest.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-test/xwiki-commons-store-blob-test-docker/src/test/it/org/xwiki/store/blob/AllIT.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-test/xwiki-commons-store-blob-test-docker/src/test/it/org/xwiki/store/blob/BlobStoreContainer.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-test/xwiki-commons-store-blob-test-docker/src/test/it/org/xwiki/store/blob/BlobStoreExtension.java M xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-test/xwiki-commons-store-blob-test-docker/src/test/it/org/xwiki/store/blob/S3BlobStoreIT.java A xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-test/xwiki-commons-store-blob-test-docker/src/test/it/org/xwiki/store/blob/S3BlobStoreWithoutConditionalCopiesIT.java A xwiki-commons-core/xwiki-commons-store/xwiki-commons-store-blob/xwiki-commons-store-blob-test/xwiki-commons-store-blob-test-docker/src/test/it/org/xwiki/store/blob/S3BlobStoreWithoutConditionalRequestsIT.java Log Message: ----------- XCOMMONS-3823: Allow using the S3 blob store with services that don't support conditional writes (#2043) * Add the `store.s3.conditionalWrites` property (default true): the `If-None-Match` condition of uploads (PutObject and CompleteMultipartUpload), for S3-compatible services that don't implement conditional writes. * Add the `store.s3.conditionalCopies` property (default true): the conditions of copies (`If-None-Match` on CopyObject, `x-amz-copy-source-if-match` on UploadPartCopy), for services that support the condition of uploads but not those of copies (OVHcloud Object Storage rejects any condition on CopyObject with 501 Not Implemented and fails the UploadPartCopy precondition for sources uploaded in several parts). * Stop sending the source ETag precondition on CopyObject: a single CopyObject reads the source once, so it adds little. * Always check that the object is absent before a `CREATE_NEW` write, also when the condition header is sent, since some services ignore unsupported headers; the condition, when enabled, makes the check atomic. * When the source precondition is not sent on UploadPartCopy, check the source again (ETag, size, last modification) before completing a multipart copy and abort it if the source changed or was deleted. * Name the property to change only when the service answered 501 to a request that carried a condition, and name the property that governs that request in the top-level message; explain a 412 on UploadPartCopy, and a 403 on the existence check (the credentials need to list the bucket). * Throw `BlobAlreadyExistsException` when a copy or move loses a `CREATE_NEW` race (412 on CopyObject or CompleteMultipartUpload, or the target found before completing a multipart copy), as `BlobStore` documents. * Document in `BlobWriteMode` that `CREATE_NEW` is not guaranteed to be atomic. * Remove the superseded constructors of the internal `S3BlobOutputStream` and `S3MultipartUploadHelper`. * Read both properties from the configuration only (`S3BlobStoreConfiguration`), like the endpoint and the credentials of the S3 client that all S3 blob stores share: they describe the S3 service, not a store. * Raise the coverage threshold of `xwiki-commons-store-blob-s3` to 0.93. * Read the conditional request properties of the integration tests in `BlobStoreExtension`, which passes them to the mocked configuration so that `CrossStoreBlobStoreIT` uses them too, and run `S3BlobStoreIT` against SILO with the conditions of copies disabled and with all conditions disabled. Co-authored-by: Claude <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-commons/settings/notifications
participants (1)
-
XWiki Notifications