[#603] Fix GetBucketPolicyStatus case sensitivity
All checks were successful
/ Vulncheck (push) Successful in 1m1s
/ Builds (push) Successful in 1m4s
/ OCI image (push) Successful in 1m59s
/ Lint (push) Successful in 2m15s
/ Tests (push) Successful in 1m27s

According to the AWS documentation
(https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html),
the `IsPublic` tag value should be in uppercase. However, the `aws-cli`
utility interprets such responses as always `false`.

To avoid incorrect interpretation, we now return the tag value in lowercase.

Signed-off-by: Aleksey Kravchenko <al.kravchenko@yadro.com>
This commit is contained in:
Aleksey Kravchenko 2025-03-11 12:08:58 +03:00 committed by Alexey Vanin
parent 9edec7d573
commit d85e5b10bb

View file

@ -67,9 +67,12 @@ type PolicyStatus struct {
type PolicyStatusIsPublic string
// According to the AWS documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html),
// the `IsPublic` tag value should be in uppercase. However, the `aws-cli` utility interprets such responses
// as always `false`. To avoid incorrect interpretation, we return the tag value in lowercase.
const (
PolicyStatusIsPublicFalse = "FALSE"
PolicyStatusIsPublicTrue = "TRUE"
PolicyStatusIsPublicFalse = "false"
PolicyStatusIsPublicTrue = "true"
)
// AccessControlPolicy contains ACL.