mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: allow gateway to work with root credentials (#12655)
This commit is contained in:
parent
b6dd9b55a7
commit
b79cdc1611
@ -1019,11 +1019,15 @@ func (a adminAPIHandlers) AccountInfoHandler(w http.ResponseWriter, r *http.Requ
|
|||||||
return rd, wr
|
return rd, wr
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the latest calculated data usage
|
var dataUsageInfo madmin.DataUsageInfo
|
||||||
dataUsageInfo, err := loadDataUsageFromBackend(ctx, objectAPI)
|
var err error
|
||||||
if err != nil {
|
if !globalIsGateway {
|
||||||
// log the error, continue with the accounting response
|
// Load the latest calculated data usage
|
||||||
logger.LogIf(ctx, err)
|
dataUsageInfo, err = loadDataUsageFromBackend(ctx, objectAPI)
|
||||||
|
if err != nil {
|
||||||
|
// log the error, continue with the accounting response
|
||||||
|
logger.LogIf(ctx, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If etcd, dns federation configured list buckets from etcd.
|
// If etcd, dns federation configured list buckets from etcd.
|
||||||
|
@ -131,11 +131,12 @@ func checkKeyValid(accessKey string) (auth.Credentials, bool, APIErrorCode) {
|
|||||||
var cred = globalActiveCred
|
var cred = globalActiveCred
|
||||||
if cred.AccessKey != accessKey {
|
if cred.AccessKey != accessKey {
|
||||||
// Check if the access key is part of users credentials.
|
// Check if the access key is part of users credentials.
|
||||||
var ok bool
|
ucred, ok := globalIAMSys.GetUser(accessKey)
|
||||||
if cred, ok = globalIAMSys.GetUser(accessKey); !ok {
|
if !ok {
|
||||||
return cred, false, ErrInvalidAccessKeyID
|
return cred, false, ErrInvalidAccessKeyID
|
||||||
}
|
}
|
||||||
owner = false
|
owner = cred.AccessKey == ucred.ParentUser
|
||||||
|
cred = ucred
|
||||||
}
|
}
|
||||||
return cred, owner, ErrNone
|
return cred, owner, ErrNone
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user