aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_bucket_handlers.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2024-07-04 23:00:41 +0500
committerGitHub <noreply@github.com>2024-07-04 11:00:41 -0700
commitf77eee667df234ff0cdc98195f04b58e5d3a4110 (patch)
tree6e2ba062dea9b5f56a2d350df9a71e20a9d3b487 /weed/s3api/s3api_bucket_handlers.go
parent7c06306857feb2ef90452460735ad9c253c47f35 (diff)
downloadseaweedfs-f77eee667df234ff0cdc98195f04b58e5d3a4110.tar.xz
seaweedfs-f77eee667df234ff0cdc98195f04b58e5d3a4110.zip
add s3test for sql (#5718)
* add s3test for sql * fix test test_bucket_listv2_delimiter_basic for s3 * fix action s3tests * regen s3 api xsd * rm minor s3 test test_bucket_listv2_fetchowner_defaultempty * add docs * without xmlns
Diffstat (limited to 'weed/s3api/s3api_bucket_handlers.go')
-rw-r--r--weed/s3api/s3api_bucket_handlers.go24
1 files changed, 9 insertions, 15 deletions
diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go
index 12d2c0432..e3fa778a5 100644
--- a/weed/s3api/s3api_bucket_handlers.go
+++ b/weed/s3api/s3api_bucket_handlers.go
@@ -28,12 +28,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
-type ListAllMyBucketsResult struct {
- XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListAllMyBucketsResult"`
- Owner *s3.Owner
- Buckets []*s3.Bucket `xml:"Buckets>Bucket"`
-}
-
func (s3a *S3ApiServer) ListBucketsHandler(w http.ResponseWriter, r *http.Request) {
glog.V(3).Infof("ListBucketsHandler")
@@ -59,25 +53,25 @@ func (s3a *S3ApiServer) ListBucketsHandler(w http.ResponseWriter, r *http.Reques
identityId := r.Header.Get(s3_constants.AmzIdentityId)
- var buckets []*s3.Bucket
+ var listBuckets ListAllMyBucketsList
for _, entry := range entries {
if entry.IsDirectory {
if identity != nil && !identity.canDo(s3_constants.ACTION_LIST, entry.Name, "") {
continue
}
- buckets = append(buckets, &s3.Bucket{
- Name: aws.String(entry.Name),
- CreationDate: aws.Time(time.Unix(entry.Attributes.Crtime, 0).UTC()),
+ listBuckets.Bucket = append(listBuckets.Bucket, ListAllMyBucketsEntry{
+ Name: entry.Name,
+ CreationDate: time.Unix(entry.Attributes.Crtime, 0).UTC(),
})
}
}
response = ListAllMyBucketsResult{
- Owner: &s3.Owner{
- ID: aws.String(identityId),
- DisplayName: aws.String(identityId),
+ Owner: CanonicalUser{
+ ID: identityId,
+ DisplayName: identityId,
},
- Buckets: buckets,
+ Buckets: listBuckets,
}
writeSuccessResponseXML(w, r, response)
@@ -487,7 +481,7 @@ func (s3a *S3ApiServer) DeleteBucketLifecycleHandler(w http.ResponseWriter, r *h
// GetBucketLocationHandler Get bucket location
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html
func (s3a *S3ApiServer) GetBucketLocationHandler(w http.ResponseWriter, r *http.Request) {
- writeSuccessResponseXML(w, r, LocationConstraint{})
+ writeSuccessResponseXML(w, r, CreateBucketConfiguration{})
}
// GetBucketRequestPaymentHandler Get bucket location