mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix support OBDAdminAction is valid action (#9354)
This commit is contained in:
parent
6a8298b137
commit
bde0f444db
@ -565,7 +565,16 @@ func (a adminAPIHandlers) ListCannedPolicies(w http.ResponseWriter, r *http.Requ
|
||||
return
|
||||
}
|
||||
|
||||
if err = json.NewEncoder(w).Encode(policies); err != nil {
|
||||
var newPolicies = make(map[string]iampolicy.Policy)
|
||||
for name, p := range policies {
|
||||
_, err = json.Marshal(p)
|
||||
if err != nil {
|
||||
logger.LogIf(ctx, err)
|
||||
continue
|
||||
}
|
||||
newPolicies[name] = p
|
||||
}
|
||||
if err = json.NewEncoder(w).Encode(newPolicies); err != nil {
|
||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
||||
return
|
||||
}
|
||||
|
@ -115,6 +115,7 @@ var supportedAdminActions = map[AdminAction]struct{}{
|
||||
TopLocksAdminAction: {},
|
||||
ProfilingAdminAction: {},
|
||||
TraceAdminAction: {},
|
||||
OBDInfoAdminAction: {},
|
||||
ConsoleLogAdminAction: {},
|
||||
KMSKeyStatusAdminAction: {},
|
||||
ServerUpdateAdminAction: {},
|
||||
@ -159,6 +160,7 @@ var adminActionConditionKeyMap = map[Action]condition.KeySet{
|
||||
StorageInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...),
|
||||
ServerInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...),
|
||||
DataUsageInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...),
|
||||
OBDInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...),
|
||||
TopLocksAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...),
|
||||
ProfilingAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...),
|
||||
TraceAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...),
|
||||
|
@ -72,9 +72,10 @@ var AdminDiagnostics = Policy{
|
||||
{
|
||||
SID: policy.ID(""),
|
||||
Effect: policy.Allow,
|
||||
Actions: NewActionSet(ProfilingAdminAction, TraceAdminAction,
|
||||
ConsoleLogAdminAction, ServerInfoAdminAction,
|
||||
TopLocksAdminAction, OBDInfoAdminAction),
|
||||
Actions: NewActionSet(ProfilingAdminAction,
|
||||
TraceAdminAction, ConsoleLogAdminAction,
|
||||
ServerInfoAdminAction, TopLocksAdminAction,
|
||||
OBDInfoAdminAction),
|
||||
Resources: NewResourceSet(NewResource("*", "")),
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user