From bee9d7609901ad10024cd6a5b1c3eafc67a760cf Mon Sep 17 00:00:00 2001 From: Eric Allam Date: Fri, 1 Nov 2024 11:05:47 +0000 Subject: [PATCH] Add individual run ids to auto-generated public access token when calling batchTrigger --- .changeset/orange-llamas-jog.md | 5 +++++ packages/core/src/v3/apiClient/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/orange-llamas-jog.md diff --git a/.changeset/orange-llamas-jog.md b/.changeset/orange-llamas-jog.md new file mode 100644 index 0000000000..778dab2d50 --- /dev/null +++ b/.changeset/orange-llamas-jog.md @@ -0,0 +1,5 @@ +--- +"@trigger.dev/core": patch +--- + +Add individual run ids to auto-generated public access token when calling batchTrigger diff --git a/packages/core/src/v3/apiClient/index.ts b/packages/core/src/v3/apiClient/index.ts index 9b46c1f1fa..e0fd38e895 100644 --- a/packages/core/src/v3/apiClient/index.ts +++ b/packages/core/src/v3/apiClient/index.ts @@ -230,7 +230,7 @@ export class ApiClient { secretKey: this.accessToken, payload: { ...claims, - scopes: [`read:batch:${data.batchId}`], + scopes: [`read:batch:${data.batchId}`].concat(data.runs.map((r) => `read:runs:${r}`)), }, expirationTime: requestOptions?.publicAccessToken?.expirationTime ?? "1h", });