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", });