@backstage/plugin-permission-backend 0.5.26-next.1 → 0.5.26-next.2
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 +14 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.cjs.js +2 -22
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/alpha.d.ts +1 -7
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @backstage/plugin-permission-backend
|
|
2
2
|
|
|
3
|
+
## 0.5.26-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 84ad6fccd4d5: Moved `permissionModuleAllowAllPolicy` to `@backstage/plugin-permission-backend-module-allow-all-policy`
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/config@1.1.0-next.1
|
|
10
|
+
- @backstage/backend-common@0.19.5-next.2
|
|
11
|
+
- @backstage/plugin-auth-node@0.3.0-next.2
|
|
12
|
+
- @backstage/plugin-permission-node@0.7.14-next.2
|
|
13
|
+
- @backstage/backend-plugin-api@0.6.3-next.2
|
|
14
|
+
- @backstage/plugin-permission-common@0.7.8-next.1
|
|
15
|
+
- @backstage/errors@1.2.1
|
|
16
|
+
|
|
3
17
|
## 0.5.26-next.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.cjs.js
CHANGED
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var backendCommon = require('@backstage/backend-common');
|
|
6
6
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
7
|
-
var pluginPermissionCommon = require('@backstage/plugin-permission-common');
|
|
8
7
|
var alpha = require('@backstage/plugin-permission-node/alpha');
|
|
9
8
|
var router = require('./cjs/router-40c490a9.cjs.js');
|
|
10
9
|
require('zod');
|
|
11
10
|
require('express');
|
|
12
11
|
require('express-promise-router');
|
|
13
12
|
require('@backstage/errors');
|
|
13
|
+
require('@backstage/plugin-permission-common');
|
|
14
14
|
require('node-fetch');
|
|
15
15
|
require('lodash');
|
|
16
16
|
require('dataloader');
|
|
@@ -32,25 +32,6 @@ class PolicyExtensionPointImpl {
|
|
|
32
32
|
this.policy = policy;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
const permissionModuleAllowAllPolicy = backendPluginApi.createBackendModule({
|
|
36
|
-
moduleId: "allowAllPolicy",
|
|
37
|
-
pluginId: "permission",
|
|
38
|
-
register(reg) {
|
|
39
|
-
class AllowAllPermissionPolicy {
|
|
40
|
-
async handle(_request, _user) {
|
|
41
|
-
return {
|
|
42
|
-
result: pluginPermissionCommon.AuthorizeResult.ALLOW
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
reg.registerInit({
|
|
47
|
-
deps: { policy: alpha.policyExtensionPoint },
|
|
48
|
-
async init({ policy }) {
|
|
49
|
-
policy.setPolicy(new AllowAllPermissionPolicy());
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
35
|
const permissionPlugin = backendPluginApi.createBackendPlugin({
|
|
55
36
|
pluginId: "permission",
|
|
56
37
|
register(env) {
|
|
@@ -68,7 +49,7 @@ const permissionPlugin = backendPluginApi.createBackendPlugin({
|
|
|
68
49
|
const winstonLogger = backendCommon.loggerToWinstonLogger(logger);
|
|
69
50
|
if (!policies.policy) {
|
|
70
51
|
throw new Error(
|
|
71
|
-
"No policy module installed! Please install a policy module. If you want to allow all requests, use permissionModuleAllowAllPolicy"
|
|
52
|
+
"No policy module installed! Please install a policy module. If you want to allow all requests, use @backstage/plugin-permission-backend-module-allow-all-policy permissionModuleAllowAllPolicy"
|
|
72
53
|
);
|
|
73
54
|
}
|
|
74
55
|
http.use(
|
|
@@ -85,6 +66,5 @@ const permissionPlugin = backendPluginApi.createBackendPlugin({
|
|
|
85
66
|
}
|
|
86
67
|
});
|
|
87
68
|
|
|
88
|
-
exports.permissionModuleAllowAllPolicy = permissionModuleAllowAllPolicy;
|
|
89
69
|
exports.permissionPlugin = permissionPlugin;
|
|
90
70
|
//# sourceMappingURL=alpha.cjs.js.map
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.cjs.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { loggerToWinstonLogger } from '@backstage/backend-common';\nimport {\n coreServices,\n
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { loggerToWinstonLogger } from '@backstage/backend-common';\nimport {\n coreServices,\n createBackendPlugin,\n} from '@backstage/backend-plugin-api';\nimport { PermissionPolicy } from '@backstage/plugin-permission-node';\nimport {\n policyExtensionPoint,\n PolicyExtensionPoint,\n} from '@backstage/plugin-permission-node/alpha';\nimport { createRouter } from './service';\n\nclass PolicyExtensionPointImpl implements PolicyExtensionPoint {\n public policy: PermissionPolicy | undefined;\n\n setPolicy(policy: PermissionPolicy): void {\n if (this.policy) {\n throw new Error('Policy already set');\n }\n this.policy = policy;\n }\n}\n\n/**\n * Permission plugin\n *\n * @alpha\n */\nexport const permissionPlugin = createBackendPlugin({\n pluginId: 'permission',\n register(env) {\n const policies = new PolicyExtensionPointImpl();\n\n env.registerExtensionPoint(policyExtensionPoint, policies);\n\n env.registerInit({\n deps: {\n http: coreServices.httpRouter,\n config: coreServices.rootConfig,\n logger: coreServices.logger,\n discovery: coreServices.discovery,\n identity: coreServices.identity,\n },\n async init({ http, config, logger, discovery, identity }) {\n const winstonLogger = loggerToWinstonLogger(logger);\n if (!policies.policy) {\n throw new Error(\n 'No policy module installed! Please install a policy module. If you want to allow all requests, use @backstage/plugin-permission-backend-module-allow-all-policy permissionModuleAllowAllPolicy',\n );\n }\n\n http.use(\n await createRouter({\n config,\n discovery,\n identity,\n logger: winstonLogger,\n policy: policies.policy,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendPlugin","policyExtensionPoint","coreServices","loggerToWinstonLogger","createRouter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,wBAAyD,CAAA;AAAA,EAA/D,WAAA,GAAA;AACE,IAAO,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAEP,UAAU,MAAgC,EAAA;AACxC,IAAA,IAAI,KAAK,MAAQ,EAAA;AACf,MAAM,MAAA,IAAI,MAAM,oBAAoB,CAAA,CAAA;AAAA,KACtC;AACA,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA,CAAA;AAAA,GAChB;AACF,CAAA;AAOO,MAAM,mBAAmBA,oCAAoB,CAAA;AAAA,EAClD,QAAU,EAAA,YAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAM,MAAA,QAAA,GAAW,IAAI,wBAAyB,EAAA,CAAA;AAE9C,IAAI,GAAA,CAAA,sBAAA,CAAuBC,4BAAsB,QAAQ,CAAA,CAAA;AAEzD,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAMC,6BAAa,CAAA,UAAA;AAAA,QACnB,QAAQA,6BAAa,CAAA,UAAA;AAAA,QACrB,QAAQA,6BAAa,CAAA,MAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,UAAUA,6BAAa,CAAA,QAAA;AAAA,OACzB;AAAA,MACA,MAAM,KAAK,EAAE,IAAA,EAAM,QAAQ,MAAQ,EAAA,SAAA,EAAW,UAAY,EAAA;AACxD,QAAM,MAAA,aAAA,GAAgBC,oCAAsB,MAAM,CAAA,CAAA;AAClD,QAAI,IAAA,CAAC,SAAS,MAAQ,EAAA;AACpB,UAAA,MAAM,IAAI,KAAA;AAAA,YACR,gMAAA;AAAA,WACF,CAAA;AAAA,SACF;AAEA,QAAK,IAAA,CAAA,GAAA;AAAA,UACH,MAAMC,mBAAa,CAAA;AAAA,YACjB,MAAA;AAAA,YACA,SAAA;AAAA,YACA,QAAA;AAAA,YACA,MAAQ,EAAA,aAAA;AAAA,YACR,QAAQ,QAAS,CAAA,MAAA;AAAA,WAClB,CAAA;AAAA,SACH,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* A permission policy module that allows all requests.
|
|
5
|
-
*
|
|
6
|
-
* @alpha
|
|
7
|
-
*/
|
|
8
|
-
declare const permissionModuleAllowAllPolicy: () => _backstage_backend_plugin_api.BackendFeature;
|
|
9
3
|
/**
|
|
10
4
|
* Permission plugin
|
|
11
5
|
*
|
|
@@ -13,4 +7,4 @@ declare const permissionModuleAllowAllPolicy: () => _backstage_backend_plugin_ap
|
|
|
13
7
|
*/
|
|
14
8
|
declare const permissionPlugin: () => _backstage_backend_plugin_api.BackendFeature;
|
|
15
9
|
|
|
16
|
-
export {
|
|
10
|
+
export { permissionPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-permission-backend",
|
|
3
|
-
"version": "0.5.26-next.
|
|
3
|
+
"version": "0.5.26-next.2",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"clean": "backstage-cli package clean"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@backstage/backend-common": "^0.19.5-next.
|
|
45
|
-
"@backstage/backend-plugin-api": "^0.6.3-next.
|
|
46
|
-
"@backstage/config": "^1.1.0-next.
|
|
44
|
+
"@backstage/backend-common": "^0.19.5-next.2",
|
|
45
|
+
"@backstage/backend-plugin-api": "^0.6.3-next.2",
|
|
46
|
+
"@backstage/config": "^1.1.0-next.1",
|
|
47
47
|
"@backstage/errors": "^1.2.1",
|
|
48
|
-
"@backstage/plugin-auth-node": "^0.3.0-next.
|
|
49
|
-
"@backstage/plugin-permission-common": "^0.7.8-next.
|
|
50
|
-
"@backstage/plugin-permission-node": "^0.7.14-next.
|
|
48
|
+
"@backstage/plugin-auth-node": "^0.3.0-next.2",
|
|
49
|
+
"@backstage/plugin-permission-common": "^0.7.8-next.1",
|
|
50
|
+
"@backstage/plugin-permission-node": "^0.7.14-next.2",
|
|
51
51
|
"@types/express": "*",
|
|
52
52
|
"dataloader": "^2.0.0",
|
|
53
53
|
"express": "^4.17.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"zod": "^3.21.4"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@backstage/cli": "^0.22.13-next.
|
|
62
|
+
"@backstage/cli": "^0.22.13-next.2",
|
|
63
63
|
"@types/lodash": "^4.14.151",
|
|
64
64
|
"@types/supertest": "^2.0.8",
|
|
65
65
|
"msw": "^1.0.0",
|