@backstage/plugin-permission-backend-module-allow-all-policy 0.0.0-nightly-20230906021121

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 ADDED
@@ -0,0 +1,31 @@
1
+ # @backstage/plugin-permission-backend-module-allow-all-policy
2
+
3
+ ## 0.0.0-nightly-20230906021121
4
+
5
+ ### Minor Changes
6
+
7
+ - 5f7b2153526b: Created package with policy `permissionModuleAllowAllPolicy`
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/plugin-auth-node@0.0.0-nightly-20230906021121
13
+ - @backstage/backend-common@0.0.0-nightly-20230906021121
14
+ - @backstage/plugin-permission-node@0.0.0-nightly-20230906021121
15
+ - @backstage/backend-plugin-api@0.0.0-nightly-20230906021121
16
+ - @backstage/plugin-permission-common@0.0.0-nightly-20230906021121
17
+
18
+ ## 0.1.0-next.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 5f7b2153526b: Created package with policy `permissionModuleAllowAllPolicy`
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+ - @backstage/backend-common@0.19.5-next.2
28
+ - @backstage/plugin-auth-node@0.3.0-next.2
29
+ - @backstage/plugin-permission-node@0.7.14-next.2
30
+ - @backstage/backend-plugin-api@0.6.3-next.2
31
+ - @backstage/plugin-permission-common@0.7.8-next.1
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @backstage/plugin-permission-backend-module-allow-all-policy
2
+
3
+ The allow all policy backend module for the permission plugin.
4
+
5
+ _This plugin was created through the Backstage CLI_
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var backendPluginApi = require('@backstage/backend-plugin-api');
6
+ var alpha = require('@backstage/plugin-permission-node/alpha');
7
+ var pluginPermissionCommon = require('@backstage/plugin-permission-common');
8
+
9
+ class AllowAllPermissionPolicy {
10
+ async handle(_request, _user) {
11
+ return {
12
+ result: pluginPermissionCommon.AuthorizeResult.ALLOW
13
+ };
14
+ }
15
+ }
16
+
17
+ const permissionModuleAllowAllPolicy = backendPluginApi.createBackendModule({
18
+ moduleId: "allowAllPolicy",
19
+ pluginId: "permission",
20
+ register(reg) {
21
+ reg.registerInit({
22
+ deps: { policy: alpha.policyExtensionPoint },
23
+ async init({ policy }) {
24
+ policy.setPolicy(new AllowAllPermissionPolicy());
25
+ }
26
+ });
27
+ }
28
+ });
29
+
30
+ exports.permissionModuleAllowAllPolicy = permissionModuleAllowAllPolicy;
31
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/policy.ts","../src/module.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { BackstageIdentityResponse } from '@backstage/plugin-auth-node';\nimport {\n AuthorizeResult,\n PolicyDecision,\n} from '@backstage/plugin-permission-common';\nimport {\n PermissionPolicy,\n PolicyQuery,\n} from '@backstage/plugin-permission-node';\n\nexport class AllowAllPermissionPolicy implements PermissionPolicy {\n async handle(\n _request: PolicyQuery,\n _user?: BackstageIdentityResponse,\n ): Promise<PolicyDecision> {\n return {\n result: AuthorizeResult.ALLOW,\n };\n }\n}\n","/*\n * Copyright 2023 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 */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { policyExtensionPoint } from '@backstage/plugin-permission-node/alpha';\nimport { AllowAllPermissionPolicy } from './policy';\n\n/**\n * A permission policy module that allows all requests.\n *\n * @public\n */\nexport const permissionModuleAllowAllPolicy = createBackendModule({\n moduleId: 'allowAllPolicy',\n pluginId: 'permission',\n register(reg) {\n reg.registerInit({\n deps: { policy: policyExtensionPoint },\n async init({ policy }) {\n policy.setPolicy(new AllowAllPermissionPolicy());\n },\n });\n },\n});\n"],"names":["AuthorizeResult","createBackendModule","policyExtensionPoint"],"mappings":";;;;;;;;AA0BO,MAAM,wBAAqD,CAAA;AAAA,EAChE,MAAM,MACJ,CAAA,QAAA,EACA,KACyB,EAAA;AACzB,IAAO,OAAA;AAAA,MACL,QAAQA,sCAAgB,CAAA,KAAA;AAAA,KAC1B,CAAA;AAAA,GACF;AACF;;ACXO,MAAM,iCAAiCC,oCAAoB,CAAA;AAAA,EAChE,QAAU,EAAA,gBAAA;AAAA,EACV,QAAU,EAAA,YAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAA,EAAM,EAAE,MAAA,EAAQC,0BAAqB,EAAA;AAAA,MACrC,MAAM,IAAA,CAAK,EAAE,MAAA,EAAU,EAAA;AACrB,QAAO,MAAA,CAAA,SAAA,CAAU,IAAI,wBAAA,EAA0B,CAAA,CAAA;AAAA,OACjD;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
@@ -0,0 +1,10 @@
1
+ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
+
3
+ /**
4
+ * A permission policy module that allows all requests.
5
+ *
6
+ * @public
7
+ */
8
+ declare const permissionModuleAllowAllPolicy: () => _backstage_backend_plugin_api.BackendFeature;
9
+
10
+ export { permissionModuleAllowAllPolicy };
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@backstage/plugin-permission-backend-module-allow-all-policy",
3
+ "description": "Allow all policy backend module for the permission plugin.",
4
+ "version": "0.0.0-nightly-20230906021121",
5
+ "main": "dist/index.cjs.js",
6
+ "types": "dist/index.d.ts",
7
+ "license": "Apache-2.0",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "main": "dist/index.cjs.js",
11
+ "types": "dist/index.d.ts"
12
+ },
13
+ "backstage": {
14
+ "role": "backend-plugin-module"
15
+ },
16
+ "scripts": {
17
+ "start": "backstage-cli package start",
18
+ "build": "backstage-cli package build",
19
+ "lint": "backstage-cli package lint",
20
+ "test": "backstage-cli package test",
21
+ "clean": "backstage-cli package clean",
22
+ "prepack": "backstage-cli package prepack",
23
+ "postpack": "backstage-cli package postpack"
24
+ },
25
+ "dependencies": {
26
+ "@backstage/backend-common": "^0.0.0-nightly-20230906021121",
27
+ "@backstage/backend-plugin-api": "^0.0.0-nightly-20230906021121",
28
+ "@backstage/plugin-auth-node": "^0.0.0-nightly-20230906021121",
29
+ "@backstage/plugin-permission-common": "^0.0.0-nightly-20230906021121",
30
+ "@backstage/plugin-permission-node": "^0.0.0-nightly-20230906021121"
31
+ },
32
+ "devDependencies": {
33
+ "@backstage/backend-test-utils": "^0.0.0-nightly-20230906021121",
34
+ "@backstage/cli": "^0.0.0-nightly-20230906021121"
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ]
39
+ }