feat: adds not implemented routes for bucket lifecycle configuration actions

Closes #1443

Adds `NotImplemented` routes for bucket lifecycle configuration S3 actions.
- `PutBucketLifecycleConfiguration`
- `GetBucketLifecycleConfiguration`
- `DeleteBucketLifecycle`
This commit is contained in:
niksis02
2025-08-20 20:48:58 +04:00
parent 5fb73deef1
commit 025b0ee3c8
5 changed files with 111 additions and 0 deletions
+7
View File
@@ -603,6 +603,10 @@ func TestNotImplementedActions(s *S3Conf) {
GetBucketInventoryConfiguration_not_implemented(s)
ListBucketInventoryConfiguration_not_implemented(s)
DeleteBucketInventoryConfiguration_not_implemented(s)
// bucket lifecycle configuration actions
PutBucketLifecycleConfiguration_not_implemented(s)
GetBucketLifecycleConfiguration_not_implemented(s)
DeleteBucketLifecycle_not_implemented(s)
}
func TestWORMProtection(s *S3Conf) {
@@ -1325,6 +1329,9 @@ func GetIntTests() IntTests {
"GetBucketInventoryConfiguration_not_implemented": GetBucketInventoryConfiguration_not_implemented,
"ListBucketInventoryConfiguration_not_implemented": ListBucketInventoryConfiguration_not_implemented,
"DeleteBucketInventoryConfiguration_not_implemented": DeleteBucketInventoryConfiguration_not_implemented,
"PutBucketLifecycleConfiguration_not_implemented": PutBucketLifecycleConfiguration_not_implemented,
"GetBucketLifecycleConfiguration_not_implemented": GetBucketLifecycleConfiguration_not_implemented,
"DeleteBucketLifecycle_not_implemented": DeleteBucketLifecycle_not_implemented,
"WORMProtection_bucket_object_lock_configuration_compliance_mode": WORMProtection_bucket_object_lock_configuration_compliance_mode,
"WORMProtection_bucket_object_lock_configuration_governance_mode": WORMProtection_bucket_object_lock_configuration_governance_mode,
"WORMProtection_bucket_object_lock_governance_bypass_delete": WORMProtection_bucket_object_lock_governance_bypass_delete,
+57
View File
@@ -14867,6 +14867,63 @@ func DeleteBucketInventoryConfiguration_not_implemented(s *S3Conf) error {
})
}
func PutBucketLifecycleConfiguration_not_implemented(s *S3Conf) error {
testName := "PutBucketLifecycleConfiguration_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.PutBucketAnalyticsConfiguration(ctx,
&s3.PutBucketAnalyticsConfigurationInput{
Bucket: &bucket,
Id: getPtr("unique_id"),
AnalyticsConfiguration: &types.AnalyticsConfiguration{
Id: getPtr("my-id"),
StorageClassAnalysis: &types.StorageClassAnalysis{
DataExport: &types.StorageClassAnalysisDataExport{
Destination: &types.AnalyticsExportDestination{
S3BucketDestination: &types.AnalyticsS3BucketDestination{
Bucket: &bucket,
Format: types.AnalyticsS3ExportFileFormatCsv,
},
},
OutputSchemaVersion: types.StorageClassAnalysisSchemaVersionV1,
},
},
},
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func GetBucketLifecycleConfiguration_not_implemented(s *S3Conf) error {
testName := "GetBucketLifecycleConfiguration_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.GetBucketLifecycleConfiguration(ctx,
&s3.GetBucketLifecycleConfigurationInput{
Bucket: &bucket,
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func DeleteBucketLifecycle_not_implemented(s *S3Conf) error {
testName := "DeleteBucketLifecycle_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.DeleteBucketLifecycle(ctx,
&s3.DeleteBucketLifecycleInput{
Bucket: &bucket,
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func WORMProtection_bucket_object_lock_configuration_compliance_mode(s *S3Conf) error {
testName := "WORMProtection_bucket_object_lock_configuration_compliance_mode"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {