mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
enhance ListSVCs() API to return more info to avoid InfoSvc() (#19642)
ConsoleUI like applications rely on combination of ListServiceAccounts() and InfoServiceAccount() to populate UI elements, however individually these calls can be slow causing the entire UI to load sluggishly.
This commit is contained in:
@@ -156,6 +156,14 @@ func (cred Credentials) IsServiceAccount() bool {
|
||||
return cred.ParentUser != "" && ok
|
||||
}
|
||||
|
||||
// IsImpliedPolicy - returns if the policy is implied via ParentUser or not.
|
||||
func (cred Credentials) IsImpliedPolicy() bool {
|
||||
if cred.IsServiceAccount() {
|
||||
return cred.Claims[iamPolicyClaimNameSA] == "inherited-policy"
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsValid - returns whether credential is valid or not.
|
||||
func (cred Credentials) IsValid() bool {
|
||||
// Verify credentials if its enabled or not set.
|
||||
|
||||
Reference in New Issue
Block a user