permission-backend - Removed legacy backend support

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
This commit is contained in:
Andre Wanlin
2025-04-16 12:18:05 -05:00
parent 51105a038c
commit cf8fd51b61
6 changed files with 12 additions and 45 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
View File
@@ -51,7 +51,6 @@
"test": "backstage-cli package test"
},
"dependencies": {
"@backstage/backend-common": "^0.25.0",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/errors": "workspace:^",
-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:^"