@coffre/ui 0.6.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{audit-sentence-BVv_9_nq.js → audit-sentence-C_wMpAqr.js} +99 -26
- package/dist/chunks/audit-sentence-C_wMpAqr.js.map +1 -0
- package/dist/chunks/{connected-apps-rBF9XUob.js → connected-apps-Bn5rEoV2.js} +2 -2
- package/dist/chunks/{connected-apps-rBF9XUob.js.map → connected-apps-Bn5rEoV2.js.map} +1 -1
- package/dist/chunks/{delete-place-CkGezx5R.js → delete-place-CQCDHkne.js} +3 -3
- package/dist/chunks/{delete-place-CkGezx5R.js.map → delete-place-CQCDHkne.js.map} +1 -1
- package/dist/chunks/{directory-SRN01yP6.js → directory-BQNOdze_.js} +6 -5
- package/dist/chunks/{directory-SRN01yP6.js.map → directory-BQNOdze_.js.map} +1 -1
- package/dist/chunks/{grants-1E1vqkM0.js → grants-CJIBrkod.js} +3 -3
- package/dist/chunks/{grants-1E1vqkM0.js.map → grants-CJIBrkod.js.map} +1 -1
- package/dist/chunks/{offboarding-Bt7KSixm.js → offboarding-CrgwaetA.js} +3 -3
- package/dist/chunks/offboarding-CrgwaetA.js.map +1 -0
- package/dist/chunks/personal-tokens-B8rkT-DI.js +138 -0
- package/dist/chunks/personal-tokens-B8rkT-DI.js.map +1 -0
- package/dist/chunks/{principal-page-Cbx2l6XL.js → principal-page-Cv5PheS9.js} +25 -12
- package/dist/chunks/principal-page-Cv5PheS9.js.map +1 -0
- package/dist/chunks/{project-page-DKo2AFYg.js → project-page-BI--vjt3.js} +2 -2
- package/dist/chunks/{project-page-DKo2AFYg.js.map → project-page-BI--vjt3.js.map} +1 -1
- package/dist/chunks/{queries-BvSw1xBN.js → queries-epz4MIuW.js} +19 -5
- package/dist/chunks/queries-epz4MIuW.js.map +1 -0
- package/dist/chunks/{references-DCoSPtvw.js → references-DImfw0cz.js} +3 -3
- package/dist/chunks/{references-DCoSPtvw.js.map → references-DImfw0cz.js.map} +1 -1
- package/dist/chunks/{role-field-D98CvNEg.js → role-field-C1KhNaIR.js} +2 -2
- package/dist/chunks/{role-field-D98CvNEg.js.map → role-field-C1KhNaIR.js.map} +1 -1
- package/dist/chunks/{use-action-Bv7yQ0DW.js → use-action-BB-RcHo1.js} +2 -2
- package/dist/chunks/{use-action-Bv7yQ0DW.js.map → use-action-BB-RcHo1.js.map} +1 -1
- package/dist/chunks/{use-change-DIQTGXER.js → use-change-CQyDpCqw.js} +268 -17
- package/dist/chunks/use-change-CQyDpCqw.js.map +1 -0
- package/dist/chunks/{use-shell-DhFoHjDS.js → use-shell-C_NmvCt_.js} +2 -2
- package/dist/chunks/{use-shell-DhFoHjDS.js.map → use-shell-C_NmvCt_.js.map} +1 -1
- package/dist/index.d.ts +33 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/pages/account.d.ts +1 -1
- package/dist/pages/account.js +26 -9
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/audit.js +52 -32
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/environment.js +520 -192
- package/dist/pages/environment.js.map +1 -1
- package/dist/pages/login.js +1 -1
- package/dist/pages/project-access.js +8 -8
- package/dist/pages/project-access.js.map +1 -1
- package/dist/pages/project-environments.js +106 -19
- package/dist/pages/project-environments.js.map +1 -1
- package/dist/pages/project-settings.js +6 -6
- package/dist/pages/project.js +1 -1
- package/dist/pages/projects.js +4 -4
- package/dist/pages/service-account.js +278 -29
- package/dist/pages/service-account.js.map +1 -1
- package/dist/pages/service-accounts.js +4 -4
- package/dist/pages/settings.js +4 -4
- package/dist/pages/unregistered.js +1 -1
- package/dist/pages/user.js +5 -5
- package/dist/pages/users.js +4 -4
- package/package.json +3 -3
- package/src/components/actions-log.tsx +2 -1
- package/src/components/directory.tsx +1 -0
- package/src/components/generate-value.tsx +15 -7
- package/src/components/offboarding.tsx +1 -1
- package/src/components/personal-tokens.tsx +131 -0
- package/src/components/principal-page.tsx +20 -3
- package/src/components/regenerate.tsx +72 -0
- package/src/components/service-tokens.tsx +3 -3
- package/src/components/trusted-workloads.tsx +177 -8
- package/src/lib/audit-sentences.ts +110 -12
- package/src/lib/bindings.ts +41 -3
- package/src/lib/changes.ts +155 -20
- package/src/lib/generate.ts +3 -146
- package/src/lib/queries.ts +15 -4
- package/src/lib/recipes.ts +63 -0
- package/src/lib/reveal.ts +7 -1
- package/src/lib/secret-edit-batch.ts +64 -5
- package/src/options.ts +5 -1
- package/src/pages/account.tsx +27 -5
- package/src/pages/audit.tsx +23 -7
- package/src/pages/environment.tsx +357 -39
- package/src/pages/project-access.tsx +1 -1
- package/src/pages/project-environments.tsx +85 -12
- package/src/parity.ts +19 -2
- package/src/styles/globals.css +56 -3
- package/dist/chunks/audit-sentence-BVv_9_nq.js.map +0 -1
- package/dist/chunks/offboarding-Bt7KSixm.js.map +0 -1
- package/dist/chunks/principal-page-Cbx2l6XL.js.map +0 -1
- package/dist/chunks/queries-BvSw1xBN.js.map +0 -1
- package/dist/chunks/use-change-DIQTGXER.js.map +0 -1
|
@@ -40,7 +40,7 @@ function ProjectAccess({ slug, principalType, children }: { slug: string; princi
|
|
|
40
40
|
if (!result.ok) return <Notice tone="bad">{result.error}</Notice>;
|
|
41
41
|
return (
|
|
42
42
|
<>
|
|
43
|
-
<AccessPanel principalType={principalType} project={slug} environments={project.environments} grants={result.grants} />
|
|
43
|
+
<AccessPanel principalType={principalType} project={slug} environments={project.environments.filter((environment) => !environment.personal)} grants={result.grants} />
|
|
44
44
|
{children}
|
|
45
45
|
</>
|
|
46
46
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
+
import type { PersonalConfig } from '@coffre/client';
|
|
2
3
|
import { useQuery, useSuspenseQuery } from '@tanstack/react-query';
|
|
3
4
|
import { Link } from '@tanstack/react-router';
|
|
4
5
|
import { useShell } from '../lib/use-shell';
|
|
@@ -6,14 +7,16 @@ import { Menu } from '@base-ui/react/menu';
|
|
|
6
7
|
import { toast } from 'sonner';
|
|
7
8
|
import { useCoffre } from '../lib/coffre';
|
|
8
9
|
import { archiveEnvironment, createEnvironment, environmentId, renameEnvironment } from '../lib/changes';
|
|
9
|
-
import { keys, queries } from '../lib/queries';
|
|
10
|
+
import { affects, keys, queries } from '../lib/queries';
|
|
10
11
|
import { useChange, useChangeStatus } from '../lib/use-change';
|
|
11
12
|
import { ItemFailure, RowPending, rowClass } from '../components/row-state';
|
|
12
13
|
import type { GrantRow, ProjectSummary } from '../shared/models';
|
|
13
14
|
import { ArchiveBlocked, archiveBlockers } from '../components/references';
|
|
14
15
|
import { hasEnvironmentDetails, isActiveAccessibleEnvironment, type ProjectEnvironment } from '../lib/project-environments';
|
|
15
16
|
import { environmentSlugProblem } from '../lib/validation';
|
|
16
|
-
import { ConfirmDialog, EmptyState, MenuPopup, Modal, Notice, Timestamp } from '../components/ui';
|
|
17
|
+
import { ConfirmDialog, EmptyState, ErrorLine, MenuPopup, Modal, Notice, Timestamp } from '../components/ui';
|
|
18
|
+
import { Card } from '../components/page';
|
|
19
|
+
import { useAction } from '../lib/use-action';
|
|
17
20
|
import { DeletePlaceDialog } from '../components/delete-place';
|
|
18
21
|
import { PrincipalAvatar } from '../components/principal';
|
|
19
22
|
import { Archive, ChevronRight, MoreHorizontal, Pencil, Plus, RotateBack, Trash } from '../components/icons';
|
|
@@ -103,11 +106,14 @@ function EnvironmentsPanel({
|
|
|
103
106
|
<div className="table-actions">
|
|
104
107
|
<NewEnvironment
|
|
105
108
|
project={project.slug}
|
|
106
|
-
|
|
109
|
+
// Your personal config is nobody's source: its values are yours alone.
|
|
110
|
+
sources={current.filter((environment) => isActiveAccessibleEnvironment(environment) && !environment.personal).map((environment) => environment.slug)}
|
|
107
111
|
/>
|
|
108
112
|
</div>
|
|
109
113
|
)}
|
|
110
114
|
|
|
115
|
+
{canManage && <PersonalConfigs project={project.slug} />}
|
|
116
|
+
|
|
111
117
|
{archived.length > 0 && (
|
|
112
118
|
<section aria-labelledby="archived-environments">
|
|
113
119
|
<h2 className="section-title" id="archived-environments">
|
|
@@ -200,7 +206,8 @@ function EnvironmentCard({
|
|
|
200
206
|
const deletable = manageable && isArchived && capabilities.runsInstance;
|
|
201
207
|
const slugError = slug === '' ? null : environmentSlugProblem(slug);
|
|
202
208
|
const lastChange = useLastChange(project, environment.slug, opens);
|
|
203
|
-
|
|
209
|
+
// A personal config is its owner's alone: no grant reaches it, so none is shown on its card.
|
|
210
|
+
const holders = environment.personal === true ? [] : holdersOf(grants, environment.slug);
|
|
204
211
|
// Scopes match environments by slug: a new one is said to move them before the rename is saved.
|
|
205
212
|
const reslugged = slug !== environment.slug && slug !== '' && slugError === null;
|
|
206
213
|
|
|
@@ -221,6 +228,10 @@ function EnvironmentCard({
|
|
|
221
228
|
) : (
|
|
222
229
|
<span className="env-card-name">{environment.slug}</span>
|
|
223
230
|
)}
|
|
231
|
+
{/* A fork: its keys are its parent's, but for those it sets or removes. An instance before 0.7 says nothing. */}
|
|
232
|
+
{environment.personal === true
|
|
233
|
+
? <span className="tag tag-blue">yours alone</span>
|
|
234
|
+
: environment.parent != null && <span className="tag tag-outline">inherits {environment.parent}</span>}
|
|
224
235
|
</span>
|
|
225
236
|
|
|
226
237
|
{isArchived ? (
|
|
@@ -270,7 +281,8 @@ function EnvironmentCard({
|
|
|
270
281
|
|
|
271
282
|
{pending && <RowPending status={state} />}
|
|
272
283
|
|
|
273
|
-
{
|
|
284
|
+
{/* Your personal config is deleted from its own page; it is no environment of the team's to rename or archive. */}
|
|
285
|
+
{manageable && !pending && environment.personal !== true && (
|
|
274
286
|
<Menu.Root>
|
|
275
287
|
<Menu.Trigger
|
|
276
288
|
className="act act-quiet env-card-menu"
|
|
@@ -429,16 +441,70 @@ function EnvironmentCard({
|
|
|
429
441
|
}
|
|
430
442
|
|
|
431
443
|
/**
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
444
|
+
* The project's personal configs, `dev@me` (docs/design/forking.md), for
|
|
445
|
+
* whoever manages its environments: that they exist, whose, of what, and
|
|
446
|
+
* their key names, never a value, which only their owners read. Delete is
|
|
447
|
+
* how offboarding cleans one up: its values are erased.
|
|
448
|
+
*/
|
|
449
|
+
function PersonalConfigs({ project }: { project: string }) {
|
|
450
|
+
const coffre = useCoffre();
|
|
451
|
+
const { data } = useQuery(queries.personal(coffre, project));
|
|
452
|
+
const [deleting, setDeleting] = useState<PersonalConfig | null>(null);
|
|
453
|
+
const { error, run } = useAction();
|
|
454
|
+
if (data === undefined || !data.ok || data.configs.length === 0) return null;
|
|
455
|
+
return (
|
|
456
|
+
<Card
|
|
457
|
+
labelledBy="personal-configs"
|
|
458
|
+
title="Personal configs"
|
|
459
|
+
description="Members' own forks of an environment, its keys and their values over it. Only their owner reads the values; you see whose they are and their key names."
|
|
460
|
+
>
|
|
461
|
+
{error !== null && <ErrorLine error={error} />}
|
|
462
|
+
{data.configs.map((config) => (
|
|
463
|
+
<div className="card-row" key={config.slug}>
|
|
464
|
+
<div>
|
|
465
|
+
<p className="card-row-title">
|
|
466
|
+
<span className="mono">{config.of}</span> · {config.owner.replace(/^user:/, '')}
|
|
467
|
+
{config.archived && <span className="tag tag-outline">archived</span>}
|
|
468
|
+
</p>
|
|
469
|
+
<p className="card-row-desc mono">{config.keys.length === 0 ? 'no keys of its own' : config.keys.join(', ')}</p>
|
|
470
|
+
</div>
|
|
471
|
+
<button type="button" className="btn btn-sm" onClick={() => setDeleting(config)}>
|
|
472
|
+
<Trash size={14} />
|
|
473
|
+
Delete…
|
|
474
|
+
</button>
|
|
475
|
+
</div>
|
|
476
|
+
))}
|
|
477
|
+
<ConfirmDialog
|
|
478
|
+
open={deleting !== null}
|
|
479
|
+
onOpenChange={(open) => !open && setDeleting(null)}
|
|
480
|
+
title={<>Delete {deleting?.owner.replace(/^user:/, '')}'s <span className="mono">{deleting?.of}</span>?</>}
|
|
481
|
+
body={`Its ${deleting?.keys.length ?? 0} ${deleting?.keys.length === 1 ? 'value is' : 'values are'} erased for good; ${project}/${deleting?.of} itself is untouched.`}
|
|
482
|
+
confirmLabel="Delete"
|
|
483
|
+
onConfirm={() => {
|
|
484
|
+
const doomed = deleting!;
|
|
485
|
+
void run(() => coffre.environments.delete(`${project}/${doomed.slug}`), {
|
|
486
|
+
// The list, and the owner's own `dev@me` when it is theirs: its card and its keys go.
|
|
487
|
+
affects: [...affects.places(), ...affects.secrets({ project, environment: `${doomed.of}@me` })],
|
|
488
|
+
onSuccess: () => toast.success(`Deleted ${doomed.owner.replace(/^user:/, '')}'s ${doomed.of}`),
|
|
489
|
+
});
|
|
490
|
+
}}
|
|
491
|
+
/>
|
|
492
|
+
</Card>
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* A new environment, empty, or forked from one you can read: inheriting
|
|
498
|
+
* its keys live (docs/design/forking.md), or each of them copied, value and
|
|
499
|
+
* folder, without history, or a reference to it. Copying is a read, and
|
|
500
|
+
* logged as one; inheriting reads nothing until the fork is read.
|
|
435
501
|
*/
|
|
436
502
|
function NewEnvironment({ project, sources }: { project: string; sources: string[] }) {
|
|
437
503
|
const [open, setOpen] = useState(false);
|
|
438
504
|
const [slug, setSlug] = useState('');
|
|
439
|
-
// '' for empty, 'copy:prod' for a copy, 'ref:prod' for references to prod.
|
|
505
|
+
// '' for empty, 'inherit:prod' for a fork that inherits, 'copy:prod' for a copy, 'ref:prod' for references to prod.
|
|
440
506
|
const [start, setStart] = useState('');
|
|
441
|
-
const [how, from] = start === '' ? ['', ''] : (start.split(':') as ['copy' | 'ref', string]);
|
|
507
|
+
const [how, from] = start === '' ? ['', ''] : (start.split(':') as ['inherit' | 'copy' | 'ref', string]);
|
|
442
508
|
const coffre = useCoffre();
|
|
443
509
|
// A fork as references copies the keys whose source you read only through their parent: said before you confirm.
|
|
444
510
|
const { data: parent } = useQuery({ ...queries.secrets(coffre, { project, environment: from }), enabled: how === 'ref' });
|
|
@@ -473,7 +539,7 @@ function NewEnvironment({ project, sources }: { project: string; sources: string
|
|
|
473
539
|
onSubmit={(event) => {
|
|
474
540
|
event.preventDefault();
|
|
475
541
|
// Listed at once, as saving; the list says if the server refuses.
|
|
476
|
-
create({ slug, ...(from === '' ? {} : { from }), ...(how === 'ref' ? { references: true } : {}) });
|
|
542
|
+
create({ slug, ...(from === '' ? {} : { from }), ...(how === 'ref' ? { references: true } : {}), ...(how === 'inherit' ? { inherit: true } : {}) });
|
|
477
543
|
setSlug('');
|
|
478
544
|
setStart('');
|
|
479
545
|
close();
|
|
@@ -508,6 +574,11 @@ function NewEnvironment({ project, sources }: { project: string; sources: string
|
|
|
508
574
|
<span className="label">Start from</span>
|
|
509
575
|
<select className="select" value={start} onChange={(event) => setStart(event.target.value)}>
|
|
510
576
|
<option value="">Empty</option>
|
|
577
|
+
{sources.map((source) => (
|
|
578
|
+
<option key={`inherit:${source}`} value={`inherit:${source}`}>
|
|
579
|
+
Inheriting from {source}
|
|
580
|
+
</option>
|
|
581
|
+
))}
|
|
511
582
|
{sources.map((source) => (
|
|
512
583
|
<option key={`copy:${source}`} value={`copy:${source}`}>
|
|
513
584
|
A copy of {source}
|
|
@@ -522,7 +593,9 @@ function NewEnvironment({ project, sources }: { project: string; sources: string
|
|
|
522
593
|
<span className="hint">
|
|
523
594
|
{how === ''
|
|
524
595
|
? 'No secrets yet.'
|
|
525
|
-
: how === '
|
|
596
|
+
: how === 'inherit'
|
|
597
|
+
? `Keeps reading ${from}'s keys, live, except those you set or remove here. Whoever reads ${slug === '' ? 'the new environment' : slug} needs read on ${from} too, for those.`
|
|
598
|
+
: how === 'copy'
|
|
526
599
|
? `Each of ${from}'s keys, with its current value and folder, without history.`
|
|
527
600
|
: `Each key follows ${from}'s until it gets a value of its own. Whoever can read ${slug === '' ? 'the new environment' : slug} will read ${from}'s values through them, even without access to ${from}.`}
|
|
528
601
|
</span>
|
package/src/parity.ts
CHANGED
|
@@ -43,7 +43,7 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
|
|
|
43
43
|
],
|
|
44
44
|
},
|
|
45
45
|
'PUT /projects/:project/:environment': {
|
|
46
|
-
ui: [{ does: 'a project › Environments › Add environment', in: 'pages/project-environments.tsx', call: 'environments.create' }],
|
|
46
|
+
ui: [{ does: 'a project › Environments › Add environment, empty, inheriting, a copy or references', in: 'pages/project-environments.tsx', call: 'environments.create' }],
|
|
47
47
|
},
|
|
48
48
|
'PATCH /projects/:project/:environment': {
|
|
49
49
|
ui: [{ does: "an environment's card › ⋯ › Rename, Archive…, Restore", in: 'pages/project-environments.tsx', call: 'environments.update' }],
|
|
@@ -57,8 +57,17 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
|
|
|
57
57
|
'GET /projects/:project/:environment/missing': {
|
|
58
58
|
ui: [{ does: "an environment: the keys its siblings have and it lacks", in: 'lib/queries.ts', call: 'environments.missing' }],
|
|
59
59
|
},
|
|
60
|
+
'GET /personal/:project': {
|
|
61
|
+
ui: [{ does: "a project › Environments › Personal configs: whose, of what, and their key names", in: 'pages/project-environments.tsx', call: 'environments.personal' }],
|
|
62
|
+
},
|
|
63
|
+
'GET /projects/:project/:environment/version': {
|
|
64
|
+
not: 'for programs that poll an environment before reading it, `coffre export --watch` first; a page has its listing, which it reloads',
|
|
65
|
+
},
|
|
60
66
|
'PATCH /projects/:project/:environment/dismissals': {
|
|
61
|
-
ui: [
|
|
67
|
+
ui: [
|
|
68
|
+
{ does: 'an environment › Missing keys › Dismiss, Dismiss all, and Undo after either', in: 'components/missing.tsx', call: 'environments.dismiss' },
|
|
69
|
+
{ does: "a fork › an inherited key › ⋯ › Remove; a removed one › Restore; Undo after either", in: 'lib/changes.ts', call: 'environments.dismiss' },
|
|
70
|
+
],
|
|
62
71
|
},
|
|
63
72
|
'GET /secrets/:project/:environment': { ui: [{ does: 'an environment: its secrets', in: 'pages/environment.tsx', call: 'secrets.list' }] },
|
|
64
73
|
'PATCH /secrets/:project/:environment': {
|
|
@@ -71,6 +80,7 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
|
|
|
71
80
|
ui: [
|
|
72
81
|
{ does: "a secret › Edit: its name, then Save", in: 'pages/environment.tsx', call: 'secrets.rename' },
|
|
73
82
|
{ does: 'a secret › ⋯ › Archive; an archived one › ⋯ › Restore', in: 'pages/environment.tsx', call: 'secrets.update' },
|
|
83
|
+
{ does: "a fork › an override › ⋯ › Reset to its parent; a reset one › ⋯ › Use its own value again; Undo after either", in: 'lib/changes.ts', call: 'secrets.inherit' },
|
|
74
84
|
],
|
|
75
85
|
},
|
|
76
86
|
'GET /secrets/:project/:environment/:key/versions': {
|
|
@@ -123,6 +133,7 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
|
|
|
123
133
|
'DELETE /members/:member': { ui: [{ does: 'a user or service account › ⋯ › Remove…', in: 'components/directory.tsx', call: 'members.remove' }] },
|
|
124
134
|
'GET /members/:member/tokens': { ui: [{ does: 'a service account › Sign-in › Bearer tokens', in: 'components/service-tokens.tsx', call: 'tokens.list' }] },
|
|
125
135
|
'POST /members/:member/tokens': { ui: [{ does: 'a service account › Sign-in › Issue token', in: 'components/service-tokens.tsx', call: 'tokens.issue' }] },
|
|
136
|
+
'POST /handles': { not: "a handle is a stand-in for an app `coffre run` starts, which only the credential proxy takes: a page has no app to give one" },
|
|
126
137
|
'DELETE /members/:member/tokens/:id': { ui: [{ does: 'a bearer token › Revoke', in: 'components/service-tokens.tsx', call: 'tokens.revoke' }] },
|
|
127
138
|
'GET /members/:member/bindings': { ui: [{ does: 'a service account › Sign-in › Sign in with OIDC', in: 'components/trusted-workloads.tsx', call: 'bindings.list' }] },
|
|
128
139
|
'POST /members/:member/bindings': {
|
|
@@ -131,6 +142,12 @@ export const UI_PARITY: { [K in RouteKey]: Reach } = {
|
|
|
131
142
|
{ does: 'Trust a workload › Trust', in: 'components/trusted-workloads.tsx', call: 'bindings.create' },
|
|
132
143
|
],
|
|
133
144
|
},
|
|
145
|
+
'POST /members/:member/bindings/keys': {
|
|
146
|
+
ui: [
|
|
147
|
+
{ does: 'a trust binding with uploaded keys › Claims › Replace keys: the bindings replaced reviewed first', in: 'components/trusted-workloads.tsx', call: 'bindings.previewKeys' },
|
|
148
|
+
{ does: 'Replace keys › Save keys', in: 'components/trusted-workloads.tsx', call: 'bindings.replaceKeys' },
|
|
149
|
+
],
|
|
150
|
+
},
|
|
134
151
|
'DELETE /members/:member/bindings/:id': { ui: [{ does: 'a trust binding › Remove', in: 'components/trusted-workloads.tsx', call: 'bindings.remove' }] },
|
|
135
152
|
'GET /workloads/lookup': { ui: [{ does: 'Trust a workload: a repository named, its IDs looked up', in: 'components/trusted-workloads.tsx', call: 'bindings.lookup' }] },
|
|
136
153
|
'GET /workloads/repositories': { ui: [{ does: "Trust a workload: the repositories the deployment's GitHub App is installed on, offered as the name is typed", in: 'lib/queries.ts', call: 'bindings.repositories' }] },
|
package/src/styles/globals.css
CHANGED
|
@@ -1734,22 +1734,34 @@ a.crumb-link:hover {
|
|
|
1734
1734
|
}
|
|
1735
1735
|
|
|
1736
1736
|
.claims-table {
|
|
1737
|
+
/* Fixed, so that a long claim name, a nested one's path, never squeezes its value to a column of letters. */
|
|
1738
|
+
width: 100%;
|
|
1737
1739
|
margin-top: 0.25rem;
|
|
1738
1740
|
border-collapse: collapse;
|
|
1739
1741
|
font-size: 0.75rem;
|
|
1742
|
+
table-layout: fixed;
|
|
1740
1743
|
}
|
|
1741
1744
|
|
|
1742
|
-
|
|
1745
|
+
/* Inside a binding's row, as plain as in the dialog: none of the data table's own cells. */
|
|
1746
|
+
table.claims-table th {
|
|
1747
|
+
height: auto;
|
|
1743
1748
|
padding: 0.125rem 0.75rem 0.125rem 0;
|
|
1749
|
+
border: 0;
|
|
1750
|
+
background: none;
|
|
1744
1751
|
color: var(--ink-2);
|
|
1752
|
+
font-size: inherit;
|
|
1745
1753
|
font-weight: 550;
|
|
1746
1754
|
text-align: left;
|
|
1747
|
-
white-space: nowrap;
|
|
1748
1755
|
vertical-align: top;
|
|
1756
|
+
width: 38%;
|
|
1757
|
+
white-space: normal;
|
|
1758
|
+
overflow-wrap: anywhere;
|
|
1749
1759
|
}
|
|
1750
1760
|
|
|
1751
|
-
.claims-table td {
|
|
1761
|
+
table.claims-table td {
|
|
1752
1762
|
padding: 0.125rem 0;
|
|
1763
|
+
border: 0;
|
|
1764
|
+
vertical-align: top;
|
|
1753
1765
|
overflow-wrap: anywhere;
|
|
1754
1766
|
}
|
|
1755
1767
|
|
|
@@ -2563,6 +2575,34 @@ a.crumb-link:hover {
|
|
|
2563
2575
|
text-decoration-thickness: 1.5px;
|
|
2564
2576
|
}
|
|
2565
2577
|
|
|
2578
|
+
/* In a fork (docs/design/forking.md): a key it inherits reads as its
|
|
2579
|
+
parent's, muted; one it removed is struck through, not served. */
|
|
2580
|
+
.secret-row.is-inherited .cell-key > .key-cell > span:first-child,
|
|
2581
|
+
.secret-row.is-inherited .mask {
|
|
2582
|
+
color: var(--ink-3);
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
.secret-row.is-removed .cell-key > .key-cell > span:first-child {
|
|
2586
|
+
color: var(--ink-3);
|
|
2587
|
+
text-decoration: line-through;
|
|
2588
|
+
text-decoration-thickness: 1.5px;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
/* The parent a tag names, linking to its own row of the key. */
|
|
2592
|
+
.tag-link {
|
|
2593
|
+
position: relative;
|
|
2594
|
+
z-index: 1;
|
|
2595
|
+
color: inherit;
|
|
2596
|
+
text-decoration: underline;
|
|
2597
|
+
text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
|
|
2598
|
+
text-underline-offset: 2px;
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
.tag-link:hover {
|
|
2602
|
+
color: var(--ink);
|
|
2603
|
+
text-decoration-color: currentColor;
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2566
2606
|
.key-cell {
|
|
2567
2607
|
display: flex;
|
|
2568
2608
|
align-items: center;
|
|
@@ -2571,6 +2611,19 @@ a.crumb-link:hover {
|
|
|
2571
2611
|
min-width: 0;
|
|
2572
2612
|
}
|
|
2573
2613
|
|
|
2614
|
+
/* Beside a key whose value was generated: its recipe, on hover or focus. */
|
|
2615
|
+
.recipe-mark {
|
|
2616
|
+
display: inline-flex;
|
|
2617
|
+
align-items: center;
|
|
2618
|
+
color: var(--ink-3);
|
|
2619
|
+
border-radius: var(--radius-sm);
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
.recipe-mark:focus-visible {
|
|
2623
|
+
outline: 2px solid var(--accent);
|
|
2624
|
+
outline-offset: 2px;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2574
2627
|
.edit-stack {
|
|
2575
2628
|
display: flex;
|
|
2576
2629
|
flex-direction: column;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"audit-sentence-BVv_9_nq.js","names":[],"sources":["../../src/lib/audit-sentences.ts","../../src/components/audit-sentence.tsx"],"sourcesContent":["/**\n * The audit log in sentences: who did what, to what. One entry is one\n * human action, named for it (`secret.read`, `access.grant`, …); a batch of\n * them, one reveal of twelve secrets, shares an operation and reads as one\n * line, \"ran market/prod: 12 secrets\".\n *\n * A sentence is parts rather than a string, so the page can make the people\n * and places in it links. `plain` flattens it, for tests and titles.\n */\nimport { shownMember, type AuditEntryView } from '@coffre/client';\nimport { INSTANCE_ROLES, isInstanceRole, isScope, scopeInWords, type Scope } from '@coffre/core/access';\n\n/** What a sentence is made from: an entry of the log, as `GET /api/audit` gives it. */\nexport type AuditEntry = Pick<\n AuditEntryView,\n | 'seq'\n | 'author'\n | 'actorType'\n | 'actorId'\n | 'action'\n | 'decision'\n | 'reason'\n | 'detail'\n | 'subject'\n | 'project'\n | 'environment'\n | 'key'\n | 'version'\n | 'operationId'\n | 'metadata'\n>;\n\n/**\n * Text, a place (`market`, `market/prod`, `market/prod/KEY`), or a member,\n * as the log stores it (`user:…`, `token:…`): `shownMember` says it as people\n * read it, `service:…`, where it is shown.\n */\nexport type Part = string | { place: string } | { member: string };\n\nexport type Sentence = { parts: Part[]; refused: boolean };\n\n/** What one template needs: the line's leading entry, its batch, and how it was decided. */\ntype Facts = {\n entry: AuditEntry;\n /** Every entry of the batch, the lead included. */\n batch: AuditEntry[];\n /** Secrets the batch was about. */\n count: number;\n refused: boolean;\n};\n\ntype Template = {\n /** What they did: \"revealed\". */\n did: string | ((facts: Facts) => string);\n /** What they tried, after \"tried to\": \"reveal\". */\n tried: string | ((facts: Facts) => string);\n /** To what: \"market/prod/API_KEY\". */\n what: (facts: Facts) => Part[];\n /** Said only of what happened: \", now version 5\". */\n then?: (facts: Facts) => Part[];\n};\n\n// --- the pieces of a sentence ---------------------------------------------------\n\nconst text = (value: unknown): string | null => (typeof value === 'string' && value !== '' ? value : null);\nconst number = (value: unknown): number | null => (typeof value === 'number' ? value : null);\n\n/** The entry's place, as deep as it goes. */\nfunction place({ project, environment, key }: AuditEntry): Part[] {\n const path = [project, environment, key].filter((part): part is string => part !== null);\n return path.length === 0 ? ['coffre'] : [{ place: path.join('/') }];\n}\n\nfunction environmentOf({ project, environment }: AuditEntry): Part[] {\n return place({ project, environment, key: null } as AuditEntry);\n}\n\n/** The member an entry is about: its subject, or the principal a token entry names. */\nfunction subject(entry: AuditEntry): Part[] {\n if (entry.subject !== null) return [{ member: entry.subject }];\n const id = text(entry.metadata.principalId);\n if (id === null) return ['someone'];\n return [{ member: `${entry.metadata.principalType === 'service' ? 'token' : 'user'}:${id}` }];\n}\n\n/** Why the vault made someone an Owner itself, said after it. */\nfunction owned(entry: AuditEntry): Part[] {\n return entry.metadata.reason === 'owners' ? [': the deployment names them one'] : [];\n}\n\n/** An MCP client, by the name it connected under. */\nfunction app(entry: AuditEntry): Part[] {\n return [text(entry.metadata.clientName) ?? 'an app'];\n}\n\n/** A tool's call: its name, and what it named. */\nfunction tool(entry: AuditEntry): Part[] {\n const names = Array.isArray(entry.metadata.names) ? entry.metadata.names.filter((name): name is string => typeof name === 'string') : [];\n return [text(entry.metadata.tool) ?? 'a tool', ...(names.length === 0 ? [] : [` on ${names.join(', ')}`])];\n}\n\n/** The client a request came through, said after what it did: \"via Claude\". */\nfunction via(entry: AuditEntry): Part[] {\n const client = (entry.metadata.via as { clientName?: unknown } | undefined)?.clientName;\n return typeof client === 'string' ? [` via ${client}`] : [];\n}\n\n/** Why coffre itself ended a connection, said after it. */\nconst DISCONNECTED: Record<string, string> = {\n code_reused: ': its sign-in code was used twice',\n refresh_reused: ': a refresh token it had replaced was used again',\n revocation_endpoint: ', at its own request',\n superseded: ': a connection with more scopes replaced it',\n};\n\nfunction plural(count: number, one: string, many = `${one}s`): string {\n return `${count} ${count === 1 ? one : many}`;\n}\n\n/** A batch reads as its environment and a count; one entry as its secret. */\n/**\n * The secrets a read or write was about. A read through a reference is a\n * read of its source, \"market/prod/DATABASE_URL through\n * billing/prod/DATABASE_URL\"; a run that read some that way is a run of\n * the environment that holds them.\n */\nfunction secrets(facts: Facts): Part[] {\n const through = (entry: AuditEntry) => text((entry.metadata.via as { path?: unknown } | undefined)?.path);\n if (facts.batch.length === 1) {\n const held = through(facts.entry);\n return held === null ? place(facts.entry) : [...place(facts.entry), ' through ', { place: held }];\n }\n const own = facts.batch.find((entry) => through(entry) === null);\n const held = facts.batch.map(through).filter((path): path is string => path !== null);\n const where = own !== undefined ? environmentOf(own) : [{ place: held[0]!.split('/').slice(0, 2).join('/') }];\n return [\n ...where,\n facts.refused ? ', ' : ': ',\n plural(facts.count, 'secret'),\n ...(held.length === 0 ? [] : [`, ${held.length} through ${held.length === 1 ? 'a reference' : 'references'}`]),\n ];\n}\n\n/** \"market/prod/OLD\", or \"OLD and STALE in market/prod\" for an archive of several keys refused. */\nfunction archivedKeys(entry: AuditEntry): Part[] {\n const keys = Array.isArray(entry.metadata.keys) ? entry.metadata.keys.filter((key): key is string => text(key) !== null) : [];\n if (entry.key !== null || keys.length === 0) return place(entry);\n return [keys.length === 1 ? keys[0]! : `${keys.slice(0, -1).join(', ')} and ${keys.at(-1)!}`, ' in ', ...environmentOf(entry)];\n}\n\n/** \"SENTRY_DSN in market/dev\", or \"3 keys in market/dev\" for a Dismiss all. */\nfunction missingKeys(facts: Facts): Part[] {\n const key = text(facts.entry.metadata.key);\n return [facts.batch.length === 1 && key !== null ? key : plural(facts.count, 'key'), ' in ', ...environmentOf(facts.entry)];\n}\n\n/** \"billing/prod/DATABASE_URL a reference to market/prod/DATABASE_URL\", from either author's entry. */\nfunction referenceTo(entry: AuditEntry): Part[] {\n const holder = text(entry.metadata.subject);\n const key = text(entry.metadata.key);\n const source = text(entry.metadata.source) ?? text((entry.metadata.source as { path?: unknown } | undefined)?.path);\n return [\n ...(holder !== null ? [{ place: holder }] : key !== null ? place(entry) : environmentOf(entry)),\n ...(source === null ? [] : [' a reference to ', { place: source }]),\n ];\n}\n\nconst READ_VERBS: Record<string, [did: string, tried: string]> = {\n reveal: ['revealed', 'reveal'],\n run: ['ran', 'run'],\n compare: ['compared', 'compare'],\n copy: ['copied', 'copy'],\n};\n\nfunction readVerb({ entry }: Facts): [string, string] {\n return READ_VERBS[text(entry.metadata.purpose) ?? 'reveal'] ?? READ_VERBS.reveal!;\n}\n\nconst placeTemplates = (kind: 'project' | 'environment'): Record<string, Template> => {\n const what = (facts: Facts): Part[] => [`${kind} `, ...(kind === 'project' ? place({ ...facts.entry, environment: null, key: null }) : environmentOf(facts.entry))];\n return {\n [`${kind}.create`]: {\n did: 'created',\n tried: 'create',\n what,\n // A fork names the environment it copied.\n then: ({ entry }) => (text(entry.metadata.from) === null ? [] : [`, a fork of ${text(entry.metadata.from)}`]),\n },\n [`${kind}.update`]: { did: 'changed', tried: 'change', what },\n [`${kind}.archive`]: { did: 'archived', tried: 'archive', what },\n [`${kind}.restore`]: { did: 'restored', tried: 'restore', what },\n // Named by its tombstone from then on, `market~deleted-2026-10-05`, as every entry about it is.\n [`${kind}.delete`]: { did: 'deleted', tried: 'delete', what },\n };\n};\n\n// --- one template per action ----------------------------------------------------\n\nconst TEMPLATES: Record<string, Template> = {\n 'secret.read': {\n did: (facts) => readVerb(facts)[0],\n tried: (facts) => readVerb(facts)[1],\n what: secrets,\n },\n 'secret.write': {\n // New secrets are added, others changed; a batch of both is written.\n did: ({ batch }) => {\n const firsts = batch.filter((entry) => entry.version === 1).length;\n return firsts === batch.length ? 'added' : firsts === 0 ? 'changed' : 'wrote';\n },\n tried: 'change',\n what: secrets,\n then: ({ entry, batch }) =>\n batch.length > 1 || entry.version === null || entry.version === 1 ? [] : [`, now version ${entry.version}`],\n },\n 'secret.restore': {\n did: 'restored',\n tried: 'restore',\n what: ({ entry }) => [...place(entry), ...(number(entry.metadata.from) === null ? [] : [` to version ${number(entry.metadata.from)}`])],\n then: ({ entry }) => (entry.version === null ? [] : [`, now ${entry.version}`]),\n },\n 'secret.rename': {\n did: 'renamed',\n tried: 'rename',\n what: ({ entry }) => [...place(entry), ...(text(entry.metadata.nextKey) === null ? [] : [` to ${text(entry.metadata.nextKey)}`])],\n },\n 'secret.archive': { did: 'archived', tried: 'archive', what: ({ entry }) => archivedKeys(entry) },\n 'missing.dismiss': {\n did: 'dismissed',\n tried: 'dismiss',\n what: (facts) => missingKeys(facts),\n then: () => [' as not needed'],\n },\n 'missing.restore': { did: 'restored', tried: 'restore', what: (facts) => missingKeys(facts), then: () => [' to the missing keys'] },\n 'secret.reference': { did: 'made', tried: 'make', what: ({ entry }) => referenceTo(entry) },\n 'reference.create': { did: 'made', tried: 'make', what: ({ entry }) => referenceTo(entry) },\n 'reference.end': {\n did: ({ entry }) => (entry.metadata.reason === 'replaced' ? 'gave a value of its own to' : entry.metadata.reason === 'abandoned' ? 'abandoned' : 'broke'),\n tried: ({ entry }) => (entry.metadata.reason === 'replaced' ? 'replace' : entry.metadata.reason === 'abandoned' ? 'abandon' : 'break'),\n what: ({ entry }) => {\n const source = text((entry.metadata.source as { path?: unknown } | undefined)?.path);\n const holder = text(entry.metadata.subject);\n if (entry.metadata.reason === 'replaced') return [...(holder === null ? ['a reference'] : [{ place: holder }]), ...(source === null ? [] : [', no longer a reference to ', { place: source }])];\n return ['the reference ', ...(holder === null ? [] : [{ place: holder }]), ...(source === null ? [] : [' to ', { place: source }])];\n },\n then: ({ entry }) => (entry.metadata.reason === 'abandoned' ? [', which its write never stored'] : []),\n },\n 'secret.unarchive': { did: 'brought back', tried: 'bring back', what: (facts) => place(facts.entry) },\n 'secret.move': { did: 'moved', tried: 'move', what: (facts) => place(facts.entry), then: ({ entry }) => intoFolder(entry) },\n ...placeTemplates('project'),\n 'project.move': {\n did: 'moved',\n tried: 'move',\n what: ({ entry }) => ['project ', ...place({ ...entry, environment: null, key: null })],\n then: ({ entry }) => intoFolder(entry),\n },\n ...placeTemplates('environment'),\n 'environment.fork': {\n did: 'forked',\n tried: 'fork',\n what: ({ entry }) => [...environmentOf(entry), ...(text(entry.metadata.slug) === null ? [] : [` into ${text(entry.metadata.slug)}`])],\n },\n 'access.grant': {\n did: 'gave',\n tried: 'give',\n what: ({ entry }) => [...subject(entry), ` ${text(entry.metadata.role) ?? 'a role'} on `, ...placeOnly(entry)],\n then: ({ entry }) => [\n ...(text(entry.metadata.previousRole) === null ? [] : [`, was ${text(entry.metadata.previousRole)}`]),\n ...(text(entry.metadata.expiresAt) === null ? [] : [`, until ${text(entry.metadata.expiresAt)!.slice(0, 10)}`]),\n ...(entry.metadata.reason === 'every-project' ? [', for a grant on every project'] : []),\n ],\n },\n 'access.revoke': {\n did: 'took',\n tried: 'take',\n what: ({ entry }) => [\n ...(text(entry.metadata.previousRole ?? entry.metadata.role) === null ? ['access to '] : [`${text(entry.metadata.previousRole ?? entry.metadata.role)} on `]),\n ...placeOnly(entry),\n ' from ',\n ...subject(entry),\n ],\n // The vault replacing a grant on every project of 0.4: by what, an instance role or project grants.\n then: ({ entry }) => {\n const by = entry.metadata.replacedBy as { role?: unknown } | undefined;\n if (by === undefined) return [];\n const role = typeof by.role === 'string' ? roleName(by.role) : null;\n return [role === null || role === 'Member' ? ', replaced by project grants' : `, replaced by the instance role ${role}`];\n },\n },\n 'member.add': {\n did: 'added',\n tried: 'add',\n what: ({ entry }) => [\n ...subject(entry),\n ...(entry.metadata.rootAdmin === true ? [' as a root admin'] : entry.metadata.owner === true ? [' as an owner'] : asRole(entry)),\n ],\n then: ({ entry }) => owned(entry),\n },\n 'member.remove': {\n did: 'removed',\n tried: 'remove',\n what: (facts) => subject(facts.entry),\n then: ({ entry }) => (number(entry.metadata.revoked) === null ? [] : [`, who held ${plural(number(entry.metadata.revoked)!, 'grant')}`]),\n },\n 'member.restore': {\n did: 'brought back',\n tried: 'bring back',\n what: ({ entry }) => [...subject(entry), ...asRole(entry)],\n then: ({ entry }) => owned(entry),\n },\n 'member.role': {\n did: 'made',\n tried: 'make',\n what: ({ entry }) => [...subject(entry), ` ${article(roleName(text(entry.metadata.role) ?? 'member') ?? 'Member')}`, ...scoped(entry)],\n then: ({ entry }) => {\n const before = roleName(text(entry.metadata.previousRole) ?? '');\n return [\n ...(before === null ? [] : [`, was ${before}`]),\n ...(entry.metadata.reason === 'every-project' ? [', for their grants on every project'] : []),\n ...owned(entry),\n ];\n },\n },\n 'member.owner': {\n did: ({ entry }) => (entry.metadata.owner === false ? 'took owner from' : 'made'),\n tried: ({ entry }) => (entry.metadata.owner === false ? 'take owner from' : 'make'),\n what: ({ entry }) => [...subject(entry), ...(entry.metadata.owner === false ? [] : [' an owner'])],\n },\n // Where people set up service accounts themselves, which those who run the instance set.\n 'settings.change': {\n did: 'set',\n tried: 'set',\n what: ({ entry }) => ['where people set up service accounts', ...setting(entry.metadata.serviceAccounts).map((words) => `: ${words}`)],\n then: ({ entry }) => {\n const previous = (entry.metadata.previous as { serviceAccounts?: unknown } | undefined)?.serviceAccounts;\n return setting(previous).map((words) => `, was ${words}`);\n },\n },\n // A binding trusts CI runs to sign in as a service; removing one is its tombstone.\n 'token.bind': {\n did: 'trusted CI runs to sign in as',\n tried: 'trust CI runs to sign in as',\n what: (facts) => subject(facts.entry),\n then: ({ entry }) => [...inGitHubEnvironment(entry), ...reaching(entry)],\n },\n // The tokens and bindings 0.4 made, given their own scope when 0.5 first checked a credential: what their account held then.\n 'token.seal': {\n did: 'sealed',\n tried: 'seal',\n what: ({ entry }) => [`${sealedOf(entry)} of `, ...subject(entry)],\n then: ({ entry }) => reaching(entry, ', reaching nothing'),\n },\n 'token.unbind': {\n did: 'stopped trusting CI runs to sign in as',\n tried: 'stop trusting CI runs to sign in as',\n what: (facts) => subject(facts.entry),\n },\n 'vault.tampered': {\n did: 'found',\n tried: 'check',\n what: ({ entry }) => [\n ...(entry.subject === null ? ['an entry'] : [...subject(entry), \"'s record\"]),\n ` tampered with: ${TAMPERING[entry.reason ?? ''] ?? 'it fails its seal'}`,\n ],\n },\n 'key.rotate': { did: 'rotated its key', tried: 'rotate its key', what: () => [] },\n // An MCP client a person connected, such as Claude: named as the consent page showed it.\n 'mcp.connect': { did: 'connected', tried: 'connect', what: ({ entry }) => app(entry) },\n // A tool an MCP client called, by its name, and the places it named.\n 'mcp.call': { did: 'used', tried: 'use', what: ({ entry }) => tool(entry), then: ({ entry }) => via(entry) },\n // A person's decision, on coffre's page, on a change an MCP client asked for; the change's own entries follow, via the client.\n 'mcp.approve': { did: 'approved', tried: 'approve', what: ({ entry }) => tool(entry), then: ({ entry }) => [` for ${text(entry.metadata.clientName) ?? 'an app'}`] },\n 'mcp.deny': { did: 'turned down', tried: 'turn down', what: ({ entry }) => tool(entry), then: ({ entry }) => [` for ${text(entry.metadata.clientName) ?? 'an app'}`] },\n 'mcp.view': { did: 'opened an approval', tried: 'open an approval', what: () => [] },\n // The app's prompt declined, which cancels the approval it would have opened.\n 'mcp.cancel': { did: 'cancelled', tried: 'cancel', what: ({ entry }) => tool(entry), then: ({ entry }) => via(entry) },\n 'mcp.disconnect': {\n did: 'disconnected',\n tried: 'disconnect',\n what: ({ entry }) => [...app(entry), ...(entry.metadata.principalId === undefined ? [] : [' of ', ...subject(entry)])],\n then: ({ entry }) => [DISCONNECTED[text(entry.metadata.reason) ?? ''] ?? ''],\n },\n\n // Detail, hidden unless asked for.\n sign_in: {\n did: ({ entry }) => (entry.metadata.kind === 'cli' ? 'signed in to the CLI' : 'signed in'),\n tried: 'sign in',\n what: ({ entry }) => (text(entry.metadata.provider) === null ? [] : [`with ${text(entry.metadata.provider)}`]),\n },\n sign_out: { did: 'signed out', tried: 'sign out', what: () => [] },\n 'token.create': { did: 'issued a bearer token to', tried: 'issue a bearer token to', what: (facts) => subject(facts.entry), then: ({ entry }) => reaching(entry) },\n 'token.revoke': { did: 'revoked a bearer token of', tried: 'revoke a bearer token of', what: (facts) => subject(facts.entry) },\n 'device.approve': { did: 'approved a CLI sign-in', tried: 'approve a CLI sign-in', what: () => [] },\n 'device.deny': { did: 'turned down a CLI sign-in', tried: 'turn down a CLI sign-in', what: () => [] },\n 'mcp.read': { did: 'used', tried: 'use', what: ({ entry }) => tool(entry), then: ({ entry }) => via(entry) },\n 'mcp.token': {\n did: ({ entry }) => (entry.metadata.grant === 'refresh_token' ? 'refreshed the tokens of' : 'gave its first tokens to'),\n tried: 'give tokens to',\n what: ({ entry }) => app(entry),\n },\n 'account.link': {\n did: 'linked',\n tried: 'link',\n what: ({ entry }) => [`a ${text(entry.metadata.provider) ?? 'sign-in'} account`],\n },\n 'account.unlink': {\n did: 'unlinked',\n tried: 'unlink',\n what: ({ entry }) => [`a ${text(entry.metadata.provider) ?? 'sign-in'} account`],\n },\n 'key.wrap': { did: 'sealed the key of', tried: 'seal the key of', what: (facts) => versioned(facts.entry) },\n 'key.rewrap': { did: 'resealed the key of', tried: 'reseal the key of', what: (facts) => versioned(facts.entry) },\n 'key.intent': { did: 'asked KMS about', tried: 'ask KMS about', what: (facts) => secrets(facts) },\n 'key.check': {\n did: 'recorded the check value of',\n tried: 'check',\n what: ({ entry }) => [['the', text(entry.metadata.kekProvider) === 'local' ? null : text(entry.metadata.kekProvider), 'vault key', text(entry.metadata.kekId)].filter((word) => word !== null).join(' ')],\n },\n 'audit.heartbeat': { did: 'checked in', tried: 'check in', what: () => [] },\n 'audit.checkpoint': {\n did: 'signed the log',\n tried: 'sign the log',\n what: ({ entry }) => (number(entry.metadata.seq) === null ? [] : [`through entry ${number(entry.metadata.seq)}`]),\n },\n\n // Only ever refused: a read of a list, which is not logged when allowed.\n 'secret.list': { did: 'listed', tried: 'list', what: ({ entry }) => environmentOf(entry) },\n 'secret.history': { did: 'read the history of', tried: 'read the history of', what: (facts) => place(facts.entry) },\n 'secret.update': { did: 'changed', tried: 'change', what: (facts) => place(facts.entry) },\n};\n\n/** \" to the folder stripe\", or \" out of its folder\". */\nfunction intoFolder(entry: AuditEntry): Part[] {\n const folder = text(entry.metadata.to);\n return [folder === null ? ' out of its folder' : ` to the folder ${folder}`];\n}\n\n/** An instance role's name, from its slug; null for none it knows. */\nfunction roleName(role: string): string | null {\n return isInstanceRole(role) ? INSTANCE_ROLES[role].name : null;\n}\n\nfunction article(name: string): string {\n return `${/^[AEIOU]/.test(name) ? 'an' : 'a'} ${name}`;\n}\n\n/** Whether an entry's scope narrows the role; its projects are ids, which a sentence cannot name. */\nfunction scoped(entry: AuditEntry): Part[] {\n const scope = entry.metadata.scope as { projects?: unknown; environments?: unknown } | undefined;\n return scope === undefined || (scope.projects === 'all' && scope.environments === 'all') ? [] : [', with a scope'];\n}\n\n/**\n * What a token or binding reaches, its scope, each role with the places it\n * holds, counted, as the log names them by id: `, reaching developer on 2 places`.\n */\nfunction reaching(entry: AuditEntry, none = ''): Part[] {\n const scope = entry.metadata.scope;\n if (!Array.isArray(scope)) return [];\n if (scope.length === 0) return none === '' ? [] : [none];\n const byRole = new Map<string, number>();\n for (const grant of scope as { role?: unknown }[]) {\n const role = text(grant.role);\n if (role !== null) byRole.set(role, (byRole.get(role) ?? 0) + 1);\n }\n return [`, reaching ${[...byRole].map(([role, count]) => `${role} on ${plural(count, 'place')}`).join(', ')}`];\n}\n\n/** The GitHub environment a binding takes its runs from, when it names one. */\nfunction inGitHubEnvironment(entry: AuditEntry): Part[] {\n const environment = text((entry.metadata.claims as Record<string, unknown> | undefined)?.environment);\n return environment === null || !String(entry.metadata.profile).startsWith('github') ? [] : [`, in GitHub environment ${environment}`];\n}\n\n/** The tokens and trust bindings a `token.seal` names, counted: `2 tokens and a trust binding`. */\nfunction sealedOf(entry: AuditEntry): string {\n const count = (key: string) => (Array.isArray(entry.metadata[key]) ? (entry.metadata[key] as unknown[]).length : 0);\n const parts = [[count('tokens'), 'token'], [count('bindings'), 'trust binding']] as const;\n return parts.filter(([n]) => n > 0).map(([n, one]) => plural(n, one)).join(' and ') || 'nothing';\n}\n\n/**\n * The setting of where people set up service accounts, in words: its\n * projects counted, as the log names them by id, its environments by name.\n *\n * All projects · all but prod 2 projects · dev only\n */\nfunction setting(scope: unknown): string[] {\n if (!isScope(scope)) return [];\n const { projects } = scope;\n const counted: Scope = projects === 'all'\n ? scope\n : { ...scope, projects: 'only' in projects ? { only: [plural(projects.only.length, 'project')] } : { except: [plural(projects.except.length, 'project')] } };\n return [scopeInWords(counted)];\n}\n\n/** The role a member is added or brought back with, said when it is more than Member. */\nfunction asRole(entry: AuditEntry): Part[] {\n const role = roleName(text(entry.metadata.role) ?? '');\n return role === null || role === 'Member' ? [] : [` as ${article(role)}`, ...scoped(entry)];\n}\n\nfunction placeOnly(entry: AuditEntry): Part[] {\n // A grant on every project names no project: its place is a path in its payload, `*` or `*/dev`.\n const everywhere = entry.project === null ? text(entry.metadata.place) : null;\n if (everywhere !== null) return [everywhere === '*' ? 'every project' : `${everywhere.slice('*/'.length)} in every project`];\n return place({ ...entry, key: null });\n}\n\nfunction versioned(entry: AuditEntry): Part[] {\n return [...place(entry), ...(entry.version === null ? [] : [`, version ${entry.version}`])];\n}\n\nconst TAMPERING: Record<string, string> = {\n mac: \"it does not carry the vault's seal\",\n stale: 'an older copy was put back',\n forged_entry: 'the vault did not write it',\n};\n\n/** Why something was refused, in words. Codes from the vault and the app. */\nconst REASONS: Record<string, string> = {\n no_grant: 'no grant',\n bulk_limit: 'bulk limit',\n expired: 'grant expired',\n removed: 'removed from coffre',\n not_a_member: 'not a member',\n not_registered: 'not invited',\n tampered: 'their record was tampered with',\n bad_claim: 'the key did not match the secret',\n deleted: 'the place was deleted',\n not_allowed: 'not allowed',\n root_admin: 'root admins are set by the deployment',\n last_owner: 'they are the last Owner of the whole instance',\n requires_instance_admin: 'requires an admin or owner of the whole instance',\n requires_instance_owner: 'requires an instance owner',\n own_role: 'nobody changes their own role',\n own_grant: 'nobody grants themselves a role',\n service_cannot_hold_role: 'service accounts hold project grants only',\n not_service_manager: 'they hold less than the service account, or than they gave it',\n unknown_environment: 'no such environment',\n unknown_secret: 'no such secret',\n no_value: 'it holds no value',\n unknown_project: 'no such project',\n not_archived: 'it was not archived',\n referenced: 'references read it',\n kms_unavailable: 'KMS did not answer',\n wrong_kek: \"the vault's key is not the one that wrapped the data\",\n person_denied: 'they said no',\n too_many_connections: 'too many connected apps',\n unknown_connection: 'no such connected app',\n not_yours: \"it was someone else's\",\n too_many_approvals: 'too many changes waiting for approval',\n request_state: 'its retry did not match its call',\n changed: 'the change was not the one shown',\n replaced: 'what it replaces changed since it was shown',\n unconfirmed: 'what it replaces could not be read',\n disconnected: 'the app was disconnected',\n};\n\n/** What a missing permission meant, from the app's `missing_<permission>`. */\nconst MISSING: Record<string, string> = {\n secret_read: 'no grant to read it',\n secret_write: 'no grant to write',\n secret_archive: 'no grant to archive',\n audit_read: 'no grant to read the audit log',\n environment_manage: 'no grant to manage environments',\n grant_manage: 'no grant to manage access',\n project_manage: 'no grant to manage the project',\n};\n\nexport function reasonInWords(reason: string | null): string {\n if (reason === null) return 'refused';\n if (reason.startsWith('missing_')) return MISSING[reason.slice('missing_'.length)] ?? 'no grant';\n return REASONS[reason] ?? reason.replace(/_/g, ' ');\n}\n\n// --- lines ----------------------------------------------------------------------\n\n/** In a batch of mixed actions, the one the line is named for: a write, not its reads. */\nconst LEAD = ['secret.write', 'secret.read'];\n\nexport function leadOf(batch: AuditEntry[]): AuditEntry {\n for (const action of LEAD) {\n const found = batch.find((entry) => entry.action === action);\n if (found !== undefined) return found;\n }\n return batch[0]!;\n}\n\n/** What a line says: one entry, or a batch that shares an operation. */\nexport function describe(batch: AuditEntry[]): Sentence {\n const entry = leadOf(batch);\n const same = batch.filter((other) => other.action === entry.action);\n const denied = same.filter((other) => other.decision === 'deny');\n const refused = denied.length === same.length;\n const facts: Facts = {\n entry,\n batch: same,\n count: new Set(same.map((other) => `${other.project}/${other.environment}/${other.key}`)).size,\n refused,\n };\n const template = TEMPLATES[entry.action];\n if (template === undefined) return { parts: [entry.action, ' ', ...place(entry)], refused };\n const say = (verb: Template['did']) => (typeof verb === 'string' ? verb : verb(facts));\n const what = template.what(facts);\n const gap = what.length === 0 ? [] : [' '];\n if (refused) {\n const reason = reasonInWords((denied[0] ?? entry).reason);\n return { parts: ['tried to ', say(template.tried), ...gap, ...what, `: ${reason}`], refused };\n }\n const partly = denied.length === 0 ? [] : [`, ${denied.length} refused: ${reasonInWords(denied[0]!.reason)}`];\n return { parts: [say(template.did), ...gap, ...what, ...(template.then?.(facts) ?? []), ...partly], refused };\n}\n\n/** Who acted, as a part: a member links to their page; coffre itself is text. */\nexport function who(entry: Pick<AuditEntry, 'actorType' | 'actorId'>): string | { member: string } {\n if (entry.actorType === 'user') return { member: `user:${entry.actorId}` };\n if (entry.actorType === 'service') return { member: `token:${entry.actorId}` };\n return SYSTEM[entry.actorId] ?? entry.actorId;\n}\n\nconst SYSTEM: Record<string, string> = {\n scheduler: 'the scheduler',\n cron: 'the scheduler',\n vault: 'the vault',\n app: 'coffre',\n};\n\n/** Which components wrote the line, the vault first: \"vault\", \"app\", \"vault, app\". */\nexport function decidedBy(batch: Pick<AuditEntry, 'author'>[]): string {\n return (['vault', 'app'] as const).filter((author) => batch.some((entry) => entry.author === author)).join(', ');\n}\n\n/**\n * Entries in the order the page shows them, newest first, each batch as one\n * line at its newest entry. The server leaves detail out unless asked.\n */\nexport function lines<T extends AuditEntry>(entries: T[]): T[][] {\n const shown: T[][] = [];\n const batches = new Map<string, T[]>();\n for (const entry of entries) {\n const batch = entry.operationId === null ? undefined : batches.get(entry.operationId);\n if (batch !== undefined) {\n batch.push(entry);\n continue;\n }\n const fresh = [entry];\n if (entry.operationId !== null) batches.set(entry.operationId, fresh);\n shown.push(fresh);\n }\n return shown;\n}\n\n/** A sentence as text. */\nexport function plain(parts: Part[]): string {\n return parts\n .map((part) =>\n typeof part === 'string' ? part : 'place' in part ? part.place : part.member.startsWith('user:') ? part.member.slice(5) : shownMember(part.member),\n )\n .join('');\n}\n\n/**\n * The CI run an entry was written for, as its issuer stated it at the\n * exchange: `acme/api run 7001 at 3f2a9c1`, a GitLab pipeline, or the\n * token's subject. Null for an entry no trust binding's credential wrote.\n */\nexport function runLabel(run: { claims: Record<string, string | number> } | null): string | null {\n if (run === null) return null;\n const { claims } = run;\n const text = (name: string) => (typeof claims[name] === 'string' || typeof claims[name] === 'number' ? String(claims[name]) : null);\n const at = text('sha') === null ? '' : ` at ${text('sha')!.slice(0, 7)}`;\n if (text('repository') !== null && text('run_id') !== null) return `${text('repository')} run ${text('run_id')}${at}`;\n if (text('project_path') !== null && text('pipeline_id') !== null) return `${text('project_path')} pipeline ${text('pipeline_id')}${at}`;\n return text('sub') === null ? 'a CI run' : `CI run ${text('sub')}`;\n}\n","import { serviceName, shownMember } from '@coffre/client';\nimport { Fragment } from 'react';\nimport { Link } from '@tanstack/react-router';\nimport type { Part } from '../lib/audit-sentences';\nimport { breakAfterUnderscores } from './ui';\n\n/** A sentence, its people and places links to their pages. */\nexport function Sentence({ parts }: { parts: Part[] }) {\n return (\n <>\n {parts.map((part, index) => (\n <Fragment key={index}>\n {typeof part === 'string' ? (\n part\n ) : 'place' in part ? (\n <PlaceLink path={part.place} />\n ) : (\n <MemberLink member={part.member} />\n )}\n </Fragment>\n ))}\n </>\n );\n}\n\nfunction PlaceLink({ path }: { path: string }) {\n const [project, environment] = path.split('/') as [string, string | undefined];\n const text = <span className=\"mono\">{breakAfterUnderscores(path)}</span>;\n return environment === undefined ? (\n <Link to=\"/projects/$project\" params={{ project }}>\n {text}\n </Link>\n ) : (\n <Link to=\"/projects/$project/$environment\" params={{ project, environment }}>\n {text}\n </Link>\n );\n}\n\n/** A member from the log, which keeps `token:<name>`, shown as people read it: `service:<name>`, to its page. */\nfunction MemberLink({ member }: { member: string }) {\n return member.startsWith('token:') ? (\n <Link to=\"/service-accounts/$account\" params={{ account: serviceName(member) }}>\n {shownMember(member)}\n </Link>\n ) : (\n <Link to=\"/users/$user\" params={{ user: memberName(member) }}>\n {memberName(member)}\n </Link>\n );\n}\n\nexport function memberName(member: string): string {\n return member.startsWith('user:') ? member.slice('user:'.length) : shownMember(member);\n}\n"],"mappings":";;;;;;;AAgEA,IAAM,QAAQ,UAAmC,OAAO,UAAU,YAAY,UAAU,KAAK,QAAQ;AACrG,IAAM,UAAU,UAAmC,OAAO,UAAU,WAAW,QAAQ;;AAGvF,SAAS,MAAM,EAAE,SAAS,aAAa,OAA2B;CAChE,MAAM,OAAO;EAAC;EAAS;EAAa;CAAG,CAAC,CAAC,QAAQ,SAAyB,SAAS,IAAI;CACvF,OAAO,KAAK,WAAW,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,OAAO,KAAK,KAAK,GAAG,EAAE,CAAC;AACpE;AAEA,SAAS,cAAc,EAAE,SAAS,eAAmC;CACnE,OAAO,MAAM;EAAE;EAAS;EAAa,KAAK;CAAK,CAAe;AAChE;;AAGA,SAAS,QAAQ,OAA2B;CAC1C,IAAI,MAAM,YAAY,MAAM,OAAO,CAAC,EAAE,QAAQ,MAAM,QAAQ,CAAC;CAC7D,MAAM,KAAK,KAAK,MAAM,SAAS,WAAW;CAC1C,IAAI,OAAO,MAAM,OAAO,CAAC,SAAS;CAClC,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,SAAS,kBAAkB,YAAY,UAAU,OAAO,GAAG,KAAK,CAAC;AAC9F;;AAGA,SAAS,MAAM,OAA2B;CACxC,OAAO,MAAM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AAM,OAAO,aAAa,UAAU,KAAK,KAAK;AACjE;;;;AC5pBA,SAAgB,SAAS,EAAE,SAA4B;CACrD,OACE,oBAAA,YAAA,EAAA,UACG,MAAM,KAAK,MAAM,UAChB,oBAAC,UAAD,EAAA,UACG,OAAO,SAAS,WACf,OACE,WAAW,OACb,oBAAC,WAAD,EAAW,MAAM,KAAK,MAAQ,CAAA,IAE9B,oBAAC,YAAD,EAAY,QAAQ,KAAK,OAAS,CAAA,EAE5B,GARK,KAQL,CACX,EACD,CAAA;AAEN;AAEA,SAAS,UAAU,EAAE,QAA0B;CAC7C,MAAM,CAAC,SAAS,eAAe,KAAK,MAAM,GAAG;CAC7C,MAAM,OAAO,oBAAC,QAAD;EAAM,WAAU;YAAQ,sBAAsB,IAAI;CAAQ,CAAA;CACvE,OAAO,gBAAgB,KAAA,IACrB,oBAAC,MAAD;EAAM,IAAG;EAAqB,QAAQ,EAAE,QAAQ;YAC7C;CACG,CAAA,IAEN,oBAAC,MAAD;EAAM,IAAG;EAAkC,QAAQ;GAAE;GAAS;EAAY;YACvE;CACG,CAAA;AAEV;;AAGA,SAAS,WAAW,EAAE,UAA8B;CAClD,OAAO,OAAO,WAAW,QAAQ,IAC/B,oBAAC,MAAD;EAAM,IAAG;EAA6B,QAAQ,EAAE,SAAS,YAAY,MAAM,EAAE;YAC1E,YAAY,MAAM;CACf,CAAA,IAEN,oBAAC,MAAD;EAAM,IAAG;EAAe,QAAQ,EAAE,MAAM,WAAW,MAAM,EAAE;YACxD,WAAW,MAAM;CACd,CAAA;AAEV;AAEA,SAAgB,WAAW,QAAwB;CACjD,OAAO,OAAO,WAAW,OAAO,IAAI,OAAO,MAAM,CAAc,IAAI,YAAY,MAAM;AACvF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offboarding-Bt7KSixm.js","names":[],"sources":["../../src/components/offboarding.tsx"],"sourcesContent":["import { Link } from '@tanstack/react-router';\nimport { credentialScopeInWords } from '@coffre/core/access';\nimport type { PrincipalReport, RemovedPrincipal } from '../shared/models';\nimport { Card } from './page';\nimport { EmptyState, Notice, Timestamp } from './ui';\nimport { PrincipalLink } from './principal';\nimport { referenceProblem } from './references';\nimport { ChevronRight, Key, User } from './icons';\nimport { serviceName } from '@coffre/client';\n\n/**\n * The part of a user's or token's page that answers \"what do we change now\n * they have left?\". Owners only. Once someone is removed everything that let\n * them in is gone, but what they saw is not, nor tokens they issued.\n */\nexport function PrincipalReportCards({ report }: { report: PrincipalReport }) {\n const person = report.principalType === 'user';\n return (\n <>\n {report.status === 'removed' && <ConsiderRotating report={report} person={person} />}\n {report.issuedTokens.length > 0 && <IssuedTokens report={report} />}\n {report.references.length > 0 && <MadeReferences report={report} />}\n </>\n );\n}\n\nexport function RemovedNotice({ report }: { report: PrincipalReport }) {\n const person = report.principalType === 'user';\n return (\n <div className=\"report-notice\">\n <Notice>\n Removed\n {report.removedBy !== null && (\n <>\n {' '}by <span className=\"mono\">{report.removedBy}</span>\n </>\n )}\n {report.removedAt !== null && (\n <>\n {' '}on <Timestamp iso={report.removedAt} />\n </>\n )}\n .{' '}\n {person\n ? 'Their project access, sessions, CLI logins, linked sign-in accounts and connected apps were revoked, so adding them again starts from nothing.'\n : 'Its project access and every token issued to it were revoked, so adding it again starts from nothing.'}\n </Notice>\n </div>\n );\n}\n\n/**\n * The people or service accounts removed from the directory, under the live ones.\n * Removal ends their access but not the work it leaves, so they stay one click\n * away until every value they saw has been rotated.\n */\nexport function RemovedList({\n principalType,\n removed,\n}: {\n principalType: RemovedPrincipal['principalType'];\n removed: RemovedPrincipal[];\n}) {\n const users = principalType === 'user';\n const rows = removed.filter((principal) => principal.principalType === principalType);\n if (rows.length === 0) return null;\n return (\n <>\n <h2 className=\"section-title\">Removed</h2>\n <section className=\"card\" aria-label={users ? 'Removed users' : 'Removed service accounts'}>\n <div className=\"dt-wrap\">\n <table className=\"dt directory stacks\">\n <thead>\n <tr>\n <th className=\"n\">#</th>\n <th className=\"col-principal\">\n <span className=\"th\">\n {users ? <User size={14} /> : <Key size={14} />}\n {users ? 'Email' : 'Name'}\n </span>\n </th>\n <th className=\"col-role\">Consider rotating</th>\n <th className=\"col-actions\">\n <span className=\"visually-hidden\">Report</span>\n </th>\n </tr>\n </thead>\n <tbody>\n {rows.map((principal, index) => (\n <tr key={principal.principalId} className=\"row-link\">\n <td className=\"n\">{index + 1}</td>\n <td className=\"col-lead\" data-label={users ? 'Email' : 'Name'}>\n <PrincipalLink type={principal.principalType} id={principal.principalId} stretch />\n </td>\n <td className=\"col-role\" data-label=\"Consider rotating\">\n {principal.toRotate === 0 ? (\n <span className=\"cell-muted\">Nothing</span>\n ) : (\n `${principal.toRotate} ${principal.toRotate === 1 ? 'value' : 'values'}`\n )}\n </td>\n {/* The row opens the report; the chevron says it does. */}\n <td className=\"col-actions col-open cell-muted\" aria-hidden=\"true\">\n <ChevronRight size={16} />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </section>\n </>\n );\n}\n\n/** Values a removed member saw that nobody has changed since. */\nfunction ConsiderRotating({ report, person }: { report: PrincipalReport; person: boolean }) {\n const they = person ? 'they' : 'it';\n return (\n <Card\n labelledBy=\"seen-values\"\n title=\"Consider rotating\"\n description={`Values ${they} read or wrote that nobody has changed since. Rotate each at its source, such as a new API key or database password, then save the new value here.`}\n actions={\n report.rotated > 0 && (\n <span className=\"card-aside\">{report.rotated} already rotated</span>\n )\n }\n >\n {report.exposed.length === 0 ? (\n <EmptyState title=\"Nothing left to rotate\">\n {report.rotated > 0\n ? `Every value ${they} saw has had a new version since.`\n : `${person ? 'They have' : 'It has'} not read or written a value that is still current.`}\n </EmptyState>\n ) : (\n <div className=\"dt-wrap\">\n <table className=\"dt report-values\">\n <thead>\n <tr>\n <th>Secret</th>\n <th className=\"col-shrink\">Version</th>\n <th className=\"col-shrink\">Last seen</th>\n </tr>\n </thead>\n <tbody>\n {report.exposed.map((secret) => (\n <tr key={`${secret.project}/${secret.environment}/${secret.key}`}>\n <td>\n <Link\n className=\"cell-link mono\"\n to=\"/projects/$project/$environment\"\n params={{ project: secret.project, environment: secret.environment }}\n search={{ filter: secret.key }}\n >\n <span className=\"report-path\">\n {secret.project}/{secret.environment}/\n </span>\n {secret.key}\n </Link>\n </td>\n <td className=\"col-shrink cell-mono cell-muted\">v{secret.version}</td>\n <td className=\"col-shrink nowrap\">\n {secret.how === 'wrote' ? 'Wrote' : 'Read'}{' '}\n <Timestamp iso={secret.at} display=\"relative\" />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </Card>\n );\n}\n\n/**\n * References they made, as the log names them: each belongs to the\n * environment that holds it, like a value, not to them (D46), so their\n * leaving ends none. Listed to review.\n */\nfunction MadeReferences({ report }: { report: PrincipalReport }) {\n return (\n <Card\n labelledBy=\"made-references\"\n title=\"References they made\"\n description=\"These stay after they leave, and whoever reads a reference's environment reads its source through it. Review them: the source's access managers, or whoever writes where one is held, can break it.\"\n >\n <div className=\"dt-wrap\">\n <table className=\"dt stacks\">\n <thead>\n <tr>\n <th>Reference</th>\n <th>Reads</th>\n <th className=\"col-shrink\">Made</th>\n </tr>\n </thead>\n <tbody>\n {report.references.map((reference) => (\n <tr key={reference.id}>\n <td className=\"mono\" data-label=\"Reference\">{reference.holder}</td>\n <td data-label=\"Reads\">\n <span className=\"mono\">{reference.source}</span>\n {reference.state !== 'live' && <span className=\"cell-muted\"> · {referenceProblem(reference.state)}</span>}\n </td>\n <td className=\"col-shrink nowrap\" data-label=\"Made\">\n <Timestamp iso={reference.createdAt} display=\"relative\" />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </Card>\n );\n}\n\nfunction IssuedTokens({ report }: { report: PrincipalReport }) {\n return (\n <Card\n labelledBy=\"issued-tokens\"\n title=\"Bearer tokens they issued\"\n description=\"These still work, and they saw each one when it was issued. Revoke any they may have kept.\"\n >\n <div className=\"dt-wrap\">\n <table className=\"dt report-tokens\">\n <thead>\n <tr>\n <th>Token</th>\n <th className=\"col-shrink\">Expires</th>\n <th className=\"col-shrink col-hide-narrow\">Last used</th>\n </tr>\n </thead>\n <tbody>\n {report.issuedTokens.map((token) => (\n <tr key={token.id}>\n <td>\n <span className=\"cell-stack\">\n <Link className=\"cell-link mono\" to=\"/service-accounts/$account\" params={{ account: serviceName(token.service) }}>\n service:{serviceName(token.service)}\n </Link>\n <small>\n {token.label ?? 'No label'} · <span className=\"mono\">{token.hint}</span> · reaches{' '}\n {token.scope === null ? 'all its account holds' : credentialScopeInWords(token.scope)}\n </small>\n </span>\n </td>\n <td className=\"col-shrink nowrap\">\n <Timestamp iso={token.expiresAt} display=\"relative\" />\n </td>\n <td className=\"col-shrink col-hide-narrow nowrap\">\n {token.lastUsedAt === null ? (\n <span className=\"cell-muted\">Never</span>\n ) : (\n <Timestamp iso={token.lastUsedAt} display=\"relative\" />\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,qBAAqB,EAAE,UAAuC;CAC5E,MAAM,SAAS,OAAO,kBAAkB;CACxC,OACE,qBAAA,UAAA,EAAA,UAAA;EACG,OAAO,WAAW,aAAa,oBAAC,kBAAD;GAA0B;GAAgB;EAAS,CAAA;EAClF,OAAO,aAAa,SAAS,KAAK,oBAAC,cAAD,EAAsB,OAAS,CAAA;EACjE,OAAO,WAAW,SAAS,KAAK,oBAAC,gBAAD,EAAwB,OAAS,CAAA;CAClE,EAAA,CAAA;AAEN;AAEA,SAAgB,cAAc,EAAE,UAAuC;CACrE,MAAM,SAAS,OAAO,kBAAkB;CACxC,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,QAAD,EAAA,UAAA;GAAQ;GAEL,OAAO,cAAc,QACpB,qBAAA,UAAA,EAAA,UAAA;IACG;IAAI;IAAG,oBAAC,QAAD;KAAM,WAAU;eAAQ,OAAO;IAAgB,CAAA;GACvD,EAAA,CAAA;GAEH,OAAO,cAAc,QACpB,qBAAA,UAAA,EA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