Skip to content

Commit

Permalink
make sure to pass in the auth token to the ancestry endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
  • Loading branch information
freben committed Mar 14, 2022
1 parent 9486c3e commit 26fb159
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/four-schools-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---

Pass in auth token to ancestry endpoint
4 changes: 3 additions & 1 deletion plugins/catalog-backend/src/service/createRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
)
Expand Down

0 comments on commit 26fb159

Please sign in to comment.