Skip to content

Commit fa068b6

Browse files
authored
Add admin heal api and ui (#142)
1 parent a805a49 commit fa068b6

17 files changed

+9801
-6562
lines changed

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ github.com/minio/lsync v1.0.1 h1:AVvILxA976xc27hstd1oR+X9PQG0sPSom1MNb1ImfUs=
406406
github.com/minio/lsync v1.0.1/go.mod h1:tCFzfo0dlvdGl70IT4IAK/5Wtgb0/BrTmo/jE8pArKA=
407407
github.com/minio/mc v0.0.0-20200515235434-3b479cf92ed6 h1:2SrKe2vLDLwvnYkYrJelrzyGW8t/8HCbr9yDsw+8XSI=
408408
github.com/minio/mc v0.0.0-20200515235434-3b479cf92ed6/go.mod h1:U3Jgk0bcSjn+QPUMisrS6nxCWOoQ6rYWSvLCB30apuU=
409+
github.com/minio/mc v0.0.0-20200519213124-bf731558cda0 h1:D497vXgHka7/Z3oYFEbFIfAEdWBHbfad8KZ5grSROI0=
409410
github.com/minio/minio v0.0.0-20200421050159-282c9f790a03/go.mod h1:zBua5AiljGs1Irdl2XEyiJjvZVCVDIG8gjozzRBcVlw=
410411
github.com/minio/minio v0.0.0-20200516011754-9cac385aecdb h1:CQC7D3UDnUycuxhwImcVhMSLet/RbShosAnYcvMtEB8=
411412
github.com/minio/minio v0.0.0-20200516011754-9cac385aecdb/go.mod h1:wymaytM/HELuwdz7BGZHmQ3XKq2SxPsLeGxyOCaCLiA=

pkg/acl/endpoints.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var (
3535
serviceAccounts = "/service-accounts"
3636
clusters = "/clusters"
3737
clustersDetail = "/clusters/:clusterName"
38+
heal = "/heal"
3839
)
3940

4041
type ConfigurationActionSet struct {
@@ -195,6 +196,16 @@ var clustersActionSet = ConfigurationActionSet{
195196
actions: iampolicy.NewActionSet(),
196197
}
197198

199+
// healActionSet contains the list of admin actions required for this endpoint to work
200+
var healActionSet = ConfigurationActionSet{
201+
actionTypes: iampolicy.NewActionSet(
202+
iampolicy.AllAdminActions,
203+
),
204+
actions: iampolicy.NewActionSet(
205+
iampolicy.HealAdminAction,
206+
),
207+
}
208+
198209
// endpointRules contains the mapping between endpoints and ActionSets, additional rules can be added here
199210
var endpointRules = map[string]ConfigurationActionSet{
200211
configuration: configurationActionSet,
@@ -212,6 +223,7 @@ var endpointRules = map[string]ConfigurationActionSet{
212223
serviceAccounts: serviceAccountsActionSet,
213224
clusters: clustersActionSet,
214225
clustersDetail: clustersActionSet,
226+
heal: healActionSet,
215227
}
216228

217229
// GetActionsStringFromPolicy extract the admin/s3 actions from a given policy and return them in []string format

pkg/acl/endpoints_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
5959
"admin:*",
6060
},
6161
},
62-
want: 12,
62+
want: 13,
6363
},
6464
{
6565
name: "all s3 endpoints",
@@ -78,7 +78,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
7878
"s3:*",
7979
},
8080
},
81-
want: 15,
81+
want: 16,
8282
},
8383
{
8484
name: "no endpoints",

portal-ui/bindata_assetfs.go

Lines changed: 163 additions & 163 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/package-lock.json

Lines changed: 8448 additions & 6336 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121
"@types/webpack-env": "^1.14.1",
2222
"@types/websocket": "^1.0.0",
2323
"ansi-to-react": "^6.0.5",
24+
"chart.js": "^2.9.3",
2425
"codemirror": "^5.52.2",
2526
"history": "^4.10.1",
2627
"local-storage-fallback": "^4.1.1",
2728
"lodash": "^4.17.15",
2829
"moment": "^2.24.0",
2930
"npm": "^6.14.4",
3031
"react": "^16.13.1",
32+
"react-chartjs-2": "^2.9.0",
3133
"react-codemirror2": "^7.1.0",
3234
"react-dom": "^16.12.0",
3335
"react-moment": "^0.9.7",

portal-ui/src/screens/Console/Console.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { Button, LinearProgress } from "@material-ui/core";
6262
import WebhookPanel from "./Configurations/ConfigurationPanels/WebhookPanel";
6363
import Trace from "./Trace/Trace";
6464
import Logs from "./Logs/Logs";
65+
import Heal from "./Heal/Heal";
6566
import Watch from "./Watch/Watch";
6667
import ListClusters from "./Clusters/ListClusters/ListClusters";
6768
import { ISessionResponse } from "./types";
@@ -271,6 +272,10 @@ const Console = ({
271272
component: Logs,
272273
path: "/logs",
273274
},
275+
{
276+
component: Heal,
277+
path: "/heal",
278+
},
274279
{
275280
component: ListNotificationEndpoints,
276281
path: "/notification-endpoints",

0 commit comments

Comments
 (0)