@coffre/ui 0.1.9 → 0.1.11
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/client/_coffre/assets/account-BJAdDvZf.js +2 -0
- package/dist/client/_coffre/assets/account-D0jLpk5c.js +1 -0
- package/dist/client/_coffre/assets/affordances-Bq2-oUB5.js +1 -0
- package/dist/client/_coffre/assets/audit-C-pcBgKe.js +2 -0
- package/dist/client/_coffre/assets/audit-CHGlDeBB.js +1 -0
- package/dist/client/_coffre/assets/{auth.device--rDR2F8w.js → auth.device-BndOUjse.js} +1 -1
- package/dist/client/_coffre/assets/auth.device-CWHNQn9W.js +2 -0
- package/dist/client/_coffre/assets/directory-nDExpkAz.js +1 -0
- package/dist/client/_coffre/assets/dist-QVHMLatb.js +1 -0
- package/dist/client/_coffre/assets/globals-CKBoTlyH.css +1 -0
- package/dist/client/_coffre/assets/grants-CjoOnxzz.js +1 -0
- package/dist/client/_coffre/assets/icons-BQ27Ds9u.js +1 -0
- package/dist/client/_coffre/assets/index-CUGytaO3.js +12 -0
- package/dist/client/_coffre/assets/link-DP8SVWon.js +1 -0
- package/dist/client/_coffre/assets/login-CeaxDMcr.js +2 -0
- package/dist/client/_coffre/assets/login-DrMgvqZn.js +1 -0
- package/dist/client/_coffre/assets/offboarding-CNr_1tnl.js +1 -0
- package/dist/client/_coffre/assets/page-CGmvjSy4.js +1 -0
- package/dist/client/_coffre/assets/preload-helper-ClBkJ19f.js +1 -0
- package/dist/client/_coffre/assets/principal-page-DNLb_q_e.js +1 -0
- package/dist/client/_coffre/assets/projects._project._environment-CHzbboGp.js +3 -0
- package/dist/client/_coffre/assets/projects._project._environment-DDxu_HHD.js +2 -0
- package/dist/client/_coffre/assets/projects._project.index-CIAsjvg6.js +2 -0
- package/dist/client/_coffre/assets/projects._project.index-DZ9l6d-1.js +1 -0
- package/dist/client/_coffre/assets/projects.index-4eUXreE_.js +1 -0
- package/dist/client/_coffre/assets/row-state-ByET1OKX.js +1 -0
- package/dist/client/_coffre/assets/settings-D2zp1Ssu.js +1 -0
- package/dist/client/_coffre/assets/suspense-C7KwSnTG.js +1 -0
- package/dist/client/_coffre/assets/tokens._token-DWmbqzNk.js +2 -0
- package/dist/client/_coffre/assets/tokens._token-Dui_4KfS.js +1 -0
- package/dist/client/_coffre/assets/tokens.index-CSi5Wxwf.js +1 -0
- package/dist/client/_coffre/assets/ui-BdipqGpP.js +46 -0
- package/dist/client/_coffre/assets/unregistered-CA7B4C1m.js +1 -0
- package/dist/client/_coffre/assets/use-action-DRm9yVhV.js +1 -0
- package/dist/client/_coffre/assets/use-change-BRRMJocl.js +1 -0
- package/dist/client/_coffre/assets/use-shell-BMGlJ25Q.js +1 -0
- package/dist/client/_coffre/assets/useQuery-D__2KBOs.js +1 -0
- package/dist/client/_coffre/assets/useSuspenseQuery-CSXyDALB.js +1 -0
- package/dist/client/_coffre/assets/users._user-BkNrX7Qf.js +1 -0
- package/dist/client/_coffre/assets/users._user-jbSvtdOg.js +2 -0
- package/dist/client/_coffre/assets/users.index-CKnQ1G76.js +1 -0
- package/dist/server/.vite/manifest.json +343 -246
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-Dx-c3XVk.js +162 -0
- package/dist/server/_coffre/assets/{account-CZgVVZTf.js → account-BocTPU1J.js} +150 -117
- package/dist/server/_coffre/assets/{account-D7-ZAE2T.js → account-CL8hOGhO.js} +10 -24
- package/dist/server/_coffre/assets/{affordances-BNaXjMOb.js → affordances-CKANXDTG.js} +2 -22
- package/dist/server/_coffre/assets/{async-local-storage-C0cwgkEr.js → async-local-storage-C10uQtMM.js} +3 -2
- package/dist/server/_coffre/assets/{audit-BEbhtsEp.js → audit-Bcka4vA6.js} +46 -16
- package/dist/server/_coffre/assets/audit-CSRQYIhu.js +31 -0
- package/dist/server/_coffre/assets/{auth.device-w9N3FlNk.js → auth.device-CMcUISZY.js} +7 -5
- package/dist/server/_coffre/assets/{auth.device-CMR3csAI.js → auth.device-DqO0T-rU.js} +5 -5
- package/dist/server/_coffre/assets/{directory-Dr5X9TB5.js → directory-CyYx6Jx1.js} +87 -112
- package/dist/server/_coffre/assets/{use-action-DQUmeH-5.js → dist-CnnV3t2g.js} +3 -48
- package/dist/server/_coffre/assets/globals-CKBoTlyH.css +1 -0
- package/dist/server/_coffre/assets/grants-CRijabX0.js +158 -0
- package/dist/server/_coffre/assets/{page-BdnhpwvH.js → icons-Dy-5ccDF.js} +3 -196
- package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +480 -0
- package/dist/server/_coffre/assets/link-42ZWdjzZ.js +422 -0
- package/dist/server/_coffre/assets/{login-DUtCQju5.js → login-BI9tzJEy.js} +7 -5
- package/dist/server/_coffre/assets/{login-B2njIq_o.js → login-C-v88YwP.js} +2 -2
- package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +56 -0
- package/dist/server/_coffre/assets/{offboarding-DY5MarpG.js → offboarding-1H0LavTd.js} +6 -4
- package/dist/server/_coffre/assets/page-D_mO0-sn.js +3592 -0
- package/dist/server/_coffre/assets/{principal-page-SdG8_zcu.js → principal-page-DQDoXute.js} +51 -42
- package/dist/server/_coffre/assets/{projects._project._environment-CUS0VFUe.js → projects._project._environment-C-yVwC92.js} +168 -248
- package/dist/server/_coffre/assets/{projects._project._environment-BQIrmE3r.js → projects._project._environment-D_5R40of.js} +4 -11
- package/dist/server/_coffre/assets/{projects._project.index-D1NxvBtZ.js → projects._project.index-A2BImFIT.js} +134 -96
- package/dist/server/_coffre/assets/{projects._project.index-BjNdR4KC.js → projects._project.index-BPPKxKrt.js} +5 -4
- package/dist/server/_coffre/assets/{projects.index-BQDuuh6t.js → projects.index-543IsPzY.js} +62 -54
- package/dist/server/_coffre/assets/{react-dom-qCTiwGGR.js → react-dom-bBoJXlK2.js} +417 -51
- package/dist/server/_coffre/assets/{router-BUwZOXEH.js → router-CM3vK8QO.js} +376 -92
- package/dist/server/_coffre/assets/row-state-XBtDoIA4.js +117 -0
- package/dist/server/_coffre/assets/{settings-HOErM3pd.js → settings-BLVU74ym.js} +8 -6
- package/dist/server/_coffre/assets/suspense-CzYTwxOj.js +602 -0
- package/dist/server/_coffre/assets/tokens._token-B-hBgwBW.js +10 -0
- package/dist/server/_coffre/assets/{tokens._token-BZUArbzi.js → tokens._token-aubAUonP.js} +97 -79
- package/dist/server/_coffre/assets/{tokens.index-BReCgoV9.js → tokens.index-4D3jwp5v.js} +9 -6
- package/dist/server/_coffre/assets/{ui-D_slKpSF.js → ui-BI3Bf72q.js} +7 -836
- package/dist/server/_coffre/assets/{unregistered-Z17da4Rc.js → unregistered-CagDxMyw.js} +5 -3
- package/dist/server/_coffre/assets/use-action-tzBZvjjQ.js +47 -0
- package/dist/server/_coffre/assets/use-change-Dggqxy5y.js +1212 -0
- package/dist/server/_coffre/assets/use-shell-CwStDfzX.js +462 -0
- package/dist/server/_coffre/assets/useQuery-C6_dBjem.js +8 -0
- package/dist/server/_coffre/assets/{useStore-DWGPqzXR.js → useRouter-CaUSUNsw.js} +1 -420
- package/dist/server/_coffre/assets/useSuspenseQuery-BuapQt_P.js +117 -0
- package/dist/server/_coffre/assets/{users._user-DHTNhQ9o.js → users._user-137WNyxn.js} +4 -5
- package/dist/server/_coffre/assets/users._user-C252Iilj.js +10 -0
- package/dist/server/_coffre/assets/{users.index-Cfo3ODpX.js → users.index-DQHsfnal.js} +9 -6
- package/dist/server/index.js +6 -5
- package/package.json +5 -3
- package/src/components/directory.tsx +75 -104
- package/src/components/grants.tsx +60 -112
- package/src/components/principal-page.tsx +54 -67
- package/src/components/principal-picker.tsx +7 -16
- package/src/components/row-state.tsx +95 -0
- package/src/components/service-tokens.tsx +75 -64
- package/src/components/shell.tsx +1 -1
- package/src/components/syncs.tsx +42 -26
- package/src/lib/announce.ts +36 -0
- package/src/lib/changes.ts +498 -0
- package/src/lib/coffre.ts +3 -2
- package/src/lib/optimistic.ts +233 -0
- package/src/lib/queries.ts +393 -0
- package/src/lib/use-action.ts +20 -15
- package/src/lib/use-change.ts +42 -0
- package/src/lib/use-shell.ts +17 -0
- package/src/router.tsx +17 -9
- package/src/routes/__root.tsx +8 -38
- package/src/routes/account.tsx +163 -154
- package/src/routes/audit.tsx +51 -72
- package/src/routes/auth.device.tsx +4 -2
- package/src/routes/login.tsx +3 -2
- package/src/routes/projects.$project.$environment.tsx +226 -231
- package/src/routes/projects.$project.index.tsx +136 -118
- package/src/routes/projects.index.tsx +125 -145
- package/src/routes/settings.tsx +7 -7
- package/src/routes/tokens.$token.tsx +14 -17
- package/src/routes/tokens.index.tsx +8 -4
- package/src/routes/unregistered.tsx +3 -2
- package/src/routes/users.$user.tsx +4 -4
- package/src/routes/users.index.tsx +8 -4
- package/src/styles/globals.css +78 -1
- package/dist/client/_coffre/assets/account-C3rBPdu6.js +0 -2
- package/dist/client/_coffre/assets/account-J194gi6l.js +0 -1
- package/dist/client/_coffre/assets/affordances-CmoY-8Xf.js +0 -1
- package/dist/client/_coffre/assets/audit-BtI9em7Q.js +0 -2
- package/dist/client/_coffre/assets/audit-jURfT8Km.js +0 -1
- package/dist/client/_coffre/assets/auth.device-viDUwZRT.js +0 -2
- package/dist/client/_coffre/assets/coffre-CXkp3Efg.js +0 -1
- package/dist/client/_coffre/assets/directory-PEjdb8PS.js +0 -1
- package/dist/client/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/client/_coffre/assets/grants-4mSkXPU4.js +0 -1
- package/dist/client/_coffre/assets/index-CD7bvUCb.js +0 -12
- package/dist/client/_coffre/assets/login-C-wTm_t1.js +0 -2
- package/dist/client/_coffre/assets/login-CLLv1om9.js +0 -1
- package/dist/client/_coffre/assets/offboarding-DQ-56W0H.js +0 -1
- package/dist/client/_coffre/assets/page-DbSS7pYH.js +0 -1
- package/dist/client/_coffre/assets/preload-helper-DduCCcmc.js +0 -46
- package/dist/client/_coffre/assets/principal-page-DjH1cUyz.js +0 -1
- package/dist/client/_coffre/assets/projects._project._environment-BZnNvENc.js +0 -3
- package/dist/client/_coffre/assets/projects._project._environment-CLUpTvi-.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-CWXRo307.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-Dzgf95zv.js +0 -1
- package/dist/client/_coffre/assets/projects.index-BG8W91BX.js +0 -2
- package/dist/client/_coffre/assets/projects.index-N_kCFBMq.js +0 -1
- package/dist/client/_coffre/assets/settings-CNIY0--5.js +0 -1
- package/dist/client/_coffre/assets/settings-EimGqlQL.js +0 -2
- package/dist/client/_coffre/assets/tokens._token-CkU4dCwo.js +0 -1
- package/dist/client/_coffre/assets/tokens._token-Df2R8TF_.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-CSf5Mlz8.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-DtiWrKVq.js +0 -1
- package/dist/client/_coffre/assets/unregistered-D5go1AfR.js +0 -1
- package/dist/client/_coffre/assets/use-action-CUvWPRTx.js +0 -1
- package/dist/client/_coffre/assets/users._user-CImGVpYj.js +0 -1
- package/dist/client/_coffre/assets/users._user-D0JK911L.js +0 -2
- package/dist/client/_coffre/assets/users.index-B-7o0KBD.js +0 -1
- package/dist/client/_coffre/assets/users.index-BoFWF3mF.js +0 -2
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-CrnrBINO.js +0 -133
- package/dist/server/_coffre/assets/audit-wjpo1BWg.js +0 -74
- package/dist/server/_coffre/assets/coffre-DMs96kfX.js +0 -280
- package/dist/server/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/server/_coffre/assets/grants-C6UmWE8b.js +0 -243
- package/dist/server/_coffre/assets/projects.index-ha7jO4nC.js +0 -54
- package/dist/server/_coffre/assets/settings-Cy__khNA.js +0 -18
- package/dist/server/_coffre/assets/tokens._token-CmpmtfB_.js +0 -18
- package/dist/server/_coffre/assets/tokens.index-B5-4dD4C.js +0 -10
- package/dist/server/_coffre/assets/users._user-BKdSQhIg.js +0 -10
- package/dist/server/_coffre/assets/users.index-dMn0tlmc.js +0 -10
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
1
|
+
import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { C as useCoffre, b as memberRef, h as queries, o as affects, t as Card } from "./page-D_mO0-sn.js";
|
|
3
|
+
import { n as useChangeStatus, t as useChange, y as revokeCredential } from "./use-change-Dggqxy5y.js";
|
|
4
|
+
import { t as useShell } from "./use-shell-CwStDfzX.js";
|
|
5
|
+
import { t as useSuspenseQuery } from "./useSuspenseQuery-BuapQt_P.js";
|
|
6
|
+
import { a as ErrorLine, c as Spinner, i as EmptyState, l as Timestamp, o as Modal, r as CopyButton, s as Notice, t as ConfirmButton } from "./ui-BI3Bf72q.js";
|
|
7
|
+
import { J as X, M as Plus, v as Key } from "./icons-Dy-5ccDF.js";
|
|
8
|
+
import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-XBtDoIA4.js";
|
|
9
|
+
import { t as Route } from "./tokens._token-B-hBgwBW.js";
|
|
10
|
+
import { t as useAction } from "./use-action-tzBZvjjQ.js";
|
|
11
|
+
import { t as PrincipalPage } from "./principal-page-DQDoXute.js";
|
|
8
12
|
//#region src/components/service-tokens.tsx
|
|
9
13
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
10
14
|
var import_jsx_runtime = require_jsx_runtime();
|
|
@@ -19,17 +23,15 @@ var LIFETIMES = [
|
|
|
19
23
|
* one place, this dialog, for as long as it stays open: coffre keeps a hash.
|
|
20
24
|
*/
|
|
21
25
|
function ServiceTokens({ serviceId, tokens }) {
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
26
|
+
const change = revokeCredential(useCoffre(), serviceId);
|
|
27
|
+
const revoke = useChange(change);
|
|
28
|
+
const { status, dismiss } = useChangeStatus(change.list.queryKey);
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, {
|
|
25
30
|
labelledBy: "service-tokens",
|
|
26
31
|
title: "Credentials",
|
|
27
32
|
description: "Bearer tokens this service presents to the API. Each is shown once, when it is issued; coffre keeps only a hash.",
|
|
28
33
|
actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IssueToken, { serviceId }),
|
|
29
|
-
children:
|
|
30
|
-
className: "card-body",
|
|
31
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorLine, { error })
|
|
32
|
-
}), tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, {
|
|
34
|
+
children: tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, {
|
|
33
35
|
title: "No live credentials",
|
|
34
36
|
children: "Nothing can act as this service until a token is issued."
|
|
35
37
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -57,68 +59,77 @@ function ServiceTokens({ serviceId, tokens }) {
|
|
|
57
59
|
children: "Actions"
|
|
58
60
|
})
|
|
59
61
|
})
|
|
60
|
-
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: tokens.map((token) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
className: "
|
|
67
|
-
children:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
className: "cell-stack",
|
|
82
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, {
|
|
83
|
-
iso: token.lastUsedAt,
|
|
84
|
-
display: "relative"
|
|
85
|
-
}), token.lastUsedIp !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", {
|
|
86
|
-
className: "mono",
|
|
87
|
-
children: token.lastUsedIp
|
|
88
|
-
})]
|
|
89
|
-
})
|
|
90
|
-
}),
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
92
|
-
className: "nowrap cell-muted",
|
|
93
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, {
|
|
94
|
-
iso: token.expiresAt,
|
|
95
|
-
display: "relative"
|
|
96
|
-
})
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
99
|
-
className: "col-actions",
|
|
100
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfirmButton, {
|
|
101
|
-
trigger: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
102
|
-
className: "act",
|
|
103
|
-
disabled: pending,
|
|
104
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { size: 13 }), "Revoke"]
|
|
62
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: tokens.map((token) => {
|
|
63
|
+
const state = status(token.id);
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
65
|
+
className: rowClass(state),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
68
|
+
className: "cell-account",
|
|
69
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Key, { size: 15 }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
70
|
+
className: "cell-stack",
|
|
71
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: token.label ?? "Unlabelled" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", {
|
|
72
|
+
className: "mono",
|
|
73
|
+
children: token.hint
|
|
74
|
+
})]
|
|
75
|
+
})]
|
|
76
|
+
}) }),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
78
|
+
className: "nowrap",
|
|
79
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
80
|
+
className: "cell-stack",
|
|
81
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, { iso: token.createdAt }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: ["by ", token.createdBy] })]
|
|
82
|
+
})
|
|
105
83
|
}),
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
109
|
-
className: "
|
|
110
|
-
children:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
85
|
+
className: "nowrap cell-muted",
|
|
86
|
+
children: token.lastUsedAt === null ? "Never" : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
87
|
+
className: "cell-stack",
|
|
88
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, {
|
|
89
|
+
iso: token.lastUsedAt,
|
|
90
|
+
display: "relative"
|
|
91
|
+
}), token.lastUsedIp !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", {
|
|
92
|
+
className: "mono",
|
|
93
|
+
children: token.lastUsedIp
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
98
|
+
className: "nowrap cell-muted",
|
|
99
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Timestamp, {
|
|
100
|
+
iso: token.expiresAt,
|
|
101
|
+
display: "relative"
|
|
102
|
+
})
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
105
|
+
className: "col-actions",
|
|
106
|
+
children: state.state === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowPending, { status: state }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfirmButton, {
|
|
107
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
108
|
+
className: "act",
|
|
109
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { size: 13 }), "Revoke"]
|
|
110
|
+
}),
|
|
111
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
112
|
+
"Revoke ",
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
114
|
+
className: "mono",
|
|
115
|
+
children: token.hint
|
|
116
|
+
}),
|
|
117
|
+
"?"
|
|
118
|
+
] }),
|
|
119
|
+
body: "Whatever uses it is refused from its next request. Issue a new token first if the service should keep working.",
|
|
120
|
+
confirmLabel: "Revoke token",
|
|
121
|
+
onConfirm: () => revoke(token)
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowFailure, {
|
|
126
|
+
status: state,
|
|
127
|
+
columns: 5,
|
|
128
|
+
onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
|
|
129
|
+
})] }, token.id);
|
|
130
|
+
}) })]
|
|
120
131
|
})
|
|
121
|
-
})
|
|
132
|
+
})
|
|
122
133
|
});
|
|
123
134
|
}
|
|
124
135
|
function IssueToken({ serviceId }) {
|
|
@@ -149,7 +160,10 @@ function IssueToken({ serviceId }) {
|
|
|
149
160
|
run(() => coffre.tokens.issue(memberRef("service", serviceId), {
|
|
150
161
|
label: label.trim() === "" ? null : label.trim(),
|
|
151
162
|
expiresInDays: days
|
|
152
|
-
}),
|
|
163
|
+
}), {
|
|
164
|
+
affects: affects.credentials(memberRef("service", serviceId)),
|
|
165
|
+
onSuccess: (credential) => setIssued(credential)
|
|
166
|
+
});
|
|
153
167
|
},
|
|
154
168
|
children: [
|
|
155
169
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -253,12 +267,16 @@ function IssueToken({ serviceId }) {
|
|
|
253
267
|
//#region src/routes/tokens.$token.tsx?tsr-split=component
|
|
254
268
|
function TokenPage() {
|
|
255
269
|
const { token } = Route.useParams();
|
|
256
|
-
const
|
|
257
|
-
const
|
|
270
|
+
const client = useCoffre();
|
|
271
|
+
const { auth, capabilities } = useShell();
|
|
272
|
+
const member = memberRef("service", token);
|
|
273
|
+
const owner = capabilities.canManageGrants;
|
|
274
|
+
const { data: report } = useSuspenseQuery(queries.report(client, member, owner));
|
|
275
|
+
const { data: credentials } = useSuspenseQuery(queries.credentials(client, member, owner && auth.signin !== null));
|
|
276
|
+
const active = report?.ok === true && report.report?.status === "active";
|
|
258
277
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PrincipalPage, {
|
|
259
278
|
principalType: "service",
|
|
260
|
-
principalId: token
|
|
261
|
-
data: page
|
|
279
|
+
principalId: token
|
|
262
280
|
}), active && credentials?.ok === true && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ServiceTokens, {
|
|
263
281
|
serviceId: token,
|
|
264
282
|
tokens: credentials.tokens
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
1
|
+
import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-D_mO0-sn.js";
|
|
3
|
+
import { t as useShell } from "./use-shell-CwStDfzX.js";
|
|
4
|
+
import { t as useSuspenseQuery } from "./useSuspenseQuery-BuapQt_P.js";
|
|
5
|
+
import { v as Key } from "./icons-Dy-5ccDF.js";
|
|
6
|
+
import { n as DirectoryTable, t as AddPrincipal } from "./directory-CyYx6Jx1.js";
|
|
7
|
+
import { n as RemovedList } from "./offboarding-1H0LavTd.js";
|
|
6
8
|
//#region src/routes/tokens.index.tsx?tsr-split=component
|
|
7
9
|
var import_jsx_runtime = require_jsx_runtime();
|
|
8
10
|
function TokensPage() {
|
|
9
|
-
const
|
|
11
|
+
const { capabilities } = useShell();
|
|
12
|
+
const { data: result } = useSuspenseQuery(queries.directory(useCoffre(), capabilities.canManageGrants));
|
|
10
13
|
if (!result.ok) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClosedDoor, {
|
|
11
14
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Key, { size: 18 }),
|
|
12
15
|
label: "Tokens",
|