Merge pull request #1475 from versity/sis/bucket-logging-actions-not-implemented

feat: adds not implemented routes for bucket logging actions
This commit is contained in:
Ben McClelland
2025-08-20 17:10:32 -07:00
committed by GitHub
5 changed files with 83 additions and 0 deletions
+5
View File
@@ -645,6 +645,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) {
@@ -1397,6 +1400,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
@@ -15712,6 +15712,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 {