fix: adds not implemented routes for bucket analytics s3 actions.

Fixes #1433
Fixes #1437
Fixes #1438

Adds 4 routes to return `NotImplemented` for bucket analytics `S3` actions:

- `PutBucketAnalyticsConfiguration`
- `GetBucketAnalyticsConfiguration`
- `DeleteBucketAnalyticsConfiguration`
- `ListBucketAnalyticsConfiguration`
This commit is contained in:
niksis02
2025-08-19 02:14:31 +04:00
parent f31a56316b
commit 8db196634b
5 changed files with 197 additions and 51 deletions
+11
View File
@@ -583,6 +583,13 @@ func TestGetObjectLegalHold(s *S3Conf) {
GetObjectLegalHold_success(s)
}
func TestNotImplementedActions(s *S3Conf) {
PutBucketAnalyticsConfiguration_not_implemented(s)
GetBucketAnalyticsConfiguration_not_implemented(s)
ListBucketAnalyticsConfiguration_not_implemented(s)
DeleteBucketAnalyticsConfiguration_not_implemented(s)
}
func TestWORMProtection(s *S3Conf) {
WORMProtection_bucket_object_lock_configuration_compliance_mode(s)
WORMProtection_bucket_object_lock_configuration_governance_mode(s)
@@ -1288,6 +1295,10 @@ func GetIntTests() IntTests {
"GetObjectLegalHold_disabled_lock": GetObjectLegalHold_disabled_lock,
"GetObjectLegalHold_unset_config": GetObjectLegalHold_unset_config,
"GetObjectLegalHold_success": GetObjectLegalHold_success,
"PutBucketAnalyticsConfiguration_not_implemented": PutBucketAnalyticsConfiguration_not_implemented,
"GetBucketAnalyticsConfiguration_not_implemented": GetBucketAnalyticsConfiguration_not_implemented,
"ListBucketAnalyticsConfiguration_not_implemented": ListBucketAnalyticsConfiguration_not_implemented,
"DeleteBucketAnalyticsConfiguration_not_implemented": DeleteBucketAnalyticsConfiguration_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,
+73
View File
@@ -14594,6 +14594,79 @@ func GetObjectLegalHold_success(s *S3Conf) error {
}, withLock())
}
func PutBucketAnalyticsConfiguration_not_implemented(s *S3Conf) error {
testName := "PutBucketAnalyticsConfiguration_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("uniquie_id"),
AnalyticsConfiguration: &types.AnalyticsConfiguration{
Id: getPtr("my-id"),
StorageClassAnalysis: &types.StorageClassAnalysis{
DataExport: &types.StorageClassAnalysisDataExport{
OutputSchemaVersion: types.StorageClassAnalysisSchemaVersionV1,
Destination: &types.AnalyticsExportDestination{
S3BucketDestination: &types.AnalyticsS3BucketDestination{
Bucket: &bucket,
Format: types.AnalyticsS3ExportFileFormatCsv,
},
},
},
},
},
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func GetBucketAnalyticsConfiguration_not_implemented(s *S3Conf) error {
testName := "GetBucketAnalyticsConfiguration_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.GetBucketAnalyticsConfiguration(ctx,
&s3.GetBucketAnalyticsConfigurationInput{
Bucket: &bucket,
Id: getPtr("uniquie_id"),
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func ListBucketAnalyticsConfiguration_not_implemented(s *S3Conf) error {
testName := "ListBucketAnalyticsConfiguration_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.ListBucketAnalyticsConfigurations(ctx,
&s3.ListBucketAnalyticsConfigurationsInput{
Bucket: &bucket,
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func DeleteBucketAnalyticsConfiguration_not_implemented(s *S3Conf) error {
testName := "DeleteBucketAnalyticsConfiguration_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.DeleteBucketAnalyticsConfiguration(ctx,
&s3.DeleteBucketAnalyticsConfigurationInput{
Bucket: &bucket,
Id: getPtr("uniquie_id"),
})
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 {