Skip to content

Commit 47698e3

Browse files
committed
Bring trace, watch, heal and logs back to user console UI
1 parent 7577703 commit 47698e3

39 files changed

+597
-1317
lines changed

go.sum

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,14 +755,13 @@ github.com/minio/minio v0.0.0-20201203235615-de9b64834eda h1:ZE7O7pA+8zTJZVOuZrI
755755
github.com/minio/minio v0.0.0-20201203235615-de9b64834eda/go.mod h1:+wH6R6AjgNDUvMBb24p/e7zn8VU+ChUAXy4uhopGxQA=
756756
github.com/minio/minio-go/v7 v7.0.6 h1:9czXaG0LEZ9s74smSqy0rm034MxngQoP6HTTuSc5GEs=
757757
github.com/minio/minio-go/v7 v7.0.6/go.mod h1:HcIuq+11d/3MfavIPZiswSzfQ1VJ2Lwxp/XLtW46IWQ=
758-
github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
759-
github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
760-
github.com/minio/simdjson-go v0.1.5-0.20200303142138-b17fe061ea37/go.mod h1:oKURrZZEBtqObgJrSjN1Ln2n9MJj2icuBTkeJzZnvSI=
761-
github.com/minio/simdjson-go v0.1.5/go.mod h1:oKURrZZEBtqObgJrSjN1Ln2n9MJj2icuBTkeJzZnvSI=
762758
github.com/minio/operator v0.0.0-20201204220226-9901d1d0766c h1:2QpnenH2gieq5yVh6sZYylXKCoBgwKkxcgqkLr/fq9M=
763759
github.com/minio/operator v0.0.0-20201204220226-9901d1d0766c/go.mod h1:Xnb44PIBZF/JCN4uXEEzf9vFwhnB9zXsQgVKU7GThiM=
764760
github.com/minio/selfupdate v0.3.1 h1:BWEFSNnrZVMUWXbXIgLDNDjbejkmpAmZvy/nCz1HlEs=
765761
github.com/minio/selfupdate v0.3.1/go.mod h1:b8ThJzzH7u2MkF6PcIra7KaXO9Khf6alWPvMSyTDCFM=
762+
github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
763+
github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
764+
github.com/minio/simdjson-go v0.1.5/go.mod h1:oKURrZZEBtqObgJrSjN1Ln2n9MJj2icuBTkeJzZnvSI=
766765
github.com/minio/sio v0.2.1 h1:NjzKiIMSMcHediVQR0AFVx2tp7Wxh9tKPfDI3kH7aHQ=
767766
github.com/minio/sio v0.2.1/go.mod h1:8b0yPp2avGThviy/+OCJBI6OMpvxoUuiLvE6F1lebhw=
768767
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=

pkg/acl/endpoints.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ var (
4040
objectBrowserBucket = "/object-browser/:bucket"
4141
mainObjectBrowser = "/object-browser"
4242
license = "/license"
43+
watch = "/watch"
44+
heal = "/heal"
45+
trace = "/trace"
46+
logs = "/logs"
4347
)
4448

4549
type ConfigurationActionSet struct {
@@ -200,6 +204,46 @@ var licenseActionSet = ConfigurationActionSet{
200204
actions: iampolicy.NewActionSet(),
201205
}
202206

207+
// watchActionSet contains the list of admin actions required for this endpoint to work
208+
var watchActionSet = ConfigurationActionSet{
209+
actionTypes: iampolicy.NewActionSet(
210+
iampolicy.AllAdminActions,
211+
),
212+
actions: iampolicy.NewActionSet(
213+
iampolicy.ListenBucketNotificationAction,
214+
),
215+
}
216+
217+
// healActionSet contains the list of admin actions required for this endpoint to work
218+
var healActionSet = ConfigurationActionSet{
219+
actionTypes: iampolicy.NewActionSet(
220+
iampolicy.AllAdminActions,
221+
),
222+
actions: iampolicy.NewActionSet(
223+
iampolicy.HealAdminAction,
224+
),
225+
}
226+
227+
// logsActionSet contains the list of admin actions required for this endpoint to work
228+
var logsActionSet = ConfigurationActionSet{
229+
actionTypes: iampolicy.NewActionSet(
230+
iampolicy.AllAdminActions,
231+
),
232+
actions: iampolicy.NewActionSet(
233+
iampolicy.ConsoleLogAdminAction,
234+
),
235+
}
236+
237+
// traceActionSet contains the list of admin actions required for this endpoint to work
238+
var traceActionSet = ConfigurationActionSet{
239+
actionTypes: iampolicy.NewActionSet(
240+
iampolicy.AllAdminActions,
241+
),
242+
actions: iampolicy.NewActionSet(
243+
iampolicy.TraceAdminAction,
244+
),
245+
}
246+
203247
// endpointRules contains the mapping between endpoints and ActionSets, additional rules can be added here
204248
var endpointRules = map[string]ConfigurationActionSet{
205249
configuration: configurationActionSet,
@@ -218,6 +262,10 @@ var endpointRules = map[string]ConfigurationActionSet{
218262
mainObjectBrowser: objectBrowserActionSet,
219263
objectBrowserBucket: objectBrowserActionSet,
220264
license: licenseActionSet,
265+
watch: watchActionSet,
266+
heal: healActionSet,
267+
trace: traceActionSet,
268+
logs: logsActionSet,
221269
}
222270

223271
// operatorRules contains the mapping between endpoints and ActionSets for operator only mode

pkg/acl/endpoints_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
7272
"admin:*",
7373
},
7474
},
75-
want: 13,
75+
want: 17,
7676
},
7777
{
7878
name: "all s3 endpoints",
@@ -91,7 +91,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
9191
"s3:*",
9292
},
9393
},
94-
want: 16,
94+
want: 20,
9595
},
9696
{
9797
name: "Console User - default endpoints",

portal-ui/bindata_assetfs.go

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

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

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ import TenantDetails from "./Tenants/TenantDetails/TenantDetails";
4747
import ObjectBrowser from "./ObjectBrowser/ObjectBrowser";
4848
import ObjectRouting from "./Buckets/ListBuckets/Objects/ListObjects/ObjectRouting";
4949
import License from "./License/License";
50+
import Trace from "./Trace/Trace";
51+
import Logs from "./Logs/Logs";
52+
import Heal from "./Heal/Heal";
53+
import Watch from "./Watch/Watch";
5054

5155
const drawerWidth = 245;
5256

@@ -216,6 +220,10 @@ const Console = ({
216220
component: ObjectRouting,
217221
path: "/object-browser/:bucket/*",
218222
},
223+
{
224+
component: Watch,
225+
path: "/watch",
226+
},
219227
{
220228
component: Users,
221229
path: "/users",
@@ -228,6 +236,18 @@ const Console = ({
228236
component: Policies,
229237
path: "/policies",
230238
},
239+
{
240+
component: Heal,
241+
path: "/heal",
242+
},
243+
{
244+
component: Trace,
245+
path: "/trace",
246+
},
247+
{
248+
component: Logs,
249+
path: "/logs",
250+
},
231251
{
232252
component: ListNotificationEndpoints,
233253
path: "/notification-endpoints",
@@ -294,20 +314,20 @@ const Console = ({
294314
<LinearProgress />
295315
</React.Fragment>
296316
) : (
297-
<React.Fragment>
298-
The instance needs to be restarted for configuration changes
317+
<React.Fragment>
318+
The instance needs to be restarted for configuration changes
299319
to take effect.{" "}
300-
<Button
301-
color="secondary"
302-
size="small"
303-
onClick={() => {
304-
restartServer();
305-
}}
306-
>
307-
Restart
320+
<Button
321+
color="secondary"
322+
size="small"
323+
onClick={() => {
324+
restartServer();
325+
}}
326+
>
327+
Restart
308328
</Button>
309-
</React.Fragment>
310-
)}
329+
</React.Fragment>
330+
)}
311331
</div>
312332
)}
313333
<Container className={classes.container}>

0 commit comments

Comments
 (0)