Skip to content

Commit

Permalink
fix: s3proxy get bucket acl when no acl exists in s3 service
Browse files Browse the repository at this point in the history
For s3 proxy backend, the ACLs are stored in bucket tags to not
conflict with the underlying s3 object store ACLs. If the tag
for the gatway ACLs does not exist for the bucket, then we were
incorrectly returning the NoSuchTagSet from teh tag lookup.
Instead, in this case we need to just return the default gateway
bucket ACL, which is the root account ownership.

Side note that there is currently a bug in the go sdk where the
NoSuchTagSet is not defained as an error type, and a workaround
for string matching is required until this is addressed.
aws/aws-sdk-go-v2#2878
  • Loading branch information
benmcclelland committed Feb 24, 2025
1 parent dcfff94 commit ee64d7f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backend/s3proxy/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"io"
"net/http"
"strconv"
"strings"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
Expand Down Expand Up @@ -518,6 +519,14 @@ func (s *S3Proxy) GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput)
Bucket: input.Bucket,
})
if err != nil {
var ae smithy.APIError
if errors.As(err, &ae) {
// sdk issue workaround for missing NoSuchTagSet error type
// https://github.com/aws/aws-sdk-go-v2/issues/2878
if strings.Contains(ae.ErrorCode(), "NoSuchTagSet") {
return []byte{}, nil
}
}
return nil, handleError(err)
}

Expand Down

0 comments on commit ee64d7f

Please sign in to comment.