feat: adds not implemented routes for bucket ecryption actions

Closes #1439

Adds `NotImplemented` routes for bucket encryption S3 actions:

- `PutBucketEncryption`
- `GetBucketEncryption`
- `DeleteBucketEncryption`
This commit is contained in:
niksis02
2025-08-19 20:30:02 +04:00
parent 8db196634b
commit ed92ad3daa
5 changed files with 114 additions and 7 deletions
+8
View File
@@ -584,10 +584,15 @@ func TestGetObjectLegalHold(s *S3Conf) {
}
func TestNotImplementedActions(s *S3Conf) {
// bucket analytics actions
PutBucketAnalyticsConfiguration_not_implemented(s)
GetBucketAnalyticsConfiguration_not_implemented(s)
ListBucketAnalyticsConfiguration_not_implemented(s)
DeleteBucketAnalyticsConfiguration_not_implemented(s)
// bucket encryption actions
PutBucketEncryption_not_implemented(s)
GetBucketEncryption_not_implemented(s)
DeleteBucketEncryption_not_implemented(s)
}
func TestWORMProtection(s *S3Conf) {
@@ -1299,6 +1304,9 @@ func GetIntTests() IntTests {
"GetBucketAnalyticsConfiguration_not_implemented": GetBucketAnalyticsConfiguration_not_implemented,
"ListBucketAnalyticsConfiguration_not_implemented": ListBucketAnalyticsConfiguration_not_implemented,
"DeleteBucketAnalyticsConfiguration_not_implemented": DeleteBucketAnalyticsConfiguration_not_implemented,
"PutBucketEncryption_not_implemented": PutBucketEncryption_not_implemented,
"GetBucketEncryption_not_implemented": GetBucketEncryption_not_implemented,
"DeleteBucketEncryption_not_implemented": DeleteBucketEncryption_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,
+51
View File
@@ -14667,6 +14667,57 @@ func DeleteBucketAnalyticsConfiguration_not_implemented(s *S3Conf) error {
})
}
func PutBucketEncryption_not_implemented(s *S3Conf) error {
testName := "PutBucketEncryption_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.PutBucketEncryption(ctx,
&s3.PutBucketEncryptionInput{
Bucket: &bucket,
ServerSideEncryptionConfiguration: &types.ServerSideEncryptionConfiguration{
Rules: []types.ServerSideEncryptionRule{
{
ApplyServerSideEncryptionByDefault: &types.ServerSideEncryptionByDefault{
SSEAlgorithm: types.ServerSideEncryptionAes256,
},
},
},
},
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func GetBucketEncryption_not_implemented(s *S3Conf) error {
testName := "GetBucketEncryption_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.GetBucketEncryption(ctx,
&s3.GetBucketEncryptionInput{
Bucket: &bucket,
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func DeleteBucketEncryption_not_implemented(s *S3Conf) error {
testName := "DeleteBucketEncryption_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.DeleteBucketEncryption(ctx,
&s3.DeleteBucketEncryptionInput{
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 {