migrate playlist-backend plugin to the new backend system

Signed-off-by: zcason <a-zcason@expediagroup.com>
This commit is contained in:
zcason
2023-09-18 15:26:57 -05:00
parent ee7d8a737b
commit 4a2d633aae
7 changed files with 58 additions and 0 deletions
+1
View File
@@ -46,6 +46,7 @@
"@backstage/plugin-permission-backend-module-allow-all-policy": "workspace:^",
"@backstage/plugin-permission-common": "workspace:^",
"@backstage/plugin-permission-node": "workspace:^",
"@backstage/plugin-playlist-backend": "workspace:^",
"@backstage/plugin-proxy-backend": "workspace:^",
"@backstage/plugin-scaffolder-backend": "workspace:^",
"@backstage/plugin-search-backend": "workspace:^",
+1
View File
@@ -33,6 +33,7 @@ backend.add(import('@backstage/plugin-graphql-backend'));
backend.add(import('@backstage/plugin-kubernetes-backend/alpha'));
backend.add(import('@backstage/plugin-lighthouse-backend'));
backend.add(import('@backstage/plugin-linguist-backend'));
backend.add(import('@backstage/plugin-playlist-backend'));
backend.add(
import('@backstage/plugin-permission-backend-module-allow-all-policy'),
);
+4
View File
@@ -3,6 +3,7 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { BackstageIdentityResponse } from '@backstage/plugin-auth-node';
import { ConditionalPolicyDecision } from '@backstage/plugin-permission-common';
import { Conditions } from '@backstage/plugin-permission-node';
@@ -34,6 +35,9 @@ export const createPlaylistConditionalDecision: (
// @public (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public
export const playlistPlugin: () => BackendFeature;
// @public
export class DefaultPlaylistPermissionPolicy implements PermissionPolicy {
// (undocumented)
+1
View File
@@ -29,6 +29,7 @@
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/catalog-client": "workspace:^",
"@backstage/catalog-model": "workspace:^",
"@backstage/config": "workspace:^",
+1
View File
@@ -26,3 +26,4 @@ export {
isPlaylistPermission,
playlistConditions,
} from './permissions';
export { playlistPlugin as default } from './plugin';
+48
View File
@@ -0,0 +1,48 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { createRouter } from './service';
import { loggerToWinstonLogger } from '@backstage/backend-common';
export const playlistPlugin = createBackendPlugin({
pluginId: 'playlist',
register(env) {
env.registerInit({
deps: {
http: coreServices.httpRouter,
logger: coreServices.logger,
database: coreServices.database,
identity: coreServices.identity,
discovery: coreServices.discovery,
permissions: coreServices.permissions,
},
async init({ http, logger, database, identity, discovery, permissions }) {
http.use(
await createRouter({
logger: loggerToWinstonLogger(logger),
database,
identity,
discovery,
permissions,
}),
);
},
});
},
});
+2
View File
@@ -8362,6 +8362,7 @@ __metadata:
resolution: "@backstage/plugin-playlist-backend@workspace:plugins/playlist-backend"
dependencies:
"@backstage/backend-common": "workspace:^"
"@backstage/backend-plugin-api": "workspace:^"
"@backstage/backend-test-utils": "workspace:^"
"@backstage/catalog-client": "workspace:^"
"@backstage/catalog-model": "workspace:^"
@@ -25969,6 +25970,7 @@ __metadata:
"@backstage/plugin-permission-backend-module-allow-all-policy": "workspace:^"
"@backstage/plugin-permission-common": "workspace:^"
"@backstage/plugin-permission-node": "workspace:^"
"@backstage/plugin-playlist-backend": "workspace:^"
"@backstage/plugin-proxy-backend": "workspace:^"
"@backstage/plugin-scaffolder-backend": "workspace:^"
"@backstage/plugin-search-backend": "workspace:^"