diff --git a/frontend/src/lib/components/settings/CreateToken.svelte b/frontend/src/lib/components/settings/CreateToken.svelte index 9408d136ae..f0850f3d4a 100644 --- a/frontend/src/lib/components/settings/CreateToken.svelte +++ b/frontend/src/lib/components/settings/CreateToken.svelte @@ -34,6 +34,7 @@ import ClipboardPanel from '../details/ClipboardPanel.svelte' import { workspaceMcpUrl } from '../mcp/workspaceAccess' import McpAccessPicker, { type McpAccess } from '../mcp/McpAccessPicker.svelte' + import McpWorkspaceAccessList from '../mcp/McpWorkspaceAccessList.svelte' import MultiSelect from '../select/MultiSelect.svelte' import ToggleButtonGroup from '../common/toggleButton-v2/ToggleButtonGroup.svelte' import ToggleButton from '../common/toggleButton-v2/ToggleButton.svelte' @@ -378,14 +379,19 @@ // connection to that workspace alone, which its own URL makes of any sign-in. const mcpWorkspaceAccess = resource( () => mcpCreationMode, - async (on) => - on ? await McpOauthService.listMcpWorkspaceAccess({}).catch(() => []) : [] + async (on) => (on ? await McpOauthService.listMcpWorkspaceAccess({}).catch(() => []) : []) ) const mcpAsTools = $derived( !!mcpWorkspaceAccess.current?.some( (w) => w.id === mcpBoundWorkspace && w.access === 'runnables' ) ) + // Shown only where a role sets the access: elsewhere the picked access is what the token gets. + const mcpRoleLimited = $derived( + !!mcpWorkspaceAccess.current?.some( + (w) => w.limited && (mcpAllWorkspaces || mcpWorkspaces.includes(w.id)) + ) + ) const mcpUrl = $derived( mcpAsTools && mcpBoundWorkspace ? workspaceMcpUrl(mcpBoundWorkspace) @@ -447,6 +453,14 @@ {/if} {/snippet} + {#if mcpRoleLimited} + + {/if} {#if !mcpOnly}
{#if privateRangesTrusted && allowedIps.length > 0} - This instance trusts a whole private range as proxies, so a host on its private network, - a job included, can name its own client address. The allowlist holds against callers - outside that network only. An instance admin can list the reverse proxies on the Client - IP instance settings page. + This instance trusts a whole private range as proxies, so a host on its private + network, a job included, can name its own client address. The allowlist holds against + callers outside that network only. An instance admin can list the reverse proxies on + the Client IP instance settings page. {/if} {#if clientIp}