chore: deprecating the token that's passed through to the context and using ctx.secrets.backstageToken instead

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-01-19 17:11:45 +01:00
parent c3a28a46fc
commit f999b4063a
4 changed files with 8 additions and 0 deletions
@@ -35,8 +35,12 @@ export type ActionContext<Input extends InputBase> = {
/**
* User token forwarded from initial request, for use in subsequent api requests
* @deprecated use `secrets.backstageToken` instead
*/
token?: string | undefined;
secrets?: TaskSecrets;
workspacePath: string;
input: Input;
output(name: string, value: JsonValue): void;
@@ -236,7 +236,9 @@ export class HandlebarsWorkflowRunner implements WorkflowRunner {
logger: taskLogger,
logStream: stream,
input,
// this token is deprecated, and will be removed in favour of secrets.backstageToken instead.
token: task.secrets?.token,
secrets: task.secrets ?? {},
workspacePath,
async createTemporaryDirectory() {
const tmpDir = await fs.mkdtemp(
@@ -257,7 +257,9 @@ export class NunjucksWorkflowRunner implements WorkflowRunner {
await action.handler({
baseUrl: task.spec.baseUrl,
input,
// this token is deprecated, and will be removed in favour of secrets.backstageToken instead.
token: task.secrets?.token,
secrets: task.secrets ?? {},
logger: taskLogger,
logStream: streamLogger,
workspacePath,