@coffre/ui 0.15.0 → 0.16.1
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-CGUQlFMx.js → connected-apps-6sMSgQ9U.js} +5 -5
- package/dist/chunks/{connected-apps-CGUQlFMx.js.map → connected-apps-6sMSgQ9U.js.map} +1 -1
- package/dist/chunks/{delete-place-CswZ-meh.js → delete-place-T469tSN9.js} +5 -5
- package/dist/chunks/{delete-place-CswZ-meh.js.map → delete-place-T469tSN9.js.map} +1 -1
- package/dist/chunks/{directory-DrswWQLT.js → directory-B_gVf7UL.js} +18 -17
- package/dist/chunks/directory-B_gVf7UL.js.map +1 -0
- package/dist/chunks/{folders-A6sbR_PG.js → folders-CVYauIDz.js} +3 -3
- package/dist/chunks/{folders-A6sbR_PG.js.map → folders-CVYauIDz.js.map} +1 -1
- package/dist/chunks/{grants-C0cb2oii.js → grants-Dn_EW2XW.js} +8 -8
- package/dist/chunks/grants-Dn_EW2XW.js.map +1 -0
- package/dist/chunks/{multi-combobox-B3SEv1gq.js → multi-combobox-fbBRzi9z.js} +3 -3
- package/dist/chunks/{multi-combobox-B3SEv1gq.js.map → multi-combobox-fbBRzi9z.js.map} +1 -1
- package/dist/chunks/{offboarding-C1jbG_dk.js → offboarding-CXM464J_.js} +81 -80
- package/dist/chunks/offboarding-CXM464J_.js.map +1 -0
- package/dist/chunks/{page-CfhC9Hp1.js → page-Cb0ZjGda.js} +7 -12
- package/dist/chunks/page-Cb0ZjGda.js.map +1 -0
- package/dist/chunks/{personal-tokens-xC9wulhg.js → personal-tokens-CSHMlRHy.js} +7 -7
- package/dist/chunks/personal-tokens-CSHMlRHy.js.map +1 -0
- package/dist/chunks/{principal-CI17XK13.js → principal-BKJxbAtE.js} +2 -2
- package/dist/chunks/{principal-CI17XK13.js.map → principal-BKJxbAtE.js.map} +1 -1
- package/dist/chunks/{principal-page-CdSeftGD.js → principal-page-COPmTDVW.js} +132 -19
- package/dist/chunks/principal-page-COPmTDVW.js.map +1 -0
- package/dist/chunks/{project-page-CHxjBE97.js → project-page-g5_n46Nz.js} +3 -3
- package/dist/chunks/{project-page-CHxjBE97.js.map → project-page-g5_n46Nz.js.map} +1 -1
- package/dist/chunks/protected-DEWeOrmI.js +77 -0
- package/dist/chunks/protected-DEWeOrmI.js.map +1 -0
- package/dist/chunks/{queries-D1JuimTu.js → queries-D4_o-bz3.js} +22 -155
- package/dist/chunks/queries-D4_o-bz3.js.map +1 -0
- package/dist/chunks/{references-D5llUGQL.js → references-wTh_DT0M.js} +27 -23
- package/dist/chunks/references-wTh_DT0M.js.map +1 -0
- package/dist/chunks/{role-field-CoCv8wse.js → role-field-BiP09qfN.js} +5 -5
- package/dist/chunks/role-field-BiP09qfN.js.map +1 -0
- package/dist/chunks/{row-state-CYH7kZHl.js → row-state-CYhtmUkc.js} +3 -3
- package/dist/chunks/{row-state-CYH7kZHl.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-rF44Wbmm.js → theme-imSolE1q.js} +3 -3
- package/dist/chunks/{theme-rF44Wbmm.js.map → theme-imSolE1q.js.map} +1 -1
- package/dist/chunks/{ui-CGdORVzW.js → ui-Q_Eczt7m.js} +7 -3
- package/dist/chunks/{ui-CGdORVzW.js.map → ui-Q_Eczt7m.js.map} +1 -1
- package/dist/chunks/{use-action-BxrHTBZw.js → use-action-BfnN-De2.js} +3 -3
- package/dist/chunks/{use-action-BxrHTBZw.js.map → use-action-BfnN-De2.js.map} +1 -1
- package/dist/chunks/{use-change-BorW2R6C.js → use-change-Cc0X4sF3.js} +6 -4
- package/dist/chunks/use-change-Cc0X4sF3.js.map +1 -0
- package/dist/chunks/{use-roles-BZnJ9Cq0.js → use-roles-stcv2QFj.js} +13 -56
- package/dist/chunks/use-roles-stcv2QFj.js.map +1 -0
- package/dist/chunks/{use-shell-CPskgi1k.js → use-shell-DMhLa2sh.js} +3 -3
- package/dist/chunks/{use-shell-CPskgi1k.js.map → use-shell-DMhLa2sh.js.map} +1 -1
- package/dist/index.d.ts +23 -55
- package/dist/index.js +12 -31
- package/dist/index.js.map +1 -1
- package/dist/pages/account.js +12 -12
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/approval.js +2 -2
- package/dist/pages/audit.js +173 -196
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/device-login.js +2 -2
- package/dist/pages/environment.js +445 -252
- 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 +359 -28
- package/dist/pages/project-environments.js.map +1 -1
- 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 -16
- package/dist/pages/service-account.js.map +1 -1
- package/dist/pages/service-accounts.js +6 -7
- package/dist/pages/service-accounts.js.map +1 -1
- package/dist/pages/settings.d.ts +1 -6
- package/dist/pages/settings.js +155 -286
- package/dist/pages/settings.js.map +1 -1
- package/dist/pages/unregistered.js +2 -2
- package/dist/pages/user.js +7 -8
- package/dist/pages/user.js.map +1 -1
- package/dist/pages/users.js +6 -7
- package/dist/pages/users.js.map +1 -1
- package/package.json +8 -3
- package/src/components/actions-log.tsx +8 -61
- package/src/components/directory.tsx +10 -9
- package/src/components/grants.tsx +2 -2
- package/src/components/icons.tsx +0 -2
- package/src/components/offboarding.tsx +9 -16
- package/src/components/page.tsx +2 -3
- package/src/components/personal-tokens.tsx +5 -2
- package/src/components/principal-page.tsx +5 -4
- package/src/components/protected.tsx +39 -52
- package/src/components/references.tsx +18 -7
- package/src/components/role-editor.tsx +68 -99
- package/src/components/role-field.tsx +1 -1
- 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 +490 -529
- 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 +19 -168
- package/src/lib/reveal.ts +32 -5
- package/src/lib/roles.ts +10 -36
- package/src/lib/row-reads.ts +2 -2
- package/src/lib/signin-errors.ts +5 -33
- package/src/options.ts +3 -19
- package/src/pages/account.tsx +1 -1
- package/src/pages/audit.tsx +151 -228
- package/src/pages/environment.tsx +373 -247
- package/src/pages/login.tsx +2 -4
- package/src/pages/project-environments.tsx +322 -20
- package/src/pages/service-accounts.tsx +1 -1
- package/src/pages/settings.tsx +49 -134
- package/src/pages/user.tsx +2 -2
- package/src/pages/users.tsx +1 -1
- package/src/parity.ts +11 -20
- package/src/styles/globals.css +107 -273
- package/dist/chunks/actions-log-DupYCEyV.js +0 -1134
- package/dist/chunks/actions-log-DupYCEyV.js.map +0 -1
- package/dist/chunks/directory-DrswWQLT.js.map +0 -1
- package/dist/chunks/environment-actions-8rL9Cw6X.js +0 -576
- package/dist/chunks/environment-actions-8rL9Cw6X.js.map +0 -1
- package/dist/chunks/grants-C0cb2oii.js.map +0 -1
- package/dist/chunks/offboarding-C1jbG_dk.js.map +0 -1
- package/dist/chunks/page-CfhC9Hp1.js.map +0 -1
- package/dist/chunks/personal-tokens-xC9wulhg.js.map +0 -1
- package/dist/chunks/principal-page-CdSeftGD.js.map +0 -1
- package/dist/chunks/queries-D1JuimTu.js.map +0 -1
- package/dist/chunks/references-D5llUGQL.js.map +0 -1
- package/dist/chunks/role-field-CoCv8wse.js.map +0 -1
- package/dist/chunks/signin-errors-TlQmQe0t.js.map +0 -1
- package/dist/chunks/use-change-BorW2R6C.js.map +0 -1
- package/dist/chunks/use-roles-BZnJ9Cq0.js.map +0 -1
- package/src/components/environment-actions.tsx +0 -508
package/dist/pages/audit.js
CHANGED
|
@@ -1,41 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as Notice, f as Toggletip, i as EmptyState,
|
|
3
|
-
import {
|
|
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
|
-
const trees = Promise.allSettled([wholeTrees(client)]);
|
|
28
|
-
verdict = withTrees(await client.audit.verifyWhole((stretch) => setWalked({ through: stretch.through })), true, (await trees)[0]);
|
|
29
|
-
} catch (error) {
|
|
30
|
-
verdict = chainUnknown(error);
|
|
31
|
-
}
|
|
32
|
-
if (verdict.integrity === "unknown") setWalkFailed(verdict.problem);
|
|
33
|
-
else if (verdict.integrity === "owners-only") setWalkFailed("the request was refused (HTTP 403)");
|
|
34
|
-
else setWhole(verdict);
|
|
35
|
-
setWalked(null);
|
|
36
|
-
};
|
|
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]);
|
|
37
51
|
const { decision, actorId } = search;
|
|
38
|
-
const detail = search.detail === "1";
|
|
39
52
|
const deniedOnly = decision === "deny";
|
|
40
53
|
if (!result.ok) return /* @__PURE__ */ jsx(ClosedDoor, {
|
|
41
54
|
icon: /* @__PURE__ */ jsx(Ledger, { size: 18 }),
|
|
@@ -43,8 +56,26 @@ function AuditPage() {
|
|
|
43
56
|
title: "The audit log is closed to you",
|
|
44
57
|
children: result.error
|
|
45
58
|
});
|
|
46
|
-
const
|
|
47
|
-
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");
|
|
48
79
|
const shown = lines(result.entries);
|
|
49
80
|
const filters = {
|
|
50
81
|
decision,
|
|
@@ -57,40 +88,55 @@ function AuditPage() {
|
|
|
57
88
|
className: "chain-live",
|
|
58
89
|
"aria-live": "polite",
|
|
59
90
|
"aria-atomic": "true",
|
|
60
|
-
children: /* @__PURE__ */ jsx(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
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()
|
|
67
97
|
})
|
|
68
98
|
})
|
|
69
99
|
}),
|
|
70
|
-
|
|
100
|
+
failed.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
71
101
|
style: { marginBottom: "1.25rem" },
|
|
72
102
|
children: /* @__PURE__ */ jsxs(Notice, {
|
|
73
103
|
tone: "bad",
|
|
74
104
|
children: [
|
|
75
105
|
/* @__PURE__ */ jsx("strong", { children: "Treat this as an incident." }),
|
|
76
106
|
" ",
|
|
77
|
-
|
|
78
|
-
" ",
|
|
79
|
-
|
|
80
|
-
"Something with direct access to the database has changed what
|
|
81
|
-
|
|
82
|
-
" until that is explained."
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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."
|
|
94
140
|
]
|
|
95
141
|
})
|
|
96
142
|
}),
|
|
@@ -145,10 +191,6 @@ function AuditPage() {
|
|
|
145
191
|
]
|
|
146
192
|
})]
|
|
147
193
|
}),
|
|
148
|
-
/* @__PURE__ */ jsx(ReadsLag, {
|
|
149
|
-
reads: result.reads,
|
|
150
|
-
omitted: result.readsOmitted
|
|
151
|
-
}),
|
|
152
194
|
/* @__PURE__ */ jsx("section", {
|
|
153
195
|
className: "card card-wide",
|
|
154
196
|
"aria-label": "Audit entries",
|
|
@@ -194,36 +236,27 @@ function AuditPage() {
|
|
|
194
236
|
batch,
|
|
195
237
|
filters,
|
|
196
238
|
detail: search.detail,
|
|
197
|
-
|
|
198
|
-
},
|
|
239
|
+
proof
|
|
240
|
+
}, batch[0].seq)) })]
|
|
199
241
|
})
|
|
200
242
|
})
|
|
201
243
|
})
|
|
202
244
|
] });
|
|
203
245
|
}
|
|
204
|
-
/** Where the chain breaks is an entry of 0.14's: 0.15's sealed log numbers its changes apart, and says no entry of its own. */
|
|
205
|
-
function breaksAt(entry, seq) {
|
|
206
|
-
return entry.log !== "0.15" && entry.seq === seq;
|
|
207
|
-
}
|
|
208
|
-
/** An entry by its log and number: 0.14's chain and 0.15's sealed log each number theirs. */
|
|
209
|
-
function entryKey(entry) {
|
|
210
|
-
return `${entry.log}:${entry.seq}`;
|
|
211
|
-
}
|
|
212
246
|
/**
|
|
213
247
|
* One action: an entry, or a batch of them under one operation, which opens
|
|
214
248
|
* to each; a read of several secrets, logged as one entry, opens to each
|
|
215
249
|
* secret, under its entry's number.
|
|
216
250
|
*/
|
|
217
|
-
function Line({ batch, filters, detail,
|
|
218
|
-
const
|
|
219
|
-
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");
|
|
220
254
|
const lead = batch[0];
|
|
221
255
|
const sentence = describe(batch);
|
|
222
256
|
const seqs = batch.map((entry) => entry.seq);
|
|
223
257
|
const each = batch.flatMap(perSecret);
|
|
224
258
|
const grouped = each.length > 1;
|
|
225
259
|
const [unit, units] = each.length === batch.length ? ["entry", "entries"] : ["secret", "secrets"];
|
|
226
|
-
const breakRow = each.findIndex((entry) => breakAt !== null && breaksAt(entry, breakAt));
|
|
227
260
|
const [first, last] = [Math.min(...seqs), Math.max(...seqs)];
|
|
228
261
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Row, {
|
|
229
262
|
entry: lead,
|
|
@@ -233,8 +266,7 @@ function Line({ batch, filters, detail, breakAt }) {
|
|
|
233
266
|
decided: decidedBy(batch),
|
|
234
267
|
filters,
|
|
235
268
|
detail,
|
|
236
|
-
|
|
237
|
-
marked: breaksInside,
|
|
269
|
+
proof: shown,
|
|
238
270
|
toggle: grouped ? /* @__PURE__ */ jsx("button", {
|
|
239
271
|
type: "button",
|
|
240
272
|
className: "batch-toggle",
|
|
@@ -253,32 +285,28 @@ function Line({ batch, filters, detail, breakAt }) {
|
|
|
253
285
|
decided: decidedBy([entry]),
|
|
254
286
|
filters,
|
|
255
287
|
detail,
|
|
256
|
-
|
|
257
|
-
marked: false,
|
|
288
|
+
proof: proof(entry),
|
|
258
289
|
child: true
|
|
259
|
-
}, `${
|
|
290
|
+
}, `${entry.seq}:${i}`);
|
|
260
291
|
})] });
|
|
261
292
|
}
|
|
262
|
-
function Row({ entry, seq, parts, refused, decided, filters, detail,
|
|
293
|
+
function Row({ entry, seq, parts, refused, decided, filters, detail, proof, toggle, child = false }) {
|
|
263
294
|
const actor = who(entry);
|
|
264
295
|
const classes = [
|
|
265
296
|
refused && "is-denied",
|
|
266
|
-
|
|
297
|
+
proof === "failed" && "is-break",
|
|
267
298
|
child && "is-child",
|
|
268
299
|
entry.detail && "is-detail",
|
|
269
|
-
|
|
300
|
+
entry.action === "vault.tampered" && "is-tampered"
|
|
270
301
|
].filter(Boolean);
|
|
271
302
|
return /* @__PURE__ */ jsxs("tr", {
|
|
272
303
|
className: classes.length === 0 ? void 0 : classes.join(" "),
|
|
304
|
+
"data-proof": proof,
|
|
273
305
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ jsx("td", {
|
|
275
307
|
className: "n",
|
|
276
308
|
"data-label": "Sequence",
|
|
277
|
-
|
|
278
|
-
children: [seq, entry.log === "0.15" && /* @__PURE__ */ jsx("small", {
|
|
279
|
-
className: "n-log",
|
|
280
|
-
children: "sealed"
|
|
281
|
-
})]
|
|
309
|
+
children: seq
|
|
282
310
|
}),
|
|
283
311
|
/* @__PURE__ */ jsx("td", {
|
|
284
312
|
className: "nowrap cell-mono",
|
|
@@ -313,7 +341,7 @@ function Row({ entry, seq, parts, refused, decided, filters, detail, breaks, mar
|
|
|
313
341
|
}),
|
|
314
342
|
entry.run !== null && /* @__PURE__ */ jsx("small", {
|
|
315
343
|
className: "actor-run",
|
|
316
|
-
title:
|
|
344
|
+
title: `Exchanged in entry ${entry.run.exchangeSeq}`,
|
|
317
345
|
children: runLabel(entry.run)
|
|
318
346
|
}),
|
|
319
347
|
entry.token != null && /* @__PURE__ */ jsxs("small", {
|
|
@@ -327,21 +355,22 @@ function Row({ entry, seq, parts, refused, decided, filters, detail, breaks, mar
|
|
|
327
355
|
})
|
|
328
356
|
]
|
|
329
357
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ jsx("td", {
|
|
331
359
|
className: "cell-sentence",
|
|
332
360
|
"data-label": "What they did",
|
|
333
|
-
children:
|
|
361
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
334
362
|
className: "sentence",
|
|
335
363
|
children: [
|
|
336
364
|
toggle,
|
|
337
|
-
|
|
365
|
+
entry.action === "vault.tampered" && /* @__PURE__ */ jsx(AlertTriangle, { size: 13 }),
|
|
338
366
|
/* @__PURE__ */ jsx(Sentence, { parts }),
|
|
339
|
-
|
|
367
|
+
proof === "failed" && /* @__PURE__ */ jsx(BreakMark, {}),
|
|
368
|
+
proof === "unproven" && /* @__PURE__ */ jsx("span", {
|
|
369
|
+
className: "unproven-mark",
|
|
370
|
+
children: "not proven"
|
|
371
|
+
})
|
|
340
372
|
]
|
|
341
|
-
})
|
|
342
|
-
className: "actor-run",
|
|
343
|
-
children: "Forged: the vault does not vouch for this entry"
|
|
344
|
-
})]
|
|
373
|
+
})
|
|
345
374
|
}),
|
|
346
375
|
/* @__PURE__ */ jsx("td", {
|
|
347
376
|
className: "nowrap",
|
|
@@ -358,136 +387,84 @@ function Row({ entry, seq, parts, refused, decided, filters, detail, breaks, mar
|
|
|
358
387
|
]
|
|
359
388
|
});
|
|
360
389
|
}
|
|
361
|
-
/**
|
|
390
|
+
/** An entry that is not what the vault signed, said in words as well as in red. */
|
|
362
391
|
function BreakMark() {
|
|
363
392
|
return /* @__PURE__ */ jsxs("span", {
|
|
364
393
|
className: "break-mark",
|
|
365
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 11 }), "
|
|
394
|
+
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 11 }), "not as signed"]
|
|
366
395
|
});
|
|
367
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
|
+
}
|
|
368
404
|
/**
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
* This replaced a card with a "Verify chain" button on it. A green result you
|
|
372
|
-
* have to ask for is reassurance rather than evidence: it is checked when
|
|
373
|
-
* someone is already feeling confident, and not on the morning it would have
|
|
374
|
-
* 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.
|
|
375
407
|
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* 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.
|
|
383
414
|
*/
|
|
384
|
-
function
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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"
|
|
389
423
|
});
|
|
390
|
-
if (
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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]
|
|
398
434
|
});
|
|
399
|
-
if (
|
|
435
|
+
if (head === null) return /* @__PURE__ */ jsxs("div", {
|
|
400
436
|
className: "chain",
|
|
401
437
|
children: [/* @__PURE__ */ jsx(Toggletip, {
|
|
402
438
|
align: "end",
|
|
403
|
-
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.",
|
|
404
440
|
children: /* @__PURE__ */ jsxs("button", {
|
|
405
441
|
type: "button",
|
|
406
442
|
className: "chain-flag chain-flag-warn",
|
|
407
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), "
|
|
443
|
+
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), "Not proven"]
|
|
408
444
|
})
|
|
409
|
-
}),
|
|
410
|
-
type: "button",
|
|
411
|
-
className: "btn btn-sm",
|
|
412
|
-
disabled: retrying,
|
|
413
|
-
onClick: onRetry,
|
|
414
|
-
children: "Retry"
|
|
415
|
-
})]
|
|
445
|
+
}), again]
|
|
416
446
|
});
|
|
417
|
-
|
|
418
|
-
className: "chain-flag chain-flag-bad",
|
|
419
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), chain.failedAtSeq === null ? "Log does not verify" : `Log broken at ${chain.failedAtSeq}`]
|
|
420
|
-
});
|
|
421
|
-
const signed = chain.checkpoint === null ? null : `${absolute(chain.checkpoint.signedAt, false)} UTC`;
|
|
422
|
-
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.`;
|
|
423
|
-
const trees = chain.trees;
|
|
424
|
-
const sealed = trees?.checkpoint == null ? null : `its checkpoint of ${absolute(new Date(trees.checkpoint.at).toISOString(), false)} UTC`;
|
|
425
|
-
const sealedLog = trees === null ? "" : ` The sealed log: ${sealed === null ? "nothing sealed yet" : sealed}, and every entry since, verified.`;
|
|
426
|
-
const unchecked = chain.treesFailed !== null;
|
|
447
|
+
const signed = `${absolute(head.signedAt, false)} UTC`;
|
|
427
448
|
return /* @__PURE__ */ jsxs("div", {
|
|
428
449
|
className: "chain",
|
|
429
450
|
children: [
|
|
430
|
-
|
|
431
|
-
align: "end",
|
|
432
|
-
label: "Keys released through KMS whose outcome the vault has not logged yet. Each settles within seconds, or is logged as failed.",
|
|
433
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
434
|
-
type: "button",
|
|
435
|
-
className: "chain-note",
|
|
436
|
-
role: "status",
|
|
437
|
-
children: [
|
|
438
|
-
chain.pending,
|
|
439
|
-
" key operation",
|
|
440
|
-
chain.pending === 1 ? "" : "s",
|
|
441
|
-
" in flight"
|
|
442
|
-
]
|
|
443
|
-
})
|
|
444
|
-
}),
|
|
445
|
-
chain.remaining > 0 && /* @__PURE__ */ jsx(Toggletip, {
|
|
451
|
+
counts.unproven > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Toggletip, {
|
|
446
452
|
align: "end",
|
|
447
|
-
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.`,
|
|
448
454
|
children: /* @__PURE__ */ jsxs("button", {
|
|
449
455
|
type: "button",
|
|
450
456
|
className: "chain-note",
|
|
451
|
-
|
|
452
|
-
children: [
|
|
453
|
-
chain.remaining.toLocaleString("en"),
|
|
454
|
-
" newer ",
|
|
455
|
-
chain.remaining === 1 ? "entry" : "entries",
|
|
456
|
-
" to verify"
|
|
457
|
-
]
|
|
458
|
-
})
|
|
459
|
-
}),
|
|
460
|
-
walkFailed !== null && /* @__PURE__ */ jsx(Toggletip, {
|
|
461
|
-
align: "end",
|
|
462
|
-
label: `coffre could not walk the whole log: ${walkFailed}. The verdict beside it, from the newest checkpoint, stands.`,
|
|
463
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
464
|
-
type: "button",
|
|
465
|
-
className: "chain-flag chain-flag-warn",
|
|
466
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), "Whole log not checked"]
|
|
457
|
+
children: [plural(counts.unproven), " not proven"]
|
|
467
458
|
})
|
|
468
|
-
}),
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
label: `${chain.treesFailed}. The rest of the log's verdict stands.`,
|
|
472
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
473
|
-
type: "button",
|
|
474
|
-
className: "chain-flag chain-flag-warn",
|
|
475
|
-
children: [/* @__PURE__ */ jsx(AlertTriangle, { size: 14 }), chain.treesBehind && chain.trees !== null ? `Sealed log not checked to the head (${chain.trees.pending.toLocaleString("en")}+ entries pending)` : "Sealed log not checked"]
|
|
476
|
-
})
|
|
477
|
-
}),
|
|
478
|
-
!chain.whole && chain.remaining === 0 && /* @__PURE__ */ jsx("button", {
|
|
479
|
-
type: "button",
|
|
480
|
-
className: "btn btn-sm",
|
|
481
|
-
onClick: onWalk,
|
|
482
|
-
children: "Verify whole log"
|
|
483
|
-
}),
|
|
484
|
-
chain.remaining === 0 && !unchecked && /* @__PURE__ */ jsx(Toggletip, {
|
|
459
|
+
}), again] }),
|
|
460
|
+
pruned && counts.unproven === 0 && again,
|
|
461
|
+
counts.proven > 0 && /* @__PURE__ */ jsx(Toggletip, {
|
|
485
462
|
align: "end",
|
|
486
|
-
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.`,
|
|
487
464
|
children: /* @__PURE__ */ jsxs("button", {
|
|
488
465
|
type: "button",
|
|
489
466
|
className: "chain-seal",
|
|
490
|
-
children: [/* @__PURE__ */ jsx(ShieldCheck, { size: 14 }), "
|
|
467
|
+
children: [/* @__PURE__ */ jsx(ShieldCheck, { size: 14 }), "Proven"]
|
|
491
468
|
})
|
|
492
469
|
})
|
|
493
470
|
]
|