fix: forwarding of non-enumerable property

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-10-16 10:57:46 +02:00
parent f24661ce64
commit 59137ff3c8
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Fix issue with token not being available because it's now non-enumerable
@@ -493,6 +493,7 @@ export async function createRouter(
});
const credentials = await httpAuth.credentials(req);
await checkPermission({
credentials,
permissions: [taskCreatePermission],
@@ -563,7 +564,11 @@ export async function createRouter(
const secrets: InternalTaskSecrets = {
...req.body.secrets,
backstageToken: token,
__initiatorCredentials: JSON.stringify(credentials),
__initiatorCredentials: JSON.stringify({
...credentials,
// credentials.token is nonenumerable and will not be serialized, so we need to add it explicitly
token: (credentials as any).token,
}),
};
const result = await taskBroker.dispatch({