feat: adds not implemented routes for bucket replication actions

Closes #1449

Adds `NotImplemented` routes for bucket replication S3 actions:
- `PutBucketReplication`
- `GetBucketReplication`
- `DeleteBucketReplication`

Adds missing actions in metrics `ActionMap`
This commit is contained in:
niksis02
2025-08-21 16:44:29 +04:00
parent 45a1f7ae7c
commit 88f84bfd89
5 changed files with 246 additions and 1 deletions
+7
View File
@@ -655,6 +655,10 @@ func TestNotImplementedActions(s *S3Conf) {
GetBucketMetricsConfiguration_not_implemented(s)
ListBucketMetricsConfigurations_not_implemented(s)
DeleteBucketMetricsConfiguration_not_implemented(s)
// bucket replication actions
PutBucketReplication_not_implemented(s)
GetBucketReplication_not_implemented(s)
DeleteBucketReplication_not_implemented(s)
}
func TestWORMProtection(s *S3Conf) {
@@ -1414,6 +1418,9 @@ func GetIntTests() IntTests {
"GetBucketMetricsConfiguration_not_implemented": GetBucketMetricsConfiguration_not_implemented,
"ListBucketMetricsConfigurations_not_implemented": ListBucketMetricsConfigurations_not_implemented,
"DeleteBucketMetricsConfiguration_not_implemented": DeleteBucketMetricsConfiguration_not_implemented,
"PutBucketReplication_not_implemented": PutBucketReplication_not_implemented,
"GetBucketReplication_not_implemented": GetBucketReplication_not_implemented,
"DeleteBucketReplication_not_implemented": DeleteBucketReplication_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,
+57
View File
@@ -15832,6 +15832,63 @@ func DeleteBucketMetricsConfiguration_not_implemented(s *S3Conf) error {
})
}
func PutBucketReplication_not_implemented(s *S3Conf) error {
testName := "PutBucketReplication_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.PutBucketReplication(ctx,
&s3.PutBucketReplicationInput{
Bucket: &bucket,
ReplicationConfiguration: &types.ReplicationConfiguration{
Role: getPtr("arn:aws:iam::35667example:role/CrossRegionReplicationRoleForS3"),
Rules: []types.ReplicationRule{
{
Destination: &types.Destination{
Bucket: &bucket,
AccessControlTranslation: &types.AccessControlTranslation{
Owner: types.OwnerOverrideDestination,
},
Account: getPtr("grt1"),
},
Status: types.ReplicationRuleStatusEnabled,
},
},
},
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func GetBucketReplication_not_implemented(s *S3Conf) error {
testName := "GetBucketReplication_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.GetBucketReplication(ctx,
&s3.GetBucketReplicationInput{
Bucket: &bucket,
})
cancel()
return checkApiErr(err, s3err.GetAPIError(s3err.ErrNotImplemented))
})
}
func DeleteBucketReplication_not_implemented(s *S3Conf) error {
testName := "DeleteBucketReplication_not_implemented"
return actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
_, err := s3client.DeleteBucketReplication(ctx,
&s3.DeleteBucketReplicationInput{
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 {