@webiny/app-security-access-management 5.20.0 → 5.22.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +4 -1
- package/index.js +48 -3
- package/package.json +20 -26
- package/plugins/index.js +1 -3
- package/plugins/permissionRenderer/index.js +1 -1
- package/ui/views/ApiKeys/ApiKeyForm.js +1 -1
- package/ui/views/ApiKeys/ApiKeysDataList.js +2 -2
- package/ui/views/Groups/GroupsDataList.js +2 -2
- package/ui/views/Groups/GroupsForm.js +1 -1
- package/plugins/menus.d.ts +0 -4
- package/plugins/menus.js +0 -61
package/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: () => any[];
|
|
2
3
|
export default _default;
|
|
4
|
+
export declare const AccessManagementExtension: () => JSX.Element;
|
|
5
|
+
export declare const AccessManagement: React.MemoExoticComponent<() => JSX.Element>;
|
package/index.js
CHANGED
|
@@ -1,4 +1,49 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
3
|
+
import { Layout, Plugins, AddMenu, AddRoute } from "@webiny/app-admin";
|
|
4
|
+
import { HasPermission } from "@webiny/app-security";
|
|
5
|
+
import { Permission } from "./plugins/constants";
|
|
6
|
+
import { Groups } from "./ui/views/Groups";
|
|
7
|
+
import { ApiKeys } from "./ui/views/ApiKeys";
|
|
8
|
+
import accessManagementPugins from "./plugins";
|
|
2
9
|
export default (function () {
|
|
3
|
-
return
|
|
4
|
-
});
|
|
10
|
+
return [];
|
|
11
|
+
});
|
|
12
|
+
export var AccessManagementExtension = function AccessManagementExtension() {
|
|
13
|
+
plugins.register(accessManagementPugins());
|
|
14
|
+
return /*#__PURE__*/React.createElement(Plugins, null, /*#__PURE__*/React.createElement(HasPermission, {
|
|
15
|
+
name: Permission.Groups
|
|
16
|
+
}, /*#__PURE__*/React.createElement(AddRoute, {
|
|
17
|
+
exact: true,
|
|
18
|
+
path: "/access-management/groups"
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Layout, {
|
|
20
|
+
title: "Access Management - Groups"
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Groups, null)))), /*#__PURE__*/React.createElement(HasPermission, {
|
|
22
|
+
name: Permission.ApiKeys
|
|
23
|
+
}, /*#__PURE__*/React.createElement(AddRoute, {
|
|
24
|
+
exact: true,
|
|
25
|
+
path: "/access-management/api-keys"
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Layout, {
|
|
27
|
+
title: "Access Management - API Keys"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ApiKeys, null)))), /*#__PURE__*/React.createElement(HasPermission, {
|
|
29
|
+
any: [Permission.Groups, Permission.ApiKeys]
|
|
30
|
+
}, /*#__PURE__*/React.createElement(AddMenu, {
|
|
31
|
+
name: "settings"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(AddMenu, {
|
|
33
|
+
name: "settings.accessManagement",
|
|
34
|
+
label: "Access Management"
|
|
35
|
+
}, /*#__PURE__*/React.createElement(HasPermission, {
|
|
36
|
+
name: Permission.Groups
|
|
37
|
+
}, /*#__PURE__*/React.createElement(AddMenu, {
|
|
38
|
+
name: "settings.accessManagement.groups",
|
|
39
|
+
label: "Groups",
|
|
40
|
+
path: "/access-management/groups"
|
|
41
|
+
})), /*#__PURE__*/React.createElement(HasPermission, {
|
|
42
|
+
name: Permission.ApiKeys
|
|
43
|
+
}, /*#__PURE__*/React.createElement(AddMenu, {
|
|
44
|
+
name: "settings.accessManagement.apiKeys",
|
|
45
|
+
label: "API Keys",
|
|
46
|
+
path: "/access-management/api-keys"
|
|
47
|
+
}))))));
|
|
48
|
+
};
|
|
49
|
+
export var AccessManagement = /*#__PURE__*/memo(AccessManagementExtension);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-security-access-management",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0-beta.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,34 +14,33 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@apollo/react-hooks": "3.1.5",
|
|
17
|
-
"@emotion/styled": "10.0
|
|
18
|
-
"@webiny/app": "5.
|
|
19
|
-
"@webiny/app-admin": "5.
|
|
20
|
-
"@webiny/app-security": "5.
|
|
21
|
-
"@webiny/form": "5.
|
|
22
|
-
"@webiny/plugins": "5.
|
|
23
|
-
"@webiny/react-router": "5.
|
|
24
|
-
"@webiny/ui": "5.
|
|
25
|
-
"@webiny/validation": "5.
|
|
17
|
+
"@emotion/styled": "10.3.0",
|
|
18
|
+
"@webiny/app": "5.22.0-beta.1",
|
|
19
|
+
"@webiny/app-admin": "5.22.0-beta.1",
|
|
20
|
+
"@webiny/app-security": "5.22.0-beta.1",
|
|
21
|
+
"@webiny/form": "5.22.0-beta.1",
|
|
22
|
+
"@webiny/plugins": "5.22.0-beta.1",
|
|
23
|
+
"@webiny/react-router": "5.22.0-beta.1",
|
|
24
|
+
"@webiny/ui": "5.22.0-beta.1",
|
|
25
|
+
"@webiny/validation": "5.22.0-beta.1",
|
|
26
26
|
"emotion": "10.0.27",
|
|
27
27
|
"graphql-tag": "2.12.6",
|
|
28
28
|
"lodash": "4.17.21",
|
|
29
29
|
"react": "16.14.0",
|
|
30
30
|
"react-dom": "16.14.0",
|
|
31
|
-
"react-helmet": "
|
|
31
|
+
"react-helmet": "6.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@babel/cli": "^7.
|
|
35
|
-
"@babel/core": "^7.
|
|
36
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
37
|
-
"@babel/preset-env": "^7.
|
|
38
|
-
"@babel/preset-react": "^7.
|
|
39
|
-
"@babel/preset-typescript": "^7.
|
|
40
|
-
"@webiny/cli": "^5.
|
|
41
|
-
"@webiny/project-utils": "^5.
|
|
34
|
+
"@babel/cli": "^7.16.0",
|
|
35
|
+
"@babel/core": "^7.16.0",
|
|
36
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
37
|
+
"@babel/preset-env": "^7.16.4",
|
|
38
|
+
"@babel/preset-react": "^7.16.0",
|
|
39
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
40
|
+
"@webiny/cli": "^5.22.0-beta.1",
|
|
41
|
+
"@webiny/project-utils": "^5.22.0-beta.1",
|
|
42
42
|
"babel-plugin-emotion": "^9.2.8",
|
|
43
43
|
"babel-plugin-lodash": "^3.3.4",
|
|
44
|
-
"babel-plugin-named-asset-import": "^1.0.0-next.3e165448",
|
|
45
44
|
"rimraf": "^3.0.2",
|
|
46
45
|
"ttypescript": "^1.5.12",
|
|
47
46
|
"typescript": "^4.1.3"
|
|
@@ -54,11 +53,6 @@
|
|
|
54
53
|
"build": "yarn webiny run build",
|
|
55
54
|
"watch": "yarn webiny run watch"
|
|
56
55
|
},
|
|
57
|
-
"svgo": {
|
|
58
|
-
"plugins": {
|
|
59
|
-
"removeViewBox": false
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
56
|
"adio": {
|
|
63
57
|
"ignore": {
|
|
64
58
|
"peerDependencies": [
|
|
@@ -66,5 +60,5 @@
|
|
|
66
60
|
]
|
|
67
61
|
}
|
|
68
62
|
},
|
|
69
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "b651010b23f28b3ce1c27130713322ce65b32dcd"
|
|
70
64
|
}
|
package/plugins/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import routes from "./routes";
|
|
2
|
-
import menus from "./menus";
|
|
3
1
|
import installation from "./installation";
|
|
4
2
|
import permissionRenderer from "./permissionRenderer";
|
|
5
3
|
import secureRouteError from "./secureRouteError";
|
|
6
4
|
export default (function () {
|
|
7
|
-
return [
|
|
5
|
+
return [installation, permissionRenderer, secureRouteError];
|
|
8
6
|
});
|
|
@@ -5,7 +5,7 @@ var _templateObject, _templateObject2;
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { i18n } from "@webiny/app/i18n";
|
|
7
7
|
import { AccordionItem } from "@webiny/ui/Accordion";
|
|
8
|
-
import { ReactComponent as SecurityIcon } from "@
|
|
8
|
+
import { ReactComponent as SecurityIcon } from "@webiny/app-admin/assets/icons/baseline-security-24px.svg";
|
|
9
9
|
import { SecurityPermissions } from "./SecurityPermissions";
|
|
10
10
|
import { PermissionRendererPlugin } from "@webiny/app-admin/plugins/PermissionRendererPlugin";
|
|
11
11
|
var t = i18n.ns("app-security-admin-users/plugins/permissionRenderer");
|
|
@@ -26,7 +26,7 @@ import * as GQL from "./graphql";
|
|
|
26
26
|
import { SnackbarAction } from "@webiny/ui/Snackbar";
|
|
27
27
|
import isEmpty from "lodash/isEmpty";
|
|
28
28
|
import EmptyView from "@webiny/app-admin/components/EmptyView";
|
|
29
|
-
import { ReactComponent as AddIcon } from "@
|
|
29
|
+
import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
|
|
30
30
|
import styled from "@emotion/styled";
|
|
31
31
|
var t = i18n.ns("app-security-admin-users/admin/api-keys/form");
|
|
32
32
|
var ButtonWrapper = /*#__PURE__*/styled("div", {
|
|
@@ -19,8 +19,8 @@ import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
|
|
|
19
19
|
import { useQuery, useMutation } from "@apollo/react-hooks";
|
|
20
20
|
import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDialog";
|
|
21
21
|
import * as GQL from "./graphql";
|
|
22
|
-
import { ReactComponent as AddIcon } from "@
|
|
23
|
-
import { ReactComponent as FilterIcon } from "@
|
|
22
|
+
import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
|
|
23
|
+
import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
|
|
24
24
|
import { serializeSorters, deserializeSorters } from "../utils";
|
|
25
25
|
var t = i18n.ns("app-security/admin/groups/data-list");
|
|
26
26
|
var SORTERS = [{
|
|
@@ -20,8 +20,8 @@ import { ButtonIcon, ButtonSecondary } from "@webiny/ui/Button";
|
|
|
20
20
|
import { Cell, Grid } from "@webiny/ui/Grid";
|
|
21
21
|
import { Select } from "@webiny/ui/Select";
|
|
22
22
|
import SearchUI from "@webiny/app-admin/components/SearchUI";
|
|
23
|
-
import { ReactComponent as AddIcon } from "@
|
|
24
|
-
import { ReactComponent as FilterIcon } from "@
|
|
23
|
+
import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
|
|
24
|
+
import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
|
|
25
25
|
import { deserializeSorters, serializeSorters } from "../utils";
|
|
26
26
|
var t = i18n.ns("app-security/admin/groups/data-list");
|
|
27
27
|
var SORTERS = [{
|
|
@@ -27,7 +27,7 @@ import { CREATE_GROUP, LIST_GROUPS, READ_GROUP, UPDATE_GROUP } from "./graphql";
|
|
|
27
27
|
import { SnackbarAction } from "@webiny/ui/Snackbar";
|
|
28
28
|
import isEmpty from "lodash/isEmpty";
|
|
29
29
|
import EmptyView from "@webiny/app-admin/components/EmptyView";
|
|
30
|
-
import { ReactComponent as AddIcon } from "@
|
|
30
|
+
import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
|
|
31
31
|
var t = i18n.ns("app-security/admin/groups/form");
|
|
32
32
|
var ButtonWrapper = /*#__PURE__*/styled("div", {
|
|
33
33
|
target: "euuiyav0",
|
package/plugins/menus.d.ts
DELETED
package/plugins/menus.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import { NavigationMenuElement, TAGS } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
|
|
4
|
-
import { Permission } from "./constants";
|
|
5
|
-
import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
|
|
6
|
-
import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
|
|
7
|
-
export default new UIViewPlugin(NavigationView, /*#__PURE__*/function () {
|
|
8
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(view) {
|
|
9
|
-
var _view$getSecurityHook, identity, groups, apiKeys, mainMenu;
|
|
10
|
-
|
|
11
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
12
|
-
while (1) {
|
|
13
|
-
switch (_context.prev = _context.next) {
|
|
14
|
-
case 0:
|
|
15
|
-
_context.next = 2;
|
|
16
|
-
return view.isRendered();
|
|
17
|
-
|
|
18
|
-
case 2:
|
|
19
|
-
_view$getSecurityHook = view.getSecurityHook(), identity = _view$getSecurityHook.identity;
|
|
20
|
-
groups = identity.getPermission(Permission.Groups);
|
|
21
|
-
apiKeys = identity.getPermission(Permission.ApiKeys);
|
|
22
|
-
|
|
23
|
-
if (!(!groups && !apiKeys)) {
|
|
24
|
-
_context.next = 7;
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return _context.abrupt("return");
|
|
29
|
-
|
|
30
|
-
case 7:
|
|
31
|
-
mainMenu = view.getSettingsMenuElement().addElement(new NavigationMenuElement("accessManagement", {
|
|
32
|
-
label: "Access Management",
|
|
33
|
-
tags: [TAGS.UTILS]
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
if (groups) {
|
|
37
|
-
mainMenu.addElement(new NavigationMenuElement("groups", {
|
|
38
|
-
label: "Groups",
|
|
39
|
-
path: "/access-management/groups"
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (apiKeys) {
|
|
44
|
-
mainMenu.addElement(new NavigationMenuElement("apiKeys", {
|
|
45
|
-
label: "API Keys",
|
|
46
|
-
path: "/access-management/api-keys"
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
case 10:
|
|
51
|
-
case "end":
|
|
52
|
-
return _context.stop();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, _callee);
|
|
56
|
-
}));
|
|
57
|
-
|
|
58
|
-
return function (_x) {
|
|
59
|
-
return _ref.apply(this, arguments);
|
|
60
|
-
};
|
|
61
|
-
}());
|