mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
IAM: Protect managed service account frontend details page (#77839)
* Add `isManaged` property to frontend model * Remove enabled and token buttons for managed SA * Replace trash icon for lock icon for managed SA * Block the role picker for managed SA * Filter SA list usiong the managed filter * Rename external for managed * Add only managed filter * Toggle the enable buttons for managed sa * Disable add token and delete token buttons * Remove the edit name button * Disable the Role picker for managed sa * Hide the permissions section * Add managed by row --------- Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
@@ -158,6 +158,8 @@ type ServiceAccountProfileDTO struct {
|
||||
Teams []string `json:"teams" xorm:"-"`
|
||||
// example: false
|
||||
IsExternal bool `json:"isExternal,omitempty" xorm:"-"`
|
||||
// example: grafana-app
|
||||
RequiredBy string `json:"requiredBy,omitempty" xorm:"-"`
|
||||
|
||||
Tokens int64 `json:"tokens,omitempty"`
|
||||
AccessControl map[string]bool `json:"accessControl,omitempty" xorm:"-"`
|
||||
|
||||
@@ -139,6 +139,7 @@ func (s *ServiceAccountsProxy) RetrieveServiceAccount(ctx context.Context, orgID
|
||||
|
||||
if s.isProxyEnabled {
|
||||
sa.IsExternal = isExternalServiceAccount(sa.Login)
|
||||
sa.RequiredBy = strings.ReplaceAll(sa.Name, serviceaccounts.ExtSvcPrefix, "")
|
||||
}
|
||||
|
||||
return sa, nil
|
||||
|
||||
Reference in New Issue
Block a user