@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
|
@@ -1,1134 +0,0 @@
|
|
|
1
|
-
import { o as keys } from "./queries-D1JuimTu.js";
|
|
2
|
-
import { c as Notice, h as breakAfterUnderscores, i as EmptyState, l as Spinner, u as Timestamp } from "./ui-CGdORVzW.js";
|
|
3
|
-
import { S as Clock, Z as ShieldCheck, et as SlashCircle, f as Activity, l as uiResult, u as useCoffre } from "./page-CfhC9Hp1.js";
|
|
4
|
-
import { Fragment } from "react";
|
|
5
|
-
import { Link } from "@tanstack/react-router";
|
|
6
|
-
import { INSTANCE_ROLES, ROLES, isBuiltinRole, isInstanceRole, isScope, scopeInWords } from "@coffre/core/access";
|
|
7
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
9
|
-
import { runLabel, serviceName, shownMember } from "@coffre/client";
|
|
10
|
-
//#region src/lib/audit-sentences.ts
|
|
11
|
-
/**
|
|
12
|
-
* The audit log in sentences: who did what, to what. One entry is one
|
|
13
|
-
* human action, named for it (`secret.read`, `access.grant`, …); a batch of
|
|
14
|
-
* them, one reveal of twelve secrets, shares an operation and reads as one
|
|
15
|
-
* line, "ran market/prod: 12 secrets".
|
|
16
|
-
*
|
|
17
|
-
* A sentence is parts rather than a string, so the page can make the people
|
|
18
|
-
* and places in it links. `plain` flattens it, for tests and titles.
|
|
19
|
-
*/
|
|
20
|
-
var text = (value) => typeof value === "string" && value !== "" ? value : null;
|
|
21
|
-
var number = (value) => typeof value === "number" ? value : null;
|
|
22
|
-
/** The entry's place, as deep as it goes. */
|
|
23
|
-
function place({ project, environment, key }) {
|
|
24
|
-
const path = [
|
|
25
|
-
project,
|
|
26
|
-
environment,
|
|
27
|
-
key
|
|
28
|
-
].filter((part) => part !== null);
|
|
29
|
-
return path.length === 0 ? ["coffre"] : [{ place: path.join("/") }];
|
|
30
|
-
}
|
|
31
|
-
function environmentOf({ project, environment }) {
|
|
32
|
-
return place({
|
|
33
|
-
project,
|
|
34
|
-
environment,
|
|
35
|
-
key: null
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/** The member an entry is about: its subject, or the principal a token entry names. */
|
|
39
|
-
function subject(entry) {
|
|
40
|
-
if (entry.subject !== null) return [{ member: entry.subject }];
|
|
41
|
-
const id = text(entry.metadata.principalId);
|
|
42
|
-
if (id === null) return ["someone"];
|
|
43
|
-
return [{ member: `${entry.metadata.principalType === "service" ? "token" : "user"}:${id}` }];
|
|
44
|
-
}
|
|
45
|
-
/** Whether a token entry is about a personal token, which acts as its person, rather than a service account's. */
|
|
46
|
-
function personal(entry) {
|
|
47
|
-
return entry.metadata.kind === "personal";
|
|
48
|
-
}
|
|
49
|
-
/** A personal token's label, as it was made: ` "cursor-agent"`. */
|
|
50
|
-
function labelled(entry) {
|
|
51
|
-
const label = text(entry.metadata.label);
|
|
52
|
-
return label === null ? [] : [` “${label}”`];
|
|
53
|
-
}
|
|
54
|
-
/** Why the vault made someone an Owner itself, said after it. */
|
|
55
|
-
function owned(entry) {
|
|
56
|
-
return entry.metadata.reason === "owners" ? [": the deployment names them one"] : [];
|
|
57
|
-
}
|
|
58
|
-
/** An MCP client, by the name it connected under. */
|
|
59
|
-
function app(entry) {
|
|
60
|
-
return [text(entry.metadata.clientName) ?? "an app"];
|
|
61
|
-
}
|
|
62
|
-
/** A tool's call: its name, and what it named. */
|
|
63
|
-
function tool(entry) {
|
|
64
|
-
const names = Array.isArray(entry.metadata.names) ? entry.metadata.names.filter((name) => typeof name === "string") : [];
|
|
65
|
-
return [text(entry.metadata.tool) ?? "a tool", ...names.length === 0 ? [] : [` on ${names.join(", ")}`]];
|
|
66
|
-
}
|
|
67
|
-
/** The client a request came through, said after what it did: "via Claude". */
|
|
68
|
-
function via(entry) {
|
|
69
|
-
const client = entry.metadata.via?.clientName;
|
|
70
|
-
return typeof client === "string" ? [` via ${client}`] : [];
|
|
71
|
-
}
|
|
72
|
-
/** Why coffre itself ended a connection, said after it. */
|
|
73
|
-
var DISCONNECTED = {
|
|
74
|
-
code_reused: ": its sign-in code was used twice",
|
|
75
|
-
refresh_reused: ": a refresh token it had replaced was used again",
|
|
76
|
-
revocation_endpoint: ", at its own request",
|
|
77
|
-
superseded: ": a connection with more scopes replaced it"
|
|
78
|
-
};
|
|
79
|
-
function plural(count, one, many = `${one}s`) {
|
|
80
|
-
return `${count} ${count === 1 ? one : many}`;
|
|
81
|
-
}
|
|
82
|
-
/** A batch reads as its environment and a count; one entry as its secret. */
|
|
83
|
-
/**
|
|
84
|
-
* The secrets a read or write was about. A read through a reference is a
|
|
85
|
-
* read of its source, "market/prod/DATABASE_URL through
|
|
86
|
-
* billing/prod/DATABASE_URL"; a run that read some that way is a run of
|
|
87
|
-
* the environment that holds them. A value a fork inherits is its parent's,
|
|
88
|
-
* read in the fork: "market/prod/STRIPE_KEY in market/prod-eu".
|
|
89
|
-
*/
|
|
90
|
-
function secrets(facts) {
|
|
91
|
-
const through = (entry) => text(entry.metadata.via?.path);
|
|
92
|
-
const forkOf = (entry) => {
|
|
93
|
-
const slug = text(entry.metadata.through?.slug);
|
|
94
|
-
const project = through(entry)?.split("/")[0] ?? entry.project;
|
|
95
|
-
return slug === null || project === null ? null : `${project}/${slug}`;
|
|
96
|
-
};
|
|
97
|
-
if (facts.batch.length === 1) {
|
|
98
|
-
const [held, fork] = [through(facts.entry), forkOf(facts.entry)];
|
|
99
|
-
return [
|
|
100
|
-
...place(facts.entry),
|
|
101
|
-
...held === null ? [] : [" through ", { place: held }],
|
|
102
|
-
...fork === null ? [] : [" in ", { place: fork }]
|
|
103
|
-
];
|
|
104
|
-
}
|
|
105
|
-
const fork = facts.batch.map(forkOf).find((path) => path !== null);
|
|
106
|
-
const own = facts.batch.find((entry) => through(entry) === null && forkOf(entry) === null);
|
|
107
|
-
const held = facts.batch.map(through).filter((path) => path !== null);
|
|
108
|
-
const inherited = facts.batch.filter((entry) => forkOf(entry) !== null).length;
|
|
109
|
-
return [
|
|
110
|
-
...fork !== void 0 && fork !== null ? [{ place: fork }] : own !== void 0 ? environmentOf(own) : [{ place: held[0].split("/").slice(0, 2).join("/") }],
|
|
111
|
-
facts.refused ? ", " : ": ",
|
|
112
|
-
plural(facts.count, "secret"),
|
|
113
|
-
...held.length === 0 ? [] : [`, ${held.length} through ${held.length === 1 ? "a reference" : "references"}`],
|
|
114
|
-
...inherited === 0 ? [] : [`, ${inherited} inherited`]
|
|
115
|
-
];
|
|
116
|
-
}
|
|
117
|
-
/** "market/prod/OLD", or "OLD and STALE in market/prod" for an archive of several keys refused. */
|
|
118
|
-
function archivedKeys(entry) {
|
|
119
|
-
const keys = Array.isArray(entry.metadata.keys) ? entry.metadata.keys.filter((key) => text(key) !== null) : [];
|
|
120
|
-
if (entry.key !== null || keys.length === 0) return place(entry);
|
|
121
|
-
return [
|
|
122
|
-
keys.length === 1 ? keys[0] : `${keys.slice(0, -1).join(", ")} and ${keys.at(-1)}`,
|
|
123
|
-
" in ",
|
|
124
|
-
...environmentOf(entry)
|
|
125
|
-
];
|
|
126
|
-
}
|
|
127
|
-
/** "SENTRY_DSN in market/dev", or "3 keys in market/dev" for a Dismiss all. */
|
|
128
|
-
function missingKeys(facts) {
|
|
129
|
-
const key = text(facts.entry.metadata.key);
|
|
130
|
-
return [
|
|
131
|
-
facts.batch.length === 1 && key !== null ? key : plural(facts.count, "key"),
|
|
132
|
-
" in ",
|
|
133
|
-
...environmentOf(facts.entry)
|
|
134
|
-
];
|
|
135
|
-
}
|
|
136
|
-
/** "billing/prod/DATABASE_URL a reference to market/prod/DATABASE_URL", from either author's entry. */
|
|
137
|
-
function referenceTo(entry) {
|
|
138
|
-
const holder = text(entry.metadata.subject);
|
|
139
|
-
const key = text(entry.metadata.key);
|
|
140
|
-
const source = text(entry.metadata.source) ?? text(entry.metadata.source?.path);
|
|
141
|
-
return [...holder !== null ? [{ place: holder }] : key !== null ? place(entry) : environmentOf(entry), ...source === null ? [] : [" a reference to ", { place: source }]];
|
|
142
|
-
}
|
|
143
|
-
var READ_VERBS = {
|
|
144
|
-
reveal: ["revealed", "reveal"],
|
|
145
|
-
run: ["ran", "run"],
|
|
146
|
-
compare: ["compared", "compare"],
|
|
147
|
-
copy: ["copied", "copy"],
|
|
148
|
-
use: ["used", "use"],
|
|
149
|
-
expose: ["was given", "be given"]
|
|
150
|
-
};
|
|
151
|
-
function readVerb({ entry }) {
|
|
152
|
-
return READ_VERBS[text(entry.metadata.purpose) ?? "reveal"] ?? READ_VERBS.reveal;
|
|
153
|
-
}
|
|
154
|
-
var placeTemplates = (kind) => {
|
|
155
|
-
const of = (entry) => {
|
|
156
|
-
const parent = text(entry.metadata.personal) ?? text(entry.metadata.with);
|
|
157
|
-
return parent === null || entry.project === null ? null : `${entry.project}/${parent}`;
|
|
158
|
-
};
|
|
159
|
-
const what = (facts) => {
|
|
160
|
-
const personal = kind === "environment" ? of(facts.entry) : null;
|
|
161
|
-
if (personal !== null) return ["a personal config of ", { place: personal }];
|
|
162
|
-
if (kind === "environment" && facts.entry.metadata.personal === true) return [`a personal config, ${text(facts.entry.metadata.path) ?? ""}`];
|
|
163
|
-
return [`${kind} `, ...kind === "project" ? place({
|
|
164
|
-
...facts.entry,
|
|
165
|
-
environment: null,
|
|
166
|
-
key: null
|
|
167
|
-
}) : environmentOf(facts.entry)];
|
|
168
|
-
};
|
|
169
|
-
return {
|
|
170
|
-
[`${kind}.create`]: {
|
|
171
|
-
did: "created",
|
|
172
|
-
tried: "create",
|
|
173
|
-
what,
|
|
174
|
-
then: ({ entry }) => text(entry.metadata.inherits) !== null ? [`, inheriting from ${text(entry.metadata.inherits)}`] : text(entry.metadata.from) === null ? [] : [`, a fork of ${text(entry.metadata.from)}`]
|
|
175
|
-
},
|
|
176
|
-
[`${kind}.update`]: {
|
|
177
|
-
did: "changed",
|
|
178
|
-
tried: "change",
|
|
179
|
-
what
|
|
180
|
-
},
|
|
181
|
-
[`${kind}.archive`]: {
|
|
182
|
-
did: "archived",
|
|
183
|
-
tried: "archive",
|
|
184
|
-
what
|
|
185
|
-
},
|
|
186
|
-
[`${kind}.restore`]: {
|
|
187
|
-
did: "restored",
|
|
188
|
-
tried: "restore",
|
|
189
|
-
what
|
|
190
|
-
},
|
|
191
|
-
[`${kind}.delete`]: {
|
|
192
|
-
did: "deleted",
|
|
193
|
-
tried: "delete",
|
|
194
|
-
what
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
var TEMPLATES = {
|
|
199
|
-
"secret.read": {
|
|
200
|
-
did: (facts) => readVerb(facts)[0],
|
|
201
|
-
tried: (facts) => readVerb(facts)[1],
|
|
202
|
-
what: secrets
|
|
203
|
-
},
|
|
204
|
-
"secret.write": {
|
|
205
|
-
did: ({ entry, batch }) => {
|
|
206
|
-
if (batch.length === 1 && text(entry.metadata.was) !== null) return "made";
|
|
207
|
-
const firsts = batch.filter((entry) => entry.version === 1).length;
|
|
208
|
-
return firsts === batch.length ? "added" : firsts === 0 ? "changed" : "wrote";
|
|
209
|
-
},
|
|
210
|
-
tried: "change",
|
|
211
|
-
what: secrets,
|
|
212
|
-
then: ({ entry, batch }) => {
|
|
213
|
-
const version = batch.length > 1 || entry.version === null || entry.version === 1 ? [] : [`, now version ${entry.version}`];
|
|
214
|
-
if (batch.length > 1) return version;
|
|
215
|
-
const level = entry.metadata.sensitive === true ? "sensitive" : entry.metadata.plain === true ? "plain" : "secret";
|
|
216
|
-
if (text(entry.metadata.was) !== null) return [
|
|
217
|
-
` ${level}`,
|
|
218
|
-
...number(entry.metadata.kept) === null ? [" with a new value"] : [],
|
|
219
|
-
...version
|
|
220
|
-
];
|
|
221
|
-
return [...version, ...level === "plain" ? [", as a plain value, no secret"] : level === "sensitive" ? [", as a sensitive value, shown to nobody"] : []];
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
"credential.use": {
|
|
225
|
-
did: ({ entry }) => entry.metadata.purpose === "expose" ? "was given the values of" : "used the credential",
|
|
226
|
-
tried: ({ entry }) => entry.metadata.purpose === "expose" ? "be given the values of" : "use the credential",
|
|
227
|
-
what: ({ entry }) => [
|
|
228
|
-
text(entry.metadata.credential) ?? "",
|
|
229
|
-
...text(entry.metadata.host) === null ? [] : [` on ${text(entry.metadata.host)}`],
|
|
230
|
-
...entry.metadata.egress === true ? [", through the deployment's egress"] : []
|
|
231
|
-
]
|
|
232
|
-
},
|
|
233
|
-
"secret.restore": {
|
|
234
|
-
did: "restored",
|
|
235
|
-
tried: "restore",
|
|
236
|
-
what: ({ entry }) => [...place(entry), ...number(entry.metadata.from) === null ? [] : [` to version ${number(entry.metadata.from)}`]],
|
|
237
|
-
then: ({ entry }) => entry.version === null ? [] : [`, now ${entry.version}`]
|
|
238
|
-
},
|
|
239
|
-
"secret.loosen": {
|
|
240
|
-
did: "made",
|
|
241
|
-
tried: "make",
|
|
242
|
-
what: ({ entry }) => place(entry),
|
|
243
|
-
then: ({ entry }) => [` ${text(entry.metadata.to) ?? "secret"}, from ${text(entry.metadata.from) ?? "sensitive"}, its value kept`, ...entry.version === null ? [] : [`, now version ${entry.version}`]]
|
|
244
|
-
},
|
|
245
|
-
"secret.rename": {
|
|
246
|
-
did: "renamed",
|
|
247
|
-
tried: "rename",
|
|
248
|
-
what: ({ entry }) => [...place(entry), ...text(entry.metadata.nextKey) === null ? [] : [` to ${text(entry.metadata.nextKey)}`]],
|
|
249
|
-
then: ({ entry }) => text(entry.metadata.parent) === null ? [] : [`, as ${text(entry.metadata.parent)} did`]
|
|
250
|
-
},
|
|
251
|
-
"secret.archive": {
|
|
252
|
-
did: "archived",
|
|
253
|
-
tried: "archive",
|
|
254
|
-
what: ({ entry }) => archivedKeys(entry)
|
|
255
|
-
},
|
|
256
|
-
"secret.reset": {
|
|
257
|
-
did: "reset",
|
|
258
|
-
tried: "reset",
|
|
259
|
-
what: ({ entry }) => place(entry),
|
|
260
|
-
then: ({ entry }) => text(entry.metadata.from) === null ? [] : [` to ${text(entry.metadata.from)}'s value`]
|
|
261
|
-
},
|
|
262
|
-
"missing.dismiss": {
|
|
263
|
-
did: "dismissed",
|
|
264
|
-
tried: "dismiss",
|
|
265
|
-
what: (facts) => missingKeys(facts),
|
|
266
|
-
then: () => [" as not needed"]
|
|
267
|
-
},
|
|
268
|
-
"missing.restore": {
|
|
269
|
-
did: "restored",
|
|
270
|
-
tried: "restore",
|
|
271
|
-
what: (facts) => missingKeys(facts),
|
|
272
|
-
then: () => [" to the missing keys"]
|
|
273
|
-
},
|
|
274
|
-
"secret.reference": {
|
|
275
|
-
did: "made",
|
|
276
|
-
tried: "make",
|
|
277
|
-
what: ({ entry }) => referenceTo(entry)
|
|
278
|
-
},
|
|
279
|
-
"reference.create": {
|
|
280
|
-
did: "made",
|
|
281
|
-
tried: "make",
|
|
282
|
-
what: ({ entry }) => referenceTo(entry)
|
|
283
|
-
},
|
|
284
|
-
"reference.end": {
|
|
285
|
-
did: ({ entry }) => entry.metadata.reason === "replaced" ? "gave a value of its own to" : entry.metadata.reason === "abandoned" ? "abandoned" : "broke",
|
|
286
|
-
tried: ({ entry }) => entry.metadata.reason === "replaced" ? "replace" : entry.metadata.reason === "abandoned" ? "abandon" : "break",
|
|
287
|
-
what: ({ entry }) => {
|
|
288
|
-
const source = text(entry.metadata.source?.path);
|
|
289
|
-
const holder = text(entry.metadata.subject);
|
|
290
|
-
if (entry.metadata.reason === "replaced") return [...holder === null ? ["a reference"] : [{ place: holder }], ...source === null ? [] : [", no longer a reference to ", { place: source }]];
|
|
291
|
-
return [
|
|
292
|
-
"the reference ",
|
|
293
|
-
...holder === null ? [] : [{ place: holder }],
|
|
294
|
-
...source === null ? [] : [" to ", { place: source }]
|
|
295
|
-
];
|
|
296
|
-
},
|
|
297
|
-
then: ({ entry }) => entry.metadata.reason === "abandoned" ? [", which its write never stored"] : []
|
|
298
|
-
},
|
|
299
|
-
"secret.unarchive": {
|
|
300
|
-
did: "brought back",
|
|
301
|
-
tried: "bring back",
|
|
302
|
-
what: (facts) => place(facts.entry)
|
|
303
|
-
},
|
|
304
|
-
"secret.move": {
|
|
305
|
-
did: "moved",
|
|
306
|
-
tried: "move",
|
|
307
|
-
what: (facts) => place(facts.entry),
|
|
308
|
-
then: ({ entry }) => intoFolder(entry)
|
|
309
|
-
},
|
|
310
|
-
...placeTemplates("project"),
|
|
311
|
-
"project.move": {
|
|
312
|
-
did: "moved",
|
|
313
|
-
tried: "move",
|
|
314
|
-
what: ({ entry }) => ["project ", ...place({
|
|
315
|
-
...entry,
|
|
316
|
-
environment: null,
|
|
317
|
-
key: null
|
|
318
|
-
})],
|
|
319
|
-
then: ({ entry }) => intoFolder(entry)
|
|
320
|
-
},
|
|
321
|
-
...placeTemplates("environment"),
|
|
322
|
-
"environment.fork": {
|
|
323
|
-
did: "forked",
|
|
324
|
-
tried: "fork",
|
|
325
|
-
what: ({ entry }) => [...environmentOf(entry), ...text(entry.metadata.slug) === null ? [] : [` into ${text(entry.metadata.slug)}`]]
|
|
326
|
-
},
|
|
327
|
-
"access.grant": {
|
|
328
|
-
did: "gave",
|
|
329
|
-
tried: "give",
|
|
330
|
-
what: ({ entry }) => [
|
|
331
|
-
...subject(entry),
|
|
332
|
-
` ${text(entry.metadata.role) ?? "a role"} on `,
|
|
333
|
-
...placeOnly(entry)
|
|
334
|
-
],
|
|
335
|
-
then: ({ entry }) => [
|
|
336
|
-
...text(entry.metadata.previousRole) === null ? [] : [`, was ${text(entry.metadata.previousRole)}`],
|
|
337
|
-
...text(entry.metadata.expiresAt) === null ? [] : [`, until ${text(entry.metadata.expiresAt).slice(0, 10)}`],
|
|
338
|
-
...entry.metadata.reason === "every-project" ? [", for a grant on every project"] : []
|
|
339
|
-
]
|
|
340
|
-
},
|
|
341
|
-
"access.revoke": {
|
|
342
|
-
did: "took",
|
|
343
|
-
tried: "take",
|
|
344
|
-
what: ({ entry }) => [
|
|
345
|
-
...text(entry.metadata.previousRole ?? entry.metadata.role) === null ? ["access to "] : [`${text(entry.metadata.previousRole ?? entry.metadata.role)} on `],
|
|
346
|
-
...placeOnly(entry),
|
|
347
|
-
" from ",
|
|
348
|
-
...subject(entry)
|
|
349
|
-
],
|
|
350
|
-
then: ({ entry }) => {
|
|
351
|
-
const by = entry.metadata.replacedBy;
|
|
352
|
-
if (by === void 0) return [];
|
|
353
|
-
const role = typeof by.role === "string" ? roleName(by.role) : null;
|
|
354
|
-
return [role === null || role === "Member" ? ", replaced by project grants" : `, replaced by the global role ${role}`];
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
"member.add": {
|
|
358
|
-
did: "added",
|
|
359
|
-
tried: "add",
|
|
360
|
-
what: ({ entry }) => [...subject(entry), ...entry.metadata.rootAdmin === true ? [" as a root admin"] : entry.metadata.owner === true ? [" as an owner"] : asRole(entry)],
|
|
361
|
-
then: ({ entry }) => owned(entry)
|
|
362
|
-
},
|
|
363
|
-
"member.remove": {
|
|
364
|
-
did: "removed",
|
|
365
|
-
tried: "remove",
|
|
366
|
-
what: (facts) => subject(facts.entry),
|
|
367
|
-
then: ({ entry }) => number(entry.metadata.revoked) === null ? [] : [`, who held ${plural(number(entry.metadata.revoked), "grant")}`]
|
|
368
|
-
},
|
|
369
|
-
"member.restore": {
|
|
370
|
-
did: "brought back",
|
|
371
|
-
tried: "bring back",
|
|
372
|
-
what: ({ entry }) => [...subject(entry), ...asRole(entry)],
|
|
373
|
-
then: ({ entry }) => owned(entry)
|
|
374
|
-
},
|
|
375
|
-
"member.role": {
|
|
376
|
-
did: "made",
|
|
377
|
-
tried: "make",
|
|
378
|
-
what: ({ entry }) => [
|
|
379
|
-
...subject(entry),
|
|
380
|
-
` ${article(roleName(text(entry.metadata.role) ?? "member") ?? "Member")}`,
|
|
381
|
-
...scoped(entry)
|
|
382
|
-
],
|
|
383
|
-
then: ({ entry }) => {
|
|
384
|
-
const before = roleName(text(entry.metadata.previousRole) ?? "");
|
|
385
|
-
return [
|
|
386
|
-
...before === null ? [] : [`, was ${before}`],
|
|
387
|
-
...entry.metadata.reason === "every-project" ? [", for their grants on every project"] : [],
|
|
388
|
-
...owned(entry)
|
|
389
|
-
];
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
"member.owner": {
|
|
393
|
-
did: ({ entry }) => entry.metadata.owner === false ? "took owner from" : "made",
|
|
394
|
-
tried: ({ entry }) => entry.metadata.owner === false ? "take owner from" : "make",
|
|
395
|
-
what: ({ entry }) => [...subject(entry), ...entry.metadata.owner === false ? [] : [" an owner"]]
|
|
396
|
-
},
|
|
397
|
-
"settings.change": {
|
|
398
|
-
did: "set",
|
|
399
|
-
tried: "set",
|
|
400
|
-
what: ({ entry }) => ["where people set up service accounts", ...setting(entry.metadata.serviceAccounts).map((words) => `: ${words}`)],
|
|
401
|
-
then: ({ entry }) => {
|
|
402
|
-
const previous = entry.metadata.previous?.serviceAccounts;
|
|
403
|
-
return setting(previous).map((words) => `, was ${words}`);
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
"policy.change": {
|
|
407
|
-
did: ({ entry }) => POLICY_VERBS[policyOf(entry).verb][0],
|
|
408
|
-
tried: ({ entry }) => POLICY_VERBS[policyOf(entry).verb][1],
|
|
409
|
-
what: ({ entry }) => policyOf(entry).what
|
|
410
|
-
},
|
|
411
|
-
"token.bind": {
|
|
412
|
-
did: "trusted CI runs to sign in as",
|
|
413
|
-
tried: "trust CI runs to sign in as",
|
|
414
|
-
what: (facts) => subject(facts.entry),
|
|
415
|
-
then: ({ entry }) => [...inGitHubEnvironment(entry), ...reaching(entry)]
|
|
416
|
-
},
|
|
417
|
-
"token.seal": {
|
|
418
|
-
did: "sealed",
|
|
419
|
-
tried: "seal",
|
|
420
|
-
what: ({ entry }) => [`${sealedOf(entry)} of `, ...subject(entry)],
|
|
421
|
-
then: ({ entry }) => reaching(entry, ", reaching nothing")
|
|
422
|
-
},
|
|
423
|
-
"token.unbind": {
|
|
424
|
-
did: "stopped trusting CI runs to sign in as",
|
|
425
|
-
tried: "stop trusting CI runs to sign in as",
|
|
426
|
-
what: (facts) => subject(facts.entry)
|
|
427
|
-
},
|
|
428
|
-
"token.exchange": {
|
|
429
|
-
did: "signed in",
|
|
430
|
-
tried: "sign in",
|
|
431
|
-
what: ({ entry }) => [entry.metadata.proof === "aws" ? "with its AWS identity" : `with an ID token from ${issuerName(entry)}`],
|
|
432
|
-
then: ({ entry }) => entry.metadata.kind === "workload" ? [", for a session bound to its key"] : []
|
|
433
|
-
},
|
|
434
|
-
"vault.tampered": {
|
|
435
|
-
did: "found",
|
|
436
|
-
tried: "check",
|
|
437
|
-
what: ({ entry }) => [...entry.subject === null ? ["an entry"] : [...subject(entry), "'s record"], ` tampered with: ${TAMPERING[entry.reason ?? ""] ?? "it fails its seal"}`]
|
|
438
|
-
},
|
|
439
|
-
"key.rotate": {
|
|
440
|
-
did: ({ entry }) => entry.author === "app" ? "moved to its new app key" : "rotated its key",
|
|
441
|
-
tried: ({ entry }) => entry.author === "app" ? "move to its new app key" : "rotate its key",
|
|
442
|
-
what: () => []
|
|
443
|
-
},
|
|
444
|
-
"mcp.connect": {
|
|
445
|
-
did: "connected",
|
|
446
|
-
tried: "connect",
|
|
447
|
-
what: ({ entry }) => app(entry)
|
|
448
|
-
},
|
|
449
|
-
"mcp.call": {
|
|
450
|
-
did: "used",
|
|
451
|
-
tried: "use",
|
|
452
|
-
what: ({ entry }) => tool(entry),
|
|
453
|
-
then: ({ entry }) => via(entry)
|
|
454
|
-
},
|
|
455
|
-
"mcp.approve": {
|
|
456
|
-
did: "approved",
|
|
457
|
-
tried: "approve",
|
|
458
|
-
what: ({ entry }) => tool(entry),
|
|
459
|
-
then: ({ entry }) => [` for ${text(entry.metadata.clientName) ?? "an app"}`]
|
|
460
|
-
},
|
|
461
|
-
"mcp.deny": {
|
|
462
|
-
did: "turned down",
|
|
463
|
-
tried: "turn down",
|
|
464
|
-
what: ({ entry }) => tool(entry),
|
|
465
|
-
then: ({ entry }) => [` for ${text(entry.metadata.clientName) ?? "an app"}`]
|
|
466
|
-
},
|
|
467
|
-
"mcp.view": {
|
|
468
|
-
did: "opened an approval",
|
|
469
|
-
tried: "open an approval",
|
|
470
|
-
what: () => []
|
|
471
|
-
},
|
|
472
|
-
"mcp.cancel": {
|
|
473
|
-
did: "cancelled",
|
|
474
|
-
tried: "cancel",
|
|
475
|
-
what: ({ entry }) => tool(entry),
|
|
476
|
-
then: ({ entry }) => via(entry)
|
|
477
|
-
},
|
|
478
|
-
"mcp.disconnect": {
|
|
479
|
-
did: "disconnected",
|
|
480
|
-
tried: "disconnect",
|
|
481
|
-
what: ({ entry }) => [...app(entry), ...entry.metadata.principalId === void 0 ? [] : [" of ", ...subject(entry)]],
|
|
482
|
-
then: ({ entry }) => [DISCONNECTED[text(entry.metadata.reason) ?? ""] ?? ""]
|
|
483
|
-
},
|
|
484
|
-
sign_in: {
|
|
485
|
-
did: ({ entry }) => entry.metadata.kind === "cli" ? "signed in to the CLI" : "signed in",
|
|
486
|
-
tried: "sign in",
|
|
487
|
-
what: ({ entry }) => text(entry.metadata.provider) === null ? [] : [`with ${text(entry.metadata.provider)}`]
|
|
488
|
-
},
|
|
489
|
-
sign_out: {
|
|
490
|
-
did: "signed out",
|
|
491
|
-
tried: "sign out",
|
|
492
|
-
what: () => []
|
|
493
|
-
},
|
|
494
|
-
"token.create": {
|
|
495
|
-
did: ({ entry }) => entry.metadata.kind === "handle" ? "made a handle" : personal(entry) ? "made a personal token" : "issued a bearer token to",
|
|
496
|
-
tried: ({ entry }) => entry.metadata.kind === "handle" ? "make a handle" : personal(entry) ? "make a personal token" : "issue a bearer token to",
|
|
497
|
-
what: ({ entry }) => personal(entry) ? labelled(entry) : subject(entry),
|
|
498
|
-
then: ({ entry }) => reaching(entry)
|
|
499
|
-
},
|
|
500
|
-
"token.revoke": {
|
|
501
|
-
did: ({ entry }) => personal(entry) ? "revoked a personal token of" : "revoked a bearer token of",
|
|
502
|
-
tried: ({ entry }) => personal(entry) ? "revoke a personal token of" : "revoke a bearer token of",
|
|
503
|
-
what: (facts) => subject(facts.entry)
|
|
504
|
-
},
|
|
505
|
-
"token.use": {
|
|
506
|
-
did: "used a personal token for",
|
|
507
|
-
tried: "use a personal token for",
|
|
508
|
-
what: ({ entry }) => [text(entry.metadata.route) ?? "something"]
|
|
509
|
-
},
|
|
510
|
-
"device.approve": {
|
|
511
|
-
did: "approved a CLI sign-in",
|
|
512
|
-
tried: "approve a CLI sign-in",
|
|
513
|
-
what: () => []
|
|
514
|
-
},
|
|
515
|
-
"device.deny": {
|
|
516
|
-
did: "turned down a CLI sign-in",
|
|
517
|
-
tried: "turn down a CLI sign-in",
|
|
518
|
-
what: () => []
|
|
519
|
-
},
|
|
520
|
-
"mcp.read": {
|
|
521
|
-
did: "used",
|
|
522
|
-
tried: "use",
|
|
523
|
-
what: ({ entry }) => tool(entry),
|
|
524
|
-
then: ({ entry }) => via(entry)
|
|
525
|
-
},
|
|
526
|
-
"mcp.token": {
|
|
527
|
-
did: ({ entry }) => entry.metadata.grant === "refresh_token" ? "refreshed the tokens of" : "gave its first tokens to",
|
|
528
|
-
tried: "give tokens to",
|
|
529
|
-
what: ({ entry }) => app(entry)
|
|
530
|
-
},
|
|
531
|
-
"account.link": {
|
|
532
|
-
did: "linked",
|
|
533
|
-
tried: "link",
|
|
534
|
-
what: ({ entry }) => [`a ${text(entry.metadata.provider) ?? "sign-in"} account`]
|
|
535
|
-
},
|
|
536
|
-
"account.unlink": {
|
|
537
|
-
did: "unlinked",
|
|
538
|
-
tried: "unlink",
|
|
539
|
-
what: ({ entry }) => [`a ${text(entry.metadata.provider) ?? "sign-in"} account`]
|
|
540
|
-
},
|
|
541
|
-
"key.wrap": {
|
|
542
|
-
did: "sealed the key of",
|
|
543
|
-
tried: "seal the key of",
|
|
544
|
-
what: (facts) => versioned(facts.entry)
|
|
545
|
-
},
|
|
546
|
-
"key.rewrap": {
|
|
547
|
-
did: "resealed the key of",
|
|
548
|
-
tried: "reseal the key of",
|
|
549
|
-
what: (facts) => versioned(facts.entry)
|
|
550
|
-
},
|
|
551
|
-
"key.intent": {
|
|
552
|
-
did: "asked KMS about",
|
|
553
|
-
tried: "ask KMS about",
|
|
554
|
-
what: (facts) => secrets(facts)
|
|
555
|
-
},
|
|
556
|
-
"key.check": {
|
|
557
|
-
did: "recorded the check value of",
|
|
558
|
-
tried: "check",
|
|
559
|
-
what: ({ entry }) => [[
|
|
560
|
-
"the",
|
|
561
|
-
text(entry.metadata.kekProvider) === "local" ? null : text(entry.metadata.kekProvider),
|
|
562
|
-
"vault key",
|
|
563
|
-
text(entry.metadata.kekId)
|
|
564
|
-
].filter((word) => word !== null).join(" ")]
|
|
565
|
-
},
|
|
566
|
-
"audit.heartbeat": {
|
|
567
|
-
did: "checked in",
|
|
568
|
-
tried: "check in",
|
|
569
|
-
what: () => []
|
|
570
|
-
},
|
|
571
|
-
"key.reseal": {
|
|
572
|
-
did: "signed rows again under its new app key:",
|
|
573
|
-
tried: "sign rows again under its new app key",
|
|
574
|
-
what: ({ entry }) => {
|
|
575
|
-
const count = (name) => typeof entry.metadata[name] === "number" ? entry.metadata[name] : 0;
|
|
576
|
-
const [unsigned, later] = [count("unsignedCount"), count("later")];
|
|
577
|
-
return [`${count("resealed")}, and ${count("signedOut")} signed out${later === 0 ? "" : `; ${later} another listed key signed, for its own rotation`}${unsigned === 0 ? "" : `; ${unsigned} no key listed had signed, left as they were`}`];
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
"audit.finding": {
|
|
581
|
-
did: "found the log changed",
|
|
582
|
-
tried: "find the log changed",
|
|
583
|
-
what: ({ entry }) => [number(entry.metadata.seq) === null ? text(entry.metadata.reason) ?? "where it walked" : `at entry ${number(entry.metadata.seq)}`]
|
|
584
|
-
},
|
|
585
|
-
"audit.finding_cleared": {
|
|
586
|
-
did: "found the log whole again",
|
|
587
|
-
tried: "find the log whole again",
|
|
588
|
-
what: () => []
|
|
589
|
-
},
|
|
590
|
-
"audit.reanchor": {
|
|
591
|
-
did: "re-anchored the log",
|
|
592
|
-
tried: "re-anchor the log",
|
|
593
|
-
what: ({ entry }) => number(entry.metadata.at) === null ? [] : [`at entry ${number(entry.metadata.at)}`]
|
|
594
|
-
},
|
|
595
|
-
"audit.loss_accepted": {
|
|
596
|
-
did: "accepted as lost",
|
|
597
|
-
tried: "accept as lost",
|
|
598
|
-
what: ({ entry }) => [`entries ${number(entry.metadata.from) ?? "?"} to ${number(entry.metadata.to) ?? "?"}`]
|
|
599
|
-
},
|
|
600
|
-
"audit.loss_unapplied": {
|
|
601
|
-
did: "could not apply the acceptance of",
|
|
602
|
-
tried: "apply the acceptance of",
|
|
603
|
-
what: ({ entry }) => [`entries ${number(entry.metadata.from) ?? "?"} to ${number(entry.metadata.to) ?? "?"} as lost`]
|
|
604
|
-
},
|
|
605
|
-
"audit.checkpoint": {
|
|
606
|
-
did: "signed the log",
|
|
607
|
-
tried: "sign the log",
|
|
608
|
-
what: ({ entry }) => number(entry.metadata.seq) === null ? [] : [`through entry ${number(entry.metadata.seq)}`]
|
|
609
|
-
},
|
|
610
|
-
"secret.list": {
|
|
611
|
-
did: "listed",
|
|
612
|
-
tried: "list",
|
|
613
|
-
what: ({ entry }) => environmentOf(entry)
|
|
614
|
-
},
|
|
615
|
-
"secret.history": {
|
|
616
|
-
did: "read the history of",
|
|
617
|
-
tried: "read the history of",
|
|
618
|
-
what: (facts) => place(facts.entry)
|
|
619
|
-
},
|
|
620
|
-
"secret.update": {
|
|
621
|
-
did: "changed",
|
|
622
|
-
tried: "change",
|
|
623
|
-
what: (facts) => place(facts.entry)
|
|
624
|
-
}
|
|
625
|
-
};
|
|
626
|
-
/** " to the folder stripe", or " out of its folder". */
|
|
627
|
-
function intoFolder(entry) {
|
|
628
|
-
const folder = text(entry.metadata.to);
|
|
629
|
-
return [folder === null ? " out of its folder" : ` to the folder ${folder}`];
|
|
630
|
-
}
|
|
631
|
-
/** An instance role's name, from its slug; null for none it knows. */
|
|
632
|
-
function roleName(role) {
|
|
633
|
-
return isInstanceRole(role) ? INSTANCE_ROLES[role].name : null;
|
|
634
|
-
}
|
|
635
|
-
/** What a policy change did, and what it did it to, as `did` and `tried` say it. */
|
|
636
|
-
var POLICY_VERBS = {
|
|
637
|
-
protect: ["protected", "protect"],
|
|
638
|
-
unprotect: ["unprotected", "unprotect"],
|
|
639
|
-
edit: ["edited", "edit"],
|
|
640
|
-
reset: ["reset", "reset"],
|
|
641
|
-
make: ["made", "make"],
|
|
642
|
-
delete: ["deleted", "delete"]
|
|
643
|
-
};
|
|
644
|
-
/**
|
|
645
|
-
* A `policy.change` entry, from what it names: its `change`, an
|
|
646
|
-
* environment's protection or a role's definition, and the role `before`
|
|
647
|
-
* it. A built-in role's definition dropped is a reset; one an Owner made, a
|
|
648
|
-
* deletion; one that was not there, made. A refusal the app wrote names the
|
|
649
|
-
* role alone.
|
|
650
|
-
*
|
|
651
|
-
* protected market/prod edited the Developer role
|
|
652
|
-
* made the Release manager role reset the Auditor instance role
|
|
653
|
-
*/
|
|
654
|
-
function policyOf(entry) {
|
|
655
|
-
const change = record(entry.metadata.change);
|
|
656
|
-
if (change.kind === "protect") {
|
|
657
|
-
const count = Array.isArray(change.environmentIds) ? change.environmentIds.length : 1;
|
|
658
|
-
const what = entry.environment !== null ? place({
|
|
659
|
-
...entry,
|
|
660
|
-
key: null
|
|
661
|
-
}) : entry.project === null ? [count === 1 ? "an environment" : plural(count, "environment")] : [count === 1 ? "a new environment of " : `${plural(count, "environment")} of `, { place: entry.project }];
|
|
662
|
-
return {
|
|
663
|
-
verb: change.protected === false ? "unprotect" : "protect",
|
|
664
|
-
what
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
const instance = (change.kind ?? entry.metadata.kind) === "instance-role";
|
|
668
|
-
const id = text(change.role) ?? text(entry.metadata.role);
|
|
669
|
-
const shipped = id !== null && (instance ? isInstanceRole(id) : isBuiltinRole(id));
|
|
670
|
-
const definition = change.definition === null ? null : record(change.definition);
|
|
671
|
-
const before = record(entry.metadata.before);
|
|
672
|
-
const name = text(definition?.name) ?? text(record(before.definition).name) ?? (id === null ? null : shipped ? (instance ? INSTANCE_ROLES[id] : ROLES[id]).name : id);
|
|
673
|
-
return {
|
|
674
|
-
verb: change.definition === null || entry.metadata.definition === null || entry.reason === "role_granted" ? shipped ? "reset" : "delete" : before.definition === null ? "make" : "edit",
|
|
675
|
-
what: [name === null ? "a role" : `the ${name} ${instance ? "global role" : "role"}`]
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
/** An object of the metadata's, or an empty one for anything else. */
|
|
679
|
-
function record(value) {
|
|
680
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
681
|
-
}
|
|
682
|
-
function article(name) {
|
|
683
|
-
return `${/^[AEIOU]/.test(name) ? "an" : "a"} ${name}`;
|
|
684
|
-
}
|
|
685
|
-
/** Whether an entry's scope narrows the role; its projects are ids, which a sentence cannot name. */
|
|
686
|
-
function scoped(entry) {
|
|
687
|
-
const scope = entry.metadata.scope;
|
|
688
|
-
return scope === void 0 || scope.projects === "all" && scope.environments === "all" ? [] : [", with a scope"];
|
|
689
|
-
}
|
|
690
|
-
/**
|
|
691
|
-
* What a token or binding reaches, its scope, each role with the places it
|
|
692
|
-
* holds, counted, as the log names them by id: `, reaching developer on 2 places`.
|
|
693
|
-
*/
|
|
694
|
-
function reaching(entry, none = "") {
|
|
695
|
-
const scope = entry.metadata.scope;
|
|
696
|
-
if (!Array.isArray(scope)) return [];
|
|
697
|
-
if (scope.length === 0) return none === "" ? [] : [none];
|
|
698
|
-
const byRole = /* @__PURE__ */ new Map();
|
|
699
|
-
for (const grant of scope) {
|
|
700
|
-
const role = text(grant.role);
|
|
701
|
-
if (role !== null) byRole.set(role, (byRole.get(role) ?? 0) + 1);
|
|
702
|
-
}
|
|
703
|
-
return [`, reaching ${[...byRole].map(([role, count]) => `${role} on ${plural(count, "place")}`).join(", ")}`];
|
|
704
|
-
}
|
|
705
|
-
/** The issuer an ID token came from, by its host: `token.actions.githubusercontent.com`. */
|
|
706
|
-
function issuerName(entry) {
|
|
707
|
-
const issuer = text(entry.metadata.issuer);
|
|
708
|
-
if (issuer === null) return "its platform";
|
|
709
|
-
return URL.canParse(issuer) && new URL(issuer).host !== "" ? new URL(issuer).host : issuer;
|
|
710
|
-
}
|
|
711
|
-
/** The GitHub environment a binding takes its runs from, when it names one. */
|
|
712
|
-
function inGitHubEnvironment(entry) {
|
|
713
|
-
const environment = text(entry.metadata.claims?.environment);
|
|
714
|
-
return environment === null || !String(entry.metadata.profile).startsWith("github") ? [] : [`, in GitHub environment ${environment}`];
|
|
715
|
-
}
|
|
716
|
-
/** The tokens and trust bindings a `token.seal` names, counted: `2 tokens and a trust binding`. */
|
|
717
|
-
function sealedOf(entry) {
|
|
718
|
-
const count = (key) => Array.isArray(entry.metadata[key]) ? entry.metadata[key].length : 0;
|
|
719
|
-
return [[count("tokens"), "token"], [count("bindings"), "trust binding"]].filter(([n]) => n > 0).map(([n, one]) => plural(n, one)).join(" and ") || "nothing";
|
|
720
|
-
}
|
|
721
|
-
/**
|
|
722
|
-
* The setting of where people set up service accounts, in words: its
|
|
723
|
-
* projects counted, as the log names them by id, its environments by name.
|
|
724
|
-
*
|
|
725
|
-
* All projects · all but prod 2 projects · dev only
|
|
726
|
-
*/
|
|
727
|
-
function setting(scope) {
|
|
728
|
-
if (!isScope(scope)) return [];
|
|
729
|
-
const { projects } = scope;
|
|
730
|
-
return [scopeInWords(projects === "all" ? scope : {
|
|
731
|
-
...scope,
|
|
732
|
-
projects: "only" in projects ? { only: [plural(projects.only.length, "project")] } : { except: [plural(projects.except.length, "project")] }
|
|
733
|
-
})];
|
|
734
|
-
}
|
|
735
|
-
/** The role a member is added or brought back with, said when it is more than Member. */
|
|
736
|
-
function asRole(entry) {
|
|
737
|
-
const role = roleName(text(entry.metadata.role) ?? "");
|
|
738
|
-
return role === null || role === "Member" ? [] : [` as ${article(role)}`, ...scoped(entry)];
|
|
739
|
-
}
|
|
740
|
-
function placeOnly(entry) {
|
|
741
|
-
const everywhere = entry.project === null ? text(entry.metadata.place) : null;
|
|
742
|
-
if (everywhere !== null) return [everywhere === "*" ? "every project" : `${everywhere.slice(2)} in every project`];
|
|
743
|
-
return place({
|
|
744
|
-
...entry,
|
|
745
|
-
key: null
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
function versioned(entry) {
|
|
749
|
-
return [...place(entry), ...entry.version === null ? [] : [`, version ${entry.version}`]];
|
|
750
|
-
}
|
|
751
|
-
var TAMPERING = {
|
|
752
|
-
mac: "it does not carry the vault's seal",
|
|
753
|
-
stale: "an older copy was put back",
|
|
754
|
-
forged_entry: "the vault did not write it"
|
|
755
|
-
};
|
|
756
|
-
/** Why something was refused, in words. Codes from the vault and the app. */
|
|
757
|
-
var REASONS = {
|
|
758
|
-
no_grant: "no grant",
|
|
759
|
-
bulk_limit: "bulk limit",
|
|
760
|
-
stand_ins: "people get placeholders",
|
|
761
|
-
sensitive: "the value is sensitive",
|
|
762
|
-
looser: "making it visible takes a new value",
|
|
763
|
-
not_owner: "only an Owner of the project does it in place",
|
|
764
|
-
inherited: "it is inherited",
|
|
765
|
-
expired: "grant expired",
|
|
766
|
-
removed: "removed from coffre",
|
|
767
|
-
not_a_member: "not a member",
|
|
768
|
-
not_registered: "not invited",
|
|
769
|
-
tampered: "their record was tampered with",
|
|
770
|
-
bad_claim: "the key did not match the secret",
|
|
771
|
-
deleted: "the place was deleted",
|
|
772
|
-
not_allowed: "not allowed",
|
|
773
|
-
root_admin: "root admins are set by the deployment",
|
|
774
|
-
last_owner: "they are the last Owner of the whole instance",
|
|
775
|
-
requires_instance_admin: "requires an admin or owner of the whole instance",
|
|
776
|
-
requires_instance_owner: "requires an instance owner",
|
|
777
|
-
own_role: "nobody changes their own role",
|
|
778
|
-
own_grant: "nobody grants themselves a role",
|
|
779
|
-
service_cannot_hold_role: "service accounts hold project grants only",
|
|
780
|
-
not_service_manager: "they hold less than the service account, or than they gave it",
|
|
781
|
-
unknown_environment: "no such environment",
|
|
782
|
-
unknown_secret: "no such secret",
|
|
783
|
-
no_value: "it holds no value",
|
|
784
|
-
unknown_project: "no such project",
|
|
785
|
-
not_archived: "it was not archived",
|
|
786
|
-
referenced: "references read it",
|
|
787
|
-
kms_unavailable: "KMS did not answer",
|
|
788
|
-
wrong_kek: "the vault's key is not the one that wrapped the data",
|
|
789
|
-
person_denied: "they said no",
|
|
790
|
-
too_many_connections: "too many connected apps",
|
|
791
|
-
unknown_connection: "no such connected app",
|
|
792
|
-
not_yours: "it was someone else's",
|
|
793
|
-
too_many_approvals: "too many changes waiting for approval",
|
|
794
|
-
request_state: "its retry did not match its call",
|
|
795
|
-
changed: "the change was not the one shown",
|
|
796
|
-
replaced: "what it replaces changed since it was shown",
|
|
797
|
-
unconfirmed: "what it replaces could not be read",
|
|
798
|
-
disconnected: "the app was disconnected",
|
|
799
|
-
personal_token: "only its person can, signed in as themselves",
|
|
800
|
-
beyond_holder: "more than they hold",
|
|
801
|
-
role_granted: "grants still name it"
|
|
802
|
-
};
|
|
803
|
-
/** What a missing permission meant, from the app's `missing_<permission>`. */
|
|
804
|
-
var MISSING = {
|
|
805
|
-
secret_read: "no grant to read it",
|
|
806
|
-
secret_write: "no grant to write",
|
|
807
|
-
secret_archive: "no grant to archive",
|
|
808
|
-
audit_read: "no grant to read the audit log",
|
|
809
|
-
environment_manage: "no grant to manage environments",
|
|
810
|
-
grant_manage: "no grant to manage access",
|
|
811
|
-
project_manage: "no grant to manage the project"
|
|
812
|
-
};
|
|
813
|
-
function reasonInWords(reason) {
|
|
814
|
-
if (reason === null) return "refused";
|
|
815
|
-
if (reason.startsWith("missing_")) return MISSING[reason.slice(8)] ?? "no grant";
|
|
816
|
-
return REASONS[reason] ?? reason.replace(/_/g, " ");
|
|
817
|
-
}
|
|
818
|
-
/** In a batch of mixed actions, the one the line is named for: a write, not its reads. */
|
|
819
|
-
var LEAD = ["secret.write", "secret.read"];
|
|
820
|
-
function leadOf(batch) {
|
|
821
|
-
for (const action of LEAD) {
|
|
822
|
-
const found = batch.find((entry) => entry.action === action);
|
|
823
|
-
if (found !== void 0) return found;
|
|
824
|
-
}
|
|
825
|
-
return batch[0];
|
|
826
|
-
}
|
|
827
|
-
/**
|
|
828
|
-
* A read of several secrets, logged once for its place, as the entries it
|
|
829
|
-
* would be about one secret each: its key and version, and what its own
|
|
830
|
-
* part of the metadata says, such as the reference it went through. Any
|
|
831
|
-
* other entry as it is.
|
|
832
|
-
*/
|
|
833
|
-
function perSecret(entry) {
|
|
834
|
-
const listed = entry.metadata.secrets;
|
|
835
|
-
if (entry.secrets === null || entry.secrets.length === 0 || !Array.isArray(listed)) return [entry];
|
|
836
|
-
return entry.secrets.map(({ key, version }, i) => {
|
|
837
|
-
const own = listed[i];
|
|
838
|
-
return {
|
|
839
|
-
...entry,
|
|
840
|
-
key,
|
|
841
|
-
version,
|
|
842
|
-
secrets: null,
|
|
843
|
-
metadata: {
|
|
844
|
-
...entry.metadata,
|
|
845
|
-
secrets: void 0,
|
|
846
|
-
...typeof own === "object" && own !== null && !Array.isArray(own) ? own : {}
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
/** What a line says: one entry, or a batch that shares an operation. */
|
|
852
|
-
function describe(batch) {
|
|
853
|
-
const entry = perSecret(leadOf(batch))[0];
|
|
854
|
-
const same = batch.filter((other) => other.action === entry.action).flatMap(perSecret);
|
|
855
|
-
const denied = same.filter((other) => other.decision === "deny");
|
|
856
|
-
const refused = denied.length === same.length;
|
|
857
|
-
const facts = {
|
|
858
|
-
entry,
|
|
859
|
-
batch: same,
|
|
860
|
-
count: new Set(same.map((other) => `${other.project}/${other.environment}/${other.key}`)).size,
|
|
861
|
-
refused
|
|
862
|
-
};
|
|
863
|
-
const template = TEMPLATES[entry.action];
|
|
864
|
-
if (template === void 0) return {
|
|
865
|
-
parts: [
|
|
866
|
-
entry.action,
|
|
867
|
-
" ",
|
|
868
|
-
...place(entry)
|
|
869
|
-
],
|
|
870
|
-
refused
|
|
871
|
-
};
|
|
872
|
-
const say = (verb) => typeof verb === "string" ? verb : verb(facts);
|
|
873
|
-
const what = template.what(facts);
|
|
874
|
-
const gap = what.length === 0 ? [] : [" "];
|
|
875
|
-
if (refused) {
|
|
876
|
-
const reason = reasonInWords((denied[0] ?? entry).reason);
|
|
877
|
-
return {
|
|
878
|
-
parts: [
|
|
879
|
-
"tried to ",
|
|
880
|
-
say(template.tried),
|
|
881
|
-
...gap,
|
|
882
|
-
...what,
|
|
883
|
-
`: ${reason}`
|
|
884
|
-
],
|
|
885
|
-
refused
|
|
886
|
-
};
|
|
887
|
-
}
|
|
888
|
-
const partly = denied.length === 0 ? [] : [`, ${denied.length} refused: ${reasonInWords(denied[0].reason)}`];
|
|
889
|
-
return {
|
|
890
|
-
parts: [
|
|
891
|
-
say(template.did),
|
|
892
|
-
...gap,
|
|
893
|
-
...what,
|
|
894
|
-
...template.then?.(facts) ?? [],
|
|
895
|
-
...partly
|
|
896
|
-
],
|
|
897
|
-
refused
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
/** Who acted, as a part: a member links to their page; coffre itself is text. */
|
|
901
|
-
function who(entry) {
|
|
902
|
-
if (entry.actorType === "user") return { member: `user:${entry.actorId}` };
|
|
903
|
-
if (entry.actorType === "service") return { member: `token:${entry.actorId}` };
|
|
904
|
-
return SYSTEM[entry.actorId] ?? entry.actorId;
|
|
905
|
-
}
|
|
906
|
-
var SYSTEM = {
|
|
907
|
-
scheduler: "the scheduler",
|
|
908
|
-
cron: "the scheduler",
|
|
909
|
-
vault: "the vault",
|
|
910
|
-
app: "coffre",
|
|
911
|
-
"coffre-key-rotation": "coffre"
|
|
912
|
-
};
|
|
913
|
-
/** Which components wrote the line, the vault first: "vault", "app", "vault, app". */
|
|
914
|
-
function decidedBy(batch) {
|
|
915
|
-
return ["vault", "app"].filter((author) => batch.some((entry) => entry.author === author)).join(", ");
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* Entries in the order the page shows them, newest first, each batch as one
|
|
919
|
-
* line at its newest entry. The server leaves detail out unless asked.
|
|
920
|
-
*/
|
|
921
|
-
function lines(entries) {
|
|
922
|
-
const shown = [];
|
|
923
|
-
const batches = /* @__PURE__ */ new Map();
|
|
924
|
-
for (const entry of entries) {
|
|
925
|
-
const batch = entry.operationId === null ? void 0 : batches.get(entry.operationId);
|
|
926
|
-
if (batch !== void 0) {
|
|
927
|
-
batch.push(entry);
|
|
928
|
-
continue;
|
|
929
|
-
}
|
|
930
|
-
const fresh = [entry];
|
|
931
|
-
if (entry.operationId !== null) batches.set(entry.operationId, fresh);
|
|
932
|
-
shown.push(fresh);
|
|
933
|
-
}
|
|
934
|
-
return shown;
|
|
935
|
-
}
|
|
936
|
-
//#endregion
|
|
937
|
-
//#region src/components/audit-sentence.tsx
|
|
938
|
-
/** A sentence, its people and places links to their pages. */
|
|
939
|
-
function Sentence({ parts }) {
|
|
940
|
-
return /* @__PURE__ */ jsx(Fragment$1, { children: parts.map((part, index) => /* @__PURE__ */ jsx(Fragment, { children: typeof part === "string" ? part : "place" in part ? /* @__PURE__ */ jsx(PlaceLink, { path: part.place }) : /* @__PURE__ */ jsx(MemberLink, { member: part.member }) }, index)) });
|
|
941
|
-
}
|
|
942
|
-
function PlaceLink({ path }) {
|
|
943
|
-
const [project, environment] = path.split("/");
|
|
944
|
-
const text = /* @__PURE__ */ jsx("span", {
|
|
945
|
-
className: "mono",
|
|
946
|
-
children: breakAfterUnderscores(path)
|
|
947
|
-
});
|
|
948
|
-
return environment === void 0 ? /* @__PURE__ */ jsx(Link, {
|
|
949
|
-
to: "/projects/$project",
|
|
950
|
-
params: { project },
|
|
951
|
-
children: text
|
|
952
|
-
}) : /* @__PURE__ */ jsx(Link, {
|
|
953
|
-
to: "/projects/$project/$environment",
|
|
954
|
-
params: {
|
|
955
|
-
project,
|
|
956
|
-
environment
|
|
957
|
-
},
|
|
958
|
-
children: text
|
|
959
|
-
});
|
|
960
|
-
}
|
|
961
|
-
/** A member from the log, which keeps `token:<name>`, shown as people read it: `service:<name>`, to its page. */
|
|
962
|
-
function MemberLink({ member }) {
|
|
963
|
-
return member.startsWith("token:") ? /* @__PURE__ */ jsx(Link, {
|
|
964
|
-
to: "/service-accounts/$account",
|
|
965
|
-
params: { account: serviceName(member) },
|
|
966
|
-
children: shownMember(member)
|
|
967
|
-
}) : /* @__PURE__ */ jsx(Link, {
|
|
968
|
-
to: "/users/$user",
|
|
969
|
-
params: { user: memberName(member) },
|
|
970
|
-
children: memberName(member)
|
|
971
|
-
});
|
|
972
|
-
}
|
|
973
|
-
function memberName(member) {
|
|
974
|
-
return member.startsWith("user:") ? member.slice(5) : shownMember(member);
|
|
975
|
-
}
|
|
976
|
-
//#endregion
|
|
977
|
-
//#region src/components/actions-log.tsx
|
|
978
|
-
var PAGE_SIZE = 50;
|
|
979
|
-
/**
|
|
980
|
-
* How far a page's reads are listed, when that says something: 0.15's log
|
|
981
|
-
* lists a read once the vault's projector has caught up with it, which runs
|
|
982
|
-
* apart from sealing, so that a projector behind or stopped shows rather
|
|
983
|
-
* than leaves reads missing unsaid. An instance before 0.15 says nothing.
|
|
984
|
-
*/
|
|
985
|
-
function ReadsLag({ reads, omitted }) {
|
|
986
|
-
if (omitted !== void 0) return /* @__PURE__ */ jsx("div", {
|
|
987
|
-
style: { marginBottom: "1.25rem" },
|
|
988
|
-
children: /* @__PURE__ */ jsx(Notice, { children: omitted === "path" ? "Reads are listed on the whole audit log and on each member’s page, not here." : "Reads are listed to those who read the whole audit log; your own are on your page." })
|
|
989
|
-
});
|
|
990
|
-
if (reads?.behind !== true && reads?.forged !== true) return null;
|
|
991
|
-
return /* @__PURE__ */ jsx("div", {
|
|
992
|
-
style: { marginBottom: "1.25rem" },
|
|
993
|
-
children: reads.forged === true ? /* @__PURE__ */ jsx(Notice, {
|
|
994
|
-
tone: "bad",
|
|
995
|
-
children: "The vault does not vouch for how far reads are listed: something with direct access to the database moved it. Newer reads may be missing."
|
|
996
|
-
}) : /* @__PURE__ */ jsx(Notice, {
|
|
997
|
-
tone: "warn",
|
|
998
|
-
children: reads.through === null ? "No read is listed yet: the reads sealed so far wait to be listed." : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
999
|
-
"Reads sealed through ",
|
|
1000
|
-
/* @__PURE__ */ jsx(Timestamp, {
|
|
1001
|
-
iso: reads.through,
|
|
1002
|
-
precise: true
|
|
1003
|
-
}),
|
|
1004
|
-
"; newer reads wait to be listed."
|
|
1005
|
-
] })
|
|
1006
|
-
})
|
|
1007
|
-
});
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* Everything one member did, newest first, from the audit log: the same
|
|
1011
|
-
* entries `coffre audit --actor` lists, said as the audit page says them.
|
|
1012
|
-
* Older pages come on request.
|
|
1013
|
-
*/
|
|
1014
|
-
function ActionsLog({ member }) {
|
|
1015
|
-
const client = useCoffre();
|
|
1016
|
-
const log = useInfiniteQuery({
|
|
1017
|
-
queryKey: [
|
|
1018
|
-
...keys.audit,
|
|
1019
|
-
"actor",
|
|
1020
|
-
member
|
|
1021
|
-
],
|
|
1022
|
-
staleTime: 0,
|
|
1023
|
-
initialPageParam: void 0,
|
|
1024
|
-
queryFn: ({ pageParam }) => uiResult(() => client.audit.list({
|
|
1025
|
-
actor: member,
|
|
1026
|
-
limit: PAGE_SIZE,
|
|
1027
|
-
sealed: "1",
|
|
1028
|
-
before: pageParam
|
|
1029
|
-
})),
|
|
1030
|
-
getNextPageParam: (page) => page.ok ? page.next ?? void 0 : void 0
|
|
1031
|
-
});
|
|
1032
|
-
if (log.isPending) return /* @__PURE__ */ jsxs("p", {
|
|
1033
|
-
className: "hint",
|
|
1034
|
-
children: [/* @__PURE__ */ jsx(Spinner, { size: 13 }), " Reading the log…"]
|
|
1035
|
-
});
|
|
1036
|
-
const failed = log.data?.pages.find((page) => !page.ok);
|
|
1037
|
-
if (failed !== void 0 && !failed.ok) return /* @__PURE__ */ jsx(Notice, {
|
|
1038
|
-
tone: "bad",
|
|
1039
|
-
children: failed.error
|
|
1040
|
-
});
|
|
1041
|
-
const shown = lines((log.data?.pages ?? []).flatMap((page) => page.ok ? page.entries : []));
|
|
1042
|
-
const first = log.data?.pages[0];
|
|
1043
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1044
|
-
/* @__PURE__ */ jsx(ReadsLag, {
|
|
1045
|
-
reads: first?.ok === true ? first.reads : void 0,
|
|
1046
|
-
omitted: first?.ok === true ? first.readsOmitted : void 0
|
|
1047
|
-
}),
|
|
1048
|
-
/* @__PURE__ */ jsx("section", {
|
|
1049
|
-
className: "card",
|
|
1050
|
-
"aria-label": "Actions log",
|
|
1051
|
-
children: shown.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { title: "Nothing yet" }) : /* @__PURE__ */ jsx("div", {
|
|
1052
|
-
className: "dt-wrap",
|
|
1053
|
-
children: /* @__PURE__ */ jsxs("table", {
|
|
1054
|
-
className: "dt actions-log stacks stacks-inline",
|
|
1055
|
-
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1056
|
-
/* @__PURE__ */ jsx("th", {
|
|
1057
|
-
className: "col-shrink",
|
|
1058
|
-
children: /* @__PURE__ */ jsxs("span", {
|
|
1059
|
-
className: "th",
|
|
1060
|
-
children: [/* @__PURE__ */ jsx(Clock, { size: 14 }), "When"]
|
|
1061
|
-
})
|
|
1062
|
-
}),
|
|
1063
|
-
/* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsxs("span", {
|
|
1064
|
-
className: "th",
|
|
1065
|
-
children: [/* @__PURE__ */ jsx(Activity, { size: 14 }), "Action"]
|
|
1066
|
-
}) }),
|
|
1067
|
-
/* @__PURE__ */ jsx("th", {
|
|
1068
|
-
className: "col-shrink",
|
|
1069
|
-
children: /* @__PURE__ */ jsxs("span", {
|
|
1070
|
-
className: "th",
|
|
1071
|
-
children: [/* @__PURE__ */ jsx(ShieldCheck, { size: 14 }), "Outcome"]
|
|
1072
|
-
})
|
|
1073
|
-
})
|
|
1074
|
-
] }) }), /* @__PURE__ */ jsx("tbody", { children: shown.map((batch) => {
|
|
1075
|
-
const lead = batch[0];
|
|
1076
|
-
const sentence = describe(batch);
|
|
1077
|
-
return /* @__PURE__ */ jsxs("tr", {
|
|
1078
|
-
className: sentence.refused ? "is-denied" : void 0,
|
|
1079
|
-
children: [
|
|
1080
|
-
/* @__PURE__ */ jsx("td", {
|
|
1081
|
-
className: "nowrap cell-muted",
|
|
1082
|
-
title: lead.occurredAt,
|
|
1083
|
-
children: /* @__PURE__ */ jsx(Timestamp, {
|
|
1084
|
-
iso: lead.occurredAt,
|
|
1085
|
-
display: "relative"
|
|
1086
|
-
})
|
|
1087
|
-
}),
|
|
1088
|
-
/* @__PURE__ */ jsxs("td", {
|
|
1089
|
-
className: "cell-sentence",
|
|
1090
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
1091
|
-
className: "sentence",
|
|
1092
|
-
children: /* @__PURE__ */ jsx(Sentence, { parts: sentence.parts })
|
|
1093
|
-
}), lead.run !== null && /* @__PURE__ */ jsx("small", {
|
|
1094
|
-
className: "actor-run",
|
|
1095
|
-
children: runLabel(lead.run)
|
|
1096
|
-
})]
|
|
1097
|
-
}),
|
|
1098
|
-
/* @__PURE__ */ jsx("td", {
|
|
1099
|
-
className: "nowrap",
|
|
1100
|
-
"data-label": "Outcome",
|
|
1101
|
-
children: lead.forged === true ? /* @__PURE__ */ jsxs("span", {
|
|
1102
|
-
className: "decided decided-refused",
|
|
1103
|
-
title: "The vault does not vouch for this entry",
|
|
1104
|
-
children: [/* @__PURE__ */ jsx(SlashCircle, { size: 13 }), "Forged"]
|
|
1105
|
-
}) : sentence.refused ? /* @__PURE__ */ jsxs("span", {
|
|
1106
|
-
className: "decided decided-refused",
|
|
1107
|
-
children: [/* @__PURE__ */ jsx(SlashCircle, { size: 13 }), "Refused"]
|
|
1108
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
1109
|
-
className: "cell-muted",
|
|
1110
|
-
children: "Allowed"
|
|
1111
|
-
})
|
|
1112
|
-
})
|
|
1113
|
-
]
|
|
1114
|
-
}, `${lead.log}:${lead.seq}`);
|
|
1115
|
-
}) })]
|
|
1116
|
-
})
|
|
1117
|
-
})
|
|
1118
|
-
}),
|
|
1119
|
-
log.hasNextPage && /* @__PURE__ */ jsx("div", {
|
|
1120
|
-
className: "table-actions",
|
|
1121
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
1122
|
-
type: "button",
|
|
1123
|
-
className: "btn",
|
|
1124
|
-
disabled: log.isFetchingNextPage,
|
|
1125
|
-
onClick: () => void log.fetchNextPage(),
|
|
1126
|
-
children: [log.isFetchingNextPage && /* @__PURE__ */ jsx(Spinner, {}), "Show older"]
|
|
1127
|
-
})
|
|
1128
|
-
})
|
|
1129
|
-
] });
|
|
1130
|
-
}
|
|
1131
|
-
//#endregion
|
|
1132
|
-
export { decidedBy as a, perSecret as c, memberName as i, runLabel as l, ReadsLag as n, describe as o, Sentence as r, lines as s, ActionsLog as t, who as u };
|
|
1133
|
-
|
|
1134
|
-
//# sourceMappingURL=actions-log-DupYCEyV.js.map
|