From 30ed0c92c6fe218a2fbeadeaaded83442f81b053 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 2 Oct 2026 22:46:36 +0200 Subject: [PATCH] fix: list the job token toggle with the other step and flow settings Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_014FHGE3ynoAu6yrgeg4kLwL --- .../lib/components/JobTokenScopesSetting.svelte | 16 +++++++++++++--- frontend/src/lib/components/ScriptBuilder.svelte | 7 ------- .../flows/content/FlowRunSettings.svelte | 13 +++++++++---- .../components/flows/content/FlowSettings.svelte | 10 ++++++---- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/frontend/src/lib/components/JobTokenScopesSetting.svelte b/frontend/src/lib/components/JobTokenScopesSetting.svelte index ac5fc8d59c..6ef1ecf3c4 100644 --- a/frontend/src/lib/components/JobTokenScopesSetting.svelte +++ b/frontend/src/lib/components/JobTokenScopesSetting.svelte @@ -8,9 +8,12 @@ /** `null`/`undefined`: the job token has the full permissions of the identity it runs as. */ value: string[] | null | undefined kind: 'script' | 'flow' | 'step' + /** Match the toggles listed around it. */ + size?: 'xs' | 'sm' + textClass?: string } - let { value = $bindable(), kind }: Props = $props() + let { value = $bindable(), kind, size = 'sm', textClass }: Props = $props() const OIDC_ONLY = ['oidc:write'] @@ -36,7 +39,8 @@
{ if (value != null) { @@ -45,7 +49,13 @@ setMode('oidc_only') } }} - options={{ right: 'Restrict the job token' }} + options={{ + right: 'Restrict the job token', + rightTooltip: + "Limit what the WM_TOKEN of this " + + kind + + "'s jobs can do through the API, e.g. only mint an OIDC token. Use it for code that handles untrusted input, such as AI agents." + }} /> {#if value != null} setMode(v)}> diff --git a/frontend/src/lib/components/ScriptBuilder.svelte b/frontend/src/lib/components/ScriptBuilder.svelte index 059d0109ef..62f9851fcc 100644 --- a/frontend/src/lib/components/ScriptBuilder.svelte +++ b/frontend/src/lib/components/ScriptBuilder.svelte @@ -2069,13 +2069,6 @@
- {#snippet header()} - - Restrict what the token of this script's jobs (WM_TOKEN) can do through the - API, e.g. only mint an OIDC token. Use it for scripts that run untrusted - input, such as AI agents. - - {/snippet}
{/if} +
+ +
+ {#if loopSubset}
@@ -383,8 +392,4 @@ {/if}
{/if} -
- {@render sectionHeader('Job token')} - -
diff --git a/frontend/src/lib/components/flows/content/FlowSettings.svelte b/frontend/src/lib/components/flows/content/FlowSettings.svelte index e73733aa91..3fc6ce9908 100644 --- a/frontend/src/lib/components/flows/content/FlowSettings.svelte +++ b/frontend/src/lib/components/flows/content/FlowSettings.svelte @@ -460,10 +460,12 @@ }} /> -
- Job token - -
+