feat: adds not implemented routes for bucket logging actions

Closes #1444

Adds `NotImplemented` routes for bucket logging S3 actions:
- `PutBucketLogging`
- `GetBucketLogging`
This commit is contained in:
niksis02
2025-08-20 21:07:09 +04:00
parent 025b0ee3c8
commit 5f28a7449e
5 changed files with 83 additions and 0 deletions
+5
View File
@@ -607,6 +607,9 @@ func TestNotImplementedActions(s *S3Conf) {
PutBucketLifecycleConfiguration_not_implemented(s)
GetBucketLifecycleConfiguration_not_implemented(s)
DeleteBucketLifecycle_not_implemented(s)
// bucket logging actions
PutBucketLogging_not_implemented(s)
GetBucketLogging_not_implemented(s)
}
func TestWORMProtection(s *S3Conf) {
@@ -1332,6 +1335,8 @@ func GetIntTests() IntTests {
"PutBucketLifecycleConfiguration_not_implemented": PutBucketLifecycleConfiguration_not_implemented,
"GetBucketLifecycleConfiguration_not_implemented": GetBucketLifecycleConfiguration_not_implemented,
"DeleteBucketLifecycle_not_implemented": DeleteBucketLifecycle_not_implemented,
"PutBucketLogging_not_implemented": PutBucketLogging_not_implemented,
"GetBucketLogging_not_implemented": GetBucketLogging_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,
+46
View File
@@ -14924,6 +14924,52 @@ func DeleteBucketLifecycle_not_implemented(s *S3Conf) error {
})
}
func PutBucketLogging_not_implemented(s *S3Conf) error {
testName := "PutBucketLogging_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.PutBucketLogging(ctx,
&s3.PutBucketLoggingInput{
Bucket: &bucket,
BucketLoggingStatus: &types.BucketLoggingStatus{
LoggingEnabled: &types.LoggingEnabled{
TargetBucket: &bucket,
TargetGrants: []types.TargetGrant{
{
Grantee: &types.Grantee{
Type: types.TypeCanonicalUser,
ID: getPtr("grt1"),
},
Permission: types.BucketLogsPermissionRead,
},
},
TargetObjectKeyFormat: &types.TargetObjectKeyFormat{
SimplePrefix: &types.SimplePrefix{},
},
TargetPrefix: getPtr("prefix"),
},
},
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func GetBucketLogging_not_implemented(s *S3Conf) error {
testName := "GetBucketLogging_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.GetBucketLogging(ctx,
&s3.GetBucketLoggingInput{
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 {