From 26fb159a30e1249ba799aad5b47fb4289878da41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 14 Mar 2022 14:39:02 +0100 Subject: [PATCH] make sure to pass in the auth token to the ancestry endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/four-schools-shake.md | 5 +++++ plugins/catalog-backend/src/service/createRouter.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/four-schools-shake.md diff --git a/.changeset/four-schools-shake.md b/.changeset/four-schools-shake.md new file mode 100644 index 0000000000..9fd81b5888 --- /dev/null +++ b/.changeset/four-schools-shake.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Pass in auth token to ancestry endpoint diff --git a/plugins/catalog-backend/src/service/createRouter.ts b/plugins/catalog-backend/src/service/createRouter.ts index 56121f4155..df289d579b 100644 --- a/plugins/catalog-backend/src/service/createRouter.ts +++ b/plugins/catalog-backend/src/service/createRouter.ts @@ -158,7 +158,9 @@ export async function createRouter( async (req, res) => { const { kind, namespace, name } = req.params; const entityRef = stringifyEntityRef({ kind, namespace, name }); - const response = await entitiesCatalog.entityAncestry(entityRef); + const response = await entitiesCatalog.entityAncestry(entityRef, { + authorizationToken: getBearerToken(req.header('authorization')), + }); res.status(200).json(response); }, )