@webiny/app-security-access-management 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.eb196ccd2f
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/README.md +5 -3
- package/components/GroupAutocomplete/graphql.js +17 -11
- package/components/GroupAutocomplete/graphql.js.map +1 -1
- package/components/GroupAutocomplete/index.d.ts +3 -3
- package/components/GroupAutocomplete/index.js +13 -18
- package/components/GroupAutocomplete/index.js.map +1 -1
- package/components/GroupsMultiAutocomplete/graphql.d.ts +1 -0
- package/components/GroupsMultiAutocomplete/graphql.js +23 -0
- package/components/GroupsMultiAutocomplete/graphql.js.map +1 -0
- package/components/GroupsMultiAutocomplete/index.d.ts +5 -0
- package/components/GroupsMultiAutocomplete/index.js +19 -0
- package/components/GroupsMultiAutocomplete/index.js.map +1 -0
- package/components/NotAuthorizedError/NotAuthorizedError.d.ts +1 -1
- package/components/NotAuthorizedError/NotAuthorizedError.js +20 -56
- package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -1
- package/components/NotAuthorizedError/index.js +2 -11
- package/components/NotAuthorizedError/index.js.map +1 -1
- package/components/TeamAutocomplete/graphql.d.ts +1 -0
- package/components/TeamAutocomplete/graphql.js +18 -0
- package/components/TeamAutocomplete/graphql.js.map +1 -0
- package/components/TeamAutocomplete/index.d.ts +5 -0
- package/components/TeamAutocomplete/index.js +18 -0
- package/components/TeamAutocomplete/index.js.map +1 -0
- package/components/TeamsMultiAutocomplete/graphql.d.ts +1 -0
- package/components/TeamsMultiAutocomplete/graphql.js +23 -0
- package/components/TeamsMultiAutocomplete/graphql.js.map +1 -0
- package/components/TeamsMultiAutocomplete/index.d.ts +5 -0
- package/components/TeamsMultiAutocomplete/index.js +19 -0
- package/components/TeamsMultiAutocomplete/index.js.map +1 -0
- package/index.d.ts +1 -8
- package/index.js +80 -62
- package/index.js.map +1 -1
- package/package.json +22 -30
- package/plugins/constants.d.ts +1 -0
- package/plugins/constants.js +6 -10
- package/plugins/constants.js.map +1 -1
- package/plugins/index.d.ts +1 -1
- package/plugins/index.js +5 -13
- package/plugins/index.js.map +1 -1
- package/plugins/installation.d.ts +1 -1
- package/plugins/installation.js +75 -71
- package/plugins/installation.js.map +1 -1
- package/plugins/permissionRenderer/SecurityPermissions.d.ts +2 -2
- package/plugins/permissionRenderer/SecurityPermissions.js +110 -102
- package/plugins/permissionRenderer/SecurityPermissions.js.map +1 -1
- package/plugins/permissionRenderer/index.js +19 -24
- package/plugins/permissionRenderer/index.js.map +1 -1
- package/plugins/routes.d.ts +1 -1
- package/plugins/routes.js +24 -34
- package/plugins/routes.js.map +1 -1
- package/plugins/secureRouteError.d.ts +2 -2
- package/plugins/secureRouteError.js +8 -14
- package/plugins/secureRouteError.js.map +1 -1
- package/types.d.ts +14 -1
- package/types.js +2 -4
- package/types.js.map +1 -1
- package/ui/elements/GroupAutocompleteElement.d.ts +1 -1
- package/ui/elements/GroupAutocompleteElement.js +31 -48
- package/ui/elements/GroupAutocompleteElement.js.map +1 -1
- package/ui/elements/GroupsMultiAutocompleteElement.d.ts +6 -0
- package/ui/elements/GroupsMultiAutocompleteElement.js +32 -0
- package/ui/elements/GroupsMultiAutocompleteElement.js.map +1 -0
- package/ui/elements/TeamAutocompleteElement.d.ts +6 -0
- package/ui/elements/TeamAutocompleteElement.js +32 -0
- package/ui/elements/TeamAutocompleteElement.js.map +1 -0
- package/ui/views/ApiKeys/ApiKeyForm.d.ts +1 -1
- package/ui/views/ApiKeys/ApiKeyForm.js +149 -198
- package/ui/views/ApiKeys/ApiKeyForm.js.map +1 -1
- package/ui/views/ApiKeys/ApiKeys.d.ts +3 -3
- package/ui/views/ApiKeys/ApiKeys.js +11 -18
- package/ui/views/ApiKeys/ApiKeys.js.map +1 -1
- package/ui/views/ApiKeys/ApiKeysDataList.d.ts +1 -1
- package/ui/views/ApiKeys/ApiKeysDataList.js +120 -160
- package/ui/views/ApiKeys/ApiKeysDataList.js.map +1 -1
- package/ui/views/ApiKeys/graphql.d.ts +8 -0
- package/ui/views/ApiKeys/graphql.js +81 -20
- package/ui/views/ApiKeys/graphql.js.map +1 -1
- package/ui/views/ApiKeys/index.js +2 -15
- package/ui/views/ApiKeys/index.js.map +1 -1
- package/ui/views/ApiKeys/utils.d.ts +1 -1
- package/ui/views/ApiKeys/utils.js +5 -12
- package/ui/views/ApiKeys/utils.js.map +1 -1
- package/ui/views/Groups/Groups.d.ts +3 -3
- package/ui/views/Groups/Groups.js +11 -18
- package/ui/views/Groups/Groups.js.map +1 -1
- package/ui/views/Groups/GroupsDataList.d.ts +1 -1
- package/ui/views/Groups/GroupsDataList.js +124 -167
- package/ui/views/Groups/GroupsDataList.js.map +1 -1
- package/ui/views/Groups/GroupsForm.d.ts +1 -1
- package/ui/views/Groups/GroupsForm.js +175 -186
- package/ui/views/Groups/GroupsForm.js.map +1 -1
- package/ui/views/Groups/graphql.d.ts +8 -0
- package/ui/views/Groups/graphql.js +84 -20
- package/ui/views/Groups/graphql.js.map +1 -1
- package/ui/views/Groups/index.js +2 -15
- package/ui/views/Groups/index.js.map +1 -1
- package/ui/views/Teams/Teams.d.ts +8 -0
- package/ui/views/Teams/Teams.js +12 -0
- package/ui/views/Teams/Teams.js.map +1 -0
- package/ui/views/Teams/TeamsDataList.d.ts +5 -0
- package/ui/views/Teams/TeamsDataList.js +151 -0
- package/ui/views/Teams/TeamsDataList.js.map +1 -0
- package/ui/views/Teams/TeamsForm.d.ts +5 -0
- package/ui/views/Teams/TeamsForm.js +173 -0
- package/ui/views/Teams/TeamsForm.js.map +1 -0
- package/ui/views/Teams/graphql.d.ts +13 -0
- package/ui/views/Teams/graphql.js +89 -0
- package/ui/views/Teams/graphql.js.map +1 -0
- package/ui/views/Teams/index.d.ts +1 -0
- package/ui/views/Teams/index.js +3 -0
- package/ui/views/Teams/index.js.map +1 -0
- package/ui/views/utils.d.ts +1 -1
- package/ui/views/utils.js +5 -15
- package/ui/views/utils.js.map +1 -1
package/README.md
CHANGED
|
@@ -66,9 +66,11 @@ Auth.configure({
|
|
|
66
66
|
responseType: "token"
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
interface AuthenticatorProps {
|
|
70
|
+
children: React.ReactNode;
|
|
71
|
+
}
|
|
70
72
|
// The `Authenticator` component.
|
|
71
|
-
const Authenticator
|
|
73
|
+
const Authenticator = (props: AuthenticatorProps) => {
|
|
72
74
|
const { setIdentity } = useSecurity();
|
|
73
75
|
|
|
74
76
|
useEffect(() => {
|
|
@@ -101,7 +103,7 @@ Finally, use the `useSecurity` React hook in any of your components:
|
|
|
101
103
|
import React from "react";
|
|
102
104
|
import { useSecurity } from "@webiny/app-security";
|
|
103
105
|
|
|
104
|
-
const MyComponent
|
|
106
|
+
const MyComponent = () => {
|
|
105
107
|
const { identity } = useSecurity();
|
|
106
108
|
|
|
107
109
|
if (identity) {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
export const LIST_GROUPS = gql`
|
|
3
|
+
query listGroups {
|
|
4
|
+
security {
|
|
5
|
+
groups: listGroups {
|
|
6
|
+
data {
|
|
7
|
+
id
|
|
8
|
+
slug
|
|
9
|
+
name
|
|
10
|
+
description
|
|
11
|
+
createdOn
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
2
17
|
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.LIST_GROUPS = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var LIST_GROUPS = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n"])));
|
|
12
|
-
exports.LIST_GROUPS = LIST_GROUPS;
|
|
18
|
+
//# sourceMappingURL=graphql.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["gql","LIST_GROUPS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,WAAW,GAAGD,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AutoCompleteProps } from "@webiny/ui/AutoComplete";
|
|
3
|
-
|
|
4
|
-
export declare const GroupAutocomplete: React.
|
|
2
|
+
import type { AutoCompleteProps } from "@webiny/ui/AutoComplete";
|
|
3
|
+
type GroupAutocompleteProps = Partial<AutoCompleteProps>;
|
|
4
|
+
export declare const GroupAutocomplete: (props: GroupAutocompleteProps) => React.JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var GroupAutocomplete = function GroupAutocomplete(props) {
|
|
13
|
-
var _useQuery = (0, _reactHooks.useQuery)(_graphql.LIST_GROUPS),
|
|
14
|
-
data = _useQuery.data,
|
|
15
|
-
loading = _useQuery.loading;
|
|
16
|
-
var options = loading || !data ? [] : data.security.groups.data;
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(_AutoComplete.AutoComplete, Object.assign({}, props, {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AutoComplete } from "@webiny/ui/AutoComplete";
|
|
3
|
+
import { LIST_GROUPS } from "./graphql";
|
|
4
|
+
import { useQuery } from "@apollo/react-hooks";
|
|
5
|
+
export const GroupAutocomplete = props => {
|
|
6
|
+
const {
|
|
7
|
+
data,
|
|
8
|
+
loading
|
|
9
|
+
} = useQuery(LIST_GROUPS);
|
|
10
|
+
const options = loading || !data ? [] : data.security.groups.data;
|
|
11
|
+
return /*#__PURE__*/React.createElement(AutoComplete, Object.assign({}, props, {
|
|
18
12
|
options: options,
|
|
19
13
|
valueProp: "id",
|
|
20
14
|
value: loading ? undefined : props.value
|
|
21
15
|
}));
|
|
22
16
|
};
|
|
23
|
-
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","AutoComplete","LIST_GROUPS","useQuery","GroupAutocomplete","props","data","loading","options","security","groups","createElement","Object","assign","valueProp","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { AutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupAutocompleteProps = Partial<AutoCompleteProps>;\nexport const GroupAutocomplete = (props: GroupAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,WAAW;AACpB,SAASC,QAAQ,QAAQ,qBAAqB;AAG9C,OAAO,MAAMC,iBAAiB,GAAIC,KAA6B,IAAK;EAChE,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,WAAW,CAAC;EAE/C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACIN,KAAA,CAAAW,aAAA,CAACV,YAAY,EAAAW,MAAA,CAAAC,MAAA,KACLR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,KAAK,EAAER,OAAO,GAAGS,SAAS,GAAGX,KAAK,CAACU;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LIST_GROUPS: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
export const LIST_GROUPS = gql`
|
|
3
|
+
query listGroups {
|
|
4
|
+
security {
|
|
5
|
+
groups: listGroups {
|
|
6
|
+
data {
|
|
7
|
+
id
|
|
8
|
+
slug
|
|
9
|
+
name
|
|
10
|
+
description
|
|
11
|
+
createdOn
|
|
12
|
+
}
|
|
13
|
+
error {
|
|
14
|
+
data
|
|
15
|
+
message
|
|
16
|
+
code
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["gql","LIST_GROUPS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n error {\n data\n message\n code\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,WAAW,GAAGD,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MultiAutoCompleteProps } from "@webiny/ui/AutoComplete";
|
|
3
|
+
type GroupsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;
|
|
4
|
+
export declare const GroupsMultiAutocomplete: (props: GroupsMultiAutocompleteProps) => React.JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MultiAutoComplete } from "@webiny/ui/AutoComplete";
|
|
3
|
+
import { LIST_GROUPS } from "./graphql";
|
|
4
|
+
import { useQuery } from "@apollo/react-hooks";
|
|
5
|
+
export const GroupsMultiAutocomplete = props => {
|
|
6
|
+
const {
|
|
7
|
+
data,
|
|
8
|
+
loading
|
|
9
|
+
} = useQuery(LIST_GROUPS);
|
|
10
|
+
const options = loading || !data ? [] : data.security.groups.data;
|
|
11
|
+
return /*#__PURE__*/React.createElement(MultiAutoComplete, Object.assign({}, props, {
|
|
12
|
+
options: options,
|
|
13
|
+
valueProp: "id",
|
|
14
|
+
unique: true,
|
|
15
|
+
value: loading ? undefined : props.value
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","MultiAutoComplete","LIST_GROUPS","useQuery","GroupsMultiAutocomplete","props","data","loading","options","security","groups","createElement","Object","assign","valueProp","unique","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { MultiAutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { MultiAutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;\n\nexport const GroupsMultiAutocomplete = (props: GroupsMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n unique={true}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,WAAW;AACpB,SAASC,QAAQ,QAAQ,qBAAqB;AAI9C,OAAO,MAAMC,uBAAuB,GAAIC,KAAmC,IAAK;EAC5E,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,WAAW,CAAC;EAE/C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACIN,KAAA,CAAAW,aAAA,CAACV,iBAAiB,EAAAW,MAAA,CAAAC,MAAA,KACVR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,MAAM,EAAE,IAAK;IACbC,KAAK,EAAET,OAAO,GAAGU,SAAS,GAAGZ,KAAK,CAACW;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare const NotAuthorizedError: React.
|
|
2
|
+
export declare const NotAuthorizedError: () => React.JSX.Element;
|
|
@@ -1,59 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _emotion = require("emotion");
|
|
12
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
|
-
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
|
14
|
-
var _SecureRouteError = _interopRequireDefault(require("./SecureRouteError.svg"));
|
|
15
|
-
var _Typography = require("@webiny/ui/Typography");
|
|
16
|
-
var ContentWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
17
|
-
target: "e18nns4o0",
|
|
18
|
-
label: "ContentWrapper"
|
|
19
|
-
})({
|
|
20
|
-
display: "block",
|
|
21
|
-
paddingTop: "15%",
|
|
22
|
-
textAlign: "center",
|
|
23
|
-
margin: "auto"
|
|
24
|
-
});
|
|
25
|
-
var styles = {
|
|
26
|
-
authErrorImgStyle: /*#__PURE__*/(0, _emotion.css)({
|
|
27
|
-
width: "192px",
|
|
28
|
-
paddingBottom: "24px"
|
|
29
|
-
}, "label:authErrorImgStyle;"),
|
|
30
|
-
bodyStyle: /*#__PURE__*/(0, _emotion.css)({
|
|
31
|
-
color: "var(--mdc-theme-text-primary-on-background)",
|
|
32
|
-
display: "block"
|
|
33
|
-
}, "label:bodyStyle;"),
|
|
34
|
-
linkStyle: /*#__PURE__*/(0, _emotion.css)({
|
|
35
|
-
textDecoration: "none",
|
|
36
|
-
"&:hover": {
|
|
37
|
-
textDecoration: "none"
|
|
38
|
-
}
|
|
39
|
-
}, "label:linkStyle;")
|
|
40
|
-
};
|
|
41
|
-
var NotAuthorizedError = function NotAuthorizedError() {
|
|
42
|
-
return /*#__PURE__*/React.createElement(ContentWrapper, null, /*#__PURE__*/React.createElement(_reactHelmet.default, {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import Helmet from "react-helmet";
|
|
3
|
+
import authErrorImg from "./SecureRouteError.svg";
|
|
4
|
+
import { Link, Text } from "@webiny/admin-ui";
|
|
5
|
+
export const NotAuthorizedError = () => {
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "wby-flex-1"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "wby-h-full wby-flex wby-flex-col wby-items-center wby-justify-center wby-text-center wby-gap-xs"
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Helmet, {
|
|
43
11
|
title: "Not authorized"
|
|
44
12
|
}), /*#__PURE__*/React.createElement("img", {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
className: styles.bodyStyle
|
|
54
|
-
}, "Please contact your administrator to request access."), /*#__PURE__*/React.createElement(_reactRouter.Link, {
|
|
55
|
-
to: "/",
|
|
56
|
-
className: styles.linkStyle
|
|
57
|
-
}, "Take me back."));
|
|
13
|
+
width: 200,
|
|
14
|
+
height: 200,
|
|
15
|
+
src: authErrorImg,
|
|
16
|
+
alt: "Not Authorized",
|
|
17
|
+
className: "wby-mb-xl"
|
|
18
|
+
}), /*#__PURE__*/React.createElement(Text, null, "You are not authorized to view this route."), /*#__PURE__*/React.createElement(Text, null, "Please contact your administrator to request access."), /*#__PURE__*/React.createElement(Link, {
|
|
19
|
+
to: "/"
|
|
20
|
+
}, "Take me back.")));
|
|
58
21
|
};
|
|
59
|
-
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=NotAuthorizedError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","Helmet","authErrorImg","Link","Text","NotAuthorizedError","createElement","className","title","width","height","src","alt","to"],"sources":["NotAuthorizedError.tsx"],"sourcesContent":["import * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport authErrorImg from \"./SecureRouteError.svg\";\nimport { Link, Text } from \"@webiny/admin-ui\";\n\nexport const NotAuthorizedError = () => {\n return (\n <div className={\"wby-flex-1\"}>\n <div\n className={\n \"wby-h-full wby-flex wby-flex-col wby-items-center wby-justify-center wby-text-center wby-gap-xs\"\n }\n >\n <Helmet title={\"Not authorized\"} />\n\n <img\n width={200}\n height={200}\n src={authErrorImg}\n alt=\"Not Authorized\"\n className={\"wby-mb-xl\"}\n />\n <Text>You are not authorized to view this route.</Text>\n <Text>Please contact your administrator to request access.</Text>\n <Link to=\"/\">Take me back.</Link>\n </div>\n </div>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,YAAY;AACnB,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAE7C,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EACpC,oBACIL,KAAA,CAAAM,aAAA;IAAKC,SAAS,EAAE;EAAa,gBACzBP,KAAA,CAAAM,aAAA;IACIC,SAAS,EACL;EACH,gBAEDP,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,KAAK,EAAE;EAAiB,CAAE,CAAC,eAEnCR,KAAA,CAAAM,aAAA;IACIG,KAAK,EAAE,GAAI;IACXC,MAAM,EAAE,GAAI;IACZC,GAAG,EAAET,YAAa;IAClBU,GAAG,EAAC,gBAAgB;IACpBL,SAAS,EAAE;EAAY,CAC1B,CAAC,eACFP,KAAA,CAAAM,aAAA,CAACF,IAAI,QAAC,4CAAgD,CAAC,eACvDJ,KAAA,CAAAM,aAAA,CAACF,IAAI,QAAC,sDAA0D,CAAC,eACjEJ,KAAA,CAAAM,aAAA,CAACH,IAAI;IAACU,EAAE,EAAC;EAAG,GAAC,eAAmB,CAC/B,CACJ,CAAC;AAEd,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export { NotAuthorizedError } from "./NotAuthorizedError";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "NotAuthorizedError", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _NotAuthorizedError.NotAuthorizedError;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _NotAuthorizedError = require("./NotAuthorizedError");
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { NotAuthorizedError } from \"./NotAuthorizedError\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["NotAuthorizedError"],"sources":["index.ts"],"sourcesContent":["export { NotAuthorizedError } from \"./NotAuthorizedError\";\n"],"mappings":"AAAA,SAASA,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LIST_TEAMS: import("graphql").DocumentNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["gql","LIST_TEAMS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_TEAMS = gql`\n query listTeams {\n security {\n teams: listTeams {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,UAAU,GAAGD,GAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AutoComplete } from "@webiny/ui/AutoComplete";
|
|
3
|
+
import { LIST_TEAMS } from "./graphql";
|
|
4
|
+
import { useQuery } from "@apollo/react-hooks";
|
|
5
|
+
export const TeamAutocomplete = props => {
|
|
6
|
+
const {
|
|
7
|
+
data,
|
|
8
|
+
loading
|
|
9
|
+
} = useQuery(LIST_TEAMS);
|
|
10
|
+
const options = loading || !data ? [] : data.security.teams.data;
|
|
11
|
+
return /*#__PURE__*/React.createElement(AutoComplete, Object.assign({}, props, {
|
|
12
|
+
options: options,
|
|
13
|
+
valueProp: "id",
|
|
14
|
+
value: loading ? undefined : props.value
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AutoComplete","LIST_TEAMS","useQuery","TeamAutocomplete","props","data","loading","options","security","teams","createElement","Object","assign","valueProp","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { AutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_TEAMS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamAutocompleteProps = Partial<AutoCompleteProps>;\nexport const TeamAutocomplete = (props: TeamAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_TEAMS);\n\n const options = loading || !data ? [] : data.security.teams.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,UAAU;AACnB,SAASC,QAAQ,QAAQ,qBAAqB;AAG9C,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAC9D,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,UAAU,CAAC;EAE9C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,KAAK,CAACJ,IAAI;EAEhE,oBACIN,KAAA,CAAAW,aAAA,CAACV,YAAY,EAAAW,MAAA,CAAAC,MAAA,KACLR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,KAAK,EAAER,OAAO,GAAGS,SAAS,GAAGX,KAAK,CAACU;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LIST_TEAMS: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
export const LIST_TEAMS = gql`
|
|
3
|
+
query listTeams {
|
|
4
|
+
security {
|
|
5
|
+
teams: listTeams {
|
|
6
|
+
data {
|
|
7
|
+
id
|
|
8
|
+
slug
|
|
9
|
+
name
|
|
10
|
+
description
|
|
11
|
+
createdOn
|
|
12
|
+
}
|
|
13
|
+
error {
|
|
14
|
+
data
|
|
15
|
+
message
|
|
16
|
+
code
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["gql","LIST_TEAMS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_TEAMS = gql`\n query listTeams {\n security {\n teams: listTeams {\n data {\n id\n slug\n name\n description\n createdOn\n }\n error {\n data\n message\n code\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,UAAU,GAAGD,GAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MultiAutoCompleteProps } from "@webiny/ui/AutoComplete";
|
|
3
|
+
type TeamsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;
|
|
4
|
+
export declare const TeamsMultiAutocomplete: (props: TeamsMultiAutocompleteProps) => React.JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MultiAutoComplete } from "@webiny/ui/AutoComplete";
|
|
3
|
+
import { LIST_TEAMS } from "./graphql";
|
|
4
|
+
import { useQuery } from "@apollo/react-hooks";
|
|
5
|
+
export const TeamsMultiAutocomplete = props => {
|
|
6
|
+
const {
|
|
7
|
+
data,
|
|
8
|
+
loading
|
|
9
|
+
} = useQuery(LIST_TEAMS);
|
|
10
|
+
const options = loading || !data ? [] : data.security.teams.data;
|
|
11
|
+
return /*#__PURE__*/React.createElement(MultiAutoComplete, Object.assign({}, props, {
|
|
12
|
+
options: options,
|
|
13
|
+
valueProp: "id",
|
|
14
|
+
unique: true,
|
|
15
|
+
value: loading ? undefined : props.value
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","MultiAutoComplete","LIST_TEAMS","useQuery","TeamsMultiAutocomplete","props","data","loading","options","security","teams","createElement","Object","assign","valueProp","unique","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { MultiAutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { MultiAutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_TEAMS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;\n\nexport const TeamsMultiAutocomplete = (props: TeamsMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_TEAMS);\n\n const options = loading || !data ? [] : data.security.teams.data;\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n unique={true}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,UAAU;AACnB,SAASC,QAAQ,QAAQ,qBAAqB;AAI9C,OAAO,MAAMC,sBAAsB,GAAIC,KAAkC,IAAK;EAC1E,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,UAAU,CAAC;EAE9C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,KAAK,CAACJ,IAAI;EAEhE,oBACIN,KAAA,CAAAW,aAAA,CAACV,iBAAiB,EAAAW,MAAA,CAAAC,MAAA,KACVR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,MAAM,EAAE,IAAK;IACbC,KAAK,EAAET,OAAO,GAAGU,SAAS,GAAGZ,KAAK,CAACW;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
* TODO @ts-refactor
|
|
4
|
-
* Find out why is there empty default export
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: () => never[];
|
|
7
|
-
export default _default;
|
|
8
|
-
export declare const AccessManagementExtension: () => JSX.Element;
|
|
9
|
-
export declare const AccessManagement: React.MemoExoticComponent<() => JSX.Element>;
|
|
2
|
+
export declare const AccessManagement: React.MemoExoticComponent<() => React.JSX.Element>;
|
package/index.js
CHANGED
|
@@ -1,65 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
var _default = function _default() {
|
|
23
|
-
return [];
|
|
24
|
-
};
|
|
25
|
-
exports.default = _default;
|
|
26
|
-
var AccessManagementExtension = function AccessManagementExtension() {
|
|
27
|
-
_plugins.plugins.register((0, _plugins2.default)());
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_appAdmin.Plugins, null, /*#__PURE__*/_react.default.createElement(_appSecurity.HasPermission, {
|
|
29
|
-
name: _constants.Permission.Groups
|
|
30
|
-
}, /*#__PURE__*/_react.default.createElement(_appAdmin.AddRoute, {
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
3
|
+
import { Layout, Wcp } 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 { Teams } from "./ui/views/Teams";
|
|
8
|
+
import { ApiKeys } from "./ui/views/ApiKeys";
|
|
9
|
+
import accessManagementPlugins from "./plugins";
|
|
10
|
+
import { AdminConfig } from "@webiny/app-admin";
|
|
11
|
+
const {
|
|
12
|
+
Menu,
|
|
13
|
+
Route
|
|
14
|
+
} = AdminConfig;
|
|
15
|
+
const AccessManagementExtension = () => {
|
|
16
|
+
plugins.register(accessManagementPlugins());
|
|
17
|
+
return /*#__PURE__*/React.createElement(AdminConfig, null, /*#__PURE__*/React.createElement(HasPermission, {
|
|
18
|
+
name: Permission.Groups
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Route, {
|
|
20
|
+
name: "security.groups",
|
|
31
21
|
exact: true,
|
|
32
|
-
path: "/access-management/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
path: "/access-management/roles",
|
|
23
|
+
element: /*#__PURE__*/React.createElement(Layout, {
|
|
24
|
+
title: "Access Management - Roles"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Groups, null))
|
|
26
|
+
})), /*#__PURE__*/React.createElement(Wcp.CanUseTeams, null, /*#__PURE__*/React.createElement(HasPermission, {
|
|
27
|
+
name: Permission.Teams
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Route, {
|
|
29
|
+
name: "security.teams",
|
|
38
30
|
exact: true,
|
|
39
|
-
path: "/access-management/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
31
|
+
path: "/access-management/teams",
|
|
32
|
+
element: /*#__PURE__*/React.createElement(Layout, {
|
|
33
|
+
title: "Access Management - Teams"
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Teams, null))
|
|
35
|
+
}))), /*#__PURE__*/React.createElement(HasPermission, {
|
|
36
|
+
name: Permission.ApiKeys
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Route, {
|
|
38
|
+
name: "security.apiKeys",
|
|
39
|
+
exact: true,
|
|
40
|
+
path: "/access-management/api-keys",
|
|
41
|
+
element: /*#__PURE__*/React.createElement(Layout, {
|
|
42
|
+
title: "Access Management - API Keys"
|
|
43
|
+
}, /*#__PURE__*/React.createElement(ApiKeys, null))
|
|
44
|
+
})), /*#__PURE__*/React.createElement(HasPermission, {
|
|
45
|
+
any: [Permission.Groups, Permission.ApiKeys, Permission.Teams]
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
47
|
+
name: "security.settings",
|
|
48
|
+
parent: "settings",
|
|
49
|
+
element: /*#__PURE__*/React.createElement(Menu.Group, {
|
|
50
|
+
text: "Access Management"
|
|
51
|
+
})
|
|
52
|
+
})), /*#__PURE__*/React.createElement(HasPermission, {
|
|
53
|
+
name: Permission.Groups
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
55
|
+
name: "security.roles",
|
|
56
|
+
parent: "settings",
|
|
57
|
+
element: /*#__PURE__*/React.createElement(Menu.Link, {
|
|
58
|
+
text: "Roles",
|
|
59
|
+
to: "/access-management/roles"
|
|
60
|
+
})
|
|
61
|
+
})), /*#__PURE__*/React.createElement(Wcp.CanUseTeams, null, /*#__PURE__*/React.createElement(HasPermission, {
|
|
62
|
+
name: Permission.Teams
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
64
|
+
name: "security.teams",
|
|
65
|
+
parent: "settings",
|
|
66
|
+
element: /*#__PURE__*/React.createElement(Menu.Link, {
|
|
67
|
+
text: "Teams",
|
|
68
|
+
to: "/access-management/teams"
|
|
69
|
+
})
|
|
70
|
+
}))), /*#__PURE__*/React.createElement(HasPermission, {
|
|
71
|
+
name: Permission.ApiKeys
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
73
|
+
name: "security.apiKeys",
|
|
74
|
+
parent: "settings",
|
|
75
|
+
element: /*#__PURE__*/React.createElement(Menu.Link, {
|
|
76
|
+
text: "API Keys",
|
|
77
|
+
to: "/access-management/api-keys"
|
|
78
|
+
})
|
|
79
|
+
})));
|
|
62
80
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
81
|
+
export const AccessManagement = /*#__PURE__*/memo(AccessManagementExtension);
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=index.js.map
|