@backstage/plugin-scaffolder-common 1.2.7-next.1 → 1.2.7
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/CHANGELOG.md +22 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.cjs.js +9 -0
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/alpha.d.ts +15 -2
- package/dist/alpha.esm.js +8 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-common
|
|
2
2
|
|
|
3
|
+
## 1.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 65e989f4018: Added permissions for authorizing parameters and steps
|
|
8
|
+
- 48da4c46e45: Export `typeguard` for `isTemplateEntityV1beta3`
|
|
9
|
+
- bcae5aaf25c: Added permissions for authorizing actions
|
|
10
|
+
- 65e989f4018: Define optional `backstage:permissions` property to parameters and steps used to authorize part of the template using the permission framework
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/plugin-permission-common@0.7.5
|
|
13
|
+
- @backstage/catalog-model@1.3.0
|
|
14
|
+
- @backstage/types@1.0.2
|
|
15
|
+
|
|
16
|
+
## 1.2.7-next.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @backstage/catalog-model@1.3.0-next.0
|
|
22
|
+
- @backstage/types@1.0.2
|
|
23
|
+
- @backstage/plugin-permission-common@0.7.5-next.0
|
|
24
|
+
|
|
3
25
|
## 1.2.7-next.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.cjs.js
CHANGED
|
@@ -5,6 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var pluginPermissionCommon = require('@backstage/plugin-permission-common');
|
|
6
6
|
|
|
7
7
|
const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = "scaffolder-template";
|
|
8
|
+
const RESOURCE_TYPE_SCAFFOLDER_ACTION = "scaffolder-action";
|
|
9
|
+
const actionExecutePermission = pluginPermissionCommon.createPermission({
|
|
10
|
+
name: "scaffolder.action.execute",
|
|
11
|
+
attributes: {},
|
|
12
|
+
resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION
|
|
13
|
+
});
|
|
8
14
|
const templateParameterReadPermission = pluginPermissionCommon.createPermission({
|
|
9
15
|
name: "scaffolder.template.parameter.read",
|
|
10
16
|
attributes: {
|
|
@@ -20,11 +26,14 @@ const templateStepReadPermission = pluginPermissionCommon.createPermission({
|
|
|
20
26
|
resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
|
|
21
27
|
});
|
|
22
28
|
const scaffolderPermissions = [
|
|
29
|
+
actionExecutePermission,
|
|
23
30
|
templateParameterReadPermission,
|
|
24
31
|
templateStepReadPermission
|
|
25
32
|
];
|
|
26
33
|
|
|
34
|
+
exports.RESOURCE_TYPE_SCAFFOLDER_ACTION = RESOURCE_TYPE_SCAFFOLDER_ACTION;
|
|
27
35
|
exports.RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = RESOURCE_TYPE_SCAFFOLDER_TEMPLATE;
|
|
36
|
+
exports.actionExecutePermission = actionExecutePermission;
|
|
28
37
|
exports.scaffolderPermissions = scaffolderPermissions;
|
|
29
38
|
exports.templateParameterReadPermission = templateParameterReadPermission;
|
|
30
39
|
exports.templateStepReadPermission = templateStepReadPermission;
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.cjs.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to a scaffolder templates.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more parameters from a template.\n *\n * If this permission is not authorized, it will appear that the\n * parameter does not exist in the template — both in the frontend\n * and in API responses.\n *\n * @alpha\n */\nexport const templateParameterReadPermission = createPermission({\n name: 'scaffolder.template.parameter.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more steps from a template.\n *\n * If this permission is not authorized, it will appear that the\n * step does not exist in the template — both in the frontend\n * and in API responses. Steps will also not be executed.\n *\n * @alpha\n */\nexport const templateStepReadPermission = createPermission({\n name: 'scaffolder.template.step.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n"],"names":["createPermission"],"mappings":";;;;;;AAuBO,MAAM,iCAAoC,GAAA,sBAAA;
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to a scaffolder templates.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';\n\n/**\n * Permission resource type which corresponds to a scaffolder action.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_ACTION = 'scaffolder-action';\n\n/**\n * This permission is used to authorize actions that involve executing\n * an action from a template.\n *\n * @alpha\n */\nexport const actionExecutePermission = createPermission({\n name: 'scaffolder.action.execute',\n attributes: {},\n resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more parameters from a template.\n *\n * If this permission is not authorized, it will appear that the\n * parameter does not exist in the template — both in the frontend\n * and in API responses.\n *\n * @alpha\n */\nexport const templateParameterReadPermission = createPermission({\n name: 'scaffolder.template.parameter.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more steps from a template.\n *\n * If this permission is not authorized, it will appear that the\n * step does not exist in the template — both in the frontend\n * and in API responses. Steps will also not be executed.\n *\n * @alpha\n */\nexport const templateStepReadPermission = createPermission({\n name: 'scaffolder.template.step.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n actionExecutePermission,\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n"],"names":["createPermission"],"mappings":";;;;;;AAuBO,MAAM,iCAAoC,GAAA,sBAAA;AAO1C,MAAM,+BAAkC,GAAA,oBAAA;AAQxC,MAAM,0BAA0BA,uCAAiB,CAAA;AAAA,EACtD,IAAM,EAAA,2BAAA;AAAA,EACN,YAAY,EAAC;AAAA,EACb,YAAc,EAAA,+BAAA;AAChB,CAAC,EAAA;AAYM,MAAM,kCAAkCA,uCAAiB,CAAA;AAAA,EAC9D,IAAM,EAAA,oCAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,iCAAA;AAChB,CAAC,EAAA;AAYM,MAAM,6BAA6BA,uCAAiB,CAAA;AAAA,EACzD,IAAM,EAAA,+BAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,iCAAA;AAChB,CAAC,EAAA;AAMM,MAAM,qBAAwB,GAAA;AAAA,EACnC,uBAAA;AAAA,EACA,+BAAA;AAAA,EACA,0BAAA;AACF;;;;;;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -6,6 +6,19 @@ import * as _backstage_plugin_permission_common from '@backstage/plugin-permissi
|
|
|
6
6
|
* @alpha
|
|
7
7
|
*/
|
|
8
8
|
declare const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = "scaffolder-template";
|
|
9
|
+
/**
|
|
10
|
+
* Permission resource type which corresponds to a scaffolder action.
|
|
11
|
+
*
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
declare const RESOURCE_TYPE_SCAFFOLDER_ACTION = "scaffolder-action";
|
|
15
|
+
/**
|
|
16
|
+
* This permission is used to authorize actions that involve executing
|
|
17
|
+
* an action from a template.
|
|
18
|
+
*
|
|
19
|
+
* @alpha
|
|
20
|
+
*/
|
|
21
|
+
declare const actionExecutePermission: _backstage_plugin_permission_common.ResourcePermission<"scaffolder-action">;
|
|
9
22
|
/**
|
|
10
23
|
* This permission is used to authorize actions that involve reading
|
|
11
24
|
* one or more parameters from a template.
|
|
@@ -32,6 +45,6 @@ declare const templateStepReadPermission: _backstage_plugin_permission_common.Re
|
|
|
32
45
|
* List of all the scaffolder permissions
|
|
33
46
|
* @alpha
|
|
34
47
|
*/
|
|
35
|
-
declare const scaffolderPermissions: _backstage_plugin_permission_common.ResourcePermission<"scaffolder-template">[];
|
|
48
|
+
declare const scaffolderPermissions: (_backstage_plugin_permission_common.ResourcePermission<"scaffolder-action"> | _backstage_plugin_permission_common.ResourcePermission<"scaffolder-template">)[];
|
|
36
49
|
|
|
37
|
-
export { RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, scaffolderPermissions, templateParameterReadPermission, templateStepReadPermission };
|
|
50
|
+
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderPermissions, templateParameterReadPermission, templateStepReadPermission };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { createPermission } from '@backstage/plugin-permission-common';
|
|
2
2
|
|
|
3
3
|
const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = "scaffolder-template";
|
|
4
|
+
const RESOURCE_TYPE_SCAFFOLDER_ACTION = "scaffolder-action";
|
|
5
|
+
const actionExecutePermission = createPermission({
|
|
6
|
+
name: "scaffolder.action.execute",
|
|
7
|
+
attributes: {},
|
|
8
|
+
resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION
|
|
9
|
+
});
|
|
4
10
|
const templateParameterReadPermission = createPermission({
|
|
5
11
|
name: "scaffolder.template.parameter.read",
|
|
6
12
|
attributes: {
|
|
@@ -16,9 +22,10 @@ const templateStepReadPermission = createPermission({
|
|
|
16
22
|
resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
|
|
17
23
|
});
|
|
18
24
|
const scaffolderPermissions = [
|
|
25
|
+
actionExecutePermission,
|
|
19
26
|
templateParameterReadPermission,
|
|
20
27
|
templateStepReadPermission
|
|
21
28
|
];
|
|
22
29
|
|
|
23
|
-
export { RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, scaffolderPermissions, templateParameterReadPermission, templateStepReadPermission };
|
|
30
|
+
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderPermissions, templateParameterReadPermission, templateStepReadPermission };
|
|
24
31
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to a scaffolder templates.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more parameters from a template.\n *\n * If this permission is not authorized, it will appear that the\n * parameter does not exist in the template — both in the frontend\n * and in API responses.\n *\n * @alpha\n */\nexport const templateParameterReadPermission = createPermission({\n name: 'scaffolder.template.parameter.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more steps from a template.\n *\n * If this permission is not authorized, it will appear that the\n * step does not exist in the template — both in the frontend\n * and in API responses. Steps will also not be executed.\n *\n * @alpha\n */\nexport const templateStepReadPermission = createPermission({\n name: 'scaffolder.template.step.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n"],"names":[],"mappings":";;AAuBO,MAAM,iCAAoC,GAAA,sBAAA;
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to a scaffolder templates.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';\n\n/**\n * Permission resource type which corresponds to a scaffolder action.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_ACTION = 'scaffolder-action';\n\n/**\n * This permission is used to authorize actions that involve executing\n * an action from a template.\n *\n * @alpha\n */\nexport const actionExecutePermission = createPermission({\n name: 'scaffolder.action.execute',\n attributes: {},\n resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more parameters from a template.\n *\n * If this permission is not authorized, it will appear that the\n * parameter does not exist in the template — both in the frontend\n * and in API responses.\n *\n * @alpha\n */\nexport const templateParameterReadPermission = createPermission({\n name: 'scaffolder.template.parameter.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more steps from a template.\n *\n * If this permission is not authorized, it will appear that the\n * step does not exist in the template — both in the frontend\n * and in API responses. Steps will also not be executed.\n *\n * @alpha\n */\nexport const templateStepReadPermission = createPermission({\n name: 'scaffolder.template.step.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n actionExecutePermission,\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n"],"names":[],"mappings":";;AAuBO,MAAM,iCAAoC,GAAA,sBAAA;AAO1C,MAAM,+BAAkC,GAAA,oBAAA;AAQxC,MAAM,0BAA0B,gBAAiB,CAAA;AAAA,EACtD,IAAM,EAAA,2BAAA;AAAA,EACN,YAAY,EAAC;AAAA,EACb,YAAc,EAAA,+BAAA;AAChB,CAAC,EAAA;AAYM,MAAM,kCAAkC,gBAAiB,CAAA;AAAA,EAC9D,IAAM,EAAA,oCAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,iCAAA;AAChB,CAAC,EAAA;AAYM,MAAM,6BAA6B,gBAAiB,CAAA;AAAA,EACzD,IAAM,EAAA,+BAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA,iCAAA;AAChB,CAAC,EAAA;AAMM,MAAM,qBAAwB,GAAA;AAAA,EACnC,uBAAA;AAAA,EACA,+BAAA;AAAA,EACA,0BAAA;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { JsonObject, JsonValue } from '@backstage/types';
|
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
type TemplateInfo = {
|
|
11
11
|
/**
|
|
12
12
|
* The entityRef of the template
|
|
13
13
|
*/
|
|
@@ -104,7 +104,7 @@ interface TaskSpecV1beta3 {
|
|
|
104
104
|
*
|
|
105
105
|
* @public
|
|
106
106
|
*/
|
|
107
|
-
|
|
107
|
+
type TaskSpec = TaskSpecV1beta3;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Backstage catalog Template kind Entity. Templates are used by the Scaffolder
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-common",
|
|
3
3
|
"description": "Common functionalities for the scaffolder, to be shared between scaffolder and scaffolder-backend plugin",
|
|
4
|
-
"version": "1.2.7
|
|
4
|
+
"version": "1.2.7",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"url": "https://github.com/backstage/backstage/issues"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@backstage/catalog-model": "^1.
|
|
58
|
-
"@backstage/plugin-permission-common": "^0.7.5
|
|
57
|
+
"@backstage/catalog-model": "^1.3.0",
|
|
58
|
+
"@backstage/plugin-permission-common": "^0.7.5",
|
|
59
59
|
"@backstage/types": "^1.0.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@backstage/cli": "^0.22.6
|
|
62
|
+
"@backstage/cli": "^0.22.6"
|
|
63
63
|
},
|
|
64
64
|
"module": "dist/index.esm.js"
|
|
65
65
|
}
|