@red-hat-developer-hub/backstage-plugin-bulk-import-backend 9.0.1 → 9.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-bulk-import-backend
2
2
 
3
+ ## 9.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2bebbeb: Updated dependency `prettier` to `3.9.8`.
8
+ - fe07a78: Updated dependency `@openapitools/openapi-generator-cli` to `2.41.0`.
9
+ Updated dependency `@playwright/test` to `1.63.0`.
10
+ - 22ab37c: Updated dependency `prettier` to `3.9.7`.
11
+ - Updated dependencies [2bebbeb]
12
+ - Updated dependencies [22ab37c]
13
+ - @red-hat-developer-hub/backstage-plugin-bulk-import-common@9.1.1
14
+
15
+ ## 9.1.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 2b31f6c: Convert `bulk.import` from a resource permission to a feature permission, and register the NFS bulk import page using the `if` permission predicate.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [2b31f6c]
24
+ - @red-hat-developer-hub/backstage-plugin-bulk-import-common@9.1.0
25
+
3
26
  ## 9.0.1
4
27
 
5
28
  ### Patch Changes
package/README.md CHANGED
@@ -30,7 +30,9 @@ To set up the bulk import backend package for the backend:
30
30
 
31
31
  #### Permission Framework Support
32
32
 
33
- The Bulk Import Backend plugin has support for the permission framework. A basic example permission policy is shown below to disallow access to the bulk import API for all users except those in the `backstage-admins` group.
33
+ The Bulk Import Backend plugin has support for the permission framework. The plugin registers `bulk.import` as a **feature permission** (`BasicPermission`) from `@red-hat-developer-hub/backstage-plugin-bulk-import-common`.
34
+
35
+ A basic example permission policy is shown below to disallow access to the bulk import API for all users except those in the `backstage-admins` group.
34
36
 
35
37
  1. Create a backend module for the permission policy, under a `packages/backend/src/plugins/permissions.ts` file:
36
38
 
@@ -9,8 +9,7 @@ async function permissionCheck(auditor, openApiOperationId, permissions, httpAut
9
9
  const decision = (await permissions.authorize(
10
10
  [
11
11
  {
12
- permission: backstagePluginBulkImportCommon.bulkImportPermission,
13
- resourceRef: backstagePluginBulkImportCommon.bulkImportPermission.resourceType
12
+ permission: backstagePluginBulkImportCommon.bulkImportPermission
14
13
  }
15
14
  ],
16
15
  {
@@ -1 +1 @@
1
- {"version":3,"file":"auth.cjs.js","sources":["../../src/helpers/auth.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 type {\n AuditorService,\n HttpAuthService,\n PermissionsService,\n} from '@backstage/backend-plugin-api';\nimport { NotAllowedError } from '@backstage/errors';\nimport { AuthorizeResult } from '@backstage/plugin-permission-common';\n\nimport express from 'express';\n\nimport { bulkImportPermission } from '@red-hat-developer-hub/backstage-plugin-bulk-import-common';\n\nimport { auditCreateEvent } from './auditorUtils';\n\n/**\n * This will resolve to { result: AuthorizeResult.ALLOW } if the permission framework is disabled\n */\nexport async function permissionCheck(\n auditor: AuditorService,\n openApiOperationId: string | undefined,\n permissions: PermissionsService,\n httpAuth: HttpAuthService,\n req: express.Request,\n) {\n const decision = (\n await permissions.authorize(\n [\n {\n permission: bulkImportPermission,\n resourceRef: bulkImportPermission.resourceType,\n },\n ],\n {\n credentials: await httpAuth.credentials(req),\n },\n )\n )[0];\n\n if (decision.result === AuthorizeResult.DENY) {\n const err = new NotAllowedError('Unauthorized');\n const auditorEvent = await auditCreateEvent(\n auditor,\n openApiOperationId,\n req,\n );\n await auditorEvent.fail({ error: err, meta: { responseStatus: 403 } });\n throw err;\n }\n}\n"],"names":["bulkImportPermission","AuthorizeResult","NotAllowedError","auditCreateEvent"],"mappings":";;;;;;;AAiCA,eAAsB,eAAA,CACpB,OAAA,EACA,kBAAA,EACA,WAAA,EACA,UACA,GAAA,EACA;AACA,EAAA,MAAM,QAAA,GAAA,CACJ,MAAM,WAAA,CAAY,SAAA;AAAA,IAChB;AAAA,MACE;AAAA,QACE,UAAA,EAAYA,oDAAA;AAAA,QACZ,aAAaA,oDAAA,CAAqB;AAAA;AACpC,KACF;AAAA,IACA;AAAA,MACE,WAAA,EAAa,MAAM,QAAA,CAAS,WAAA,CAAY,GAAG;AAAA;AAC7C,KAEF,CAAC,CAAA;AAEH,EAAA,IAAI,QAAA,CAAS,MAAA,KAAWC,sCAAA,CAAgB,IAAA,EAAM;AAC5C,IAAA,MAAM,GAAA,GAAM,IAAIC,sBAAA,CAAgB,cAAc,CAAA;AAC9C,IAAA,MAAM,eAAe,MAAMC,6BAAA;AAAA,MACzB,OAAA;AAAA,MACA,kBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,YAAA,CAAa,IAAA,CAAK,EAAE,KAAA,EAAO,GAAA,EAAK,MAAM,EAAE,cAAA,EAAgB,GAAA,EAAI,EAAG,CAAA;AACrE,IAAA,MAAM,GAAA;AAAA,EACR;AACF;;;;"}
1
+ {"version":3,"file":"auth.cjs.js","sources":["../../src/helpers/auth.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 type {\n AuditorService,\n HttpAuthService,\n PermissionsService,\n} from '@backstage/backend-plugin-api';\nimport { NotAllowedError } from '@backstage/errors';\nimport { AuthorizeResult } from '@backstage/plugin-permission-common';\n\nimport express from 'express';\n\nimport { bulkImportPermission } from '@red-hat-developer-hub/backstage-plugin-bulk-import-common';\n\nimport { auditCreateEvent } from './auditorUtils';\n\n/**\n * This will resolve to { result: AuthorizeResult.ALLOW } if the permission framework is disabled\n */\nexport async function permissionCheck(\n auditor: AuditorService,\n openApiOperationId: string | undefined,\n permissions: PermissionsService,\n httpAuth: HttpAuthService,\n req: express.Request,\n) {\n const decision = (\n await permissions.authorize(\n [\n {\n permission: bulkImportPermission,\n },\n ],\n {\n credentials: await httpAuth.credentials(req),\n },\n )\n )[0];\n\n if (decision.result === AuthorizeResult.DENY) {\n const err = new NotAllowedError('Unauthorized');\n const auditorEvent = await auditCreateEvent(\n auditor,\n openApiOperationId,\n req,\n );\n await auditorEvent.fail({ error: err, meta: { responseStatus: 403 } });\n throw err;\n }\n}\n"],"names":["bulkImportPermission","AuthorizeResult","NotAllowedError","auditCreateEvent"],"mappings":";;;;;;;AAiCA,eAAsB,eAAA,CACpB,OAAA,EACA,kBAAA,EACA,WAAA,EACA,UACA,GAAA,EACA;AACA,EAAA,MAAM,QAAA,GAAA,CACJ,MAAM,WAAA,CAAY,SAAA;AAAA,IAChB;AAAA,MACE;AAAA,QACE,UAAA,EAAYA;AAAA;AACd,KACF;AAAA,IACA;AAAA,MACE,WAAA,EAAa,MAAM,QAAA,CAAS,WAAA,CAAY,GAAG;AAAA;AAC7C,KAEF,CAAC,CAAA;AAEH,EAAA,IAAI,QAAA,CAAS,MAAA,KAAWC,sCAAA,CAAgB,IAAA,EAAM;AAC5C,IAAA,MAAM,GAAA,GAAM,IAAIC,sBAAA,CAAgB,cAAc,CAAA;AAC9C,IAAA,MAAM,eAAe,MAAMC,6BAAA;AAAA,MACzB,OAAA;AAAA,MACA,kBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,YAAA,CAAa,IAAA,CAAK,EAAE,KAAA,EAAO,GAAA,EAAK,MAAM,EAAE,cAAA,EAAgB,GAAA,EAAI,EAAG,CAAA;AACrE,IAAA,MAAM,GAAA;AAAA,EACR;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-bulk-import-backend",
3
- "version": "9.0.1",
3
+ "version": "9.1.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -61,7 +61,7 @@
61
61
  "@gitbeaker/rest": "^43.4.0",
62
62
  "@octokit/auth-app": "^7.2.2",
63
63
  "@octokit/rest": "^20.0.2",
64
- "@red-hat-developer-hub/backstage-plugin-bulk-import-common": "^9.0.1",
64
+ "@red-hat-developer-hub/backstage-plugin-bulk-import-common": "^9.1.1",
65
65
  "@red-hat-developer-hub/backstage-plugin-orchestrator-common": "^3.7.3",
66
66
  "ajv-formats": "^3.0.1",
67
67
  "eventsource-client": "^1.2.0",
@@ -80,7 +80,7 @@
80
80
  "@backstage/config": "^1.3.8",
81
81
  "@backstage/plugin-catalog-backend": "^3.9.1",
82
82
  "@backstage/types": "^1.2.2",
83
- "@openapitools/openapi-generator-cli": "2.40.1",
83
+ "@openapitools/openapi-generator-cli": "2.41.0",
84
84
  "@spotify/prettier-config": "^15.0.0",
85
85
  "@types/express": "4.17.25",
86
86
  "@types/git-url-parse": "^9.0.0",
@@ -89,7 +89,7 @@
89
89
  "js-yaml-cli": "0.6.0",
90
90
  "msw": "1.3.5",
91
91
  "openapicmd": "2.9.2",
92
- "prettier": "3.9.6",
92
+ "prettier": "3.9.8",
93
93
  "supertest": "6.3.4"
94
94
  },
95
95
  "files": [