Skip to content

Commit 622f9ed

Browse files
bexsoftBenjamin Perez
andauthored
Added URl routing for tabs in buckets (#769)
Signed-off-by: Benjamin Perez <[email protected]> Co-authored-by: Benjamin Perez <[email protected]>
1 parent 213d758 commit 622f9ed

25 files changed

+1469
-991
lines changed

pkg/acl/endpoints.go

Lines changed: 65 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,41 @@ import (
2222

2323
// endpoints definition
2424
var (
25-
configuration = "/settings"
26-
users = "/users"
27-
usersDetail = "/users/:userName"
28-
groups = "/groups"
29-
iamPolicies = "/policies"
30-
policiesDetail = "/policies/:policyName"
31-
dashboard = "/dashboard"
32-
profiling = "/profiling"
33-
buckets = "/buckets"
34-
bucketsDetail = "/buckets/:bucketName"
35-
serviceAccounts = "/account"
36-
changePassword = "/account/change-password"
37-
tenants = "/tenants"
38-
tenantsDetail = "/namespaces/:tenantNamespace/tenants/:tenantName"
39-
storage = "/storage"
40-
storageVolumes = "/storage/volumes"
41-
storageDrives = "/storage/drives"
42-
remoteBuckets = "/remote-buckets"
43-
replication = "/replication"
44-
objectBrowser = "/object-browser/:bucket/*"
45-
objectBrowserBucket = "/object-browser/:bucket"
46-
mainObjectBrowser = "/object-browser"
47-
license = "/license"
48-
watch = "/watch"
49-
heal = "/heal"
50-
trace = "/trace"
51-
logs = "/logs"
52-
healthInfo = "/health-info"
25+
configuration = "/settings"
26+
users = "/users"
27+
usersDetail = "/users/:userName"
28+
groups = "/groups"
29+
iamPolicies = "/policies"
30+
policiesDetail = "/policies/:policyName"
31+
dashboard = "/dashboard"
32+
profiling = "/profiling"
33+
buckets = "/buckets"
34+
bucketsDetail = "/buckets/:bucketName"
35+
bucketsDetailSummary = "/buckets/:bucketName/summary"
36+
bucketsDetailEvents = "/buckets/:bucketName/events"
37+
bucketsDetailReplication = "/buckets/:bucketName/replication"
38+
bucketsDetailLifecycle = "/buckets/:bucketName/lifecycle"
39+
bucketsDetailAccess = "/buckets/:bucketName/access"
40+
bucketsDetailAccessPolicies = "/buckets/:bucketName/access/policies"
41+
bucketsDetailAccessUsers = "/buckets/:bucketName/access/users"
42+
serviceAccounts = "/account"
43+
changePassword = "/account/change-password"
44+
tenants = "/tenants"
45+
tenantsDetail = "/namespaces/:tenantNamespace/tenants/:tenantName"
46+
storage = "/storage"
47+
storageVolumes = "/storage/volumes"
48+
storageDrives = "/storage/drives"
49+
remoteBuckets = "/remote-buckets"
50+
replication = "/replication"
51+
objectBrowser = "/object-browser/:bucket/*"
52+
objectBrowserBucket = "/object-browser/:bucket"
53+
mainObjectBrowser = "/object-browser"
54+
license = "/license"
55+
watch = "/watch"
56+
heal = "/heal"
57+
trace = "/trace"
58+
logs = "/logs"
59+
healthInfo = "/health-info"
5360
)
5461

5562
type ConfigurationActionSet struct {
@@ -276,29 +283,36 @@ var displayRules = map[string]func() bool{
276283

277284
// endpointRules contains the mapping between endpoints and ActionSets, additional rules can be added here
278285
var endpointRules = map[string]ConfigurationActionSet{
279-
configuration: configurationActionSet,
280-
users: usersActionSet,
281-
usersDetail: usersActionSet,
282-
groups: groupsActionSet,
283-
iamPolicies: iamPoliciesActionSet,
284-
policiesDetail: iamPoliciesActionSet,
285-
dashboard: dashboardActionSet,
286-
profiling: profilingActionSet,
287-
buckets: bucketsActionSet,
288-
bucketsDetail: bucketsActionSet,
289-
serviceAccounts: serviceAccountsActionSet,
290-
changePassword: changePasswordActionSet,
291-
remoteBuckets: remoteBucketsActionSet,
292-
replication: replicationActionSet,
293-
objectBrowser: objectBrowserActionSet,
294-
mainObjectBrowser: objectBrowserActionSet,
295-
objectBrowserBucket: objectBrowserActionSet,
296-
license: licenseActionSet,
297-
watch: watchActionSet,
298-
heal: healActionSet,
299-
trace: traceActionSet,
300-
logs: logsActionSet,
301-
healthInfo: healthInfoActionSet,
286+
configuration: configurationActionSet,
287+
users: usersActionSet,
288+
usersDetail: usersActionSet,
289+
groups: groupsActionSet,
290+
iamPolicies: iamPoliciesActionSet,
291+
policiesDetail: iamPoliciesActionSet,
292+
dashboard: dashboardActionSet,
293+
profiling: profilingActionSet,
294+
buckets: bucketsActionSet,
295+
bucketsDetail: bucketsActionSet,
296+
bucketsDetailSummary: bucketsActionSet,
297+
bucketsDetailEvents: bucketsActionSet,
298+
bucketsDetailReplication: bucketsActionSet,
299+
bucketsDetailLifecycle: bucketsActionSet,
300+
bucketsDetailAccess: bucketsActionSet,
301+
bucketsDetailAccessPolicies: bucketsActionSet,
302+
bucketsDetailAccessUsers: bucketsActionSet,
303+
serviceAccounts: serviceAccountsActionSet,
304+
changePassword: changePasswordActionSet,
305+
remoteBuckets: remoteBucketsActionSet,
306+
replication: replicationActionSet,
307+
objectBrowser: objectBrowserActionSet,
308+
mainObjectBrowser: objectBrowserActionSet,
309+
objectBrowserBucket: objectBrowserActionSet,
310+
license: licenseActionSet,
311+
watch: watchActionSet,
312+
heal: healActionSet,
313+
trace: traceActionSet,
314+
logs: logsActionSet,
315+
healthInfo: healthInfoActionSet,
302316
}
303317

304318
// 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
@@ -81,7 +81,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
8181
"s3:*",
8282
},
8383
},
84-
want: 7,
84+
want: 14,
8585
},
8686
{
8787
name: "all admin and s3 endpoints",
@@ -91,7 +91,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
9191
"s3:*",
9292
},
9393
},
94-
want: 23,
94+
want: 30,
9595
},
9696
{
9797
name: "Console User - default endpoints",
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.a19f3d53.chunk.css",
4-
"main.js": "/static/js/main.0047f81c.chunk.js",
5-
"main.js.map": "/static/js/main.0047f81c.chunk.js.map",
4+
"main.js": "/static/js/main.ad0a1441.chunk.js",
5+
"main.js.map": "/static/js/main.ad0a1441.chunk.js.map",
66
"runtime-main.js": "/static/js/runtime-main.f48e99e5.js",
77
"runtime-main.js.map": "/static/js/runtime-main.f48e99e5.js.map",
8-
"static/css/2.13d7fda8.chunk.css": "/static/css/2.13d7fda8.chunk.css",
9-
"static/js/2.791bc763.chunk.js": "/static/js/2.791bc763.chunk.js",
10-
"static/js/2.791bc763.chunk.js.map": "/static/js/2.791bc763.chunk.js.map",
8+
"static/css/2.76b14b73.chunk.css": "/static/css/2.76b14b73.chunk.css",
9+
"static/js/2.1bd26e6c.chunk.js": "/static/js/2.1bd26e6c.chunk.js",
10+
"static/js/2.1bd26e6c.chunk.js.map": "/static/js/2.1bd26e6c.chunk.js.map",
1111
"index.html": "/index.html",
12-
"static/css/2.13d7fda8.chunk.css.map": "/static/css/2.13d7fda8.chunk.css.map",
12+
"static/css/2.76b14b73.chunk.css.map": "/static/css/2.76b14b73.chunk.css.map",
1313
"static/css/main.a19f3d53.chunk.css.map": "/static/css/main.a19f3d53.chunk.css.map",
14-
"static/js/2.791bc763.chunk.js.LICENSE.txt": "/static/js/2.791bc763.chunk.js.LICENSE.txt",
14+
"static/js/2.1bd26e6c.chunk.js.LICENSE.txt": "/static/js/2.1bd26e6c.chunk.js.LICENSE.txt",
1515
"static/media/minio_console_logo.0837460e.svg": "/static/media/minio_console_logo.0837460e.svg",
1616
"static/media/minio_operator_logo.1312b7c9.svg": "/static/media/minio_operator_logo.1312b7c9.svg"
1717
},
1818
"entrypoints": [
1919
"static/js/runtime-main.f48e99e5.js",
20-
"static/css/2.13d7fda8.chunk.css",
21-
"static/js/2.791bc763.chunk.js",
20+
"static/css/2.76b14b73.chunk.css",
21+
"static/js/2.1bd26e6c.chunk.js",
2222
"static/css/main.a19f3d53.chunk.css",
23-
"static/js/main.0047f81c.chunk.js"
23+
"static/js/main.ad0a1441.chunk.js"
2424
]
2525
}

portal-ui/build/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.13d7fda8.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.791bc763.chunk.js"></script><script src="/static/js/main.0047f81c.chunk.js"></script></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.76b14b73.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.1bd26e6c.chunk.js"></script><script src="/static/js/main.ad0a1441.chunk.js"></script></body></html>

portal-ui/build/static/css/2.13d7fda8.chunk.css renamed to portal-ui/build/static/css/2.76b14b73.chunk.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)