@backstage/plugin-scaffolder-common 1.5.2 → 1.5.3-next.0

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @backstage/plugin-scaffolder-common
2
2
 
3
+ ## 1.5.3-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - bcec60f: added the following new permissions to the scaffolder backend endpoints:
8
+
9
+ - `scaffolder.task.create`
10
+ - `scaffolder.task.cancel`
11
+ - `scaffolder.task.read`
12
+
3
13
  ## 1.5.2
4
14
 
5
15
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-common",
3
- "version": "1.5.2",
3
+ "version": "1.5.3-next.0",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/alpha.cjs.js CHANGED
@@ -23,23 +23,48 @@ const templateStepReadPermission = pluginPermissionCommon.createPermission({
23
23
  },
24
24
  resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
25
25
  });
26
- const scaffolderPermissions = [
27
- actionExecutePermission,
28
- templateParameterReadPermission,
29
- templateStepReadPermission
30
- ];
26
+ const taskReadPermission = pluginPermissionCommon.createPermission({
27
+ name: "scaffolder.task.read",
28
+ attributes: {
29
+ action: "read"
30
+ }
31
+ });
32
+ const taskCreatePermission = pluginPermissionCommon.createPermission({
33
+ name: "scaffolder.task.create",
34
+ attributes: {
35
+ action: "create"
36
+ }
37
+ });
38
+ const taskCancelPermission = pluginPermissionCommon.createPermission({
39
+ name: "scaffolder.task.cancel",
40
+ attributes: {}
41
+ });
31
42
  const scaffolderTemplatePermissions = [
32
43
  templateParameterReadPermission,
33
44
  templateStepReadPermission
34
45
  ];
35
46
  const scaffolderActionPermissions = [actionExecutePermission];
47
+ const scaffolderTaskPermissions = [
48
+ taskCancelPermission,
49
+ taskCreatePermission,
50
+ taskReadPermission
51
+ ];
52
+ const scaffolderPermissions = [
53
+ ...scaffolderTemplatePermissions,
54
+ ...scaffolderActionPermissions,
55
+ ...scaffolderTaskPermissions
56
+ ];
36
57
 
37
58
  exports.RESOURCE_TYPE_SCAFFOLDER_ACTION = RESOURCE_TYPE_SCAFFOLDER_ACTION;
38
59
  exports.RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = RESOURCE_TYPE_SCAFFOLDER_TEMPLATE;
39
60
  exports.actionExecutePermission = actionExecutePermission;
40
61
  exports.scaffolderActionPermissions = scaffolderActionPermissions;
41
62
  exports.scaffolderPermissions = scaffolderPermissions;
63
+ exports.scaffolderTaskPermissions = scaffolderTaskPermissions;
42
64
  exports.scaffolderTemplatePermissions = scaffolderTemplatePermissions;
65
+ exports.taskCancelPermission = taskCancelPermission;
66
+ exports.taskCreatePermission = taskCreatePermission;
67
+ exports.taskReadPermission = taskReadPermission;
43
68
  exports.templateParameterReadPermission = templateParameterReadPermission;
44
69
  exports.templateStepReadPermission = templateStepReadPermission;
45
70
  //# sourceMappingURL=alpha.cjs.js.map
@@ -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 * 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\n/**\n * List of the scaffolder permissions that are associated with template steps and parameters.\n * @alpha\n */\nexport const scaffolderTemplatePermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder actions.\n * @alpha\n */\nexport const scaffolderActionPermissions = [actionExecutePermission];\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,EAAA;AAMO,MAAM,6BAAgC,GAAA;AAAA,EAC3C,+BAAA;AAAA,EACA,0BAAA;AACF,EAAA;AAMa,MAAA,2BAAA,GAA8B,CAAC,uBAAuB;;;;;;;;;;;"}
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 * This permission is used to authorize actions that involve reading one or more tasks in the scaffolder,\n * and reading logs of tasks\n *\n * @alpha\n */\nexport const taskReadPermission = createPermission({\n name: 'scaffolder.task.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the creation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCreatePermission = createPermission({\n name: 'scaffolder.task.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the cancellation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCancelPermission = createPermission({\n name: 'scaffolder.task.cancel',\n attributes: {},\n});\n\n/**\n * List of the scaffolder permissions that are associated with template steps and parameters.\n * @alpha\n */\nexport const scaffolderTemplatePermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder actions.\n * @alpha\n */\nexport const scaffolderActionPermissions = [actionExecutePermission];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder tasks.\n * @alpha\n */\nexport const scaffolderTaskPermissions = [\n taskCancelPermission,\n taskCreatePermission,\n taskReadPermission,\n];\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n ...scaffolderTemplatePermissions,\n ...scaffolderActionPermissions,\n ...scaffolderTaskPermissions,\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;AAQM,MAAM,qBAAqBA,uCAAiB,CAAA;AAAA,EACjD,IAAM,EAAA,sBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AACF,CAAC,EAAA;AAOM,MAAM,uBAAuBA,uCAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF,CAAC,EAAA;AAOM,MAAM,uBAAuBA,uCAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,YAAY,EAAC;AACf,CAAC,EAAA;AAMM,MAAM,6BAAgC,GAAA;AAAA,EAC3C,+BAAA;AAAA,EACA,0BAAA;AACF,EAAA;AAMa,MAAA,2BAAA,GAA8B,CAAC,uBAAuB,EAAA;AAM5D,MAAM,yBAA4B,GAAA;AAAA,EACvC,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA,kBAAA;AACF,EAAA;AAMO,MAAM,qBAAwB,GAAA;AAAA,EACnC,GAAG,6BAAA;AAAA,EACH,GAAG,2BAAA;AAAA,EACH,GAAG,yBAAA;AACL;;;;;;;;;;;;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -42,10 +42,24 @@ declare const templateParameterReadPermission: _backstage_plugin_permission_comm
42
42
  */
43
43
  declare const templateStepReadPermission: _backstage_plugin_permission_common.ResourcePermission<"scaffolder-template">;
44
44
  /**
45
- * List of all the scaffolder permissions
45
+ * This permission is used to authorize actions that involve reading one or more tasks in the scaffolder,
46
+ * and reading logs of tasks
47
+ *
46
48
  * @alpha
47
49
  */
48
- declare const scaffolderPermissions: (_backstage_plugin_permission_common.ResourcePermission<"scaffolder-action"> | _backstage_plugin_permission_common.ResourcePermission<"scaffolder-template">)[];
50
+ declare const taskReadPermission: _backstage_plugin_permission_common.BasicPermission;
51
+ /**
52
+ * This permission is used to authorize actions that involve the creation of tasks in the scaffolder.
53
+ *
54
+ * @alpha
55
+ */
56
+ declare const taskCreatePermission: _backstage_plugin_permission_common.BasicPermission;
57
+ /**
58
+ * This permission is used to authorize actions that involve the cancellation of tasks in the scaffolder.
59
+ *
60
+ * @alpha
61
+ */
62
+ declare const taskCancelPermission: _backstage_plugin_permission_common.BasicPermission;
49
63
  /**
50
64
  * List of the scaffolder permissions that are associated with template steps and parameters.
51
65
  * @alpha
@@ -56,5 +70,15 @@ declare const scaffolderTemplatePermissions: _backstage_plugin_permission_common
56
70
  * @alpha
57
71
  */
58
72
  declare const scaffolderActionPermissions: _backstage_plugin_permission_common.ResourcePermission<"scaffolder-action">[];
73
+ /**
74
+ * List of the scaffolder permissions that are associated with scaffolder tasks.
75
+ * @alpha
76
+ */
77
+ declare const scaffolderTaskPermissions: _backstage_plugin_permission_common.BasicPermission[];
78
+ /**
79
+ * List of all the scaffolder permissions
80
+ * @alpha
81
+ */
82
+ declare const scaffolderPermissions: (_backstage_plugin_permission_common.BasicPermission | _backstage_plugin_permission_common.ResourcePermission<"scaffolder-action"> | _backstage_plugin_permission_common.ResourcePermission<"scaffolder-template">)[];
59
83
 
60
- export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTemplatePermissions, templateParameterReadPermission, templateStepReadPermission };
84
+ export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateParameterReadPermission, templateStepReadPermission };
package/dist/alpha.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTemplatePermissions, templateParameterReadPermission, templateStepReadPermission } from './permissions.esm.js';
1
+ export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateParameterReadPermission, templateStepReadPermission } from './permissions.esm.js';
2
2
  //# sourceMappingURL=alpha.esm.js.map
@@ -21,16 +21,37 @@ const templateStepReadPermission = createPermission({
21
21
  },
22
22
  resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
23
23
  });
24
- const scaffolderPermissions = [
25
- actionExecutePermission,
26
- templateParameterReadPermission,
27
- templateStepReadPermission
28
- ];
24
+ const taskReadPermission = createPermission({
25
+ name: "scaffolder.task.read",
26
+ attributes: {
27
+ action: "read"
28
+ }
29
+ });
30
+ const taskCreatePermission = createPermission({
31
+ name: "scaffolder.task.create",
32
+ attributes: {
33
+ action: "create"
34
+ }
35
+ });
36
+ const taskCancelPermission = createPermission({
37
+ name: "scaffolder.task.cancel",
38
+ attributes: {}
39
+ });
29
40
  const scaffolderTemplatePermissions = [
30
41
  templateParameterReadPermission,
31
42
  templateStepReadPermission
32
43
  ];
33
44
  const scaffolderActionPermissions = [actionExecutePermission];
45
+ const scaffolderTaskPermissions = [
46
+ taskCancelPermission,
47
+ taskCreatePermission,
48
+ taskReadPermission
49
+ ];
50
+ const scaffolderPermissions = [
51
+ ...scaffolderTemplatePermissions,
52
+ ...scaffolderActionPermissions,
53
+ ...scaffolderTaskPermissions
54
+ ];
34
55
 
35
- export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTemplatePermissions, templateParameterReadPermission, templateStepReadPermission };
56
+ export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateParameterReadPermission, templateStepReadPermission };
36
57
  //# sourceMappingURL=permissions.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.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\n/**\n * List of the scaffolder permissions that are associated with template steps and parameters.\n * @alpha\n */\nexport const scaffolderTemplatePermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder actions.\n * @alpha\n */\nexport const scaffolderActionPermissions = [actionExecutePermission];\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,EAAA;AAMO,MAAM,6BAAgC,GAAA;AAAA,EAC3C,+BAAA;AAAA,EACA,0BAAA;AACF,EAAA;AAMa,MAAA,2BAAA,GAA8B,CAAC,uBAAuB;;;;"}
1
+ {"version":3,"file":"permissions.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 * This permission is used to authorize actions that involve reading one or more tasks in the scaffolder,\n * and reading logs of tasks\n *\n * @alpha\n */\nexport const taskReadPermission = createPermission({\n name: 'scaffolder.task.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the creation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCreatePermission = createPermission({\n name: 'scaffolder.task.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the cancellation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCancelPermission = createPermission({\n name: 'scaffolder.task.cancel',\n attributes: {},\n});\n\n/**\n * List of the scaffolder permissions that are associated with template steps and parameters.\n * @alpha\n */\nexport const scaffolderTemplatePermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder actions.\n * @alpha\n */\nexport const scaffolderActionPermissions = [actionExecutePermission];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder tasks.\n * @alpha\n */\nexport const scaffolderTaskPermissions = [\n taskCancelPermission,\n taskCreatePermission,\n taskReadPermission,\n];\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n ...scaffolderTemplatePermissions,\n ...scaffolderActionPermissions,\n ...scaffolderTaskPermissions,\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;AAQM,MAAM,qBAAqB,gBAAiB,CAAA;AAAA,EACjD,IAAM,EAAA,sBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,MAAA;AAAA,GACV;AACF,CAAC,EAAA;AAOM,MAAM,uBAAuB,gBAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,GACV;AACF,CAAC,EAAA;AAOM,MAAM,uBAAuB,gBAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,YAAY,EAAC;AACf,CAAC,EAAA;AAMM,MAAM,6BAAgC,GAAA;AAAA,EAC3C,+BAAA;AAAA,EACA,0BAAA;AACF,EAAA;AAMa,MAAA,2BAAA,GAA8B,CAAC,uBAAuB,EAAA;AAM5D,MAAM,yBAA4B,GAAA;AAAA,EACvC,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA,kBAAA;AACF,EAAA;AAMO,MAAM,qBAAwB,GAAA;AAAA,EACnC,GAAG,6BAAA;AAAA,EACH,GAAG,2BAAA;AAAA,EACH,GAAG,yBAAA;AACL;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-common",
3
- "version": "1.5.2",
3
+ "version": "1.5.3-next.0",
4
4
  "description": "Common functionalities for the scaffolder, to be shared between scaffolder and scaffolder-backend plugin",
5
5
  "backstage": {
6
6
  "role": "common-library"
@@ -57,7 +57,7 @@
57
57
  "@backstage/types": "^1.1.1"
58
58
  },
59
59
  "devDependencies": {
60
- "@backstage/cli": "^0.26.5"
60
+ "@backstage/cli": "^0.26.7-next.1"
61
61
  },
62
62
  "module": "./dist/index.esm.js"
63
63
  }