Merge pull request #29644 from awanlin/permissions-backend/remove-backend-common

permission-backend - Removed legacy backend support
This commit is contained in:
Patrik Oldsberg
2025-04-21 23:48:27 +02:00
committed by GitHub
6 changed files with 13 additions and 46 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-permission-backend': minor
---
**BREAKING** Removed support for the legacy backend system, please [migrate to the new backend system](https://backstage.io/docs/backend-system/building-backends/migrating)
+1 -2
View File
@@ -51,14 +51,12 @@
"test": "backstage-cli package test"
},
"dependencies": {
"@backstage/backend-common": "^0.25.0",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/plugin-auth-node": "workspace:^",
"@backstage/plugin-permission-common": "workspace:^",
"@backstage/plugin-permission-node": "workspace:^",
"@types/express": "^4.17.6",
"dataloader": "^2.0.0",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
@@ -70,6 +68,7 @@
"@backstage/backend-defaults": "workspace:^",
"@backstage/backend-test-utils": "workspace:^",
"@backstage/cli": "workspace:^",
"@types/express": "^4.17.6",
"@types/lodash": "^4.14.151",
"@types/supertest": "^2.0.8",
"msw": "^1.0.0",
-32
View File
@@ -3,41 +3,9 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { AuthService } from '@backstage/backend-plugin-api';
import { BackendFeature } from '@backstage/backend-plugin-api';
import { DiscoveryService } from '@backstage/backend-plugin-api';
import express from 'express';
import { HttpAuthService } from '@backstage/backend-plugin-api';
import { IdentityApi } from '@backstage/plugin-auth-node';
import { LoggerService } from '@backstage/backend-plugin-api';
import { PermissionPolicy } from '@backstage/plugin-permission-node';
import { RootConfigService } from '@backstage/backend-plugin-api';
import { UserInfoService } from '@backstage/backend-plugin-api';
// @public @deprecated
export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public
const permissionPlugin: BackendFeature;
export default permissionPlugin;
// @public @deprecated
export interface RouterOptions {
// (undocumented)
auth?: AuthService;
// (undocumented)
config: RootConfigService;
// (undocumented)
discovery: DiscoveryService;
// (undocumented)
httpAuth?: HttpAuthService;
// (undocumented)
identity?: IdentityApi;
// (undocumented)
logger: LoggerService;
// (undocumented)
policy: PermissionPolicy;
// (undocumented)
userInfo?: UserInfoService;
}
```
-1
View File
@@ -19,4 +19,3 @@
* @packageDocumentation
*/
export { permissionPlugin as default } from './plugin';
export * from './service';
@@ -17,7 +17,6 @@
import { z } from 'zod';
import express, { Request, Response } from 'express';
import Router from 'express-promise-router';
import { createLegacyAuthAdapters } from '@backstage/backend-common';
import { InputError } from '@backstage/errors';
import { IdentityApi } from '@backstage/plugin-auth-node';
import {
@@ -99,8 +98,7 @@ const evaluatePermissionRequestBatchSchema: z.ZodSchema<EvaluatePermissionReques
* Options required when constructing a new {@link express#Router} using
* {@link createRouter}.
*
* @public
* @deprecated Please migrate to the new backend system as this will be removed in the future.
* @internal
*/
export interface RouterOptions {
logger: LoggerService;
@@ -108,9 +106,9 @@ export interface RouterOptions {
policy: PermissionPolicy;
identity?: IdentityApi;
config: RootConfigService;
auth?: AuthService;
httpAuth?: HttpAuthService;
userInfo?: UserInfoService;
auth: AuthService;
httpAuth: HttpAuthService;
userInfo: UserInfoService;
}
const handleRequest = async (
@@ -194,14 +192,13 @@ const handleRequest = async (
* Creates a new {@link express#Router} which provides the backend API
* for the permission system.
*
* @deprecated Please migrate to the new backend system as this will be removed in the future.
* @public
* @internal
*/
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {
const { policy, discovery, config, logger } = options;
const { auth, httpAuth, userInfo } = createLegacyAuthAdapters(options);
const { policy, discovery, config, logger, auth, httpAuth, userInfo } =
options;
if (!config.getOptionalBoolean('permission.enabled')) {
logger.warn(
-1
View File
@@ -6980,7 +6980,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@backstage/plugin-permission-backend@workspace:plugins/permission-backend"
dependencies:
"@backstage/backend-common": "npm:^0.25.0"
"@backstage/backend-defaults": "workspace:^"
"@backstage/backend-plugin-api": "workspace:^"
"@backstage/backend-test-utils": "workspace:^"