@coffre/ui 0.14.7 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit-sentences.d.ts +56 -0
- package/dist/audit-sentences.js +886 -0
- package/dist/audit-sentences.js.map +1 -0
- package/dist/chunks/audit-sentence-C8NnAdjF.js +48 -0
- package/dist/chunks/audit-sentence-C8NnAdjF.js.map +1 -0
- package/dist/chunks/{connected-apps-IJdunsu8.js → connected-apps-6sMSgQ9U.js} +5 -5
- package/dist/chunks/{connected-apps-IJdunsu8.js.map → connected-apps-6sMSgQ9U.js.map} +1 -1
- package/dist/chunks/{delete-place-dIVoK87I.js → delete-place-T469tSN9.js} +5 -5
- package/dist/chunks/{delete-place-dIVoK87I.js.map → delete-place-T469tSN9.js.map} +1 -1
- package/dist/chunks/{directory-BM8yoiJN.js → directory-B_gVf7UL.js} +13 -12
- package/dist/chunks/{directory-BM8yoiJN.js.map → directory-B_gVf7UL.js.map} +1 -1
- package/dist/chunks/{folders-D3A1NGpt.js → folders-CVYauIDz.js} +3 -3
- package/dist/chunks/{folders-D3A1NGpt.js.map → folders-CVYauIDz.js.map} +1 -1
- package/dist/chunks/{grants-CjVmOgb2.js → grants-Dn_EW2XW.js} +6 -6
- package/dist/chunks/{grants-CjVmOgb2.js.map → grants-Dn_EW2XW.js.map} +1 -1
- package/dist/chunks/{multi-combobox-B0JzP1QN.js → multi-combobox-fbBRzi9z.js} +3 -3
- package/dist/chunks/{multi-combobox-B0JzP1QN.js.map → multi-combobox-fbBRzi9z.js.map} +1 -1
- package/dist/chunks/{offboarding-DbozhPym.js → offboarding-CXM464J_.js} +19 -13
- package/dist/chunks/offboarding-CXM464J_.js.map +1 -0
- package/dist/chunks/{page-JTORvh-N.js → page-Cb0ZjGda.js} +2 -2
- package/dist/chunks/{page-JTORvh-N.js.map → page-Cb0ZjGda.js.map} +1 -1
- package/dist/chunks/{personal-tokens-zWZOzLIC.js → personal-tokens-CSHMlRHy.js} +7 -7
- package/dist/chunks/personal-tokens-CSHMlRHy.js.map +1 -0
- package/dist/chunks/{principal-DFBswTBr.js → principal-BKJxbAtE.js} +2 -2
- package/dist/chunks/{principal-DFBswTBr.js.map → principal-BKJxbAtE.js.map} +1 -1
- package/dist/chunks/{principal-page-jJ0RVFg8.js → principal-page-COPmTDVW.js} +20 -17
- package/dist/chunks/principal-page-COPmTDVW.js.map +1 -0
- package/dist/chunks/{project-page-BjwEoXfU.js → project-page-g5_n46Nz.js} +3 -3
- package/dist/chunks/{project-page-BjwEoXfU.js.map → project-page-g5_n46Nz.js.map} +1 -1
- package/dist/chunks/{protected-y7KVhtHd.js → protected-DEWeOrmI.js} +7 -7
- package/dist/chunks/{protected-y7KVhtHd.js.map → protected-DEWeOrmI.js.map} +1 -1
- package/dist/chunks/{queries-2jdgTwfZ.js → queries-D4_o-bz3.js} +11 -88
- package/dist/chunks/queries-D4_o-bz3.js.map +1 -0
- package/dist/chunks/{references-CRT2BsOS.js → references-wTh_DT0M.js} +27 -23
- package/dist/chunks/references-wTh_DT0M.js.map +1 -0
- package/dist/chunks/{role-field-DswIpPqY.js → role-field-BiP09qfN.js} +4 -4
- package/dist/chunks/{role-field-DswIpPqY.js.map → role-field-BiP09qfN.js.map} +1 -1
- package/dist/chunks/{row-state-xtRGFnDc.js → row-state-CYhtmUkc.js} +3 -3
- package/dist/chunks/{row-state-xtRGFnDc.js.map → row-state-CYhtmUkc.js.map} +1 -1
- package/dist/chunks/{signin-errors-TlQmQe0t.js → signin-errors-BMnox7XD.js} +5 -19
- package/dist/chunks/signin-errors-BMnox7XD.js.map +1 -0
- package/dist/chunks/{theme-Ck45wzWB.js → theme-imSolE1q.js} +3 -3
- package/dist/chunks/{theme-Ck45wzWB.js.map → theme-imSolE1q.js.map} +1 -1
- package/dist/chunks/{ui-D-blFWfx.js → ui-Q_Eczt7m.js} +7 -3
- package/dist/chunks/{ui-D-blFWfx.js.map → ui-Q_Eczt7m.js.map} +1 -1
- package/dist/chunks/{use-action-CXEFFjx5.js → use-action-BfnN-De2.js} +3 -3
- package/dist/chunks/{use-action-CXEFFjx5.js.map → use-action-BfnN-De2.js.map} +1 -1
- package/dist/chunks/{use-change-BC4xo02c.js → use-change-Cc0X4sF3.js} +6 -4
- package/dist/chunks/use-change-Cc0X4sF3.js.map +1 -0
- package/dist/chunks/{use-roles-DswiNxBk.js → use-roles-stcv2QFj.js} +3 -3
- package/dist/chunks/{use-roles-DswiNxBk.js.map → use-roles-stcv2QFj.js.map} +1 -1
- package/dist/chunks/{use-shell-zpjE_MKh.js → use-shell-DMhLa2sh.js} +3 -3
- package/dist/chunks/{use-shell-zpjE_MKh.js.map → use-shell-DMhLa2sh.js.map} +1 -1
- package/dist/index.d.ts +22 -10
- package/dist/index.js +7 -7
- package/dist/pages/account.js +11 -11
- package/dist/pages/approval.js +2 -2
- package/dist/pages/audit.js +163 -152
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/device-login.js +2 -2
- package/dist/pages/environment.js +67 -35
- package/dist/pages/environment.js.map +1 -1
- package/dist/pages/login.js +6 -15
- package/dist/pages/login.js.map +1 -1
- package/dist/pages/oauth-authorize.js +2 -2
- package/dist/pages/project-access.js +11 -11
- package/dist/pages/project-environments.js +12 -12
- package/dist/pages/project-settings.js +8 -8
- package/dist/pages/project.js +3 -3
- package/dist/pages/projects.js +8 -8
- package/dist/pages/service-account.js +19 -15
- package/dist/pages/service-account.js.map +1 -1
- package/dist/pages/service-accounts.js +5 -5
- package/dist/pages/settings.js +26 -37
- package/dist/pages/settings.js.map +1 -1
- package/dist/pages/unregistered.js +2 -2
- package/dist/pages/user.js +7 -7
- package/dist/pages/user.js.map +1 -1
- package/dist/pages/users.js +5 -5
- package/package.json +8 -3
- package/src/components/directory.tsx +5 -4
- package/src/components/offboarding.tsx +9 -9
- package/src/components/personal-tokens.tsx +5 -2
- package/src/components/principal-page.tsx +4 -3
- package/src/components/references.tsx +18 -7
- package/src/components/trusted-workloads.tsx +6 -5
- package/src/components/ui.tsx +5 -0
- package/src/lib/audit-proofs.ts +51 -0
- package/src/lib/audit-sentences.ts +473 -509
- package/src/lib/bindings.ts +6 -0
- package/src/lib/changes.ts +3 -1
- package/src/lib/coffre.ts +2 -2
- package/src/lib/queries.ts +9 -94
- package/src/lib/reveal.ts +32 -5
- package/src/lib/row-reads.ts +2 -2
- package/src/lib/signin-errors.ts +5 -33
- package/src/pages/audit.tsx +145 -182
- package/src/pages/environment.tsx +21 -20
- package/src/pages/login.tsx +2 -4
- package/src/pages/settings.tsx +6 -10
- package/src/pages/user.tsx +2 -2
- package/src/parity.ts +0 -2
- package/src/styles/globals.css +18 -2
- package/dist/chunks/audit-sentence-JgJEwQEC.js +0 -969
- package/dist/chunks/audit-sentence-JgJEwQEC.js.map +0 -1
- package/dist/chunks/offboarding-DbozhPym.js.map +0 -1
- package/dist/chunks/personal-tokens-zWZOzLIC.js.map +0 -1
- package/dist/chunks/principal-page-jJ0RVFg8.js.map +0 -1
- package/dist/chunks/queries-2jdgTwfZ.js.map +0 -1
- package/dist/chunks/references-CRT2BsOS.js.map +0 -1
- package/dist/chunks/signin-errors-TlQmQe0t.js.map +0 -1
- package/dist/chunks/use-change-BC4xo02c.js.map +0 -1
package/dist/pages/audit.js
CHANGED
|
@@ -1,39 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as Notice, f as Toggletip, i as EmptyState,
|
|
3
|
-
import { $ as SlashCircle, P as Ledger, S as Clock, X as ShieldCheck, b as ChevronRight, f as Activity, i as PageHeader, it as User,
|
|
1
|
+
import { y as queries } from "../chunks/queries-D4_o-bz3.js";
|
|
2
|
+
import { c as Notice, f as Toggletip, i as EmptyState, m as absolute, u as Timestamp } from "../chunks/ui-Q_Eczt7m.js";
|
|
3
|
+
import { $ as SlashCircle, P as Ledger, S as Clock, X as ShieldCheck, b as ChevronRight, f as Activity, i as PageHeader, it as User, m as AlertTriangle, n as ClosedDoor, st as X, u as useCoffre } from "../chunks/page-Cb0ZjGda.js";
|
|
4
|
+
import { decidedBy, describe, lines, perSecret, runLabel, who } from "../audit-sentences.js";
|
|
4
5
|
import { t as pageRoute } from "../chunks/page-route-Drfw7lmn.js";
|
|
5
|
-
import {
|
|
6
|
-
import { useState } from "react";
|
|
6
|
+
import { n as memberName, t as Sentence } from "../chunks/audit-sentence-C8NnAdjF.js";
|
|
7
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
8
|
import { Link } from "@tanstack/react-router";
|
|
8
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
11
|
+
//#region src/lib/audit-proofs.ts
|
|
12
|
+
/** A batch's, or a read's: its worst entry's. */
|
|
13
|
+
function proofOf(proofs) {
|
|
14
|
+
return proofs.includes("failed") ? "failed" : proofs.includes("unproven") ? "unproven" : "proven";
|
|
15
|
+
}
|
|
16
|
+
var headKey = (head) => `${head.size}@${head.signedAt}`;
|
|
17
|
+
/**
|
|
18
|
+
* Each entry's proof as the page shows it: the answer's, except that one
|
|
19
|
+
* proven before under this same head and now not is failed. Under one head
|
|
20
|
+
* an entry proves or does not for good: only its tree and leaf, columns a
|
|
21
|
+
* writer edits, can move it past the head, so the page never shows an entry
|
|
22
|
+
* proven and later not proven against the same head. Another head is
|
|
23
|
+
* another answer: one put back from before covers less, and the page shows
|
|
24
|
+
* what it covers.
|
|
25
|
+
*/
|
|
26
|
+
function shownProofs(proved, head, entries) {
|
|
27
|
+
const seen = head === null ? void 0 : proved.get(headKey(head));
|
|
28
|
+
return new Map(entries.map((entry) => [entry.seq, entry.proof === "unproven" && seen?.has(entry.seq) ? "failed" : entry.proof]));
|
|
29
|
+
}
|
|
30
|
+
/** Notes what an answer proved, under its head. */
|
|
31
|
+
function remember(proved, head, entries) {
|
|
32
|
+
if (head === null) return;
|
|
33
|
+
const key = headKey(head);
|
|
34
|
+
const seen = proved.get(key) ?? /* @__PURE__ */ new Set();
|
|
35
|
+
for (const entry of entries) if (entry.proof === "proven") seen.add(entry.seq);
|
|
36
|
+
proved.set(key, seen);
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
10
39
|
//#region src/pages/audit.tsx
|
|
11
40
|
var Route = pageRoute();
|
|
12
41
|
function AuditPage() {
|
|
13
42
|
const search = Route.useSearch();
|
|
14
43
|
const client = useCoffre();
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
setWalked({ through: null });
|
|
23
|
-
setWalkFailed(null);
|
|
24
|
-
setWhole(null);
|
|
25
|
-
let verdict;
|
|
26
|
-
try {
|
|
27
|
-
verdict = chainResult(await client.audit.verifyWhole((stretch) => setWalked({ through: stretch.through })), true);
|
|
28
|
-
} catch (error) {
|
|
29
|
-
verdict = chainUnknown(error);
|
|
30
|
-
}
|
|
31
|
-
if (verdict.integrity === "unknown") setWalkFailed(verdict.problem);
|
|
32
|
-
else if (verdict.integrity !== "owners-only") setWhole(verdict);
|
|
33
|
-
setWalked(null);
|
|
34
|
-
};
|
|
44
|
+
const entries = useSuspenseQuery(queries.auditEntries(client, search));
|
|
45
|
+
const result = entries.data;
|
|
46
|
+
const proved = useRef(/* @__PURE__ */ new Map());
|
|
47
|
+
const proofs = result.ok ? shownProofs(proved.current, result.head, result.entries) : /* @__PURE__ */ new Map();
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (result.ok) remember(proved.current, result.head, result.entries);
|
|
50
|
+
}, [result]);
|
|
35
51
|
const { decision, actorId } = search;
|
|
36
|
-
const detail = search.detail === "1";
|
|
37
52
|
const deniedOnly = decision === "deny";
|
|
38
53
|
if (!result.ok) return /* @__PURE__ */ jsx(ClosedDoor, {
|
|
39
54
|
icon: /* @__PURE__ */ jsx(Ledger, { size: 18 }),
|
|
@@ -41,8 +56,26 @@ function AuditPage() {
|
|
|
41
56
|
title: "The audit log is closed to you",
|
|
42
57
|
children: result.error
|
|
43
58
|
});
|
|
44
|
-
const
|
|
45
|
-
const
|
|
59
|
+
const proof = (entry) => proofs.get(entry.seq) ?? entry.proof;
|
|
60
|
+
const failed = result.entries.filter((entry) => proof(entry) === "failed");
|
|
61
|
+
const counts = {
|
|
62
|
+
failed: failed.length,
|
|
63
|
+
unproven: result.entries.filter((entry) => proof(entry) === "unproven").length,
|
|
64
|
+
proven: result.entries.filter((entry) => proof(entry) === "proven").length
|
|
65
|
+
};
|
|
66
|
+
const signed = result.head === null ? null : `${absolute(result.head.signedAt, false)} UTC`;
|
|
67
|
+
const holes = result.holes ?? [];
|
|
68
|
+
const gone = (kind) => {
|
|
69
|
+
const found = holes.filter((hole) => hole[kind] > 0);
|
|
70
|
+
const count = found.reduce((sum, hole) => sum + hole[kind], 0);
|
|
71
|
+
return {
|
|
72
|
+
count,
|
|
73
|
+
places: found.length === 1 ? where(found[0]) : `, in ${found.length} places`,
|
|
74
|
+
entries: `${count.toLocaleString("en")} ${count === 1 ? "entry" : "entries"}`
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const removed = gone("kept");
|
|
78
|
+
const pruned = gone("aging");
|
|
46
79
|
const shown = lines(result.entries);
|
|
47
80
|
const filters = {
|
|
48
81
|
decision,
|
|
@@ -55,40 +88,55 @@ function AuditPage() {
|
|
|
55
88
|
className: "chain-live",
|
|
56
89
|
"aria-live": "polite",
|
|
57
90
|
"aria-atomic": "true",
|
|
58
|
-
children: /* @__PURE__ */ jsx(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
onWalk: () => void walkWhole()
|
|
91
|
+
children: /* @__PURE__ */ jsx(ProofStatus, {
|
|
92
|
+
head: result.head,
|
|
93
|
+
counts,
|
|
94
|
+
pruned: pruned.count > 0,
|
|
95
|
+
checking: entries.isFetching,
|
|
96
|
+
onCheck: () => void entries.refetch()
|
|
65
97
|
})
|
|
66
98
|
})
|
|
67
99
|
}),
|
|
68
|
-
|
|
100
|
+
failed.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
69
101
|
style: { marginBottom: "1.25rem" },
|
|
70
102
|
children: /* @__PURE__ */ jsxs(Notice, {
|
|
71
103
|
tone: "bad",
|
|
72
104
|
children: [
|
|
73
105
|
/* @__PURE__ */ jsx("strong", { children: "Treat this as an incident." }),
|
|
74
106
|
" ",
|
|
75
|
-
|
|
76
|
-
" ",
|
|
77
|
-
|
|
78
|
-
"Something with direct access to the database has changed what
|
|
79
|
-
|
|
80
|
-
" until that is explained."
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
failed.length === 1 ? `Entry ${failed[0].seq} is` : `${failed.length} entries below are`,
|
|
108
|
+
" not what the vault signed",
|
|
109
|
+
signed === null ? "" : ` in the head it signed at ${signed}`,
|
|
110
|
+
". Something with direct access to the database has changed what the log records, and ",
|
|
111
|
+
failed.length === 1 ? "that entry" : "those entries",
|
|
112
|
+
" can’t be relied on until that is explained."
|
|
113
|
+
]
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
removed.count > 0 && /* @__PURE__ */ jsx("div", {
|
|
117
|
+
style: { marginBottom: "1.25rem" },
|
|
118
|
+
children: /* @__PURE__ */ jsxs(Notice, {
|
|
119
|
+
tone: "bad",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ jsx("strong", { children: "Treat this as an incident." }),
|
|
122
|
+
" The log lacks ",
|
|
123
|
+
removed.entries,
|
|
124
|
+
" the vault’s head numbers",
|
|
125
|
+
removed.places,
|
|
126
|
+
". Nothing prunes these entries: something with direct access to the database removed them."
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
pruned.count > 0 && /* @__PURE__ */ jsx("div", {
|
|
131
|
+
style: { marginBottom: "1.25rem" },
|
|
132
|
+
children: /* @__PURE__ */ jsxs(Notice, {
|
|
133
|
+
tone: "warn",
|
|
134
|
+
children: [
|
|
135
|
+
"The log lacks ",
|
|
136
|
+
pruned.entries,
|
|
137
|
+
" the vault’s head numbers",
|
|
138
|
+
pruned.places,
|
|
139
|
+
", all of the kind it prunes with age. A prune while the page read the log does this, and checking again settles it; entries that stay missing were removed by something with direct access to the database."
|
|
92
140
|
]
|
|
93
141
|
})
|
|
94
142
|
}),
|
|
@@ -188,7 +236,7 @@ function AuditPage() {
|
|
|
188
236
|
batch,
|
|
189
237
|
filters,
|
|
190
238
|
detail: search.detail,
|
|
191
|
-
|
|
239
|
+
proof
|
|
192
240
|
}, batch[0].seq)) })]
|
|
193
241
|
})
|
|
194
242
|
})
|
|
@@ -200,16 +248,15 @@ function AuditPage() {
|
|
|
200
248
|
* to each; a read of several secrets, logged as one entry, opens to each
|
|
201
249
|
* secret, under its entry's number.
|
|
202
250
|
*/
|
|
203
|
-
function Line({ batch, filters, detail,
|
|
204
|
-
const
|
|
205
|
-
const [open, setOpen] = useState(
|
|
251
|
+
function Line({ batch, filters, detail, proof }) {
|
|
252
|
+
const shown = proofOf(batch.map(proof));
|
|
253
|
+
const [open, setOpen] = useState(shown === "failed");
|
|
206
254
|
const lead = batch[0];
|
|
207
255
|
const sentence = describe(batch);
|
|
208
256
|
const seqs = batch.map((entry) => entry.seq);
|
|
209
257
|
const each = batch.flatMap(perSecret);
|
|
210
258
|
const grouped = each.length > 1;
|
|
211
259
|
const [unit, units] = each.length === batch.length ? ["entry", "entries"] : ["secret", "secrets"];
|
|
212
|
-
const breakRow = each.findIndex((entry) => entry.seq === breakAt);
|
|
213
260
|
const [first, last] = [Math.min(...seqs), Math.max(...seqs)];
|
|
214
261
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Row, {
|
|
215
262
|
entry: lead,
|
|
@@ -219,8 +266,7 @@ function Line({ batch, filters, detail, breakAt }) {
|
|
|
219
266
|
decided: decidedBy(batch),
|
|
220
267
|
filters,
|
|
221
268
|
detail,
|
|
222
|
-
|
|
223
|
-
marked: breaksInside,
|
|
269
|
+
proof: shown,
|
|
224
270
|
toggle: grouped ? /* @__PURE__ */ jsx("button", {
|
|
225
271
|
type: "button",
|
|
226
272
|
className: "batch-toggle",
|
|
@@ -239,23 +285,23 @@ function Line({ batch, filters, detail, breakAt }) {
|
|
|
239
285
|
decided: decidedBy([entry]),
|
|
240
286
|
filters,
|
|
241
287
|
detail,
|
|
242
|
-
|
|
243
|
-
marked: false,
|
|
288
|
+
proof: proof(entry),
|
|
244
289
|
child: true
|
|
245
290
|
}, `${entry.seq}:${i}`);
|
|
246
291
|
})] });
|
|
247
292
|
}
|
|
248
|
-
function Row({ entry, seq, parts, refused, decided, filters, detail,
|
|
293
|
+
function Row({ entry, seq, parts, refused, decided, filters, detail, proof, toggle, child = false }) {
|
|
249
294
|
const actor = who(entry);
|
|
250
295
|
const classes = [
|
|
251
296
|
refused && "is-denied",
|
|
252
|
-
|
|
297
|
+
proof === "failed" && "is-break",
|
|
253
298
|
child && "is-child",
|
|
254
299
|
entry.detail && "is-detail",
|
|
255
300
|
entry.action === "vault.tampered" && "is-tampered"
|
|
256
301
|
].filter(Boolean);
|
|
257
302
|
return /* @__PURE__ */ jsxs("tr", {
|
|
258
303
|
className: classes.length === 0 ? void 0 : classes.join(" "),
|
|
304
|
+
"data-proof": proof,
|
|
259
305
|
children: [
|
|
260
306
|
/* @__PURE__ */ jsx("td", {
|
|
261
307
|
className: "n",
|
|
@@ -318,7 +364,11 @@ function Row({ entry, seq, parts, refused, decided, filters, detail, breaks, mar
|
|
|
318
364
|
toggle,
|
|
319
365
|
entry.action === "vault.tampered" && /* @__PURE__ */ jsx(AlertTriangle, { size: 13 }),
|
|
320
366
|
/* @__PURE__ */ jsx(Sentence, { parts }),
|
|
321
|
-
|
|
367
|
+
proof === "failed" && /* @__PURE__ */ jsx(BreakMark, {}),
|
|
368
|
+
proof === "unproven" && /* @__PURE__ */ jsx("span", {
|
|
369
|
+
className: "unproven-mark",
|
|
370
|
+
children: "not proven"
|
|
371
|
+
})
|
|
322
372
|
]
|
|
323
373
|
})
|
|
324
374
|
}),
|
|
@@ -337,123 +387,84 @@ function Row({ entry, seq, parts, refused, decided, filters, detail, breaks, mar
|
|
|
337
387
|
]
|
|
338
388
|
});
|
|
339
389
|
}
|
|
340
|
-
/**
|
|
390
|
+
/** An entry that is not what the vault signed, said in words as well as in red. */
|
|
341
391
|
function BreakMark() {
|
|
342
392
|
return /* @__PURE__ */ jsxs("span", {
|
|
343
393
|
className: "break-mark",
|
|
344
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 11 }), "
|
|
394
|
+
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 11 }), "not as signed"]
|
|
345
395
|
});
|
|
346
396
|
}
|
|
397
|
+
/** Where a hole is, between the entries found around it. */
|
|
398
|
+
function where(hole) {
|
|
399
|
+
if (hole.above !== null && hole.below !== null) return ` between entries ${hole.below} and ${hole.above}`;
|
|
400
|
+
if (hole.below !== null) return ` after entry ${hole.below}`;
|
|
401
|
+
if (hole.above !== null) return ` before entry ${hole.above}`;
|
|
402
|
+
return "";
|
|
403
|
+
}
|
|
347
404
|
/**
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
* This replaced a card with a "Verify chain" button on it. A green result you
|
|
351
|
-
* have to ask for is reassurance rather than evidence: it is checked when
|
|
352
|
-
* someone is already feeling confident, and not on the morning it would have
|
|
353
|
-
* mattered. Recomputing on load makes the claim continuous.
|
|
405
|
+
* What the entries shown prove, beside the title: rendered with the page,
|
|
406
|
+
* from the answer that listed them, never a loading state.
|
|
354
407
|
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* passing for a broken log.
|
|
408
|
+
* The vault vouches for a head of the log in the page's own call, and the
|
|
409
|
+
* server proves each entry shown against it from the tiles. So the claim is
|
|
410
|
+
* about what is on screen, every time it is shown, however long the log.
|
|
411
|
+
* An entry past the head is not proven: signed since the vault's read, or
|
|
412
|
+
* put there by a writer, which the page cannot tell apart; checking again,
|
|
413
|
+
* against a newer head, settles the first.
|
|
362
414
|
*/
|
|
363
|
-
function
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
415
|
+
function ProofStatus({ head, counts, pruned, checking, onCheck }) {
|
|
416
|
+
const plural = (n) => `${n.toLocaleString("en")} ${n === 1 ? "entry" : "entries"}`;
|
|
417
|
+
const again = /* @__PURE__ */ jsx("button", {
|
|
418
|
+
type: "button",
|
|
419
|
+
className: "btn btn-sm",
|
|
420
|
+
disabled: checking,
|
|
421
|
+
onClick: onCheck,
|
|
422
|
+
children: "Check again"
|
|
368
423
|
});
|
|
369
|
-
if (
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
424
|
+
if (counts.failed > 0) return /* @__PURE__ */ jsxs("div", {
|
|
425
|
+
className: "chain",
|
|
426
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
427
|
+
className: "chain-flag chain-flag-bad",
|
|
428
|
+
children: [
|
|
429
|
+
/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }),
|
|
430
|
+
plural(counts.failed),
|
|
431
|
+
" not as signed"
|
|
432
|
+
]
|
|
433
|
+
}), (counts.unproven > 0 || pruned) && again]
|
|
377
434
|
});
|
|
378
|
-
if (
|
|
435
|
+
if (head === null) return /* @__PURE__ */ jsxs("div", {
|
|
379
436
|
className: "chain",
|
|
380
437
|
children: [/* @__PURE__ */ jsx(Toggletip, {
|
|
381
438
|
align: "end",
|
|
382
|
-
label:
|
|
439
|
+
label: "The vault vouched for no head of the log: it has signed none yet, or the one in the database is not one it signed. No entry below is proven.",
|
|
383
440
|
children: /* @__PURE__ */ jsxs("button", {
|
|
384
441
|
type: "button",
|
|
385
442
|
className: "chain-flag chain-flag-warn",
|
|
386
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), "
|
|
443
|
+
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), "Not proven"]
|
|
387
444
|
})
|
|
388
|
-
}),
|
|
389
|
-
type: "button",
|
|
390
|
-
className: "btn btn-sm",
|
|
391
|
-
disabled: retrying,
|
|
392
|
-
onClick: onRetry,
|
|
393
|
-
children: "Retry"
|
|
394
|
-
})]
|
|
395
|
-
});
|
|
396
|
-
if (chain.integrity === "broken") return /* @__PURE__ */ jsxs("span", {
|
|
397
|
-
className: "chain-flag chain-flag-bad",
|
|
398
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), chain.failedAtSeq === null ? "Log does not verify" : `Log broken at ${chain.failedAtSeq}`]
|
|
445
|
+
}), again]
|
|
399
446
|
});
|
|
400
|
-
const signed =
|
|
401
|
-
const verified = chain.whole ? `Audit log verified from its first entry by the app and vault keys${signed === null ? ", not signed yet" : `, last signature at ${signed}`}.` : signed === null ? "Audit log verified by the app and vault keys, not signed yet." : `What was written since the last checkpoint verified by the app and vault keys; the checkpoint, signed at ${signed}, vouches for everything before it, as each was checked when it was written.`;
|
|
447
|
+
const signed = `${absolute(head.signedAt, false)} UTC`;
|
|
402
448
|
return /* @__PURE__ */ jsxs("div", {
|
|
403
449
|
className: "chain",
|
|
404
450
|
children: [
|
|
405
|
-
|
|
451
|
+
counts.unproven > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Toggletip, {
|
|
406
452
|
align: "end",
|
|
407
|
-
label:
|
|
453
|
+
label: `Past the head the vault signed at ${signed}, of ${head.size.toLocaleString("en")} entries: signed since, or put there by something with direct access to the database. Checking again, against a newer head, settles the first.`,
|
|
408
454
|
children: /* @__PURE__ */ jsxs("button", {
|
|
409
455
|
type: "button",
|
|
410
456
|
className: "chain-note",
|
|
411
|
-
|
|
412
|
-
children: [
|
|
413
|
-
chain.pending,
|
|
414
|
-
" key operation",
|
|
415
|
-
chain.pending === 1 ? "" : "s",
|
|
416
|
-
" in flight"
|
|
417
|
-
]
|
|
457
|
+
children: [plural(counts.unproven), " not proven"]
|
|
418
458
|
})
|
|
419
|
-
}),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
label: `Verified through entry ${chain.through?.toLocaleString("en") ?? "none"}. The checkpoints are catching up with the log, a stretch every five minutes, and a check goes no further than they have.`,
|
|
423
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
424
|
-
type: "button",
|
|
425
|
-
className: "chain-note",
|
|
426
|
-
role: "status",
|
|
427
|
-
children: [
|
|
428
|
-
chain.remaining.toLocaleString("en"),
|
|
429
|
-
" newer ",
|
|
430
|
-
chain.remaining === 1 ? "entry" : "entries",
|
|
431
|
-
" to verify"
|
|
432
|
-
]
|
|
433
|
-
})
|
|
434
|
-
}),
|
|
435
|
-
walkFailed !== null && /* @__PURE__ */ jsx(Toggletip, {
|
|
436
|
-
align: "end",
|
|
437
|
-
label: `coffre could not walk the whole log: ${walkFailed}. The verdict beside it, from the newest checkpoint, stands.`,
|
|
438
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
439
|
-
type: "button",
|
|
440
|
-
className: "chain-flag chain-flag-warn",
|
|
441
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), "Whole log not checked"]
|
|
442
|
-
})
|
|
443
|
-
}),
|
|
444
|
-
!chain.whole && chain.remaining === 0 && /* @__PURE__ */ jsx("button", {
|
|
445
|
-
type: "button",
|
|
446
|
-
className: "btn btn-sm",
|
|
447
|
-
onClick: onWalk,
|
|
448
|
-
children: "Verify whole log"
|
|
449
|
-
}),
|
|
450
|
-
chain.remaining === 0 && /* @__PURE__ */ jsx(Toggletip, {
|
|
459
|
+
}), again] }),
|
|
460
|
+
pruned && counts.unproven === 0 && again,
|
|
461
|
+
counts.proven > 0 && /* @__PURE__ */ jsx(Toggletip, {
|
|
451
462
|
align: "end",
|
|
452
|
-
label:
|
|
463
|
+
label: `Each entry below the vault’s head, signed at ${signed}, is proven against it: what it records is what the vault signed, where it signed it.`,
|
|
453
464
|
children: /* @__PURE__ */ jsxs("button", {
|
|
454
465
|
type: "button",
|
|
455
466
|
className: "chain-seal",
|
|
456
|
-
children: [/* @__PURE__ */ jsx(ShieldCheck, { size: 14 }), "
|
|
467
|
+
children: [/* @__PURE__ */ jsx(ShieldCheck, { size: 14 }), "Proven"]
|
|
457
468
|
})
|
|
458
469
|
})
|
|
459
470
|
]
|
package/dist/pages/audit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","names":[],"sources":["../../src/pages/audit.tsx"],"sourcesContent":["import { type AuditEntryView } from '@coffre/client';\nimport { useState, type ReactNode } from 'react';\nimport { useSuspenseQuery } from '@tanstack/react-query';\nimport { Link } from '@tanstack/react-router';\nimport { useCoffre } from '../lib/coffre';\nimport { chainResult, chainUnknown, queries, shownChain, type AuditSearch, type ChainResult } from '../lib/queries';\nimport {\n decidedBy,\n describe,\n lines,\n perSecret,\n runLabel,\n who,\n type Part,\n} from '../lib/audit-sentences';\nimport { absolute, EmptyState, Notice, Spinner, Timestamp, Toggletip } from '../components/ui';\nimport { memberName, Sentence } from '../components/audit-sentence';\nimport { ClosedDoor, PageHeader } from '../components/page';\nimport {\n Activity,\n AlertTriangle,\n ChevronRight,\n Clock,\n Info,\n Ledger,\n ShieldCheck,\n SlashCircle,\n User,\n X,\n} from '../components/icons';\nimport { pageRoute } from '../lib/page-route';\nimport type { audit } from '../options';\n\nconst Route = pageRoute<typeof audit>();\n\nexport function AuditPage() {\n const search = Route.useSearch();\n const client = useCoffre();\n const { data: result } = useSuspenseQuery(queries.auditEntries(client, search));\n // Loaded with the entries: the page arrives with its badge.\n const verification = useSuspenseQuery(queries.auditChain(client));\n // The walk from the first entry, once someone ran it, beside the check from the newest checkpoint, which\n // the page reuses for `FRESH_MS` and asks again after that, after a change made here, or on Retry:\n // `shownChain` says which the page shows, until the page is left.\n const [whole, setWhole] = useState<ChainResult | null>(null);\n const chain = shownChain(verification.data, whole);\n // The walk from the first entry, when someone asks for it: how far it has got. Its verdict takes the badge's place.\n const [walked, setWalked] = useState<{ through: number | null } | null>(null);\n const [walkFailed, setWalkFailed] = useState<string | null>(null);\n const walkWhole = async () => {\n setWalked({ through: null });\n setWalkFailed(null);\n setWhole(null);\n let verdict: ChainResult;\n try {\n verdict = chainResult(await client.audit.verifyWhole((stretch) => setWalked({ through: stretch.through })), true);\n } catch (error) {\n verdict = chainUnknown(error);\n }\n // A walk that could not run says nothing of the log: the verdict from the newest checkpoint stands.\n if (verdict.integrity === 'unknown') setWalkFailed(verdict.problem);\n else if (verdict.integrity !== 'owners-only') setWhole(verdict);\n setWalked(null);\n };\n const { decision, actorId } = search;\n const detail = search.detail === '1';\n const deniedOnly = decision === 'deny';\n\n if (!result.ok) {\n return (\n <ClosedDoor icon={<Ledger size={18} />} label=\"Audit\" title=\"The audit log is closed to you\">\n {result.error}\n </ClosedDoor>\n );\n }\n\n const broken = chain?.integrity === 'broken' ? chain : null;\n const breakAt = broken?.failedAtSeq ?? null;\n const shown = lines(result.entries);\n const filters = { decision, actorId };\n\n return (\n <>\n <PageHeader\n title=\"Audit\"\n actions={\n // One region for every state, so each change of it is announced.\n <div className=\"chain-live\" aria-live=\"polite\" aria-atomic=\"true\">\n <ChainStatus\n chain={chain}\n walked={walked}\n walkFailed={walkFailed}\n retrying={verification.isFetching}\n onRetry={() => void verification.refetch()}\n onWalk={() => void walkWhole()}\n />\n </div>\n }\n />\n\n {broken !== null && (\n <div style={{ marginBottom: '1.25rem' }}>\n <Notice tone=\"bad\">\n <strong>Treat this as an incident.</strong>{' '}\n {broken.failedAtSeq === null\n ? `The log does not verify, found by the ${broken.author}'s check: ${broken.reason}.`\n : `The log breaks at entry ${broken.failedAtSeq}, found by the ${broken.author}'s check: ${broken.reason}.`}{' '}\n {broken.through !== null && `Every entry through ${broken.through} holds. `}\n Something with direct access to the database has changed what it records\n {broken.failedAtSeq === null ? '' : `, and nothing from entry ${broken.failedAtSeq} on can be relied on`} until\n that is explained.\n {breakAt !== null && !result.entries.some((entry) => entry.seq === breakAt) && (\n <>\n {' '}Entry {breakAt} is not among the entries below\n {detail ? (\n <>\n ; <code>coffre audit</code> lists them all.\n </>\n ) : (\n ': it may be detail, which Everything lists.'\n )}\n </>\n )}\n </Notice>\n </div>\n )}\n\n <div className=\"toolbar\">\n {/* One control for what the log lists. `exact` holds each link to the\n whole search, so only the view shown lights up. */}\n <nav className=\"segmented\" aria-label=\"Show\">\n <Link to=\"/audit\" search={{ actorId }} activeOptions={{ exact: true }}>\n Actions\n </Link>\n <Link to=\"/audit\" search={{ actorId, detail: '1' }} activeOptions={{ exact: true }}>\n Everything\n </Link>\n <Link to=\"/audit\" search={{ actorId, decision: 'deny', detail: '1' }} activeOptions={{ exact: true }}>\n <SlashCircle size={13} />\n Denials\n </Link>\n </nav>\n\n {actorId !== undefined && (\n <Link\n className=\"filter-chip\"\n to=\"/audit\"\n search={{ ...filters, actorId: undefined, detail: search.detail }}\n aria-label={`Stop filtering by ${actorId}`}\n >\n Actor <span className=\"mono\">{actorId}</span>\n <X size={13} />\n </Link>\n )}\n </div>\n\n <section className=\"card card-wide\" aria-label=\"Audit entries\">\n {shown.length === 0 ? (\n <EmptyState title={deniedOnly ? 'No denials recorded' : 'Nothing recorded yet'}>\n {deniedOnly\n ? 'Nobody has been turned away.'\n : 'The log fills as people read and write secrets and change who has access.'}\n </EmptyState>\n ) : (\n <div className=\"dt-wrap\">\n <table className=\"dt audit events stacks\">\n <thead>\n <tr>\n <th className=\"n\" title=\"Sequence number in the log\">\n #\n </th>\n <th className=\"col-shrink\">\n <span className=\"th\">\n <Clock size={14} />\n When (UTC)\n </span>\n </th>\n <th className=\"col-shrink\">\n <span className=\"th\">\n <User size={14} />\n Who\n </span>\n </th>\n <th>\n <span className=\"th\">\n <Activity size={14} />\n What they did\n </span>\n </th>\n <th className=\"col-shrink\">\n <span className=\"th\">\n <ShieldCheck size={14} />\n Decided by\n </span>\n </th>\n </tr>\n </thead>\n <tbody>\n {shown.map((batch) => (\n <Line key={batch[0]!.seq} batch={batch} filters={filters} detail={search.detail} breakAt={breakAt} />\n ))}\n </tbody>\n </table>\n </div>\n )}\n </section>\n\n </>\n );\n}\n\ntype Entry = AuditEntryView;\ntype Filters = { decision?: 'deny'; actorId?: string };\n\n/**\n * One action: an entry, or a batch of them under one operation, which opens\n * to each; a read of several secrets, logged as one entry, opens to each\n * secret, under its entry's number.\n */\nfunction Line({\n batch,\n filters,\n detail,\n breakAt,\n}: {\n batch: Entry[];\n filters: Filters;\n detail: '1' | undefined;\n breakAt: number | null;\n}) {\n const breaksInside = breakAt !== null && batch.some((entry) => entry.seq === breakAt);\n const [open, setOpen] = useState(breaksInside);\n const lead = batch[0]!;\n const sentence = describe(batch);\n const seqs = batch.map((entry) => entry.seq);\n const each = batch.flatMap(perSecret);\n const grouped = each.length > 1;\n const [unit, units] = each.length === batch.length ? ['entry', 'entries'] : ['secret', 'secrets'];\n // A read of several breaks at its first secret's row.\n const breakRow = each.findIndex((entry) => entry.seq === breakAt);\n const [first, last] = [Math.min(...seqs), Math.max(...seqs)];\n\n return (\n <>\n <Row\n entry={lead}\n seq={first === last ? String(first) : `${first}–${last}`}\n parts={sentence.parts}\n refused={sentence.refused}\n decided={decidedBy(batch)}\n filters={filters}\n detail={detail}\n breaks={breaksInside && !grouped}\n marked={breaksInside}\n toggle={\n grouped ? (\n <button\n type=\"button\"\n className=\"batch-toggle\"\n aria-expanded={open}\n aria-label={open ? `Hide each ${unit}` : `Show each of ${each.length} ${units}`}\n onClick={() => setOpen(!open)}\n >\n <ChevronRight size={14} />\n </button>\n ) : undefined\n }\n />\n {grouped &&\n open &&\n each.map((entry, i) => {\n const one = describe([entry]);\n return (\n <Row\n key={`${entry.seq}:${i}`}\n entry={entry}\n seq={String(entry.seq)}\n parts={one.parts}\n refused={one.refused}\n decided={decidedBy([entry])}\n filters={filters}\n detail={detail}\n breaks={i === breakRow}\n marked={false}\n child\n />\n );\n })}\n </>\n );\n}\n\nfunction Row({\n entry,\n seq,\n parts,\n refused,\n decided,\n filters,\n detail,\n breaks,\n marked,\n toggle,\n child = false,\n}: {\n entry: Entry;\n seq: string;\n parts: Part[];\n refused: boolean;\n decided: string;\n filters: Filters;\n detail: '1' | undefined;\n /** The entry where verification stopped. */\n breaks: boolean;\n /** A batch holding it, closed or open. */\n marked: boolean;\n toggle?: ReactNode;\n child?: boolean;\n}) {\n const actor = who(entry);\n const classes = [\n refused && 'is-denied',\n (breaks || marked) && 'is-break',\n child && 'is-child',\n entry.detail && 'is-detail',\n entry.action === 'vault.tampered' && 'is-tampered',\n ].filter(Boolean);\n return (\n <tr className={classes.length === 0 ? undefined : classes.join(' ')}>\n <td className=\"n\" data-label=\"Sequence\">\n {seq}\n </td>\n <td className=\"nowrap cell-mono\" data-label=\"When (UTC)\">\n <Timestamp iso={entry.occurredAt} precise />\n </td>\n <td data-label=\"Who\">\n {/* Filtering to one actor is the second question anyone asks after\n \"what happened\", so the actor is the control. */}\n <span className=\"actor\">\n {typeof actor === 'string' ? (\n <Link to=\"/audit\" search={{ ...filters, actorId: entry.actorId, detail }}>\n {actor}\n </Link>\n ) : (\n <Link to=\"/audit\" search={{ ...filters, actorId: entry.actorId, detail }}>\n {memberName(actor.member)}\n </Link>\n )}\n </span>\n {entry.run !== null && (\n // The run its issuer named when the credential was exchanged: what it asserted, kept in entry #exchangeSeq.\n <small className=\"actor-run\" title={`Exchanged in entry ${entry.run.exchangeSeq}`}>\n {runLabel(entry.run)}\n </small>\n )}\n {entry.token != null && (\n // The personal token the person made the request with, by the label it was made with.\n <small className=\"actor-run\" title={`Personal token ${entry.token.id}`}>\n via token “{entry.token.label}”\n </small>\n )}\n </td>\n <td className=\"cell-sentence\" data-label=\"What they did\">\n <span className=\"sentence\">\n {toggle}\n {entry.action === 'vault.tampered' && <AlertTriangle size={13} />}\n <Sentence parts={parts} />\n {breaks && <BreakMark />}\n </span>\n </td>\n <td className=\"nowrap\" data-label=\"Decided by\">\n <span className={refused ? 'decided decided-refused' : 'decided'}>\n {refused && <SlashCircle size={13} />}\n {decided}\n {refused && ', refused'}\n </span>\n </td>\n </tr>\n );\n}\n\n/** The entry the log breaks at, said in words as well as in red. */\nfunction BreakMark() {\n return (\n <span className=\"break-mark\">\n <AlertTriangle size={11} />\n breaks here\n </span>\n );\n}\n\n/**\n * Whether the log still verifies, beside the title.\n *\n * This replaced a card with a \"Verify chain\" button on it. A green result you\n * have to ask for is reassurance rather than evidence: it is checked when\n * someone is already feeling confident, and not on the morning it would have\n * mattered. Recomputing on load makes the claim continuous.\n *\n * On load it checks what was written since the newest checkpoint, which\n * vouches for everything before, so it is quick however long the log. The\n * walk from the first entry, which checks again what the checkpoints vouch\n * for, is there to ask for, a stretch a request, with how far it has got.\n * The check on load is rendered with the page, never a loading state; a\n * check that could not run says so and offers to run again, rather than\n * passing for a broken log.\n */\nfunction ChainStatus({\n chain,\n walked,\n walkFailed,\n retrying,\n onRetry,\n onWalk,\n}: {\n chain: ChainResult;\n walked: { through: number | null } | null;\n walkFailed: string | null;\n /** The check on load is being asked again. */\n retrying: boolean;\n onRetry: () => void;\n onWalk: () => void;\n}) {\n if (walked !== null) {\n return (\n <span className=\"chain-note\" role=\"status\">\n <Spinner size={14} />\n {walked.through === null ? 'Verifying from the first entry…' : `Verified through ${walked.through.toLocaleString('en')}…`}\n </span>\n );\n }\n\n if (chain.integrity === 'owners-only') {\n return (\n <Toggletip\n align=\"end\"\n label=\"Only auditors, admins and owners of the whole instance can check the log: it takes every entry, and you see only your projects'.\"\n >\n <button type=\"button\" className=\"chain-note\">\n <Info size={14} />\n Verified by owners\n </button>\n </Toggletip>\n );\n }\n\n if (chain.integrity === 'unknown') {\n return (\n <div className=\"chain\">\n <Toggletip\n align=\"end\"\n label={`coffre could not check the log: ${chain.problem}. The entries below are unverified.`}\n >\n <button type=\"button\" className=\"chain-flag chain-flag-warn\">\n <AlertTriangle size={14} />\n Couldn’t verify\n </button>\n </Toggletip>\n <button type=\"button\" className=\"btn btn-sm\" disabled={retrying} onClick={onRetry}>\n Retry\n </button>\n </div>\n );\n }\n\n if (chain.integrity === 'broken') {\n return (\n <span className=\"chain-flag chain-flag-bad\">\n <AlertTriangle size={14} />\n {chain.failedAtSeq === null ? 'Log does not verify' : `Log broken at ${chain.failedAtSeq}`}\n </span>\n );\n }\n\n const signed = chain.checkpoint === null ? null : `${absolute(chain.checkpoint.signedAt, false)} UTC`;\n const verified = chain.whole\n ? `Audit log verified from its first entry by the app and vault keys${signed === null ? ', not signed yet' : `, last signature at ${signed}`}.`\n : signed === null\n ? 'Audit log verified by the app and vault keys, not signed yet.'\n : `What was written since the last checkpoint verified by the app and vault keys; the checkpoint, signed at ${signed}, vouches for everything before it, as each was checked when it was written.`;\n return (\n <div className=\"chain\">\n {chain.pending > 0 && (\n <Toggletip\n align=\"end\"\n label=\"Keys released through KMS whose outcome the vault has not logged yet. Each settles within seconds, or is logged as failed.\"\n >\n <button type=\"button\" className=\"chain-note\" role=\"status\">\n {chain.pending} key operation{chain.pending === 1 ? '' : 's'} in flight\n </button>\n </Toggletip>\n )}\n {chain.remaining > 0 && (\n <Toggletip\n align=\"end\"\n label={`Verified through entry ${chain.through?.toLocaleString('en') ?? 'none'}. The checkpoints are catching up with the log, a stretch every five minutes, and a check goes no further than they have.`}\n >\n <button type=\"button\" className=\"chain-note\" role=\"status\">\n {chain.remaining.toLocaleString('en')} newer {chain.remaining === 1 ? 'entry' : 'entries'} to verify\n </button>\n </Toggletip>\n )}\n {walkFailed !== null && (\n <Toggletip align=\"end\" label={`coffre could not walk the whole log: ${walkFailed}. The verdict beside it, from the newest checkpoint, stands.`}>\n <button type=\"button\" className=\"chain-flag chain-flag-warn\">\n <AlertTriangle size={14} />\n Whole log not checked\n </button>\n </Toggletip>\n )}\n {!chain.whole && chain.remaining === 0 && (\n <button type=\"button\" className=\"btn btn-sm\" onClick={onWalk}>\n Verify whole log\n </button>\n )}\n {/* No seal over a log verified only in part: what is left could be anything. */}\n {chain.remaining === 0 && (\n <Toggletip align=\"end\" label={verified}>\n <button type=\"button\" className=\"chain-seal\">\n <ShieldCheck size={14} />\n Verified\n </button>\n </Toggletip>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAiCA,IAAM,QAAQ,UAAwB;AAEtC,SAAgB,YAAY;CAC1B,MAAM,SAAS,MAAM,UAAU;CAC/B,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,MAAM,WAAW,iBAAiB,QAAQ,aAAa,QAAQ,MAAM,CAAC;CAE9E,MAAM,eAAe,iBAAiB,QAAQ,WAAW,MAAM,CAAC;CAIhE,MAAM,CAAC,OAAO,YAAY,SAA6B,IAAI;CAC3D,MAAM,QAAQ,WAAW,aAAa,MAAM,KAAK;CAEjD,MAAM,CAAC,QAAQ,aAAa,SAA4C,IAAI;CAC5E,MAAM,CAAC,YAAY,iBAAiB,SAAwB,IAAI;CAChE,MAAM,YAAY,YAAY;EAC5B,UAAU,EAAE,SAAS,KAAK,CAAC;EAC3B,cAAc,IAAI;EAClB,SAAS,IAAI;EACb,IAAI;EACJ,IAAI;GACF,UAAU,YAAY,MAAM,OAAO,MAAM,aAAa,YAAY,UAAU,EAAE,SAAS,QAAQ,QAAQ,CAAC,CAAC,GAAG,IAAI;EAClH,SAAS,OAAO;GACd,UAAU,aAAa,KAAK;EAC9B;EAEA,IAAI,QAAQ,cAAc,WAAW,cAAc,QAAQ,OAAO;OAC7D,IAAI,QAAQ,cAAc,eAAe,SAAS,OAAO;EAC9D,UAAU,IAAI;CAChB;CACA,MAAM,EAAE,UAAU,YAAY;CAC9B,MAAM,SAAS,OAAO,WAAW;CACjC,MAAM,aAAa,aAAa;CAEhC,IAAI,CAAC,OAAO,IACV,OACE,oBAAC,YAAD;EAAY,MAAM,oBAAC,QAAD,EAAQ,MAAM,GAAK,CAAA;EAAG,OAAM;EAAQ,OAAM;YACzD,OAAO;CACE,CAAA;CAIhB,MAA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,CAAA;GAEZ,MAAM,YAAY,KACjB,oBAAC,WAAD;IACE,OAAM;IACN,OAAO,0BAA0B,MAAM,SAAS,eAAe,IAAI,KAAK,OAAO;cAE/E,qBAAC,UAAD;KAAQ,MAAK;KAAS,WAAU;KAAa,MAAK;eAAlD;MACG,MAAM,UAAU,eAAe,IAAI;MAAE;MAAQ,MAAM,cAAc,IAAI,UAAU;MAAU;KACpF;;GACC,CAAA;GAEZ,eAAe,QACd,oBAAC,WAAD;IAAW,OAAM;IAAM,OAAO,wCAAwC,WAAW;cAC/E,qBAAC,UAAD;KAAQ,MAAK;KAAS,WAAU;eAAhC,CACE,oBAAC,eAAD,EAAe,MAAM,GAAK,CAAA,GAAC,uBAErB;;GACC,CAAA;GAEZ,CAAC,MAAM,SAAS,MAAM,cAAc,KACnC,oBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAAa,SAAS;cAAQ;GAEtD,CAAA;GAGT,MAAM,cAAc,KACnB,oBAAC,WAAD;IAAW,OAAM;IAAM,OAAO;cAC5B,qBAAC,UAAD;KAAQ,MAAK;KAAS,WAAU;eAAhC,CACE,oBAAC,aAAD,EAAa,MAAM,GAAK,CAAA,GAAC,UAEnB;;GACC,CAAA;EAEV;;AAET"}
|
|
1
|
+
{"version":3,"file":"audit.js","names":[],"sources":["../../src/lib/audit-proofs.ts","../../src/pages/audit.tsx"],"sourcesContent":["import type { AuditEntryView, RouteOutput } from '@coffre/client';\n\n/**\n * What the audit page says of each entry it shows (docs/design/0.16.md,\n * \"Pages\"): `GET /audit` proves it against the head the vault signed, in\n * the same answer, and the page shows that, one state a row:\n *\n * proven the vault signed it as it is, where it is\n * unproven past the head: signed since the vault read it, or put\n * there by a writer; the page cannot tell which, and a\n * check against a newer head settles the first\n * failed within the head and not what it signed\n */\nexport type Proof = AuditEntryView['proof'];\nexport type Head = RouteOutput<'GET /audit'>['head'];\n\n/** A batch's, or a read's: its worst entry's. */\nexport function proofOf(proofs: readonly Proof[]): Proof {\n return proofs.includes('failed') ? 'failed' : proofs.includes('unproven') ? 'unproven' : 'proven';\n}\n\n/**\n * The entries the page has seen proven, by the head that proved them: a\n * head is its size and signing time, which its MAC covers.\n */\nexport type Proved = Map<string, Set<number>>;\n\nconst headKey = (head: NonNullable<Head>) => `${head.size}@${head.signedAt}`;\n\n/**\n * Each entry's proof as the page shows it: the answer's, except that one\n * proven before under this same head and now not is failed. Under one head\n * an entry proves or does not for good: only its tree and leaf, columns a\n * writer edits, can move it past the head, so the page never shows an entry\n * proven and later not proven against the same head. Another head is\n * another answer: one put back from before covers less, and the page shows\n * what it covers.\n */\nexport function shownProofs(proved: Proved, head: Head, entries: readonly AuditEntryView[]): Map<number, Proof> {\n const seen = head === null ? undefined : proved.get(headKey(head));\n return new Map(entries.map((entry) => [entry.seq, entry.proof === 'unproven' && seen?.has(entry.seq) ? 'failed' : entry.proof]));\n}\n\n/** Notes what an answer proved, under its head. */\nexport function remember(proved: Proved, head: Head, entries: readonly AuditEntryView[]): void {\n if (head === null) return;\n const key = headKey(head);\n const seen = proved.get(key) ?? new Set<number>();\n for (const entry of entries) if (entry.proof === 'proven') seen.add(entry.seq);\n proved.set(key, seen);\n}\n","import { type AuditEntryView } from '@coffre/client';\nimport { useEffect, useRef, useState, type ReactNode } from 'react';\nimport { useSuspenseQuery } from '@tanstack/react-query';\nimport { Link } from '@tanstack/react-router';\nimport { useCoffre } from '../lib/coffre';\nimport { queries, type AuditSearch } from '../lib/queries';\nimport { proofOf, remember, shownProofs, type Head, type Proof, type Proved } from '../lib/audit-proofs';\nimport {\n decidedBy,\n describe,\n lines,\n perSecret,\n runLabel,\n who,\n type Part,\n} from '../lib/audit-sentences';\nimport { absolute, EmptyState, Notice, Timestamp, Toggletip } from '../components/ui';\nimport { memberName, Sentence } from '../components/audit-sentence';\nimport { ClosedDoor, PageHeader } from '../components/page';\nimport {\n Activity,\n AlertTriangle,\n ChevronRight,\n Clock,\n Ledger,\n ShieldCheck,\n SlashCircle,\n User,\n X,\n} from '../components/icons';\nimport { pageRoute } from '../lib/page-route';\nimport type { audit } from '../options';\n\nconst Route = pageRoute<typeof audit>();\n\nexport function AuditPage() {\n const search = Route.useSearch();\n const client = useCoffre();\n const entries = useSuspenseQuery(queries.auditEntries(client, search));\n const result = entries.data;\n // What this page has seen proven, by head, while it is open: see `shownProofs`.\n const proved = useRef<Proved>(new Map());\n const proofs = result.ok ? shownProofs(proved.current, result.head, result.entries) : new Map<number, Proof>();\n useEffect(() => {\n if (result.ok) remember(proved.current, result.head, result.entries);\n }, [result]);\n const { decision, actorId } = search;\n const deniedOnly = decision === 'deny';\n\n if (!result.ok) {\n return (\n <ClosedDoor icon={<Ledger size={18} />} label=\"Audit\" title=\"The audit log is closed to you\">\n {result.error}\n </ClosedDoor>\n );\n }\n\n const proof = (entry: Entry) => proofs.get(entry.seq) ?? entry.proof;\n const failed = result.entries.filter((entry) => proof(entry) === 'failed');\n const counts = {\n failed: failed.length,\n unproven: result.entries.filter((entry) => proof(entry) === 'unproven').length,\n proven: result.entries.filter((entry) => proof(entry) === 'proven').length,\n };\n const signed = result.head === null ? null : `${absolute(result.head.signedAt, false)} UTC`;\n const holes = result.holes ?? [];\n // Kept entries are never pruned, so a kept one missing is removed; an aging\n // one may have been pruned while the page read the log.\n const gone = (kind: 'kept' | 'aging') => {\n const found = holes.filter((hole) => hole[kind] > 0);\n const count = found.reduce((sum, hole) => sum + hole[kind], 0);\n const places = found.length === 1 ? where(found[0]!) : `, in ${found.length} places`;\n return { count, places, entries: `${count.toLocaleString('en')} ${count === 1 ? 'entry' : 'entries'}` };\n };\n const removed = gone('kept');\n const pruned = gone('aging');\n const shown = lines(result.entries);\n const filters = { decision, actorId };\n\n return (\n <>\n <PageHeader\n title=\"Audit\"\n actions={\n // One region for every state, so each change of it is announced.\n <div className=\"chain-live\" aria-live=\"polite\" aria-atomic=\"true\">\n <ProofStatus\n head={result.head}\n counts={counts}\n pruned={pruned.count > 0}\n checking={entries.isFetching}\n onCheck={() => void entries.refetch()}\n />\n </div>\n }\n />\n\n {failed.length > 0 && (\n <div style={{ marginBottom: '1.25rem' }}>\n <Notice tone=\"bad\">\n <strong>Treat this as an incident.</strong>{' '}\n {failed.length === 1 ? `Entry ${failed[0]!.seq} is` : `${failed.length} entries below are`} not what the vault\n signed{signed === null ? '' : ` in the head it signed at ${signed}`}. Something with direct access to the\n database has changed what the log records, and {failed.length === 1 ? 'that entry' : 'those entries'} can’t be\n relied on until that is explained.\n </Notice>\n </div>\n )}\n\n {removed.count > 0 && (\n <div style={{ marginBottom: '1.25rem' }}>\n <Notice tone=\"bad\">\n <strong>Treat this as an incident.</strong> The log lacks {removed.entries} the vault’s head numbers\n {removed.places}. Nothing prunes these entries: something with direct access to the database removed them.\n </Notice>\n </div>\n )}\n\n {pruned.count > 0 && (\n <div style={{ marginBottom: '1.25rem' }}>\n <Notice tone=\"warn\">\n The log lacks {pruned.entries} the vault’s head numbers{pruned.places}, all of the kind it prunes with\n age. A prune while the page read the log does this, and checking again settles it; entries that stay missing\n were removed by something with direct access to the database.\n </Notice>\n </div>\n )}\n\n <div className=\"toolbar\">\n {/* One control for what the log lists. `exact` holds each link to the\n whole search, so only the view shown lights up. */}\n <nav className=\"segmented\" aria-label=\"Show\">\n <Link to=\"/audit\" search={{ actorId }} activeOptions={{ exact: true }}>\n Actions\n </Link>\n <Link to=\"/audit\" search={{ actorId, detail: '1' }} activeOptions={{ exact: true }}>\n Everything\n </Link>\n <Link to=\"/audit\" search={{ actorId, decision: 'deny', detail: '1' }} activeOptions={{ exact: true }}>\n <SlashCircle size={13} />\n Denials\n </Link>\n </nav>\n\n {actorId !== undefined && (\n <Link\n className=\"filter-chip\"\n to=\"/audit\"\n search={{ ...filters, actorId: undefined, detail: search.detail }}\n aria-label={`Stop filtering by ${actorId}`}\n >\n Actor <span className=\"mono\">{actorId}</span>\n <X size={13} />\n </Link>\n )}\n </div>\n\n <section className=\"card card-wide\" aria-label=\"Audit entries\">\n {shown.length === 0 ? (\n <EmptyState title={deniedOnly ? 'No denials recorded' : 'Nothing recorded yet'}>\n {deniedOnly\n ? 'Nobody has been turned away.'\n : 'The log fills as people read and write secrets and change who has access.'}\n </EmptyState>\n ) : (\n <div className=\"dt-wrap\">\n <table className=\"dt audit events stacks\">\n <thead>\n <tr>\n <th className=\"n\" title=\"Sequence number in the log\">\n #\n </th>\n <th className=\"col-shrink\">\n <span className=\"th\">\n <Clock size={14} />\n When (UTC)\n </span>\n </th>\n <th className=\"col-shrink\">\n <span className=\"th\">\n <User size={14} />\n Who\n </span>\n </th>\n <th>\n <span className=\"th\">\n <Activity size={14} />\n What they did\n </span>\n </th>\n <th className=\"col-shrink\">\n <span className=\"th\">\n <ShieldCheck size={14} />\n Decided by\n </span>\n </th>\n </tr>\n </thead>\n <tbody>\n {shown.map((batch) => (\n <Line key={batch[0]!.seq} batch={batch} filters={filters} detail={search.detail} proof={proof} />\n ))}\n </tbody>\n </table>\n </div>\n )}\n </section>\n\n </>\n );\n}\n\ntype Entry = AuditEntryView;\ntype Filters = { decision?: 'deny'; actorId?: string };\n\n/**\n * One action: an entry, or a batch of them under one operation, which opens\n * to each; a read of several secrets, logged as one entry, opens to each\n * secret, under its entry's number.\n */\nfunction Line({\n batch,\n filters,\n detail,\n proof,\n}: {\n batch: Entry[];\n filters: Filters;\n detail: '1' | undefined;\n proof: (entry: Entry) => Proof;\n}) {\n const proofs = batch.map(proof);\n const shown = proofOf(proofs);\n // A batch with an entry that fails opens on it.\n const [open, setOpen] = useState(shown === 'failed');\n const lead = batch[0]!;\n const sentence = describe(batch);\n const seqs = batch.map((entry) => entry.seq);\n const each = batch.flatMap(perSecret);\n const grouped = each.length > 1;\n const [unit, units] = each.length === batch.length ? ['entry', 'entries'] : ['secret', 'secrets'];\n const [first, last] = [Math.min(...seqs), Math.max(...seqs)];\n\n return (\n <>\n <Row\n entry={lead}\n seq={first === last ? String(first) : `${first}–${last}`}\n parts={sentence.parts}\n refused={sentence.refused}\n decided={decidedBy(batch)}\n filters={filters}\n detail={detail}\n proof={shown}\n toggle={\n grouped ? (\n <button\n type=\"button\"\n className=\"batch-toggle\"\n aria-expanded={open}\n aria-label={open ? `Hide each ${unit}` : `Show each of ${each.length} ${units}`}\n onClick={() => setOpen(!open)}\n >\n <ChevronRight size={14} />\n </button>\n ) : undefined\n }\n />\n {grouped &&\n open &&\n each.map((entry, i) => {\n const one = describe([entry]);\n return (\n <Row\n key={`${entry.seq}:${i}`}\n entry={entry}\n seq={String(entry.seq)}\n parts={one.parts}\n refused={one.refused}\n decided={decidedBy([entry])}\n filters={filters}\n detail={detail}\n proof={proof(entry)}\n child\n />\n );\n })}\n </>\n );\n}\n\nfunction Row({\n entry,\n seq,\n parts,\n refused,\n decided,\n filters,\n detail,\n proof,\n toggle,\n child = false,\n}: {\n entry: Entry;\n seq: string;\n parts: Part[];\n refused: boolean;\n decided: string;\n filters: Filters;\n detail: '1' | undefined;\n /** Its own, or a batch's: its worst entry's. */\n proof: Proof;\n toggle?: ReactNode;\n child?: boolean;\n}) {\n const actor = who(entry);\n const classes = [\n refused && 'is-denied',\n proof === 'failed' && 'is-break',\n child && 'is-child',\n entry.detail && 'is-detail',\n entry.action === 'vault.tampered' && 'is-tampered',\n ].filter(Boolean);\n return (\n <tr className={classes.length === 0 ? undefined : classes.join(' ')} data-proof={proof}>\n <td className=\"n\" data-label=\"Sequence\">\n {seq}\n </td>\n <td className=\"nowrap cell-mono\" data-label=\"When (UTC)\">\n <Timestamp iso={entry.occurredAt} precise />\n </td>\n <td data-label=\"Who\">\n {/* Filtering to one actor is the second question anyone asks after\n \"what happened\", so the actor is the control. */}\n <span className=\"actor\">\n {typeof actor === 'string' ? (\n <Link to=\"/audit\" search={{ ...filters, actorId: entry.actorId, detail }}>\n {actor}\n </Link>\n ) : (\n <Link to=\"/audit\" search={{ ...filters, actorId: entry.actorId, detail }}>\n {memberName(actor.member)}\n </Link>\n )}\n </span>\n {entry.run !== null && (\n // The run its issuer named when the credential was exchanged: what it asserted, kept in entry #exchangeSeq.\n <small className=\"actor-run\" title={`Exchanged in entry ${entry.run.exchangeSeq}`}>\n {runLabel(entry.run)}\n </small>\n )}\n {entry.token != null && (\n // The personal token the person made the request with, by the label it was made with.\n <small className=\"actor-run\" title={`Personal token ${entry.token.id}`}>\n via token “{entry.token.label}”\n </small>\n )}\n </td>\n <td className=\"cell-sentence\" data-label=\"What they did\">\n <span className=\"sentence\">\n {toggle}\n {entry.action === 'vault.tampered' && <AlertTriangle size={13} />}\n <Sentence parts={parts} />\n {proof === 'failed' && <BreakMark />}\n {proof === 'unproven' && <span className=\"unproven-mark\">not proven</span>}\n </span>\n </td>\n <td className=\"nowrap\" data-label=\"Decided by\">\n <span className={refused ? 'decided decided-refused' : 'decided'}>\n {refused && <SlashCircle size={13} />}\n {decided}\n {refused && ', refused'}\n </span>\n </td>\n </tr>\n );\n}\n\n/** An entry that is not what the vault signed, said in words as well as in red. */\nfunction BreakMark() {\n return (\n <span className=\"break-mark\">\n <AlertTriangle size={11} />\n not as signed\n </span>\n );\n}\n\n/** Where a hole is, between the entries found around it. */\nfunction where(hole: { above: number | null; below: number | null }): string {\n if (hole.above !== null && hole.below !== null) return ` between entries ${hole.below} and ${hole.above}`;\n if (hole.below !== null) return ` after entry ${hole.below}`;\n if (hole.above !== null) return ` before entry ${hole.above}`;\n return '';\n}\n\n/**\n * What the entries shown prove, beside the title: rendered with the page,\n * from the answer that listed them, never a loading state.\n *\n * The vault vouches for a head of the log in the page's own call, and the\n * server proves each entry shown against it from the tiles. So the claim is\n * about what is on screen, every time it is shown, however long the log.\n * An entry past the head is not proven: signed since the vault's read, or\n * put there by a writer, which the page cannot tell apart; checking again,\n * against a newer head, settles the first.\n */\nfunction ProofStatus({\n head,\n counts,\n pruned,\n checking,\n onCheck,\n}: {\n head: Head;\n counts: Record<Proof, number>;\n /** The log lacks entries a prune may have taken while the page read it, which checking again settles. */\n pruned: boolean;\n /** The page is being asked again. */\n checking: boolean;\n onCheck: () => void;\n}) {\n const plural = (n: number) => `${n.toLocaleString('en')} ${n === 1 ? 'entry' : 'entries'}`;\n const again = (\n <button type=\"button\" className=\"btn btn-sm\" disabled={checking} onClick={onCheck}>\n Check again\n </button>\n );\n if (counts.failed > 0) {\n // A failure stands, but the rows past the head or a prune's gap beside\n // it are still settled by checking again.\n return (\n <div className=\"chain\">\n <span className=\"chain-flag chain-flag-bad\">\n <AlertTriangle size={14} />\n {plural(counts.failed)} not as signed\n </span>\n {(counts.unproven > 0 || pruned) && again}\n </div>\n );\n }\n\n if (head === null) {\n return (\n <div className=\"chain\">\n <Toggletip\n align=\"end\"\n label=\"The vault vouched for no head of the log: it has signed none yet, or the one in the database is not one it signed. No entry below is proven.\"\n >\n <button type=\"button\" className=\"chain-flag chain-flag-warn\">\n <AlertTriangle size={14} />\n Not proven\n </button>\n </Toggletip>\n {again}\n </div>\n );\n }\n\n const signed = `${absolute(head.signedAt, false)} UTC`;\n return (\n <div className=\"chain\">\n {counts.unproven > 0 && (\n <>\n <Toggletip\n align=\"end\"\n label={`Past the head the vault signed at ${signed}, of ${head.size.toLocaleString('en')} entries: signed since, or put there by something with direct access to the database. Checking again, against a newer head, settles the first.`}\n >\n <button type=\"button\" className=\"chain-note\">\n {plural(counts.unproven)} not proven\n </button>\n </Toggletip>\n {again}\n </>\n )}\n {pruned && counts.unproven === 0 && again}\n {counts.proven > 0 && (\n <Toggletip\n align=\"end\"\n label={`Each entry below the vault’s head, signed at ${signed}, is proven against it: what it records is what the vault signed, where it signed it.`}\n >\n <button type=\"button\" className=\"chain-seal\">\n <ShieldCheck size={14} />\n Proven\n </button>\n </Toggletip>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgB,QAAQ,QAAiC;CACvD,OAAO,OAAO,SAAS,QAAQ,IAAI,WAAW,OAAO,SAAS,UAAU,IAAI,aAAa;AAC3F;AAQA,IAAM,WAAW,SAA4B,GAAG,KAAK,KAAK,GAAG,KAAK;;;;;;;;;;AAWlE,SAAgB,YAAY,QAAgB,MAA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ACjC;;CAIT,IAAI,SAAS,MACX,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,WAAD;GACE,OAAM;GACN,OAAM;aAEN,qBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;cAAhC,CACE,oBAAC,eAAD,EAAe,MAAM,GAAK,CAAA,GAAC,YAErB;;EACC,CAAA,GACV,KACE;;CAIT,MAAM,SAAS,GAAG,SAAS,KAAK,UAAU,KAAK,EAAE;CACjD,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACG,OAAO,WAAW,KACjB,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,WAAD;IACE,OAAM;IACN,OAAO,qCAAqC,OAAO,OAAO,KAAK,KAAK,eAAe,IAAI,EAAE;cAEzF,qBAAC,UAAD;KAAQ,MAAK;KAAS,WAAU;eAAhC,CACG,OAAO,OAAO,QAAQ,GAAE,aACnB;;GACC,CAAA,GACV,KACD,EAAA,CAAA;GAEH,UAAU,OAAO,aAAa,KAAK;GACnC,OAAO,SAAS,KACf,oBAAC,WAAD;IACE,OAAM;IACN,OAAO,gDAAgD,OAAO;cAE9D,qBAAC,UAAD;KAAQ,MAAK;KAAS,WAAU;eAAhC,CACE,oBAAC,aAAD,EAAa,MAAM,GAAK,CAAA,GAAC,QAEnB;;GACC,CAAA;EAEV;;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ErrorLine, l as Spinner, u as Timestamp } from "../chunks/ui-
|
|
2
|
-
import { $ as SlashCircle, c as statusOf, n as ClosedDoor, o as failureMessage, tt as Terminal, u as useCoffre, v as CheckCircle } from "../chunks/page-
|
|
1
|
+
import { a as ErrorLine, l as Spinner, u as Timestamp } from "../chunks/ui-Q_Eczt7m.js";
|
|
2
|
+
import { $ as SlashCircle, c as statusOf, n as ClosedDoor, o as failureMessage, tt as Terminal, u as useCoffre, v as CheckCircle } from "../chunks/page-Cb0ZjGda.js";
|
|
3
3
|
import { t as pageRoute } from "../chunks/page-route-Drfw7lmn.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { Link, useNavigate } from "@tanstack/react-router";
|