Skip to content

Commit 2528548

Browse files
authored
Add individual run ids to auto-generated public access token when calling batchTrigger (#1449)
1 parent befdcef commit 2528548

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/orange-llamas-jog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Add individual run ids to auto-generated public access token when calling batchTrigger

packages/core/src/v3/apiClient/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class ApiClient {
230230
secretKey: this.accessToken,
231231
payload: {
232232
...claims,
233-
scopes: [`read:batch:${data.batchId}`],
233+
scopes: [`read:batch:${data.batchId}`].concat(data.runs.map((r) => `read:runs:${r}`)),
234234
},
235235
expirationTime: requestOptions?.publicAccessToken?.expirationTime ?? "1h",
236236
});

0 commit comments

Comments
 (0)