versity / versitygw

versity s3 gateway
https://www.versity.com/products/versitygw/
Apache License 2.0
169 stars 21 forks source link

[Bug] - REST GetBucketVersioning command not returning correct format, missing Status value #843

Open lrm25 opened 4 days ago

lrm25 commented 4 days ago

Describe the bug Direct to s3, responses similar to the following are returned:

<?xml version="1.0" encoding="UTF-8"?>
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>
<?xml version="1.0" encoding="UTF-8"?>
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Status>Enabled</Status></VersioningConfiguration>
<?xml version="1.0" encoding="UTF-8"?>
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Status>Suspended</Status></VersioningConfiguration>

However, with versitygw, a message similar to the following is returned:

<?xml version="1.0" encoding="UTF-8"?>
<GetBucketVersioningOutput><MFADelete></MFADelete><Status></Status><ResultMetadata></ResultMetadata></GetBucketVersioningOutput>

The topmost element name is different, and the Status value is not being returned, even if the versioning value is added or changed. Also, the ResultMetadata value doesn't exist in the GetBucketVersioning response syntax in the S3 documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html).

To Reproduce

  1. Send an initial GetBucketVersioning REST command to both versitygw, and direct to s3. View the XML results. (a script for this is available: https://github.com/versity/versitygw/blob/test_cmdline_rest_retention/tests/rest_scripts/get_bucket_versioning.sh)
  2. Send a PutBucketVersioning command changing the versioning status to Enabled (script: https://github.com/versity/versitygw/blob/test_cmdline_rest_retention/tests/rest_scripts/put_bucket_versioning.sh).
  3. Repeat step 1.
  4. Send a PutBucketVersioning command changing the status to Suspended.
  5. Repeat step 1.

Expected behavior versitygw XML matches that of direct-to-s3 XML, and the Status value correctly changes

Server Version Version : v1.0.7 Build : b7291c3 BuildTime: 2024-09-25_08:28:23PM Darwin Lukes-MacBook-Pro.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64