mirror of
https://github.com/pgsty/minio.git
synced 2026-07-24 06:26:17 +03:00
sr: use site replicator creds to verify temp user claims (#19224)
This PR continues #19209 which did not handle claims verification of temporary users created by root in site replication scenario. Fixes: #19217
This commit is contained in:
+7
-7
@@ -298,15 +298,15 @@ func checkClaimsFromToken(r *http.Request, cred auth.Credentials) (map[string]in
|
|||||||
if cred.IsTemp() && cred.IsExpired() {
|
if cred.IsTemp() && cred.IsExpired() {
|
||||||
return nil, toAPIErrorCode(r.Context(), errInvalidAccessKeyID)
|
return nil, toAPIErrorCode(r.Context(), errInvalidAccessKeyID)
|
||||||
}
|
}
|
||||||
|
|
||||||
secret := globalActiveCred.SecretKey
|
secret := globalActiveCred.SecretKey
|
||||||
var err error
|
|
||||||
if globalSiteReplicationSys.isEnabled() && cred.AccessKey != siteReplicatorSvcAcc {
|
if globalSiteReplicationSys.isEnabled() && cred.AccessKey != siteReplicatorSvcAcc {
|
||||||
if cred.ParentUser != globalActiveCred.AccessKey {
|
nsecret, err := getTokenSigningKey()
|
||||||
secret, err = getTokenSigningKey()
|
if err != nil {
|
||||||
if err != nil {
|
return nil, toAPIErrorCode(r.Context(), err)
|
||||||
return nil, toAPIErrorCode(r.Context(), err)
|
}
|
||||||
}
|
// sign root's temporary accounts also with site replicator creds
|
||||||
|
if cred.ParentUser != globalActiveCred.AccessKey || cred.IsTemp() {
|
||||||
|
secret = nsecret
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if cred.IsServiceAccount() {
|
if cred.IsServiceAccount() {
|
||||||
|
|||||||
Reference in New Issue
Block a user