mirror of
https://github.com/versity/versitygw.git
synced 2026-09-19 06:32:10 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user