S3: S3 Object Retention API to include XML namespace support (#7517)
* Refactor S3 Object Retention API to include XML namespace support and improve compatibility with Veeam. Updated XML tags to remove hardcoded namespaces and added test cases for retention and legal hold configurations without namespaces. * Added XMLNS field setting in both places
This commit is contained in:
@@ -86,6 +86,9 @@ func (s3a *S3ApiServer) GetObjectLockConfigurationHandler(w http.ResponseWriter,
|
||||
|
||||
// Check if we have cached Object Lock configuration
|
||||
if bucketConfig.ObjectLockConfig != nil {
|
||||
// Set namespace for S3 compatibility
|
||||
bucketConfig.ObjectLockConfig.XMLNS = s3_constants.S3Namespace
|
||||
|
||||
// Use cached configuration and marshal it to XML for response
|
||||
marshaledXML, err := xml.Marshal(bucketConfig.ObjectLockConfig)
|
||||
if err != nil {
|
||||
@@ -139,6 +142,9 @@ func (s3a *S3ApiServer) GetObjectLockConfigurationHandler(w http.ResponseWriter,
|
||||
// not just ObjectLockConfig, before resetting the TTL
|
||||
s3a.updateBucketConfigCacheFromEntry(freshEntry)
|
||||
|
||||
// Set namespace for S3 compatibility
|
||||
objectLockConfig.XMLNS = s3_constants.S3Namespace
|
||||
|
||||
// Marshal and return the configuration
|
||||
marshaledXML, err := xml.Marshal(objectLockConfig)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user