mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
fix: optimize ListBuckets for anonymous users (#12182)
anonymous users are never allowed to listBuckets(), we do not need to further validate the policy, we can simply reject if credentials are empty.
This commit is contained in:
@@ -299,6 +299,12 @@ func (api objectAPIHandlers) ListBucketsHandler(w http.ResponseWriter, r *http.R
|
||||
return
|
||||
}
|
||||
|
||||
// Anonymous users, should be rejected.
|
||||
if cred.AccessKey == "" {
|
||||
writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrAccessDenied), r.URL)
|
||||
return
|
||||
}
|
||||
|
||||
// If etcd, dns federation configured list buckets from etcd.
|
||||
var bucketsInfo []BucketInfo
|
||||
if globalDNSConfig != nil && globalBucketFederation {
|
||||
|
||||
Reference in New Issue
Block a user