scaffolder-backend: remove auth-backend dependency
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
"@backstage/catalog-model": "^0.7.1",
|
||||
"@backstage/config": "^0.1.2",
|
||||
"@backstage/integration": "^0.3.2",
|
||||
"@backstage/plugin-auth-backend": "^0.2.12",
|
||||
"@gitbeaker/core": "^28.0.2",
|
||||
"@gitbeaker/node": "^28.0.2",
|
||||
"@octokit/rest": "^18.0.12",
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
import { Config } from '@backstage/config';
|
||||
import { IdentityClient } from '@backstage/plugin-auth-backend';
|
||||
import Docker from 'dockerode';
|
||||
import express from 'express';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
@@ -136,7 +135,7 @@ export async function createRouter(
|
||||
|
||||
// Forward authorization from client
|
||||
const template = await entityClient.findTemplate(templateName, {
|
||||
token: IdentityClient.getBearerToken(req.headers.authorization),
|
||||
token: getBearerToken(req.headers.authorization),
|
||||
});
|
||||
|
||||
const validationResult: ValidatorResult = validate(
|
||||
@@ -299,3 +298,7 @@ export async function createRouter(
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
function getBearerToken(header?: string): string | undefined {
|
||||
return header?.match(/Bearer\s+(\S+)/i)?.[1];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user