S3: fix list buckets handler (#7067)

* s3: fix list buckets handler

* ListBuckets permission checking
This commit is contained in:
Chris Lu
2025-08-01 12:13:11 -07:00
committed by GitHub
parent 0975968e71
commit 52d87f1d29
3 changed files with 194 additions and 57 deletions

View File

@@ -37,7 +37,9 @@ func (s3a *S3ApiServer) ListBucketsHandler(w http.ResponseWriter, r *http.Reques
var identity *Identity
var s3Err s3err.ErrorCode
if s3a.iam.isEnabled() {
identity, s3Err = s3a.iam.authUser(r)
// Use authRequest instead of authUser for consistency with other endpoints
// This ensures the same authentication flow and any fixes (like prefix handling) are applied
identity, s3Err = s3a.iam.authRequest(r, s3_constants.ACTION_LIST)
if s3Err != s3err.ErrNone {
s3err.WriteErrorResponse(w, r, s3Err)
return