chore: deprecating the token field and renaming to backstageToken as token is far too generic

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-01-19 16:43:45 +01:00
parent 8100abfde2
commit c3a28a46fc
2 changed files with 7 additions and 2 deletions
@@ -89,8 +89,10 @@ export type SerializedTaskEvent = {
*
* @public
*/
export type TaskSecrets = {
token: string | undefined;
export type TaskSecrets = JsonObject & {
/** @deprecated Use `backstageToken` instead */
token?: string;
backstageToken?: string;
};
/**
@@ -232,6 +232,9 @@ export async function createRouter(
}
const result = await taskBroker.dispatch(taskSpec, {
...req.body.secrets,
backstageToken: token,
// This is deprecated, but we need to support it for now if people are running their own task broker.
token: token,
});