From 84ce2b51afa3974700cd293344728ab082f24029 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Thu, 3 Dec 2026 11:37:15 +0100 Subject: [PATCH] feat: show the token owner in tooltips on the run page and audit logs Co-Authored-By: Claude Opus 5.5 --- backend/ee-repo-ref.txt | 2 +- backend/windmill-api/openapi.yaml | 3 ++ backend/windmill-audit/src/lib.rs | 2 ++ .../auditLogs/AuditLogDetails.svelte | 30 +++++++++++-------- .../auditLogs/AuditLogsTable.svelte | 15 ++++++---- .../components/runs/JobDetailFieldConfig.ts | 2 -- .../components/runs/JobDetailHeader.svelte | 15 +++++++++- 7 files changed, 48 insertions(+), 21 deletions(-) diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 3128930bdc..661a533d2f 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -0ecfe50159aea7ca6ec0b91e4195910430baad50 +106411cb2b5d7cd2ff2c37fd96dbfceb5e9fec07 diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 18107b0905..3436665ba9 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -35424,6 +35424,9 @@ components: token_label: type: string description: Label of the token whose prefix is in span, while that token still exists + token_owner: + type: string + description: Workspace username of that token's owner, while the token and the user still exist client_ip: type: string description: Address of the client that made the request. Forwarding headers are believed only from the proxies listed in the TRUSTED_PROXIES environment variable, or, when it is unset, from loopback and the private ranges, where a reverse proxy usually sits. Any host that reaches the server directly from a private address can then name any address here; peer_ip and forwarded_for tell such an entry apart. Absent on entries no request stands behind. diff --git a/backend/windmill-audit/src/lib.rs b/backend/windmill-audit/src/lib.rs index a8694c95a9..41dd8007d0 100644 --- a/backend/windmill-audit/src/lib.rs +++ b/backend/windmill-audit/src/lib.rs @@ -29,6 +29,8 @@ pub struct AuditLog { #[sqlx(default)] pub token_label: Option, #[sqlx(default)] + pub token_owner: Option, + #[sqlx(default)] pub client_ip: Option, #[sqlx(default)] pub user_agent: Option, diff --git a/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte b/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte index 241bcbceaf..5afbe60c12 100644 --- a/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte +++ b/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte @@ -2,7 +2,8 @@ import Button from '$lib/components/common/button/Button.svelte' import { type AuditLog } from '$lib/gen' import { displayDate } from '$lib/utils' - import { ExternalLink, X } from 'lucide-svelte' + import { ExternalLink, ListFilterPlus, X } from 'lucide-svelte' + import Tooltip from '$lib/components/meltComponents/Tooltip.svelte' import { Highlight } from 'svelte-highlight' import { json } from 'svelte-highlight/languages' import HighlightTheme from '$lib/components/HighlightTheme.svelte' @@ -63,21 +64,26 @@ {log.span.slice(JOB_SPAN_PREFIX.length)} {:else} {@const tokenText = `${log.span}****${log.token_label ? ` (${log.token_label})` : ''}`} - {#if onFilterToken} -
+
+ {#if log.token_owner} + + {#snippet text()}Owned by {log.token_owner}{/snippet} + {tokenText} + + {:else} + {tokenText} + {/if} + {#if onFilterToken} -
- {:else} - {tokenText} - {/if} + /> + {/if} +
{/if} {/if} diff --git a/frontend/src/lib/components/auditLogs/AuditLogsTable.svelte b/frontend/src/lib/components/auditLogs/AuditLogsTable.svelte index 745e56bef1..8b37e10993 100644 --- a/frontend/src/lib/components/auditLogs/AuditLogsTable.svelte +++ b/frontend/src/lib/components/auditLogs/AuditLogsTable.svelte @@ -8,6 +8,7 @@ import VirtualList from '@tutorlatin/svelte-tiny-virtual-list' import { twMerge } from 'tailwind-merge' import BatchLoadProgress from '../BatchLoadProgress.svelte' + import Tooltip from '../meltComponents/Tooltip.svelte' interface Props { logs?: AuditLog[] @@ -244,12 +245,16 @@ {#if tokenOf(logOrDate.log)} {@const token = tokenOf(logOrDate.log)!}
- + + {#snippet text()} + {token}****{logOrDate.log.token_label + ? ` (${logOrDate.log.token_label})` + : ''}{logOrDate.log.token_owner + ? `, owned by ${logOrDate.log.token_owner}` + : ''} + {/snippet} {token}**** - +