fix: keep job argument assets when the script source is unreadable

A job can be visible to someone with no read grant on its script. The assets
viewer awaited the script fetch before parsing the job arguments, so a denial
rejected the whole promise and the tab reported no assets at all, dropping the
argument-derived ones that need no script access.

Also drop the `authed` query parameter from the dereferenced OpenAPI copies,
which are served at /openapi.yaml and /openapi.json and still advertised a
parameter the handler no longer accepts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-08-12 19:28:55 +02:00
co-authored by Claude Opus 5
parent f329edaf98
commit 316d3cbae6
3 changed files with 5 additions and 13 deletions
-7
View File
@@ -13765,13 +13765,6 @@
"schema": {
"type": "boolean"
}
},
{
"name": "authed",
"in": "query",
"schema": {
"type": "boolean"
}
}
],
"responses": {
-4
View File
@@ -14328,10 +14328,6 @@ paths:
in: query
schema:
type: boolean
- name: authed
in: query
schema:
type: boolean
responses:
'200':
description: script details
@@ -37,11 +37,14 @@
if (job.job_kind === 'script') {
let code = job.raw_code
if (!code && job.script_hash && $workspaceStore) {
// A job can be visible to someone with no read permission on its script.
// Only the source-derived assets are then unavailable, so the argument-derived
// ones below must still be parsed rather than lost with the whole promise.
const script = await ScriptService.getScriptByHash({
workspace: $workspaceStore,
hash: job.script_hash
})
code = script.content
}).catch(() => undefined)
code = script?.content
}
let inferAssetsResult = await inferAssets(job.language!, code ?? '')
let assets = inferAssetsResult.status === 'ok' ? inferAssetsResult.assets : []