mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-23 14:30:46 +02:00
fixes
With these final fixes, the s3-tests should now: ✅ Return MalformedXML for ObjectLockEnabled: 'Disabled' ✅ Return MalformedXML when both Days and Years are specified in retention configuration ✅ Return InvalidBucketState (409 Conflict) when trying to suspend versioning on buckets with object lock enabled ✅ Handle all object lock validation errors consistently with proper error codes
This commit is contained in:
1 parent
9f88fd2ea5
commit
1bc503530a
3 files changed
+20
-6
No files matched your search
@@ -188,18 +188,19 @@ func validateLegalHold(legalHold *ObjectLegalHold) error {
|
||||
func validateObjectLockConfiguration(config *ObjectLockConfiguration) error {
|
||||
// ObjectLockEnabled is required for bucket-level configuration
|
||||
if config.ObjectLockEnabled == "" {
|
||||
return fmt.Errorf("object lock configuration must specify ObjectLockEnabled")
|
||||
return ErrInvalidRetentionMode
|
||||
}
|
||||
|
||||
// Validate ObjectLockEnabled value
|
||||
if config.ObjectLockEnabled != s3_constants.ObjectLockEnabled {
|
||||
return fmt.Errorf("invalid object lock enabled value: %s", config.ObjectLockEnabled)
|
||||
// ObjectLockEnabled can only be 'Enabled', any other value (including 'Disabled') is malformed XML
|
||||
return ErrInvalidRetentionMode
|
||||
}
|
||||
|
||||
// Validate Rule if present
|
||||
if config.Rule != nil {
|
||||
if config.Rule.DefaultRetention == nil {
|
||||
return fmt.Errorf("rule configuration must specify DefaultRetention")
|
||||
return ErrInvalidRetentionPeriod
|
||||
}
|
||||
return validateDefaultRetention(config.Rule.DefaultRetention)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user