@coffre/ui 0.3.0 → 0.4.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-BhHmvQX_.js +660 -0
- package/dist/chunks/audit-sentence-BhHmvQX_.js.map +1 -0
- package/dist/chunks/delete-place-CRX7ntE8.js +206 -0
- package/dist/chunks/delete-place-CRX7ntE8.js.map +1 -0
- package/dist/chunks/{directory-CSjWWUQ1.js → directory-zr3ek7Mc.js} +175 -60
- package/dist/chunks/directory-zr3ek7Mc.js.map +1 -0
- package/dist/chunks/folders-DoBmCwOi.js +207 -0
- package/dist/chunks/folders-DoBmCwOi.js.map +1 -0
- package/dist/chunks/grants-Cw1FyGID.js +669 -0
- package/dist/chunks/grants-Cw1FyGID.js.map +1 -0
- package/dist/chunks/offboarding-CE6d7um1.js +305 -0
- package/dist/chunks/offboarding-CE6d7um1.js.map +1 -0
- package/dist/chunks/one-time-DXEl9hbg.js +35 -0
- package/dist/chunks/one-time-DXEl9hbg.js.map +1 -0
- package/dist/chunks/page-DvsgZ2Hd.js +391 -0
- package/dist/chunks/page-DvsgZ2Hd.js.map +1 -0
- package/dist/chunks/principal-BIN-xwZw.js +42 -0
- package/dist/chunks/principal-BIN-xwZw.js.map +1 -0
- package/dist/chunks/{principal-page-D_91OA0l.js → principal-page-DhjO76GH.js} +245 -251
- package/dist/chunks/principal-page-DhjO76GH.js.map +1 -0
- package/dist/chunks/project-page-SRCtRe2g.js +17 -0
- package/dist/chunks/project-page-SRCtRe2g.js.map +1 -0
- package/dist/chunks/{queries-CQ81o4so.js → queries-DVR_i3rA.js} +132 -30
- package/dist/chunks/queries-DVR_i3rA.js.map +1 -0
- package/dist/chunks/references-B6pLT1uQ.js +343 -0
- package/dist/chunks/references-B6pLT1uQ.js.map +1 -0
- package/dist/chunks/{row-state-0PsrEzOL.js → row-state-DOPUsjQK.js} +3 -3
- package/dist/chunks/{row-state-0PsrEzOL.js.map → row-state-DOPUsjQK.js.map} +1 -1
- package/dist/chunks/signin-errors--ykMFuqN.js +57 -0
- package/dist/chunks/signin-errors--ykMFuqN.js.map +1 -0
- package/dist/chunks/tabs-BmwKfUeK.js +22 -0
- package/dist/chunks/tabs-BmwKfUeK.js.map +1 -0
- package/dist/chunks/{theme-B2vQolVR.js → theme-DJuz-xLM.js} +3 -3
- package/dist/chunks/{theme-B2vQolVR.js.map → theme-DJuz-xLM.js.map} +1 -1
- package/dist/chunks/{ui-DixXLQvQ.js → ui-DJje3gST.js} +6 -3
- package/dist/chunks/ui-DJje3gST.js.map +1 -0
- package/dist/chunks/{use-change-c6CeLRin.js → use-change-DUiGO19U.js} +52 -21
- package/dist/chunks/use-change-DUiGO19U.js.map +1 -0
- package/dist/chunks/{use-shell-jxd7Tzd-.js → use-shell-rNKfGjdj.js} +3 -3
- package/dist/chunks/{use-shell-jxd7Tzd-.js.map → use-shell-rNKfGjdj.js.map} +1 -1
- package/dist/chunks/validation-D312_NLf.js +87 -0
- package/dist/chunks/validation-D312_NLf.js.map +1 -0
- package/dist/index.d.ts +361 -27
- package/dist/index.js +188 -98
- package/dist/index.js.map +1 -1
- package/dist/pages/account.d.ts +2 -2
- package/dist/pages/account.js +297 -135
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/approval.d.ts +9 -0
- package/dist/pages/approval.js +207 -0
- package/dist/pages/approval.js.map +1 -0
- package/dist/pages/audit.js +17 -542
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/device-login.js +2 -3
- package/dist/pages/device-login.js.map +1 -1
- package/dist/pages/environment.js +647 -257
- package/dist/pages/environment.js.map +1 -1
- package/dist/pages/login.js +18 -7
- package/dist/pages/login.js.map +1 -1
- package/dist/pages/oauth-authorize.d.ts +10 -0
- package/dist/pages/oauth-authorize.js +249 -0
- package/dist/pages/oauth-authorize.js.map +1 -0
- package/dist/pages/project-access.d.ts +6 -0
- package/dist/pages/project-access.js +370 -0
- package/dist/pages/project-access.js.map +1 -0
- package/dist/pages/project-environments.d.ts +4 -0
- package/dist/pages/project-environments.js +593 -0
- package/dist/pages/project-environments.js.map +1 -0
- package/dist/pages/project-settings.d.ts +4 -0
- package/dist/pages/project-settings.js +242 -0
- package/dist/pages/project-settings.js.map +1 -0
- package/dist/pages/project.d.ts +10 -2
- package/dist/pages/project.js +57 -934
- package/dist/pages/project.js.map +1 -1
- package/dist/pages/projects.js +53 -21
- package/dist/pages/projects.js.map +1 -1
- package/dist/pages/service-account.d.ts +10 -0
- package/dist/pages/{token.js → service-account.js} +112 -54
- package/dist/pages/service-account.js.map +1 -0
- package/dist/pages/service-accounts.d.ts +3 -0
- package/dist/pages/service-accounts.js +38 -0
- package/dist/pages/service-accounts.js.map +1 -0
- package/dist/pages/settings.d.ts +1 -0
- package/dist/pages/settings.js +104 -42
- package/dist/pages/settings.js.map +1 -1
- package/dist/pages/unregistered.js +2 -3
- package/dist/pages/unregistered.js.map +1 -1
- package/dist/pages/user.d.ts +6 -1
- package/dist/pages/user.js +18 -6
- package/dist/pages/user.js.map +1 -1
- package/dist/pages/users.js +6 -10
- package/dist/pages/users.js.map +1 -1
- package/package.json +3 -3
- package/src/components/actions-log.tsx +117 -0
- package/src/components/audit-sentence.tsx +55 -0
- package/src/components/command-palette.tsx +4 -4
- package/src/components/delete-place.tsx +180 -0
- package/src/components/directory.tsx +259 -110
- package/src/components/every-project.tsx +287 -0
- package/src/components/expiry-field.tsx +42 -0
- package/src/components/folders.tsx +219 -0
- package/src/components/grants.tsx +11 -4
- package/src/components/icons.tsx +2 -0
- package/src/components/missing.tsx +110 -0
- package/src/components/offboarding.tsx +61 -33
- package/src/components/page.tsx +4 -1
- package/src/components/principal-page.tsx +136 -106
- package/src/components/principal-picker.tsx +5 -5
- package/src/components/principal.tsx +4 -4
- package/src/components/references.tsx +323 -0
- package/src/components/service-tokens.tsx +112 -93
- package/src/components/shell.tsx +11 -32
- package/src/components/tabs.tsx +18 -0
- package/src/components/trusted-workloads.tsx +97 -79
- package/src/components/ui.tsx +8 -1
- package/src/index.ts +13 -2
- package/src/layout.tsx +2 -2
- package/src/lib/access-plan.ts +2 -2
- package/src/lib/audit-sentences.ts +161 -77
- package/src/lib/changes.ts +56 -5
- package/src/lib/coffre.ts +3 -2
- package/src/lib/one-time.ts +32 -0
- package/src/lib/project-access.ts +11 -23
- package/src/lib/project-page.ts +14 -0
- package/src/lib/queries.ts +126 -32
- package/src/lib/search.ts +25 -0
- package/src/lib/signin-errors.ts +45 -1
- package/src/lib/validation.ts +14 -0
- package/src/options.ts +187 -35
- package/src/pages/account.tsx +274 -129
- package/src/pages/approval.tsx +197 -0
- package/src/pages/audit.tsx +9 -61
- package/src/pages/environment.tsx +585 -286
- package/src/pages/login.tsx +8 -2
- package/src/pages/oauth-authorize.tsx +233 -0
- package/src/pages/project-access.tsx +219 -0
- package/src/pages/project-environments.tsx +582 -0
- package/src/pages/project-settings.tsx +259 -0
- package/src/pages/project.tsx +52 -879
- package/src/pages/projects.tsx +55 -18
- package/src/pages/service-account.tsx +50 -0
- package/src/pages/{tokens.tsx → service-accounts.tsx} +9 -6
- package/src/pages/settings.tsx +62 -8
- package/src/pages/user.tsx +16 -4
- package/src/pages/users.tsx +2 -2
- package/src/parity.ts +160 -0
- package/src/register.ts +58 -9
- package/src/router.tsx +4 -0
- package/src/shared/models.ts +6 -2
- package/src/styles/globals.css +536 -31
- package/dist/chunks/directory-CSjWWUQ1.js.map +0 -1
- package/dist/chunks/grants-saMQagmG.js +0 -160
- package/dist/chunks/grants-saMQagmG.js.map +0 -1
- package/dist/chunks/icons-D-PfAfnH.js +0 -203
- package/dist/chunks/icons-D-PfAfnH.js.map +0 -1
- package/dist/chunks/offboarding-C6l30DZR.js +0 -263
- package/dist/chunks/offboarding-C6l30DZR.js.map +0 -1
- package/dist/chunks/page-C5HcNqf2.js +0 -190
- package/dist/chunks/page-C5HcNqf2.js.map +0 -1
- package/dist/chunks/principal-page-D_91OA0l.js.map +0 -1
- package/dist/chunks/queries-CQ81o4so.js.map +0 -1
- package/dist/chunks/signin-errors-BEFlVDbQ.js +0 -30
- package/dist/chunks/signin-errors-BEFlVDbQ.js.map +0 -1
- package/dist/chunks/ui-DixXLQvQ.js.map +0 -1
- package/dist/chunks/use-action-CWsg_YWU.js +0 -49
- package/dist/chunks/use-action-CWsg_YWU.js.map +0 -1
- package/dist/chunks/use-change-c6CeLRin.js.map +0 -1
- package/dist/chunks/validation-BQtqPe2V.js +0 -29
- package/dist/chunks/validation-BQtqPe2V.js.map +0 -1
- package/dist/pages/token.d.ts +0 -3
- package/dist/pages/token.js.map +0 -1
- package/dist/pages/tokens.d.ts +0 -3
- package/dist/pages/tokens.js +0 -39
- package/dist/pages/tokens.js.map +0 -1
- package/dist/project-BqIy8gYR.d.ts +0 -5
- package/src/lib/instance.ts +0 -13
- package/src/pages/token.tsx +0 -34
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
import { useCoffre } from '../lib/coffre';
|
|
5
|
+
import { affects, queries } from '../lib/queries';
|
|
6
|
+
import { useAction } from '../lib/use-action';
|
|
7
|
+
import { Card } from './page';
|
|
8
|
+
import { ErrorLine, Timestamp } from './ui';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Keys the environment's siblings have and it lacks, of those you read
|
|
12
|
+
* (docs/design/environments.md): each with Add, which opens a new row with
|
|
13
|
+
* its name, and Dismiss, which the whole team then sees, and below them
|
|
14
|
+
* Dismiss all and what was dismissed, each with Restore. Nothing shows when
|
|
15
|
+
* nothing is missing or dismissed.
|
|
16
|
+
*/
|
|
17
|
+
export function MissingKeys({
|
|
18
|
+
project,
|
|
19
|
+
environment,
|
|
20
|
+
canWrite,
|
|
21
|
+
onAdd,
|
|
22
|
+
}: {
|
|
23
|
+
project: string;
|
|
24
|
+
environment: string;
|
|
25
|
+
canWrite: boolean;
|
|
26
|
+
/** Open a new row with this name, empty: its value is yours to give. */
|
|
27
|
+
onAdd: (key: string) => void;
|
|
28
|
+
}) {
|
|
29
|
+
const coffre = useCoffre();
|
|
30
|
+
const place = { project, environment };
|
|
31
|
+
const { data } = useQuery(queries.missing(coffre, place));
|
|
32
|
+
const { run, pending, error } = useAction();
|
|
33
|
+
const [showDismissed, setShowDismissed] = useState(false);
|
|
34
|
+
if (data?.ok !== true || (data.missing.length === 0 && data.dismissed.length === 0)) return null;
|
|
35
|
+
const { missing, dismissed } = data;
|
|
36
|
+
const path = `${project}/${environment}`;
|
|
37
|
+
const dismiss = (patch: Record<string, true | null>) => void run(() => coffre.environments.dismiss(path, patch), { affects: affects.secrets(place) });
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<Card
|
|
42
|
+
wide
|
|
43
|
+
labelledBy="missing-keys"
|
|
44
|
+
title={missing.length === 0 ? 'Nothing missing' : `${missing.length} ${missing.length === 1 ? 'key' : 'keys'} from other environments ${missing.length === 1 ? "isn't" : "aren't"} here`}
|
|
45
|
+
description="Compared with the environments you can read."
|
|
46
|
+
>
|
|
47
|
+
<div className="dt-wrap">
|
|
48
|
+
<table className="dt stacks missing-keys">
|
|
49
|
+
<tbody>
|
|
50
|
+
{missing.map((entry) => (
|
|
51
|
+
<tr key={entry.key}>
|
|
52
|
+
<td className="mono" data-label="Key">{entry.key}</td>
|
|
53
|
+
<td className="cell-muted" data-label="In">
|
|
54
|
+
In {entry.in.join(', ')}
|
|
55
|
+
{entry.folder !== null && <>, in {entry.folder}/</>}
|
|
56
|
+
</td>
|
|
57
|
+
{canWrite && (
|
|
58
|
+
<td className="col-actions">
|
|
59
|
+
<div className="acts">
|
|
60
|
+
<button type="button" className="btn btn-sm" onClick={() => onAdd(entry.key)}>
|
|
61
|
+
Add
|
|
62
|
+
</button>
|
|
63
|
+
<button type="button" className="btn btn-sm btn-quiet" disabled={pending} onClick={() => dismiss({ [entry.key]: true })}>
|
|
64
|
+
Dismiss
|
|
65
|
+
</button>
|
|
66
|
+
</div>
|
|
67
|
+
</td>
|
|
68
|
+
)}
|
|
69
|
+
</tr>
|
|
70
|
+
))}
|
|
71
|
+
{showDismissed && dismissed.length > 0 && (
|
|
72
|
+
<tr className="folder-row">
|
|
73
|
+
<th colSpan={canWrite ? 3 : 2} scope="rowgroup">Dismissed</th>
|
|
74
|
+
</tr>
|
|
75
|
+
)}
|
|
76
|
+
{showDismissed && dismissed.map((entry) => (
|
|
77
|
+
<tr key={`dismissed:${entry.key}`}>
|
|
78
|
+
<td className="mono" data-label="Key">{entry.key}</td>
|
|
79
|
+
<td className="cell-muted" data-label="Dismissed">
|
|
80
|
+
By {entry.dismissedBy} <Timestamp iso={entry.dismissedAt} display="relative" />; in {entry.in.join(', ')}
|
|
81
|
+
</td>
|
|
82
|
+
{canWrite && (
|
|
83
|
+
<td className="col-actions">
|
|
84
|
+
<button type="button" className="btn btn-sm" disabled={pending} onClick={() => dismiss({ [entry.key]: null })}>
|
|
85
|
+
Restore
|
|
86
|
+
</button>
|
|
87
|
+
</td>
|
|
88
|
+
)}
|
|
89
|
+
</tr>
|
|
90
|
+
))}
|
|
91
|
+
</tbody>
|
|
92
|
+
</table>
|
|
93
|
+
</div>
|
|
94
|
+
{error !== null && <ErrorLine error={error} />}
|
|
95
|
+
</Card>
|
|
96
|
+
<div className="table-actions">
|
|
97
|
+
{canWrite && missing.length > 1 && (
|
|
98
|
+
<button type="button" className="btn" disabled={pending} onClick={() => dismiss(Object.fromEntries(missing.map((entry) => [entry.key, true])))}>
|
|
99
|
+
Dismiss all
|
|
100
|
+
</button>
|
|
101
|
+
)}
|
|
102
|
+
{dismissed.length > 0 && (
|
|
103
|
+
<button type="button" className="btn btn-quiet" aria-expanded={showDismissed} onClick={() => setShowDismissed((open) => !open)}>
|
|
104
|
+
{showDismissed ? 'Hide dismissed' : `Dismissed (${dismissed.length})`}
|
|
105
|
+
</button>
|
|
106
|
+
)}
|
|
107
|
+
</div>
|
|
108
|
+
</>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -3,20 +3,22 @@ import type { PrincipalReport, RemovedPrincipal } from '../shared/models';
|
|
|
3
3
|
import { Card } from './page';
|
|
4
4
|
import { EmptyState, Notice, Timestamp } from './ui';
|
|
5
5
|
import { PrincipalLink } from './principal';
|
|
6
|
+
import { referenceProblem } from './references';
|
|
6
7
|
import { ChevronRight, Key, User } from './icons';
|
|
8
|
+
import { serviceName } from '@coffre/client';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
|
-
* The part of a user's or token's page that answers "
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
* The part of a user's or token's page that answers "what do we change now
|
|
12
|
+
* they have left?". Owners only. Once someone is removed everything that let
|
|
13
|
+
* them in is gone, but what they saw is not, nor tokens they issued.
|
|
12
14
|
*/
|
|
13
15
|
export function PrincipalReportCards({ report }: { report: PrincipalReport }) {
|
|
14
|
-
const removed = report.status === 'removed';
|
|
15
16
|
const person = report.principalType === 'user';
|
|
16
17
|
return (
|
|
17
18
|
<>
|
|
18
|
-
<
|
|
19
|
+
{report.status === 'removed' && <ConsiderRotating report={report} person={person} />}
|
|
19
20
|
{report.issuedTokens.length > 0 && <IssuedTokens report={report} />}
|
|
21
|
+
{report.references.length > 0 && <MadeReferences report={report} />}
|
|
20
22
|
</>
|
|
21
23
|
);
|
|
22
24
|
}
|
|
@@ -47,7 +49,7 @@ export function RemovedNotice({ report }: { report: PrincipalReport }) {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
|
-
* The people or
|
|
52
|
+
* The people or service accounts removed from the directory, under the live ones.
|
|
51
53
|
* Removal ends their access but not the work it leaves, so they stay one click
|
|
52
54
|
* away until every value they saw has been rotated.
|
|
53
55
|
*/
|
|
@@ -64,7 +66,7 @@ export function RemovedList({
|
|
|
64
66
|
return (
|
|
65
67
|
<>
|
|
66
68
|
<h2 className="section-title">Removed</h2>
|
|
67
|
-
<section className="card" aria-label={users ? 'Removed users' : 'Removed
|
|
69
|
+
<section className="card" aria-label={users ? 'Removed users' : 'Removed service accounts'}>
|
|
68
70
|
<div className="dt-wrap">
|
|
69
71
|
<table className="dt directory stacks">
|
|
70
72
|
<thead>
|
|
@@ -76,7 +78,7 @@ export function RemovedList({
|
|
|
76
78
|
{users ? 'Email' : 'Name'}
|
|
77
79
|
</span>
|
|
78
80
|
</th>
|
|
79
|
-
<th className="col-role">
|
|
81
|
+
<th className="col-role">Consider rotating</th>
|
|
80
82
|
<th className="col-actions">
|
|
81
83
|
<span className="visually-hidden">Report</span>
|
|
82
84
|
</th>
|
|
@@ -89,7 +91,7 @@ export function RemovedList({
|
|
|
89
91
|
<td className="col-lead" data-label={users ? 'Email' : 'Name'}>
|
|
90
92
|
<PrincipalLink type={principal.principalType} id={principal.principalId} stretch />
|
|
91
93
|
</td>
|
|
92
|
-
<td className="col-role" data-label="
|
|
94
|
+
<td className="col-role" data-label="Consider rotating">
|
|
93
95
|
{principal.toRotate === 0 ? (
|
|
94
96
|
<span className="cell-muted">Nothing</span>
|
|
95
97
|
) : (
|
|
@@ -106,33 +108,18 @@ export function RemovedList({
|
|
|
106
108
|
</table>
|
|
107
109
|
</div>
|
|
108
110
|
</section>
|
|
109
|
-
<p className="hint section-foot">
|
|
110
|
-
{users ? 'They' : 'These'} can no longer sign in. Each page lists the values{' '}
|
|
111
|
-
{users ? 'they' : 'it'} saw that nobody has changed since.
|
|
112
|
-
</p>
|
|
113
111
|
</>
|
|
114
112
|
);
|
|
115
113
|
}
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
removed,
|
|
120
|
-
person,
|
|
121
|
-
}: {
|
|
122
|
-
report: PrincipalReport;
|
|
123
|
-
removed: boolean;
|
|
124
|
-
person: boolean;
|
|
125
|
-
}) {
|
|
115
|
+
/** Values a removed member saw that nobody has changed since. */
|
|
116
|
+
function ConsiderRotating({ report, person }: { report: PrincipalReport; person: boolean }) {
|
|
126
117
|
const they = person ? 'they' : 'it';
|
|
127
|
-
const description = removed
|
|
128
|
-
? `Values ${they} read or wrote that nobody has changed since, so ${they} may still hold them. Rotate each where it comes from, such as a new API key or database password, then save the new value here and it leaves this list.`
|
|
129
|
-
: `Current values ${they} ${person ? 'have' : 'has'} read or written: the ones to rotate if ${they} ${person ? 'leave' : 'is retired'}. Saving a new version takes a value off.`;
|
|
130
|
-
|
|
131
118
|
return (
|
|
132
119
|
<Card
|
|
133
120
|
labelledBy="seen-values"
|
|
134
|
-
title=
|
|
135
|
-
description={
|
|
121
|
+
title="Consider rotating"
|
|
122
|
+
description={`Values ${they} read or wrote that nobody has changed since, so ${they} may still hold them. Rotate each where it comes from, such as a new API key or database password, then save the new value here and it leaves this list.`}
|
|
136
123
|
actions={
|
|
137
124
|
report.rotated > 0 && (
|
|
138
125
|
<span className="card-aside">{report.rotated} already rotated</span>
|
|
@@ -140,7 +127,7 @@ function SeenValues({
|
|
|
140
127
|
}
|
|
141
128
|
>
|
|
142
129
|
{report.exposed.length === 0 ? (
|
|
143
|
-
<EmptyState title=
|
|
130
|
+
<EmptyState title="Nothing left to rotate">
|
|
144
131
|
{report.rotated > 0
|
|
145
132
|
? `Every value ${they} saw has had a new version since.`
|
|
146
133
|
: `${person ? 'They have' : 'It has'} not read or written a value that is still current.`}
|
|
@@ -186,12 +173,53 @@ function SeenValues({
|
|
|
186
173
|
);
|
|
187
174
|
}
|
|
188
175
|
|
|
176
|
+
/**
|
|
177
|
+
* References they made, as the log names them: each belongs to the
|
|
178
|
+
* environment that holds it, like a value, not to them (D46), so their
|
|
179
|
+
* leaving ends none. Listed to review.
|
|
180
|
+
*/
|
|
181
|
+
function MadeReferences({ report }: { report: PrincipalReport }) {
|
|
182
|
+
return (
|
|
183
|
+
<Card
|
|
184
|
+
labelledBy="made-references"
|
|
185
|
+
title="References they made"
|
|
186
|
+
description="Each belongs to the environment that holds it, like a value, and stays when they leave: whoever reads that environment reads another secret through it. Review them; the source's access managers, or whoever writes where one is held, can break it."
|
|
187
|
+
>
|
|
188
|
+
<div className="dt-wrap">
|
|
189
|
+
<table className="dt stacks">
|
|
190
|
+
<thead>
|
|
191
|
+
<tr>
|
|
192
|
+
<th>Reference</th>
|
|
193
|
+
<th>Reads</th>
|
|
194
|
+
<th className="col-shrink">Made</th>
|
|
195
|
+
</tr>
|
|
196
|
+
</thead>
|
|
197
|
+
<tbody>
|
|
198
|
+
{report.references.map((reference) => (
|
|
199
|
+
<tr key={reference.id}>
|
|
200
|
+
<td className="mono" data-label="Reference">{reference.holder}</td>
|
|
201
|
+
<td data-label="Reads">
|
|
202
|
+
<span className="mono">{reference.source}</span>
|
|
203
|
+
{reference.state !== 'live' && <span className="cell-muted"> · {referenceProblem(reference.state)}</span>}
|
|
204
|
+
</td>
|
|
205
|
+
<td className="col-shrink nowrap" data-label="Made">
|
|
206
|
+
<Timestamp iso={reference.createdAt} display="relative" />
|
|
207
|
+
</td>
|
|
208
|
+
</tr>
|
|
209
|
+
))}
|
|
210
|
+
</tbody>
|
|
211
|
+
</table>
|
|
212
|
+
</div>
|
|
213
|
+
</Card>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
189
217
|
function IssuedTokens({ report }: { report: PrincipalReport }) {
|
|
190
218
|
return (
|
|
191
219
|
<Card
|
|
192
220
|
labelledBy="issued-tokens"
|
|
193
|
-
title="
|
|
194
|
-
description="
|
|
221
|
+
title="Bearer tokens they issued"
|
|
222
|
+
description="Bearer tokens they issued to service accounts that still work. Each was shown to them once, when it was made; revoke any they may have kept a copy of."
|
|
195
223
|
>
|
|
196
224
|
<div className="dt-wrap">
|
|
197
225
|
<table className="dt report-tokens">
|
|
@@ -207,8 +235,8 @@ function IssuedTokens({ report }: { report: PrincipalReport }) {
|
|
|
207
235
|
<tr key={token.id}>
|
|
208
236
|
<td>
|
|
209
237
|
<span className="cell-stack">
|
|
210
|
-
<Link className="cell-link mono" to="/
|
|
211
|
-
{token.service}
|
|
238
|
+
<Link className="cell-link mono" to="/service-accounts/$account" params={{ account: serviceName(token.service) }}>
|
|
239
|
+
service:{serviceName(token.service)}
|
|
212
240
|
</Link>
|
|
213
241
|
<small>
|
|
214
242
|
{token.label ?? 'No label'} · <span className="mono">{token.hint}</span>
|
package/src/components/page.tsx
CHANGED
|
@@ -57,6 +57,7 @@ export function Card({
|
|
|
57
57
|
children,
|
|
58
58
|
labelledBy,
|
|
59
59
|
tone,
|
|
60
|
+
wide = false,
|
|
60
61
|
}: {
|
|
61
62
|
title: ReactNode;
|
|
62
63
|
description?: ReactNode;
|
|
@@ -64,10 +65,12 @@ export function Card({
|
|
|
64
65
|
children: ReactNode;
|
|
65
66
|
labelledBy: string;
|
|
66
67
|
tone?: 'danger';
|
|
68
|
+
/** Takes the content column whole, for a table of many or long columns. */
|
|
69
|
+
wide?: boolean;
|
|
67
70
|
}) {
|
|
68
71
|
return (
|
|
69
72
|
<section
|
|
70
|
-
className={`card${tone === 'danger' ? ' card-danger' : ''}`}
|
|
73
|
+
className={`card${tone === 'danger' ? ' card-danger' : ''}${wide ? ' card-wide' : ''}`}
|
|
71
74
|
aria-labelledby={labelledBy}
|
|
72
75
|
>
|
|
73
76
|
<div className="card-head">
|