Merge pull request #26088 from oskarjiang/fix/use-separate-token-for-cache-sync

techdocs-backend: separate request token for cache sync
This commit is contained in:
Ben Lambert
2024-08-20 13:24:33 +02:00
committed by GitHub
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-backend': patch
---
Dedicated token for techdocs cache sync
@@ -252,10 +252,14 @@ export async function createRouter(
// However, if caching is enabled, take the opportunity to check and
// invalidate stale cache entries.
if (cache) {
const { token: techDocsToken } = await auth.getPluginRequestToken({
onBehalfOf: await auth.getOwnServiceCredentials(),
targetPluginId: 'techdocs',
});
await docsSynchronizer.doCacheSync({
responseHandler,
discovery,
token,
token: techDocsToken,
entity,
});
return;