From 59d85e197fef00f60ebb64caa0fe5880d1c31741 Mon Sep 17 00:00:00 2001
From: Sam Catlow
Date: Sat, 28 Nov 2026 00:58:01 +1100
Subject: [PATCH] feat(ui): add enterprise auth, audit log, four-eyes SoD, and
promotion bundles UI (#2153)
---
ui/pages/pages.json | 12 +-
ui/src/lib/api.ts | 72 +++++
ui/src/lib/nav-specs.ts | 4 +-
ui/src/pages/org/audit.vue | 210 ++++++++++++++
ui/src/pages/settings/authentication.vue | 333 ++++++++++++++++++++---
ui/src/pages/settings/bundles.vue | 313 +++++++++++++++++++++
ui/src/runs/ApprovalsSection.vue | 24 +-
ui/src/stores/audit.ts | 82 ++++++
ui/src/typed-router.d.ts | 32 +++
9 files changed, 1039 insertions(+), 43 deletions(-)
create mode 100644 ui/src/pages/org/audit.vue
create mode 100644 ui/src/pages/settings/bundles.vue
create mode 100644 ui/src/stores/audit.ts
diff --git a/ui/pages/pages.json b/ui/pages/pages.json
index a62f7f6cc..a1189b5e3 100644
--- a/ui/pages/pages.json
+++ b/ui/pages/pages.json
@@ -74,6 +74,11 @@
"label": "Approvals",
"description": "Default owner, escalation path, approval deadline and the approvals that earn an autonomy proposal."
},
+ {
+ "path": "/org/audit",
+ "label": "Audit log",
+ "description": "Append-only record of identity, access, workflow and governance events."
+ },
{
"path": "/org/connections",
"label": "Connections",
@@ -142,7 +147,12 @@
{
"path": "/settings/authentication",
"label": "Authentication",
- "description": "Instance URL and single sign-on providers."
+ "description": "Instance URL, single sign-on providers and session lifetimes."
+ },
+ {
+ "path": "/settings/bundles",
+ "label": "Promotion bundles",
+ "description": "Export, diff and apply immutable environment bundles."
},
{
"path": "/settings/credentials",
diff --git a/ui/src/lib/api.ts b/ui/src/lib/api.ts
index 99c35f7db..92a0ab807 100644
--- a/ui/src/lib/api.ts
+++ b/ui/src/lib/api.ts
@@ -549,6 +549,19 @@ export const api = {
headers: { Accept: "text/event-stream" },
signal: opts.signal,
}),
+ auditEvents: (params: QueryParams = {}) =>
+ request("/api/audit/events" + qs(params)),
+ auditExportUrl: (params: QueryParams = {}) =>
+ "/api/audit/events/export" + qs(params),
+ exportBundle: () => request("/api/bundles/export"),
+ diffBundle: (body: { bundle_yaml: string }) =>
+ request("/api/bundles/diff", { method: "POST", body }),
+ applyBundle: (body: {
+ bundle_yaml: string;
+ bindings_yaml?: string;
+ dry_run?: boolean;
+ expect_digest?: string;
+ }) => request("/api/bundles/apply", { method: "POST", body }),
};
/** One note, in one memory class. A note is readable only in its scope: a
@@ -812,6 +825,8 @@ export interface Approval {
level: string;
summary: string;
state: string;
+ initiator_id?: string;
+ require_sod?: boolean;
/** The actions the request covers, in the order they run. An autonomy
* proposal covers none. */
steps?: ApprovalStep[];
@@ -823,6 +838,63 @@ export interface Approval {
answered_via?: string;
}
+export interface AuditEvent {
+ id: string;
+ org_id: string;
+ at: string;
+ category: string;
+ action: string;
+ actor_id: string;
+ actor_kind?: string;
+ resource_kind?: string;
+ resource_id?: string;
+ outcome: string;
+ trace_id?: string;
+ detail?: Record;
+}
+
+export interface AuditEventsResponse {
+ events: AuditEvent[];
+ more: boolean;
+}
+
+export interface BundleDiff {
+ workflows?: { op: string; name: string; details?: string[] }[];
+ access_policies?: { op: string; id: string }[];
+ judgement_rules?: { op: string; kind: string }[];
+ action_types?: {
+ op: string;
+ connector: string;
+ action: string;
+ target_kind: string;
+ environment: string;
+ details?: string[];
+ }[];
+}
+
+export interface BundleExportReply {
+ schema_version: string;
+ exported_at: string;
+ digest: string;
+ bundle_yaml: string;
+}
+
+export interface BundleDiffReply {
+ digest: string;
+ empty: boolean;
+ formatted: string;
+ diff: BundleDiff;
+}
+
+export interface BundleApplyReply {
+ digest: string;
+ dry_run: boolean;
+ applied: boolean;
+ empty: boolean;
+ formatted: string;
+ diff: BundleDiff;
+}
+
interface Decision {
id: string;
level: string;
diff --git a/ui/src/lib/nav-specs.ts b/ui/src/lib/nav-specs.ts
index 7e9ff78d2..d6b7c8945 100644
--- a/ui/src/lib/nav-specs.ts
+++ b/ui/src/lib/nav-specs.ts
@@ -40,7 +40,7 @@ export const orgSpecs: NavSpec[] = [
sections: [
{
label: "People & access",
- paths: ["/org/members", "/org/approvals", "/org/workspaces", "/org/policies", "/org/decisions"],
+ paths: ["/org/members", "/org/approvals", "/org/workspaces", "/org/policies", "/org/decisions", "/org/audit"],
},
{
label: "Agents",
@@ -64,7 +64,7 @@ export const settings: NavSpec = {
label: "Connections & channels",
paths: ["/settings/extensions", "/settings/secret-engines", "/settings/credentials"],
},
- { paths: ["/settings/status", "/settings/organisations", "/settings/authentication"] },
+ { paths: ["/settings/status", "/settings/organisations", "/settings/authentication", "/settings/bundles"] },
],
};
diff --git a/ui/src/pages/org/audit.vue b/ui/src/pages/org/audit.vue
new file mode 100644
index 000000000..9070b94d6
--- /dev/null
+++ b/ui/src/pages/org/audit.vue
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No audit events recorded
+
+
+
+
+
+
+
+
+
+ {{ row.category }}
+
+
+ {{ row.action }}
+
+
+
+
+
+
+ {{ [row.resource_kind, row.resource_id].filter(Boolean).join(":") }}
+
+ —
+
+
+
+
+ {{ row.outcome }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/pages/settings/authentication.vue b/ui/src/pages/settings/authentication.vue
index ce78c2d70..9cf5d0d98 100644
--- a/ui/src/pages/settings/authentication.vue
+++ b/ui/src/pages/settings/authentication.vue
@@ -5,52 +5,311 @@ definePage({
navPath: "/settings",
settings: true,
label: "Authentication",
- description: "Instance URL and single sign-on providers.",
+ description: "Instance URL, single sign-on providers and session lifetimes.",
section: "settings",
},
});
-import { ReadError } from "@/components/ui/read-error";
-import { Skeleton } from "@/components/ui/skeleton";
-import { Check } from "@lucide/vue";
+import { Check, Plus, Trash2 } from "@lucide/vue";
import { computed, onMounted, ref } from "vue";
-import PageHeader from "@/base/PageHeader.vue";
-import { Button } from "@/components/ui/button";
+
import CodeView from "@/base/CodeView.vue";
+import PageHeader from "@/base/PageHeader.vue";
+import { Badge } from "@/components/ui/badge";
+import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
-import { Textarea } from "@/components/ui/textarea";
-import { api, classifyActionError, describeError } from "@/lib/api";
-import { errors } from "@/copy/errors";
-import { SettingRow } from "@/components/ui/setting-row";
+import { ReadError } from "@/components/ui/read-error";
import { Section } from "@/components/ui/section";
-interface Settings {public_url:string;oidc_issuer:string;oidc_audience:string;oidc_client_id:string;trusted_proxies:string[]}
-const value=ref({public_url:"",oidc_issuer:"",oidc_audience:"",oidc_client_id:"",trusted_proxies:[]});const loaded=ref(false);const error=ref("");const sessionExpired=ref(false);const busy=ref(false);const saved=ref(false);
-async function load(){try{value.value=await api.authentication();loaded.value=true;error.value=""}catch(cause){error.value=describeError(cause, errors.common.unknown)}finally{loaded.value=true}}
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
+import { SettingRow } from "@/components/ui/setting-row";
+import { Skeleton } from "@/components/ui/skeleton";
+import { Switch } from "@/components/ui/switch";
+import { Textarea } from "@/components/ui/textarea";
+import { errors } from "@/copy/errors";
+import { api, classifyActionError, describeError } from "@/lib/api";
+
+interface Settings {
+ public_url: string;
+ oidc_issuer: string;
+ oidc_audience: string;
+ oidc_client_id: string;
+ oidc_client_secret?: string;
+ oidc_client_secret_set?: boolean;
+ oidc_groups_claim?: string;
+ oidc_role_map?: Record;
+ sso_only: boolean;
+ session_idle_timeout_s: number;
+ session_max_lifetime_s: number;
+ trusted_proxies: string[];
+}
+
+interface RoleMappingRow {
+ group: string;
+ role: string;
+}
+
+const ROLES = ["owner", "admin", "developer", "viewer"] as const;
+
+const value = ref({
+ public_url: "",
+ oidc_issuer: "",
+ oidc_audience: "",
+ oidc_client_id: "",
+ oidc_groups_claim: "",
+ sso_only: false,
+ session_idle_timeout_s: 0,
+ session_max_lifetime_s: 0,
+ trusted_proxies: [],
+});
+const clientSecret = ref("");
+const roleMapRows = ref([]);
+const loaded = ref(false);
+const error = ref("");
+const sessionExpired = ref(false);
+const busy = ref(false);
+const saved = ref(false);
+
+let loadAttempt = 0;
+
+async function load(): Promise {
+ const attempt = ++loadAttempt;
+ try {
+ const data = await api.authentication();
+ if (attempt !== loadAttempt) return;
+ value.value = {
+ public_url: data.public_url ?? "",
+ oidc_issuer: data.oidc_issuer ?? "",
+ oidc_audience: data.oidc_audience ?? "",
+ oidc_client_id: data.oidc_client_id ?? "",
+ oidc_client_secret_set: Boolean(data.oidc_client_secret_set),
+ oidc_groups_claim: data.oidc_groups_claim ?? "",
+ oidc_role_map: data.oidc_role_map ?? {},
+ sso_only: Boolean(data.sso_only),
+ session_idle_timeout_s: data.session_idle_timeout_s ?? 0,
+ session_max_lifetime_s: data.session_max_lifetime_s ?? 0,
+ trusted_proxies: data.trusted_proxies ?? [],
+ };
+ roleMapRows.value = Object.entries(data.oidc_role_map ?? {}).map(([group, role]) => ({
+ group,
+ role,
+ }));
+ error.value = "";
+ sessionExpired.value = false;
+ } catch (cause) {
+ if (attempt !== loadAttempt) return;
+ error.value = describeError(cause, errors.common.unknown);
+ } finally {
+ if (attempt === loadAttempt) loaded.value = true;
+ }
+}
onMounted(load);
-const proxyText=computed({get:()=>value.value.trusted_proxies.join("\n"),set:(text:string|number)=>{value.value.trusted_proxies=String(text).split("\n")}});
-const redirectURI=computed(()=>`${value.value.public_url.replace(/\/$/,"")}/oauth2/callback`);
-async function save(){busy.value=true;error.value="";saved.value=false;try{await api.saveAuthentication(value.value);saved.value=true}catch(cause){error.value=describeError(cause, errors.common.unknown);sessionExpired.value=classifyActionError(cause).kind==="session-expired"}finally{busy.value=false}}
+
+const proxyText = computed({
+ get: () => value.value.trusted_proxies.join("\n"),
+ set: (text: string | number) => {
+ value.value.trusted_proxies = String(text).split("\n");
+ },
+});
+
+const publicBase = computed(() => value.value.public_url.replace(/\/$/, ""));
+const redirectURI = computed(() => `${publicBase.value}/oauth2/callback`);
+const backchannelLogoutURI = computed(() => `${publicBase.value}/oauth2/backchannel-logout`);
+
+function addRoleMapping(): void {
+ roleMapRows.value.push({ group: "", role: "viewer" });
+}
+
+function removeRoleMapping(index: number): void {
+ roleMapRows.value.splice(index, 1);
+}
+
+async function save(): Promise {
+ busy.value = true;
+ error.value = "";
+ sessionExpired.value = false;
+ saved.value = false;
+ try {
+ const roleMap: Record = {};
+ for (const row of roleMapRows.value) {
+ const group = row.group.trim();
+ if (group && row.role) roleMap[group] = row.role;
+ }
+ const payload: Record = {
+ public_url: value.value.public_url,
+ oidc_issuer: value.value.oidc_issuer,
+ oidc_audience: value.value.oidc_audience,
+ oidc_client_id: value.value.oidc_client_id,
+ oidc_groups_claim: (value.value.oidc_groups_claim ?? "").trim(),
+ oidc_role_map: roleMap,
+ sso_only: value.value.sso_only,
+ session_idle_timeout_s: Number(value.value.session_idle_timeout_s) || 0,
+ session_max_lifetime_s: Number(value.value.session_max_lifetime_s) || 0,
+ trusted_proxies: value.value.trusted_proxies,
+ };
+ if (clientSecret.value) {
+ payload.oidc_client_secret = clientSecret.value;
+ }
+ await api.saveAuthentication(payload);
+ clientSecret.value = "";
+ await load();
+ saved.value = true;
+ } catch (cause) {
+ error.value = describeError(cause, errors.common.unknown);
+ sessionExpired.value = classifyActionError(cause).kind === "session-expired";
+ } finally {
+ busy.value = false;
+ }
+}
+
-
+
diff --git a/ui/src/pages/settings/bundles.vue b/ui/src/pages/settings/bundles.vue
new file mode 100644
index 000000000..ba6e21f71
--- /dev/null
+++ b/ui/src/pages/settings/bundles.vue
@@ -0,0 +1,313 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ actionError }}
+
+
+
+ {{ resultStatusLabel }}
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/runs/ApprovalsSection.vue b/ui/src/runs/ApprovalsSection.vue
index 6e6d25b52..87edb1619 100644
--- a/ui/src/runs/ApprovalsSection.vue
+++ b/ui/src/runs/ApprovalsSection.vue
@@ -7,8 +7,9 @@ import { Button } from "@/components/ui/button";
import { ReadError } from "@/components/ui/read-error";
import { Section } from "@/components/ui/section";
import { Timestamp } from "@/components/ui/timestamp";
+import { useAccountsStore } from "@/accounts/accounts";
import { errors } from "@/copy/errors";
-import { api, describeError } from "@/lib/api";
+import { api, describeError, type Approval } from "@/lib/api";
import { useRead } from "@/lib/use-read";
import { answerApproval } from "@/runs/answer";
import { coversSequence } from "@/runs/sequence";
@@ -20,10 +21,19 @@ import { useLiveResource } from "@/stores/session";
const props = defineProps<{ run?: string }>();
const emit = defineEmits<{ answered: [] }>();
+const accounts = useAccountsStore();
const { data, error, reload } = useRead(() => api.approvals());
-onMounted(reload);
+onMounted(() => {
+ reload();
+ if (!accounts.status) void accounts.load();
+});
useLiveResource("work", () => void reload());
+function isSelfApprovalBlocked(approval: Approval): boolean {
+ const userId = accounts.status?.user?.id;
+ return Boolean(approval.require_sod && userId && approval.initiator_id === userId);
+}
+
const waiting = computed(() =>
(data.value ?? []).filter((a) => a.state === "pending" && (!props.run || a.run_id === props.run)),
);
@@ -68,9 +78,17 @@ async function answer(id: string, approved: boolean): Promise {
· due
+ Four-eyes
{{ stateLabel(approval.level) }}
-
+
diff --git a/ui/src/stores/audit.ts b/ui/src/stores/audit.ts
new file mode 100644
index 000000000..9c00ee842
--- /dev/null
+++ b/ui/src/stores/audit.ts
@@ -0,0 +1,82 @@
+import { defineStore } from "pinia";
+import { ref } from "vue";
+import { errors } from "@/copy/errors";
+import { ApiError, api, describeError, type AuditEvent, type QueryParams } from "@/lib/api";
+
+export interface AuditFilters {
+ category: string;
+ action: string;
+ actor: string;
+ since: string;
+ until: string;
+}
+
+const EMPTY_FILTERS: AuditFilters = {
+ category: "",
+ action: "",
+ actor: "",
+ since: "",
+ until: "",
+};
+
+function toRFC3339(value: string): string {
+ const trimmed = value.trim();
+ if (!trimmed) return "";
+ const parsed = new Date(trimmed);
+ return Number.isNaN(parsed.getTime()) ? trimmed : parsed.toISOString();
+}
+
+export const useAuditStore = defineStore("audit", () => {
+ const events = ref([]);
+ const more = ref(false);
+ const loading = ref(false);
+ const error = ref("");
+ const filters = ref({ ...EMPTY_FILTERS });
+
+ let attempt = 0;
+
+ function queryParams(extra: QueryParams = {}): QueryParams {
+ return {
+ category: filters.value.category.trim(),
+ action: filters.value.action.trim(),
+ actor: filters.value.actor.trim(),
+ since: toRFC3339(filters.value.since),
+ until: toRFC3339(filters.value.until),
+ ...extra,
+ };
+ }
+
+ async function load(reset = true): Promise {
+ const seq = ++attempt;
+ loading.value = true;
+ error.value = "";
+ try {
+ const offset = reset ? 0 : events.value.length;
+ const reply = await api.auditEvents(queryParams({ limit: 100, offset }));
+ if (seq !== attempt) return;
+ const rows = reply.events ?? [];
+ events.value = reset ? rows : [...events.value, ...rows];
+ more.value = Boolean(reply.more);
+ } catch (cause) {
+ if (seq !== attempt) return;
+ if (cause instanceof ApiError && cause.status === 503) {
+ error.value = "Audit store unavailable";
+ return;
+ }
+ error.value = describeError(cause, errors.common.unknown);
+ } finally {
+ if (seq === attempt) loading.value = false;
+ }
+ }
+
+ function resetFilters(): void {
+ filters.value = { ...EMPTY_FILTERS };
+ void load(true);
+ }
+
+ function exportUrl(format: "jsonl" | "csv"): string {
+ return api.auditExportUrl(queryParams({ limit: 1000, format }));
+ }
+
+ return { events, more, loading, error, filters, load, resetFilters, exportUrl };
+});
diff --git a/ui/src/typed-router.d.ts b/ui/src/typed-router.d.ts
index a6fff7b4f..a400353d8 100644
--- a/ui/src/typed-router.d.ts
+++ b/ui/src/typed-router.d.ts
@@ -164,6 +164,7 @@ declare module 'vue-router/auto-routes' {
Record,
Record,
| 'org-approvals'
+ | 'org-audit'
| 'org-decisions'
| 'org-instructions'
| 'org-members'
@@ -185,6 +186,13 @@ declare module 'vue-router/auto-routes' {
Record,
| never
>,
+ 'org-audit': RouteRecordInfo<
+ 'org-audit',
+ '/org/audit',
+ Record,
+ Record,
+ | never
+ >,
'org-decisions': RouteRecordInfo<
'org-decisions',
'/org/decisions',
@@ -255,6 +263,13 @@ declare module 'vue-router/auto-routes' {
Record,
| never
>,
+ 'settings-bundles': RouteRecordInfo<
+ 'settings-bundles',
+ '/settings/bundles',
+ Record,
+ Record,
+ | never
+ >,
'settings-credentials': RouteRecordInfo<
'settings-credentials',
'/settings/credentials',
@@ -504,6 +519,7 @@ declare module 'vue-router/auto-routes' {
routes:
| '/org'
| 'org-approvals'
+ | 'org-audit'
| 'org-decisions'
| 'org-instructions'
| 'org-members'
@@ -531,6 +547,14 @@ declare module 'vue-router/auto-routes' {
pathParamNames:
| never
}
+ 'src/pages/org/audit.vue': {
+ routes:
+ | 'org-audit'
+ views:
+ | never
+ pathParamNames:
+ | never
+ }
'src/pages/org/decisions.vue': {
routes:
| 'org-decisions'
@@ -611,6 +635,14 @@ declare module 'vue-router/auto-routes' {
pathParamNames:
| never
}
+ 'src/pages/settings/bundles.vue': {
+ routes:
+ | 'settings-bundles'
+ views:
+ | never
+ pathParamNames:
+ | never
+ }
'src/pages/settings/credentials.vue': {
routes:
| 'settings-credentials'