fix: validate and apply the ListBuckets bucket-region query
ListBuckets ignored bucket-region: a value that is not a region was accepted, and a region other than the gateway one still listed every bucket. S3 rejects an invalid value with 400 InvalidArgument, "Argument value abc is not a valid AWS Region", and lists only the buckets of the requested region. Check bucket-region against the AWS region code format, always accepting the gateway region whatever its name, and return an empty list for any other region, since every bucket lives in the gateway region. Enable the REST tests that cover both cases. Fixes #1923 Fixes #1930
This commit is contained in:
1 parent
2bb327ec69
commit
b7ff97181d
8 files changed
+175
-6
No files matched your search
@@ -384,3 +384,11 @@ func GetInvalidArgObjectOwnership(value string) InvalidArgumentError {
|
||||
Description: fmt.Sprintf("Invalid x-amz-object-ownership header: %s", value),
|
||||
}
|
||||
}
|
||||
|
||||
func GetInvalidArgBucketRegion(value string) InvalidArgumentError {
|
||||
return InvalidArgumentError{
|
||||
ArgumentName: "bucket-region",
|
||||
// no ArgumentValue is returned for this error
|
||||
Description: fmt.Sprintf("Argument value %s is not a valid AWS Region", value),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user