diff --git a/CHANGELOG.md b/CHANGELOG.md index 080a6ca45..0250cb4e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,23 +129,35 @@ Version 3.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Jav * Better description of S3Mock API usage and SDK usage (fixes #219, #125, #1196) * Presigned URLs were working all along. * Added documentation and tests. -* Version updates - * Bump aws-v2.version from 2.20.115 to 2.20.146 - * Bump com.amazonaws:aws-java-sdk-s3 from 1.12.519 to 1.12.548 - * Bump spring-boot.version from 3.1.0 to 3.1.3 - * Bump alpine from 3.18.2 to 3.18.3 in /docker - * Bump testcontainers.version from 1.18.3 to 1.19.0 - * Bump kotlin.version from 1.9.0 to 1.9.10 - * Bump com.puppycrawl.tools:checkstyle from 10.12.2 to 10.12.3 + * Add ListObjectVersions API - dummy implementation (fixes #1215) +* Version updates + * Bump aws-v2.version from 2.20.115 to 2.21.14 + * Bump com.amazonaws:aws-java-sdk-s3 from 1.12.519 to 1.12.580 + * Bump spring-boot.version from 3.1.0 to 3.1.5 + * Bump alpine from 3.18.2 to 3.18.4 in /docker + * Bump testcontainers.version from 1.18.3 to 1.19.1 + * Bump kotlin.version from 1.9.0 to 1.9.20 + * Bump commons-io:commons-io from 2.13.0 to 2.15.0 + * Bump com.puppycrawl.tools:checkstyle from 10.12.2 to 10.12.4 * Bump io.fabric8:docker-maven-plugin from 0.43.2 to 0.43.4 * Bump org.apache.maven.plugins:maven-enforcer-plugin from 3.3.0 to 3.4.1 + * Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0 + * Bump org.apache.maven.plugins:maven-dependency-plugin from 3.6.0 to 3.6.1 + * Bump org.apache.maven.plugins:maven-surefire-plugin from 3.1.2 to 3.2.1 + * Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.1.2 to 3.2.1 + * Bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.3.0 to 3.3.1 + * Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.1 to 3.3.2 + * Bump license-maven-plugin-git.version from 4.2 to 4.3 + * Bump org.jacoco:jacoco-maven-plugin from 0.8.10 to 0.8.11 * Bump org.mockito.kotlin:mockito-kotlin from 5.0.0 to 5.1.0 - * Bump actions/checkout from 3.5.3 to 4.0.0 + * Bump actions/setup-java from 3.12.0 to 3.13.0 + * Bump actions/checkout from 3.5.3 to 4.1.1 * Bump actions/upload-artifact from 3.1.2 to 3.1.3 * Bump actions/dependency-review-action from 3.0.6 to 3.1.0 - * Bump github/codeql-action from 2.21.2 to 2.21.5 + * Bump github/codeql-action from 2.21.2 to 2.22.5 * Bump docker/setup-qemu-action from 2.2.0 to 3.0.0 - * Bump step-security/harden-runner from 2.5.0 to 2.5.1 + * Bump step-security/harden-runner from 2.5.0 to 2.6.0 + * Bump ossf/scorecard-action from 2.2.0 to 2.3.1 ## 3.1.0 3.x is JDK17 LTS bytecode compatible, with Docker and JUnit / direct Java integration. diff --git a/README.md b/README.md index f82298389..43ee7a0a3 100755 --- a/README.md +++ b/README.md @@ -57,105 +57,105 @@ See also the [changelog](CHANGELOG.md) for detailed information about changes in Of these [operations of the Amazon S3 API](https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_Simple_Storage_Service.html), all marked :white_check_mark: are supported by S3Mock: -| Operation | Support | Comment | -|-----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|------------------------| -| [AbortMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) | :white_check_mark: | | -| [CompleteMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) | :white_check_mark: | | -| [CopyObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) | :white_check_mark: | | -| [CreateBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) | :white_check_mark: | | -| [CreateMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) | :white_check_mark: | | -| [DeleteBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) | :white_check_mark: | | -| [DeleteBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) | :x: | | -| [DeleteBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) | :x: | | -| [DeleteBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) | :x: | | -| [DeleteBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) | :x: | | -| [DeleteBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) | :x: | | -| [DeleteBucketLifecycle](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) | :white_check_mark: | | -| [DeleteBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) | :x: | | -| [DeleteBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketOwnershipControls.html) | :x: | | -| [DeleteBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html) | :x: | | -| [DeleteBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) | :x: | | -| [DeleteBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) | :x: | | -| [DeleteBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html) | :x: | | -| [DeleteObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) | :white_check_mark: | | -| [DeleteObjects](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html) | :white_check_mark: | | -| [DeleteObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) | :x: | | -| [DeletePublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) | :x: | | -| [GetBucketAccelerateConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) | :x: | | -| [GetBucketAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAcl.html) | :x: | | -| [GetBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) | :x: | | -| [GetBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html) | :x: | | -| [GetBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) | :x: | | -| [GetBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) | :x: | | -| [GetBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) | :x: | | -| [GetBucketLifecycle](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html) | :x: | Deprecated in S3 API | -| [GetBucketLifecycleConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) | :white_check_mark: | | -| [GetBucketLocation](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html) | :white_check_mark: | | -| [GetBucketLogging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html) | :x: | | -| [GetBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) | :x: | | -| [GetBucketNotification](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotification.html) | :x: | | -| [GetBucketNotificationConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) | :x: | | -| [GetBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketOwnershipControls.html) | :x: | | -| [GetBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html) | :x: | | -| [GetBucketPolicyStatus](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) | :x: | | -| [GetBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) | :x: | | -| [GetBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html) | :x: | | -| [GetBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) | :x: | | -| [GetBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) | :x: | | -| [GetBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html) | :x: | | -| [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) | :white_check_mark: | | -| [GetObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) | :white_check_mark: | | -| [GetObjectAttributes](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) | :white_check_mark: | for objects, not parts | -| [GetObjectLegalHold](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html) | :white_check_mark: | | -| [GetObjectLockConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html) | :white_check_mark: | | -| [GetObjectRetention](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html) | :white_check_mark: | | -| [GetObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) | :white_check_mark: | | -| [GetObjectTorrent](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTorrent.html) | :x: | | -| [GetPublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) | :x: | | -| [HeadBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html) | :white_check_mark: | | -| [HeadObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html) | :white_check_mark: | | -| [ListBucketAnalyticsConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) | :x: | | -| [ListBucketIntelligentTieringConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) | :x: | | -| [ListBucketInventoryConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) | :x: | | -| [ListBucketMetricsConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) | :x: | | -| [ListBuckets](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) | :white_check_mark: | | -| [ListMultipartUploads](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) | :white_check_mark: | | -| [ListObjects](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) | :white_check_mark: | Deprecated in S3 API | -| [ListObjectsV2](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) | :white_check_mark: | | -| [ListObjectVersions](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html) | :x: | | -| [ListParts](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) | :white_check_mark: | | -| [PutBucketAccelerateConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) | :x: | | -| [PutBucketAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html) | :x: | | -| [PutBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) | :x: | | -| [PutBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) | :x: | | -| [PutBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) | :x: | | -| [PutBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) | :x: | | -| [PutBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) | :x: | | -| [PutBucketLifecycle](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) | :x: | Deprecated in S3 API | -| [PutBucketLifecycleConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) | :white_check_mark: | | -| [PutBucketLogging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html) | :x: | | -| [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) | :x: | | -| [PutBucketNotification](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html) | :x: | | -| [PutBucketNotificationConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotificationConfiguration.html) | :x: | | -| [PutBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketOwnershipControls.html) | :x: | | -| [PutBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html) | :x: | | -| [PutBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) | :x: | | -| [PutBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketRequestPayment.html) | :x: | | -| [PutBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) | :x: | | -| [PutBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) | :x: | | -| [PutBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) | :x: | | -| [PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) | :white_check_mark: | | -| [PutObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html) | :white_check_mark: | | -| [PutObjectLegalHold](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLegalHold.html) | :white_check_mark: | | -| [PutObjectLockConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLockConfiguration.html) | :white_check_mark: | | -| [PutObjectRetention](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectRetention.html) | :white_check_mark: | | -| [PutObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) | :white_check_mark: | | -| [PutPublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) | :x: | | -| [RestoreObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) | :x: | | -| [SelectObjectContent](https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html) | :x: | | -| [UploadPart](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) | :white_check_mark: | | -| [UploadPartCopy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) | :white_check_mark: | | -| [WriteGetObjectResponse](https://docs.aws.amazon.com/AmazonS3/latest/API/API_WriteGetObjectResponse.html) | :x: | | +| Operation | Support | Comment | +|-----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|---------------------------| +| [AbortMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) | :white_check_mark: | | +| [CompleteMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) | :white_check_mark: | | +| [CopyObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) | :white_check_mark: | | +| [CreateBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) | :white_check_mark: | | +| [CreateMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) | :white_check_mark: | | +| [DeleteBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) | :white_check_mark: | | +| [DeleteBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) | :x: | | +| [DeleteBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) | :x: | | +| [DeleteBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) | :x: | | +| [DeleteBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) | :x: | | +| [DeleteBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) | :x: | | +| [DeleteBucketLifecycle](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) | :white_check_mark: | | +| [DeleteBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) | :x: | | +| [DeleteBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketOwnershipControls.html) | :x: | | +| [DeleteBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html) | :x: | | +| [DeleteBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) | :x: | | +| [DeleteBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) | :x: | | +| [DeleteBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html) | :x: | | +| [DeleteObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) | :white_check_mark: | | +| [DeleteObjects](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html) | :white_check_mark: | | +| [DeleteObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) | :x: | | +| [DeletePublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) | :x: | | +| [GetBucketAccelerateConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) | :x: | | +| [GetBucketAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAcl.html) | :x: | | +| [GetBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) | :x: | | +| [GetBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html) | :x: | | +| [GetBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) | :x: | | +| [GetBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) | :x: | | +| [GetBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) | :x: | | +| [GetBucketLifecycle](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html) | :x: | Deprecated in S3 API | +| [GetBucketLifecycleConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) | :white_check_mark: | | +| [GetBucketLocation](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html) | :white_check_mark: | | +| [GetBucketLogging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html) | :x: | | +| [GetBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) | :x: | | +| [GetBucketNotification](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotification.html) | :x: | | +| [GetBucketNotificationConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) | :x: | | +| [GetBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketOwnershipControls.html) | :x: | | +| [GetBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html) | :x: | | +| [GetBucketPolicyStatus](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) | :x: | | +| [GetBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) | :x: | | +| [GetBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html) | :x: | | +| [GetBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) | :x: | | +| [GetBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) | :x: | | +| [GetBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html) | :x: | | +| [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) | :white_check_mark: | | +| [GetObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) | :white_check_mark: | | +| [GetObjectAttributes](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) | :white_check_mark: | for objects, not parts | +| [GetObjectLegalHold](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html) | :white_check_mark: | | +| [GetObjectLockConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html) | :white_check_mark: | | +| [GetObjectRetention](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html) | :white_check_mark: | | +| [GetObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) | :white_check_mark: | | +| [GetObjectTorrent](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTorrent.html) | :x: | | +| [GetPublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) | :x: | | +| [HeadBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html) | :white_check_mark: | | +| [HeadObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html) | :white_check_mark: | | +| [ListBucketAnalyticsConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) | :x: | | +| [ListBucketIntelligentTieringConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) | :x: | | +| [ListBucketInventoryConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) | :x: | | +| [ListBucketMetricsConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) | :x: | | +| [ListBuckets](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) | :white_check_mark: | | +| [ListMultipartUploads](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) | :white_check_mark: | | +| [ListObjects](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) | :white_check_mark: | Deprecated in S3 API | +| [ListObjectsV2](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) | :white_check_mark: | | +| [ListObjectVersions](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html) | :white_check_mark: | Only dummy implementation | +| [ListParts](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) | :white_check_mark: | | +| [PutBucketAccelerateConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) | :x: | | +| [PutBucketAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html) | :x: | | +| [PutBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) | :x: | | +| [PutBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) | :x: | | +| [PutBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) | :x: | | +| [PutBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) | :x: | | +| [PutBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) | :x: | | +| [PutBucketLifecycle](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) | :x: | Deprecated in S3 API | +| [PutBucketLifecycleConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) | :white_check_mark: | | +| [PutBucketLogging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html) | :x: | | +| [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) | :x: | | +| [PutBucketNotification](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html) | :x: | | +| [PutBucketNotificationConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotificationConfiguration.html) | :x: | | +| [PutBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketOwnershipControls.html) | :x: | | +| [PutBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html) | :x: | | +| [PutBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) | :x: | | +| [PutBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketRequestPayment.html) | :x: | | +| [PutBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) | :x: | | +| [PutBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) | :x: | | +| [PutBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) | :x: | | +| [PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) | :white_check_mark: | | +| [PutObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html) | :white_check_mark: | | +| [PutObjectLegalHold](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLegalHold.html) | :white_check_mark: | | +| [PutObjectLockConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLockConfiguration.html) | :white_check_mark: | | +| [PutObjectRetention](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectRetention.html) | :white_check_mark: | | +| [PutObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) | :white_check_mark: | | +| [PutPublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) | :x: | | +| [RestoreObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) | :x: | | +| [SelectObjectContent](https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html) | :x: | | +| [UploadPart](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) | :white_check_mark: | | +| [UploadPartCopy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) | :white_check_mark: | | +| [WriteGetObjectResponse](https://docs.aws.amazon.com/AmazonS3/latest/API/API_WriteGetObjectResponse.html) | :x: | | ## Usage diff --git a/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/ListObjectVersionsV2IT.kt b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/ListObjectVersionsV2IT.kt new file mode 100644 index 000000000..bfc37689c --- /dev/null +++ b/integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/ListObjectVersionsV2IT.kt @@ -0,0 +1,67 @@ +/* + * Copyright 2017-2023 Adobe. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.adobe.testing.s3mock.its + +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.groups.Tuple +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.TestInfo +import software.amazon.awssdk.core.sync.RequestBody +import software.amazon.awssdk.services.s3.model.ChecksumAlgorithm +import software.amazon.awssdk.services.s3.model.ListObjectVersionsRequest +import software.amazon.awssdk.services.s3.model.ObjectVersion +import software.amazon.awssdk.services.s3.model.PutObjectRequest +import java.io.File + +internal class ListObjectVersionsV2IT : S3TestBase() { + + @Test + fun testPutObjects_listObjectVersions(testInfo: TestInfo) { + val uploadFile = File(UPLOAD_FILE_NAME) + val bucketName = givenBucketV2(testInfo) + + s3ClientV2.putObject( + PutObjectRequest.builder() + .bucket(bucketName).key("$UPLOAD_FILE_NAME-1") + .checksumAlgorithm(ChecksumAlgorithm.SHA256) + .build(), + RequestBody.fromFile(uploadFile) + ) + + s3ClientV2.putObject( + PutObjectRequest.builder() + .bucket(bucketName).key("$UPLOAD_FILE_NAME-2") + .checksumAlgorithm(ChecksumAlgorithm.SHA256) + .build(), + RequestBody.fromFile(uploadFile) + ) + + val listObjectVersionsResponse = s3ClientV2.listObjectVersions( + ListObjectVersionsRequest.builder() + .bucket(bucketName) + .build() + ) + + assertThat(listObjectVersionsResponse.versions()) + .hasSize(2) + .extracting(ObjectVersion::checksumAlgorithm) + .containsOnly( + Tuple(arrayListOf(ChecksumAlgorithm.SHA256)), + Tuple(arrayListOf(ChecksumAlgorithm.SHA256)) + ) + } +} diff --git a/server/src/main/java/com/adobe/testing/s3mock/BucketController.java b/server/src/main/java/com/adobe/testing/s3mock/BucketController.java index fe001fd5c..98bf8e8df 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/BucketController.java +++ b/server/src/main/java/com/adobe/testing/s3mock/BucketController.java @@ -19,6 +19,7 @@ import static com.adobe.testing.s3mock.util.AwsHttpHeaders.X_AMZ_BUCKET_OBJECT_LOCK_ENABLED; import static com.adobe.testing.s3mock.util.AwsHttpParameters.CONTINUATION_TOKEN; import static com.adobe.testing.s3mock.util.AwsHttpParameters.ENCODING_TYPE; +import static com.adobe.testing.s3mock.util.AwsHttpParameters.KEY_MARKER; import static com.adobe.testing.s3mock.util.AwsHttpParameters.LIFECYCLE; import static com.adobe.testing.s3mock.util.AwsHttpParameters.LIST_TYPE_V2; import static com.adobe.testing.s3mock.util.AwsHttpParameters.LOCATION; @@ -28,14 +29,18 @@ import static com.adobe.testing.s3mock.util.AwsHttpParameters.NOT_LOCATION; import static com.adobe.testing.s3mock.util.AwsHttpParameters.NOT_OBJECT_LOCK; import static com.adobe.testing.s3mock.util.AwsHttpParameters.NOT_UPLOADS; +import static com.adobe.testing.s3mock.util.AwsHttpParameters.NOT_VERSIONS; import static com.adobe.testing.s3mock.util.AwsHttpParameters.OBJECT_LOCK; import static com.adobe.testing.s3mock.util.AwsHttpParameters.START_AFTER; +import static com.adobe.testing.s3mock.util.AwsHttpParameters.VERSIONS; +import static com.adobe.testing.s3mock.util.AwsHttpParameters.VERSION_ID_MARKER; import static org.springframework.http.MediaType.APPLICATION_XML_VALUE; import com.adobe.testing.s3mock.dto.BucketLifecycleConfiguration; import com.adobe.testing.s3mock.dto.ListAllMyBucketsResult; import com.adobe.testing.s3mock.dto.ListBucketResult; import com.adobe.testing.s3mock.dto.ListBucketResultV2; +import com.adobe.testing.s3mock.dto.ListVersionsResult; import com.adobe.testing.s3mock.dto.LocationConstraint; import com.adobe.testing.s3mock.dto.ObjectLockConfiguration; import com.adobe.testing.s3mock.service.BucketService; @@ -350,7 +355,8 @@ public ResponseEntity getBucketLocation( NOT_OBJECT_LOCK, NOT_LIST_TYPE, NOT_LIFECYCLE, - NOT_LOCATION + NOT_LOCATION, + NOT_VERSIONS }, produces = APPLICATION_XML_VALUE ) @@ -412,4 +418,49 @@ public ResponseEntity listObjectsV2( return ResponseEntity.ok(listBucketResultV2); } + + /** + * Retrieve list of versions of an object of a bucket. + * API Reference + * + * @param bucketName {@link String} set bucket name + * @param prefix {@link String} find object names they start with prefix + * @param startAfter {@link String} return key names after a specific object key in your key + * space + * @param maxKeys {@link Integer} set maximum number of keys to be returned + * @param continuationToken {@link String} pagination token returned by previous request + * + * @return {@link ListVersionsResult} a list of objects in Bucket + */ + @GetMapping( + value = { + //AWS SDK V2 pattern + "/{bucketName:.+}", + //AWS SDK V1 pattern + "/{bucketName:.+}/" + }, + params = { + VERSIONS + }, + produces = APPLICATION_XML_VALUE + ) + public ResponseEntity listObjectVersions( + @PathVariable String bucketName, + @RequestParam(required = false) String prefix, + @RequestParam(required = false) String delimiter, + @RequestParam(name = KEY_MARKER, required = false) String keyMarker, + @RequestParam(name = VERSION_ID_MARKER, required = false) String versionIdMarker, + @RequestParam(name = ENCODING_TYPE, required = false) String encodingType, + @RequestParam(name = START_AFTER, required = false) String startAfter, + @RequestParam(name = MAX_KEYS, defaultValue = "1000", required = false) Integer maxKeys, + @RequestParam(name = CONTINUATION_TOKEN, required = false) String continuationToken) { + bucketService.verifyBucketExists(bucketName); + bucketService.verifyMaxKeys(maxKeys); + bucketService.verifyEncodingType(encodingType); + var listVersionsResult = + bucketService.listVersions(bucketName, prefix, delimiter, encodingType, startAfter, + maxKeys, continuationToken, keyMarker, versionIdMarker); + + return ResponseEntity.ok(listVersionsResult); + } } diff --git a/server/src/main/java/com/adobe/testing/s3mock/dto/DeleteMarkerEntry.java b/server/src/main/java/com/adobe/testing/s3mock/dto/DeleteMarkerEntry.java new file mode 100644 index 000000000..55573893b --- /dev/null +++ b/server/src/main/java/com/adobe/testing/s3mock/dto/DeleteMarkerEntry.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017-2023 Adobe. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.adobe.testing.s3mock.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * API Reference. + */ +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public record DeleteMarkerEntry( + @JsonProperty("IsLatest") + Boolean isLatest, + @JsonProperty("Key") + String key, + @JsonProperty("LastModified") + String lastModified, + @JsonProperty("Owner") + Owner owner, + @JsonProperty("VersionId") + String versionId +) { + +} diff --git a/server/src/main/java/com/adobe/testing/s3mock/dto/ListVersionsResult.java b/server/src/main/java/com/adobe/testing/s3mock/dto/ListVersionsResult.java new file mode 100644 index 000000000..13ed893b2 --- /dev/null +++ b/server/src/main/java/com/adobe/testing/s3mock/dto/ListVersionsResult.java @@ -0,0 +1,64 @@ +/* + * Copyright 2017-2023 Adobe. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.adobe.testing.s3mock.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import java.util.List; + +/** + * Represents a result of listing object versions that reside in a Bucket. + * API Reference + */ +@JsonRootName("ListBucketResult") +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public record ListVersionsResult( + @JsonProperty("Name") + String name, + @JsonProperty("Prefix") + String prefix, + @JsonProperty("MaxKeys") + int maxKeys, + @JsonProperty("IsTruncated") + boolean isTruncated, + @JsonProperty("CommonPrefixes") + @JacksonXmlElementWrapper(useWrapping = false) + List commonPrefixes, + @JsonProperty("Delimiter") + String delimiter, + @JsonProperty("EncodingType") + String encodingType, + @JsonProperty("KeyMarker") + String keyMarker, + @JsonProperty("VersionIdMarker") + String versionIdMarker, + @JsonProperty("NextKeyMarker") + String nextKeyMarker, + @JsonProperty("NextVersionIdMarker") + String nextVersionIdMarker, + @JsonProperty("Version") + @JacksonXmlElementWrapper(useWrapping = false) + List objectVersions, + @JsonProperty("DeleteMarker") + @JacksonXmlElementWrapper(useWrapping = false) + List deleteMarkers + +) { + +} diff --git a/server/src/main/java/com/adobe/testing/s3mock/dto/ObjectVersion.java b/server/src/main/java/com/adobe/testing/s3mock/dto/ObjectVersion.java new file mode 100644 index 000000000..55922f286 --- /dev/null +++ b/server/src/main/java/com/adobe/testing/s3mock/dto/ObjectVersion.java @@ -0,0 +1,67 @@ +/* + * Copyright 2017-2023 Adobe. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.adobe.testing.s3mock.dto; + +import static com.adobe.testing.s3mock.util.EtagUtil.normalizeEtag; + +import com.adobe.testing.s3mock.store.S3ObjectMetadata; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * API Reference. + */ +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public record ObjectVersion( + @JsonProperty("Key") + String key, + @JsonProperty("LastModified") + String lastModified, + @JsonProperty("ETag") + String etag, + @JsonProperty("Size") + String size, + @JsonProperty("StorageClass") + StorageClass storageClass, + @JsonProperty("Owner") + Owner owner, + @JsonProperty("ChecksumAlgorithm") + ChecksumAlgorithm checksumAlgorithm, + @JsonProperty("IsLatest") + Boolean isLatest, + @JsonProperty("VersionId") + String versionId +) { + + public ObjectVersion { + etag = normalizeEtag(etag); + } + + public static ObjectVersion from(S3ObjectMetadata s3ObjectMetadata) { + return new ObjectVersion(s3ObjectMetadata.key(), + s3ObjectMetadata.modificationDate(), s3ObjectMetadata.etag(), + s3ObjectMetadata.size(), StorageClass.STANDARD, Owner.DEFAULT_OWNER, + s3ObjectMetadata.checksumAlgorithm(), true, "staticVersion"); + } + + public static ObjectVersion from(S3Object s3Object) { + return new ObjectVersion(s3Object.key(), + s3Object.lastModified(), s3Object.etag(), + s3Object.size(), StorageClass.STANDARD, Owner.DEFAULT_OWNER, + s3Object.checksumAlgorithm(), true, "staticVersion"); + } +} diff --git a/server/src/main/java/com/adobe/testing/s3mock/service/BucketService.java b/server/src/main/java/com/adobe/testing/s3mock/service/BucketService.java index c63cfa5dc..64f89dc15 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/service/BucketService.java +++ b/server/src/main/java/com/adobe/testing/s3mock/service/BucketService.java @@ -35,7 +35,9 @@ import com.adobe.testing.s3mock.dto.ListAllMyBucketsResult; import com.adobe.testing.s3mock.dto.ListBucketResult; import com.adobe.testing.s3mock.dto.ListBucketResultV2; +import com.adobe.testing.s3mock.dto.ListVersionsResult; import com.adobe.testing.s3mock.dto.ObjectLockConfiguration; +import com.adobe.testing.s3mock.dto.ObjectVersion; import com.adobe.testing.s3mock.dto.Prefix; import com.adobe.testing.s3mock.dto.S3Object; import com.adobe.testing.s3mock.store.BucketStore; @@ -160,6 +162,36 @@ public List getS3Objects(String bucketName, String prefix) { .toList(); } + public ListVersionsResult listVersions(String bucketName, + String prefix, + String delimiter, + String encodingType, + String startAfter, + Integer maxKeys, + String continuationToken, + String keyMarker, + String versionIdMarker) { + //first implementation with dummy versions, just list objects for now. + ListBucketResultV2 result = listObjectsV2(bucketName, prefix, delimiter, encodingType, + startAfter, maxKeys, continuationToken); + + var versions = result.contents().stream().map(ObjectVersion::from).toList(); + + return new ListVersionsResult(result.name(), + result.prefix(), + result.maxKeys(), + result.isTruncated(), + result.commonPrefixes(), + delimiter, + result.encodingType(), + result.continuationToken(), + null, + result.nextContinuationToken(), + null, + versions, + null); + } + public ListBucketResultV2 listObjectsV2(String bucketName, String prefix, String delimiter, diff --git a/server/src/main/java/com/adobe/testing/s3mock/util/AwsHttpParameters.java b/server/src/main/java/com/adobe/testing/s3mock/util/AwsHttpParameters.java index a2fabeb63..b7a82908d 100644 --- a/server/src/main/java/com/adobe/testing/s3mock/util/AwsHttpParameters.java +++ b/server/src/main/java/com/adobe/testing/s3mock/util/AwsHttpParameters.java @@ -28,7 +28,11 @@ public class AwsHttpParameters { public static final String CONTINUATION_TOKEN = "continuation-token"; public static final String DELETE = "delete"; public static final String ENCODING_TYPE = "encoding-type"; + public static final String KEY_MARKER = "key-marker"; + public static final String VERSION_ID_MARKER = "version-id-marker"; public static final String LIST_TYPE_V2 = "list-type=2"; + public static final String VERSIONS = "versions"; + public static final String NOT_VERSIONS = "!versions"; public static final String NOT_LIST_TYPE = "!list-type"; public static final String MAX_KEYS = "max-keys"; public static final String PART_NUMBER = "partNumber";