move IdentityClient.getBearerToken
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/search-common": "^0.2.2",
|
||||
"@backstage/plugin-auth-backend": "^0.10.0-next.0",
|
||||
"@backstage/plugin-auth-node": "^0.0.0",
|
||||
"@backstage/plugin-permission-common": "^0.4.0-next.0",
|
||||
"@backstage/plugin-permission-node": "^0.4.3-next.0",
|
||||
"@backstage/plugin-search-backend-node": "^0.4.5",
|
||||
|
||||
@@ -22,7 +22,7 @@ import { errorHandler } from '@backstage/backend-common';
|
||||
import { InputError } from '@backstage/errors';
|
||||
import { Config } from '@backstage/config';
|
||||
import { JsonObject, JsonValue } from '@backstage/types';
|
||||
import { IdentityClient } from '@backstage/plugin-auth-backend';
|
||||
import { getBearerTokenFromAuthorizationHeader } from '@backstage/plugin-auth-node';
|
||||
import { PermissionAuthorizer } from '@backstage/plugin-permission-common';
|
||||
import { DocumentTypeInfo, SearchResultSet } from '@backstage/search-common';
|
||||
import { SearchEngine } from '@backstage/plugin-search-backend-node';
|
||||
@@ -106,7 +106,9 @@ export async function createRouter(
|
||||
}, pageCursor=${query.pageCursor ?? ''}`,
|
||||
);
|
||||
|
||||
const token = IdentityClient.getBearerToken(req.header('authorization'));
|
||||
const token = getBearerTokenFromAuthorizationHeader(
|
||||
req.header('authorization'),
|
||||
);
|
||||
|
||||
try {
|
||||
const resultSet = await engine?.query(query, { token });
|
||||
|
||||
Reference in New Issue
Block a user