@coffre/ui 0.1.18 → 0.3.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/README.md +23 -3
- package/dist/{server/_coffre/assets/affordances-CKANXDTG.js → chunks/affordances-DAvsVz7u.js} +12 -7
- package/dist/chunks/affordances-DAvsVz7u.js.map +1 -0
- package/dist/chunks/directory-CSjWWUQ1.js +370 -0
- package/dist/chunks/directory-CSjWWUQ1.js.map +1 -0
- package/dist/{server/_coffre/assets/grants-DdKT11Ny.js → chunks/grants-saMQagmG.js} +41 -39
- package/dist/chunks/grants-saMQagmG.js.map +1 -0
- package/dist/chunks/icons-D-PfAfnH.js +203 -0
- package/dist/chunks/icons-D-PfAfnH.js.map +1 -0
- package/dist/chunks/mounted-jJmqqV_n.js +17 -0
- package/dist/chunks/mounted-jJmqqV_n.js.map +1 -0
- package/dist/{server/_coffre/assets/offboarding-CRz-K82H.js → chunks/offboarding-C6l30DZR.js} +70 -69
- package/dist/chunks/offboarding-C6l30DZR.js.map +1 -0
- package/dist/chunks/page-C5HcNqf2.js +190 -0
- package/dist/chunks/page-C5HcNqf2.js.map +1 -0
- package/dist/chunks/page-route-Drfw7lmn.js +20 -0
- package/dist/chunks/page-route-Drfw7lmn.js.map +1 -0
- package/dist/{server/_coffre/assets/principal-page-C-EFwJQw.js → chunks/principal-page-D_91OA0l.js} +105 -103
- package/dist/chunks/principal-page-D_91OA0l.js.map +1 -0
- package/dist/{server/_coffre/assets → chunks}/project-environments-lEzFHUt4.js +2 -0
- package/dist/chunks/project-environments-lEzFHUt4.js.map +1 -0
- package/dist/chunks/queries-CQ81o4so.js +376 -0
- package/dist/chunks/queries-CQ81o4so.js.map +1 -0
- package/dist/{server/_coffre/assets/row-state-C2P57xT1.js → chunks/row-state-0PsrEzOL.js} +22 -21
- package/dist/chunks/row-state-0PsrEzOL.js.map +1 -0
- package/dist/{server/_coffre/assets → chunks}/signin-errors-BEFlVDbQ.js +2 -0
- package/dist/chunks/signin-errors-BEFlVDbQ.js.map +1 -0
- package/dist/chunks/theme-B2vQolVR.js +86 -0
- package/dist/chunks/theme-B2vQolVR.js.map +1 -0
- package/dist/chunks/ui-DixXLQvQ.js +405 -0
- package/dist/chunks/ui-DixXLQvQ.js.map +1 -0
- package/dist/{server/_coffre/assets/use-action-B-xpvVRO.js → chunks/use-action-CWsg_YWU.js} +8 -6
- package/dist/chunks/use-action-CWsg_YWU.js.map +1 -0
- package/dist/{server/_coffre/assets/use-change-C8BCf3oU.js → chunks/use-change-c6CeLRin.js} +10 -474
- package/dist/chunks/use-change-c6CeLRin.js.map +1 -0
- package/dist/chunks/use-shell-jxd7Tzd-.js +26 -0
- package/dist/chunks/use-shell-jxd7Tzd-.js.map +1 -0
- package/dist/{server/_coffre/assets → chunks}/validation-BQtqPe2V.js +2 -0
- package/dist/chunks/validation-BQtqPe2V.js.map +1 -0
- package/dist/index.d.ts +386 -18
- package/dist/index.js +1147 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/account.d.ts +9 -0
- package/dist/pages/account.js +334 -0
- package/dist/pages/account.js.map +1 -0
- package/dist/pages/audit.d.ts +3 -0
- package/dist/{server/_coffre/assets/audit-qB9G2AQJ.js → pages/audit.js} +102 -100
- package/dist/pages/audit.js.map +1 -0
- package/dist/pages/device-login.d.ts +9 -0
- package/dist/pages/device-login.js +211 -0
- package/dist/pages/device-login.js.map +1 -0
- package/dist/pages/environment.d.ts +3 -0
- package/dist/{server/_coffre/assets/projects._project._environment-C6uybzeU.js → pages/environment.js} +323 -469
- package/dist/pages/environment.js.map +1 -0
- package/dist/pages/login.d.ts +10 -0
- package/dist/pages/login.js +104 -0
- package/dist/pages/login.js.map +1 -0
- package/dist/pages/project.d.ts +2 -0
- package/dist/{server/_coffre/assets/projects._project.index-3CXwkyTh.js → pages/project.js} +223 -225
- package/dist/pages/project.js.map +1 -0
- package/dist/pages/projects.d.ts +3 -0
- package/dist/{server/_coffre/assets/projects.index-iSoBpRFz.js → pages/projects.js} +83 -81
- package/dist/pages/projects.js.map +1 -0
- package/dist/pages/settings.d.ts +3 -0
- package/dist/{server/_coffre/assets/settings-BDQTF5XW.js → pages/settings.js} +20 -18
- package/dist/pages/settings.js.map +1 -0
- package/dist/pages/token.d.ts +3 -0
- package/dist/{server/_coffre/assets/tokens._token-CrBMpcbN.js → pages/token.js} +198 -267
- package/dist/pages/token.js.map +1 -0
- package/dist/pages/tokens.d.ts +3 -0
- package/dist/pages/tokens.js +39 -0
- package/dist/pages/tokens.js.map +1 -0
- package/dist/pages/unregistered.d.ts +8 -0
- package/dist/pages/unregistered.js +54 -0
- package/dist/pages/unregistered.js.map +1 -0
- package/dist/pages/user.d.ts +3 -0
- package/dist/pages/user.js +16 -0
- package/dist/pages/user.js.map +1 -0
- package/dist/pages/users.d.ts +3 -0
- package/dist/pages/users.js +39 -0
- package/dist/pages/users.js.map +1 -0
- package/dist/project-BqIy8gYR.d.ts +5 -0
- package/dist/vite.d.ts +16 -0
- package/dist/vite.js +52 -0
- package/package.json +36 -21
- package/src/assets/icon.svg +1 -0
- package/src/components/affordances.ts +10 -4
- package/src/components/command-palette.tsx +229 -203
- package/src/components/directory.tsx +34 -38
- package/src/components/principal.tsx +7 -3
- package/src/components/service-tokens.tsx +3 -2
- package/src/components/shell.tsx +89 -127
- package/src/components/theme.tsx +14 -81
- package/src/components/ui.tsx +97 -68
- package/src/index.ts +29 -0
- package/src/layout.tsx +113 -0
- package/src/lib/coffre.ts +8 -4
- package/src/lib/mounted.ts +13 -0
- package/src/lib/page-context.ts +31 -0
- package/src/lib/page-route.ts +22 -0
- package/src/lib/preferences.tsx +46 -0
- package/src/options.ts +240 -0
- package/src/{routes → pages}/account.tsx +7 -24
- package/src/{routes → pages}/audit.tsx +5 -16
- package/src/{routes/auth.device.tsx → pages/device-login.tsx} +8 -21
- package/src/{routes/projects.$project.$environment.tsx → pages/environment.tsx} +43 -52
- package/src/{routes → pages}/login.tsx +5 -16
- package/src/{routes/projects.$project.index.tsx → pages/project.tsx} +38 -50
- package/src/{routes/projects.index.tsx → pages/projects.tsx} +2 -7
- package/src/{routes → pages}/settings.tsx +3 -10
- package/src/{routes/tokens.$token.tsx → pages/token.tsx} +6 -7
- package/src/{routes/tokens.index.tsx → pages/tokens.tsx} +3 -8
- package/src/{routes → pages}/unregistered.tsx +1 -6
- package/src/pages/user.tsx +10 -0
- package/src/{routes/users.index.tsx → pages/users.tsx} +3 -8
- package/src/register.ts +55 -0
- package/src/router.tsx +31 -62
- package/src/styles/globals.css +104 -46
- package/src/vite.ts +78 -0
- package/dist/client/.assetsignore +0 -2
- package/dist/client/_coffre/assets/account-BoLGAxbD.js +0 -2
- package/dist/client/_coffre/assets/account-CnnuRTDB.js +0 -1
- package/dist/client/_coffre/assets/affordances-CEafRJcN.js +0 -1
- package/dist/client/_coffre/assets/audit-CHSvKLWX.js +0 -1
- package/dist/client/_coffre/assets/audit-Cn4hmS4u.js +0 -2
- package/dist/client/_coffre/assets/auth.device-Co5vrpaA.js +0 -2
- package/dist/client/_coffre/assets/auth.device-DAlqWacc.js +0 -1
- package/dist/client/_coffre/assets/directory-H8Eh3MnS.js +0 -1
- package/dist/client/_coffre/assets/dist-Braunv_x.js +0 -1
- package/dist/client/_coffre/assets/globals-CpMrgkV6.css +0 -1
- package/dist/client/_coffre/assets/grants-DPDxJXU1.js +0 -1
- package/dist/client/_coffre/assets/icons-Dc_-t0lp.js +0 -1
- package/dist/client/_coffre/assets/index-sUCIXRgJ.js +0 -12
- package/dist/client/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
- package/dist/client/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/client/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/client/_coffre/assets/link-DBINMwm6.js +0 -1
- package/dist/client/_coffre/assets/login-BZFYfL1Y.js +0 -1
- package/dist/client/_coffre/assets/login-CYCKWTOD.js +0 -2
- package/dist/client/_coffre/assets/offboarding-Bwpftp3g.js +0 -1
- package/dist/client/_coffre/assets/page-C_hnzdaR.js +0 -1
- package/dist/client/_coffre/assets/preload-helper-CLkO85Nq.js +0 -1
- package/dist/client/_coffre/assets/principal-page-DLho8TSJ.js +0 -1
- package/dist/client/_coffre/assets/project-environments-CfIH5kFM.js +0 -1
- package/dist/client/_coffre/assets/projects._project._environment-DHRRvQw0.js +0 -3
- package/dist/client/_coffre/assets/projects._project._environment-TLI-RjBZ.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-BO-8FZIY.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-DGl921dP.js +0 -1
- package/dist/client/_coffre/assets/projects.index-BDn7Bhoo.js +0 -1
- package/dist/client/_coffre/assets/row-state-DJ-KLamZ.js +0 -1
- package/dist/client/_coffre/assets/settings-q9G1QvR_.js +0 -1
- package/dist/client/_coffre/assets/signin-errors-CroZWZgm.js +0 -1
- package/dist/client/_coffre/assets/suspense-O8sP0mEC.js +0 -1
- package/dist/client/_coffre/assets/tokens._token-B_qczpT9.js +0 -2
- package/dist/client/_coffre/assets/tokens._token-T-sqwMbz.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-CcXSZnAG.js +0 -1
- package/dist/client/_coffre/assets/ui-BXP2IqrW.js +0 -46
- package/dist/client/_coffre/assets/unregistered-D2JXJ90x.js +0 -1
- package/dist/client/_coffre/assets/use-action-BpzKWhgg.js +0 -1
- package/dist/client/_coffre/assets/use-change-CKj3Inq9.js +0 -1
- package/dist/client/_coffre/assets/use-shell-W0SusPkz.js +0 -1
- package/dist/client/_coffre/assets/useQuery-B-lxFSES.js +0 -1
- package/dist/client/_coffre/assets/useSuspenseQuery-BZ-nzHST.js +0 -1
- package/dist/client/_coffre/assets/users._user-Bb3BGYHl.js +0 -1
- package/dist/client/_coffre/assets/users._user-DXmvKrzE.js +0 -2
- package/dist/client/_coffre/assets/users.index-BvzP3qwW.js +0 -1
- package/dist/client/_coffre/assets/validation-9Cl_XS-l.js +0 -1
- package/dist/server/.vite/manifest.json +0 -668
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js +0 -162
- package/dist/server/_coffre/assets/account-CV-a2IU2.js +0 -329
- package/dist/server/_coffre/assets/account-hk6wcIXU.js +0 -162
- package/dist/server/_coffre/assets/async-local-storage-C10uQtMM.js +0 -3108
- package/dist/server/_coffre/assets/audit-C1_Ej6YB.js +0 -31
- package/dist/server/_coffre/assets/auth.device-6JRrWbSV.js +0 -210
- package/dist/server/_coffre/assets/auth.device-CLoAxC2T.js +0 -29
- package/dist/server/_coffre/assets/directory-B-_rqsPx.js +0 -371
- package/dist/server/_coffre/assets/dist-CnnV3t2g.js +0 -908
- package/dist/server/_coffre/assets/empty-plugin-adapters-Cq4--YW-.js +0 -5
- package/dist/server/_coffre/assets/globals-CpMrgkV6.css +0 -1
- package/dist/server/_coffre/assets/icons-DOFT-eWB.js +0 -1704
- package/dist/server/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
- package/dist/server/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/server/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +0 -480
- package/dist/server/_coffre/assets/link-42ZWdjzZ.js +0 -422
- package/dist/server/_coffre/assets/login-DRKUKkaW.js +0 -22
- package/dist/server/_coffre/assets/login-DnwxVl4Y.js +0 -102
- package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +0 -56
- package/dist/server/_coffre/assets/page-D6n45dcK.js +0 -3561
- package/dist/server/_coffre/assets/projects._project._environment-CS8DdSMY.js +0 -48
- package/dist/server/_coffre/assets/projects._project.index-BGfcNpj0.js +0 -23
- package/dist/server/_coffre/assets/react-dom-bBoJXlK2.js +0 -1718
- package/dist/server/_coffre/assets/router-9BTgJhWG.js +0 -2322
- package/dist/server/_coffre/assets/start-DR3rN0St.js +0 -4
- package/dist/server/_coffre/assets/suspense-C-2QfDd2.js +0 -602
- package/dist/server/_coffre/assets/tokens._token-rY86Cjgp.js +0 -10
- package/dist/server/_coffre/assets/tokens.index-Bq5qDW9q.js +0 -37
- package/dist/server/_coffre/assets/ui-Cc0CGMtr.js +0 -14881
- package/dist/server/_coffre/assets/unregistered-D9ZKLOPJ.js +0 -53
- package/dist/server/_coffre/assets/use-shell-DwOzEi87.js +0 -462
- package/dist/server/_coffre/assets/useQuery-CTe86qFq.js +0 -8
- package/dist/server/_coffre/assets/useRouter-CaUSUNsw.js +0 -473
- package/dist/server/_coffre/assets/useSuspenseQuery-CSoHzrMb.js +0 -117
- package/dist/server/_coffre/assets/users._user-BmLKYeo_.js +0 -10
- package/dist/server/_coffre/assets/users._user-BmiHwQx3.js +0 -14
- package/dist/server/_coffre/assets/users.index-BiEax90r.js +0 -37
- package/dist/server/index.js +0 -13911
- package/src/assets/favicon-32.png +0 -0
- package/src/components/agentation.tsx +0 -34
- package/src/entry.ts +0 -19
- package/src/routeTree.gen.ts +0 -367
- package/src/routes/__root.tsx +0 -169
- package/src/routes/access.tsx +0 -11
- package/src/routes/index.tsx +0 -15
- package/src/routes/users.$user.tsx +0 -13
- package/src/types.ts +0 -21
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import {
|
|
1
|
+
import { a as ErrorLine, c as Notice, i as EmptyState, l as Spinner, r as CopyButton, s as Modal, t as ConfirmButton, u as Timestamp } from "../chunks/ui-DixXLQvQ.js";
|
|
2
|
+
import { G as X, j as Plus, m as GitHub, v as Key, x as Link } from "../chunks/icons-D-PfAfnH.js";
|
|
3
|
+
import { s as memberRef, t as Card, u as useCoffre } from "../chunks/page-C5HcNqf2.js";
|
|
4
|
+
import { a as rowClass, i as RowPending, r as RowFailure } from "../chunks/row-state-0PsrEzOL.js";
|
|
5
|
+
import { t as affects, u as queries } from "../chunks/queries-CQ81o4so.js";
|
|
6
|
+
import { t as useShell } from "../chunks/use-shell-jxd7Tzd-.js";
|
|
7
|
+
import { b as revokeCredential, g as removeBinding, n as useChangeStatus, t as useChange } from "../chunks/use-change-c6CeLRin.js";
|
|
8
|
+
import { t as pageRoute } from "../chunks/page-route-Drfw7lmn.js";
|
|
9
|
+
import { t as useAction } from "../chunks/use-action-CWsg_YWU.js";
|
|
10
|
+
import { t as PrincipalPage } from "../chunks/principal-page-D_91OA0l.js";
|
|
11
|
+
import { Fragment, useState } from "react";
|
|
12
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
14
|
+
import { GITHUB_EVENTS, GITLAB_PIPELINE_SOURCES, fullRef, githubReusable, githubWorkflow, gitlabProject } from "@coffre/core/workloads";
|
|
12
15
|
//#region src/components/service-tokens.tsx
|
|
13
|
-
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
14
|
-
var import_jsx_runtime = require_jsx_runtime();
|
|
15
16
|
var LIFETIMES = [
|
|
16
17
|
30,
|
|
17
18
|
90,
|
|
@@ -26,91 +27,91 @@ function ServiceTokens({ serviceId, tokens }) {
|
|
|
26
27
|
const change = revokeCredential(useCoffre(), serviceId);
|
|
27
28
|
const revoke = useChange(change);
|
|
28
29
|
const { status, dismiss } = useChangeStatus(change.list.queryKey);
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
30
31
|
labelledBy: "service-tokens",
|
|
31
32
|
title: "Credentials",
|
|
32
33
|
description: "Bearer tokens this service presents to the API. Each is shown once, when it is issued; coffre keeps only a hash.",
|
|
33
|
-
actions: /* @__PURE__ */
|
|
34
|
-
children: tokens.length === 0 ? /* @__PURE__ */
|
|
34
|
+
actions: /* @__PURE__ */ jsx(IssueToken, { serviceId }),
|
|
35
|
+
children: tokens.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
35
36
|
title: "No live credentials",
|
|
36
37
|
children: "Nothing can act as this service until a token is issued."
|
|
37
|
-
}) : /* @__PURE__ */
|
|
38
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
38
39
|
className: "dt-wrap",
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
40
41
|
className: "dt",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
43
|
+
/* @__PURE__ */ jsx("th", { children: "Token" }),
|
|
44
|
+
/* @__PURE__ */ jsx("th", {
|
|
44
45
|
className: "col-shrink",
|
|
45
46
|
children: "Issued (UTC)"
|
|
46
47
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ jsx("th", {
|
|
48
49
|
className: "col-shrink",
|
|
49
50
|
children: "Last used"
|
|
50
51
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ jsx("th", {
|
|
52
53
|
className: "col-shrink",
|
|
53
54
|
children: "Expires"
|
|
54
55
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ jsx("th", {
|
|
56
57
|
className: "col-actions",
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
58
59
|
className: "visually-hidden",
|
|
59
60
|
children: "Actions"
|
|
60
61
|
})
|
|
61
62
|
})
|
|
62
|
-
] }) }), /* @__PURE__ */
|
|
63
|
+
] }) }), /* @__PURE__ */ jsx("tbody", { children: tokens.map((token) => {
|
|
63
64
|
const state = status(token.id);
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("tr", {
|
|
65
66
|
className: rowClass(state),
|
|
66
67
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("span", {
|
|
68
69
|
className: "cell-account",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ jsx(Key, { size: 15 }), /* @__PURE__ */ jsxs("span", {
|
|
70
71
|
className: "cell-stack",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ jsx("span", { children: token.label ?? "Unlabelled" }), /* @__PURE__ */ jsx("small", {
|
|
72
73
|
className: "mono",
|
|
73
74
|
children: token.hint
|
|
74
75
|
})]
|
|
75
76
|
})]
|
|
76
77
|
}) }),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ jsx("td", {
|
|
78
79
|
className: "nowrap",
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
80
81
|
className: "cell-stack",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ jsx(Timestamp, { iso: token.createdAt }), /* @__PURE__ */ jsxs("small", { children: ["by ", token.createdBy] })]
|
|
82
83
|
})
|
|
83
84
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ jsx("td", {
|
|
85
86
|
className: "nowrap cell-muted",
|
|
86
|
-
children: token.lastUsedAt === null ? "Never" : /* @__PURE__ */
|
|
87
|
+
children: token.lastUsedAt === null ? "Never" : /* @__PURE__ */ jsxs("span", {
|
|
87
88
|
className: "cell-stack",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ jsx(Timestamp, {
|
|
89
90
|
iso: token.lastUsedAt,
|
|
90
91
|
display: "relative"
|
|
91
|
-
}), token.lastUsedIp !== null && /* @__PURE__ */
|
|
92
|
+
}), token.lastUsedIp !== null && /* @__PURE__ */ jsx("small", {
|
|
92
93
|
className: "mono",
|
|
93
94
|
children: token.lastUsedIp
|
|
94
95
|
})]
|
|
95
96
|
})
|
|
96
97
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ jsx("td", {
|
|
98
99
|
className: "nowrap cell-muted",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ jsx(Timestamp, {
|
|
100
101
|
iso: token.expiresAt,
|
|
101
102
|
display: "relative"
|
|
102
103
|
})
|
|
103
104
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ jsx("td", {
|
|
105
106
|
className: "col-actions",
|
|
106
|
-
children: state.state === "pending" ? /* @__PURE__ */
|
|
107
|
-
trigger: /* @__PURE__ */
|
|
107
|
+
children: state.state === "pending" ? /* @__PURE__ */ jsx(RowPending, { status: state }) : /* @__PURE__ */ jsx(ConfirmButton, {
|
|
108
|
+
trigger: /* @__PURE__ */ jsxs("button", {
|
|
108
109
|
className: "act",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ jsx(X, { size: 13 }), "Revoke"]
|
|
110
111
|
}),
|
|
111
|
-
title: /* @__PURE__ */
|
|
112
|
+
title: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
112
113
|
"Revoke ",
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ jsx("span", {
|
|
114
115
|
className: "mono",
|
|
115
116
|
children: token.hint
|
|
116
117
|
}),
|
|
@@ -122,7 +123,7 @@ function ServiceTokens({ serviceId, tokens }) {
|
|
|
122
123
|
})
|
|
123
124
|
})
|
|
124
125
|
]
|
|
125
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ jsx(RowFailure, {
|
|
126
127
|
status: state,
|
|
127
128
|
columns: 5,
|
|
128
129
|
onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
|
|
@@ -133,10 +134,10 @@ function ServiceTokens({ serviceId, tokens }) {
|
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
136
|
function IssueToken({ serviceId }) {
|
|
136
|
-
const [open, setOpen] =
|
|
137
|
-
const [label, setLabel] =
|
|
138
|
-
const [days, setDays] =
|
|
139
|
-
const [issued, setIssued] =
|
|
137
|
+
const [open, setOpen] = useState(false);
|
|
138
|
+
const [label, setLabel] = useState("");
|
|
139
|
+
const [days, setDays] = useState(90);
|
|
140
|
+
const [issued, setIssued] = useState(null);
|
|
140
141
|
const coffre = useCoffre();
|
|
141
142
|
const { pending, error, setError, run } = useAction();
|
|
142
143
|
function close() {
|
|
@@ -145,15 +146,15 @@ function IssueToken({ serviceId }) {
|
|
|
145
146
|
setLabel("");
|
|
146
147
|
setError(null);
|
|
147
148
|
}
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("button", {
|
|
149
150
|
className: "btn btn-sm",
|
|
150
151
|
onClick: () => setOpen(true),
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
-
}), /* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ jsx(Plus, { size: 14 }), "Issue token"]
|
|
153
|
+
}), /* @__PURE__ */ jsx(Modal, {
|
|
153
154
|
open,
|
|
154
155
|
onOpenChange: (next) => next ? setOpen(true) : close(),
|
|
155
156
|
title: issued === null ? "Issue a token" : "Copy the token now",
|
|
156
|
-
children: issued === null ? /* @__PURE__ */
|
|
157
|
+
children: issued === null ? /* @__PURE__ */ jsxs("form", {
|
|
157
158
|
className: "form",
|
|
158
159
|
onSubmit: (event) => {
|
|
159
160
|
event.preventDefault();
|
|
@@ -166,93 +167,94 @@ function IssueToken({ serviceId }) {
|
|
|
166
167
|
});
|
|
167
168
|
},
|
|
168
169
|
children: [
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ jsxs("div", {
|
|
170
171
|
className: "form-row",
|
|
171
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
172
173
|
className: "field",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
174
175
|
className: "label",
|
|
175
176
|
children: "Label"
|
|
176
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
177
178
|
className: "input",
|
|
178
179
|
value: label,
|
|
179
180
|
maxLength: 120,
|
|
180
181
|
placeholder: "GitHub Actions deploy",
|
|
181
182
|
onChange: (event) => setLabel(event.target.value)
|
|
182
183
|
})]
|
|
183
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ jsxs("label", {
|
|
184
185
|
className: "field",
|
|
185
186
|
style: { flex: "0 0 9rem" },
|
|
186
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
187
188
|
className: "label",
|
|
188
189
|
children: "Expires after"
|
|
189
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ jsx("select", {
|
|
190
191
|
className: "select",
|
|
191
192
|
value: days,
|
|
192
193
|
onChange: (event) => setDays(Number(event.target.value)),
|
|
193
|
-
children: LIFETIMES.map((lifetime) => /* @__PURE__ */
|
|
194
|
+
children: LIFETIMES.map((lifetime) => /* @__PURE__ */ jsxs("option", {
|
|
194
195
|
value: lifetime,
|
|
195
196
|
children: [lifetime, " days"]
|
|
196
197
|
}, lifetime))
|
|
197
198
|
})]
|
|
198
199
|
})]
|
|
199
200
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ jsx(ErrorLine, { error }),
|
|
202
|
+
/* @__PURE__ */ jsxs("div", {
|
|
202
203
|
className: "dialog-actions",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
204
205
|
className: "btn",
|
|
205
206
|
type: "button",
|
|
206
207
|
onClick: close,
|
|
207
208
|
children: "Cancel"
|
|
208
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
209
210
|
className: "btn btn-primary",
|
|
210
211
|
type: "submit",
|
|
211
212
|
disabled: pending,
|
|
212
|
-
children: [pending && /* @__PURE__ */
|
|
213
|
+
children: [pending && /* @__PURE__ */ jsx(Spinner, {}), "Issue token"]
|
|
213
214
|
})]
|
|
214
215
|
})
|
|
215
216
|
]
|
|
216
|
-
}) : /* @__PURE__ */
|
|
217
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
217
218
|
className: "form",
|
|
218
219
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ jsxs(Notice, {
|
|
220
221
|
tone: "info",
|
|
221
222
|
children: [
|
|
222
|
-
"This is the only time the value is shown. Store it where the service
|
|
223
|
-
|
|
223
|
+
"This is the only time the value is shown. Store it where the service keeps its secrets; a CI run signs the CLI in with it, piped to",
|
|
224
|
+
" ",
|
|
225
|
+
/* @__PURE__ */ jsx("span", {
|
|
224
226
|
className: "mono",
|
|
225
|
-
children: "
|
|
227
|
+
children: "coffre login <url> --token"
|
|
226
228
|
}),
|
|
227
229
|
"."
|
|
228
230
|
]
|
|
229
231
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ jsxs("div", {
|
|
231
233
|
className: "token-once",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ jsx("code", {
|
|
233
235
|
className: "mono",
|
|
234
236
|
children: issued.token
|
|
235
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ jsx(CopyButton, {
|
|
236
238
|
value: issued.token,
|
|
237
239
|
label: "Copy token"
|
|
238
240
|
})]
|
|
239
241
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ jsxs("p", {
|
|
241
243
|
className: "hint",
|
|
242
244
|
children: [
|
|
243
245
|
"Expires ",
|
|
244
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ jsx(Timestamp, { iso: issued.expiresAt }),
|
|
245
247
|
". Send it as",
|
|
246
248
|
" ",
|
|
247
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ jsx("span", {
|
|
248
250
|
className: "mono",
|
|
249
251
|
children: "Authorization: Bearer …"
|
|
250
252
|
})
|
|
251
253
|
]
|
|
252
254
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ jsx("div", {
|
|
254
256
|
className: "dialog-actions",
|
|
255
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
256
258
|
className: "btn btn-primary",
|
|
257
259
|
type: "button",
|
|
258
260
|
onClick: close,
|
|
@@ -264,80 +266,6 @@ function IssueToken({ serviceId }) {
|
|
|
264
266
|
})] });
|
|
265
267
|
}
|
|
266
268
|
//#endregion
|
|
267
|
-
//#region ../core/dist/workloads.js
|
|
268
|
-
/**
|
|
269
|
-
* Events triggered by someone with write access, at a ref the binding names
|
|
270
|
-
* exactly. `pull_request`, `pull_request_target`, `workflow_run` and the
|
|
271
|
-
* rest are refused, even when their ref happens to match: their runs can
|
|
272
|
-
* carry a stranger's code.
|
|
273
|
-
*/
|
|
274
|
-
var GITHUB_EVENTS = [
|
|
275
|
-
"push",
|
|
276
|
-
"workflow_dispatch",
|
|
277
|
-
"schedule",
|
|
278
|
-
"release"
|
|
279
|
-
];
|
|
280
|
-
/** Pipelines that run the project's own code, at its own ref: never a merge request's. */
|
|
281
|
-
var GITLAB_PIPELINE_SOURCES = [
|
|
282
|
-
"push",
|
|
283
|
-
"web",
|
|
284
|
-
"schedule"
|
|
285
|
-
];
|
|
286
|
-
/** `refs/heads/main`, or `refs/tags/v1`, as GitHub names a ref. */
|
|
287
|
-
function fullRef(kind, name) {
|
|
288
|
-
return `refs/${kind === "branch" ? "heads" : "tags"}/${name}`;
|
|
289
|
-
}
|
|
290
|
-
/** A workflow file at a ref, as GitHub's tokens name it: `acme/api/.github/workflows/deploy.yml@refs/heads/main`. */
|
|
291
|
-
function workflowRef(repository, file, ref) {
|
|
292
|
-
return `${repository}/.github/workflows/${file.replace(/^\.github\/workflows\//, "")}@${ref}`;
|
|
293
|
-
}
|
|
294
|
-
/** A workflow of the repository, run by `event` at `ref`. */
|
|
295
|
-
function githubWorkflow(input) {
|
|
296
|
-
return {
|
|
297
|
-
profile: "github",
|
|
298
|
-
claims: {
|
|
299
|
-
repository_owner_id: input.ownerId,
|
|
300
|
-
repository_id: input.repositoryId,
|
|
301
|
-
workflow_ref: workflowRef(input.repository, input.workflow, input.ref),
|
|
302
|
-
ref: input.ref,
|
|
303
|
-
event_name: input.event
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* A reusable workflow at one commit, called at `ref`: from one repository,
|
|
309
|
-
* or, with `repositoryId` null, from any repository of the organization. A
|
|
310
|
-
* `caller` workflow narrows it to one calling workflow.
|
|
311
|
-
*/
|
|
312
|
-
function githubReusable(input) {
|
|
313
|
-
const claims = {
|
|
314
|
-
repository_owner_id: input.ownerId,
|
|
315
|
-
...input.repositoryId === null ? {} : { repository_id: input.repositoryId },
|
|
316
|
-
ref: input.ref,
|
|
317
|
-
event_name: input.event,
|
|
318
|
-
job_workflow_ref: input.called,
|
|
319
|
-
job_workflow_sha: input.sha
|
|
320
|
-
};
|
|
321
|
-
if (input.caller !== void 0) claims.workflow_ref = workflowRef(input.caller.repository, input.caller.workflow, input.ref);
|
|
322
|
-
return {
|
|
323
|
-
profile: input.repositoryId === null ? "github-reusable-organization" : "github-reusable",
|
|
324
|
-
claims
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
/** A GitLab project's pipelines from `source`, at a branch or tag. */
|
|
328
|
-
function gitlabProject(input) {
|
|
329
|
-
return {
|
|
330
|
-
profile: "gitlab",
|
|
331
|
-
claims: {
|
|
332
|
-
namespace_id: input.namespaceId,
|
|
333
|
-
project_id: input.projectId,
|
|
334
|
-
ref_type: input.refType,
|
|
335
|
-
ref: input.ref,
|
|
336
|
-
pipeline_source: input.source
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
//#endregion
|
|
341
269
|
//#region src/lib/bindings.ts
|
|
342
270
|
/**
|
|
343
271
|
* Trust bindings as the pages show and make them. A binding is its claims;
|
|
@@ -471,77 +399,77 @@ function TrustedWorkloads({ serviceId, bindings }) {
|
|
|
471
399
|
const change = removeBinding(useCoffre(), serviceId);
|
|
472
400
|
const remove = useChange(change);
|
|
473
401
|
const { status, dismiss } = useChangeStatus(change.list.queryKey);
|
|
474
|
-
return /* @__PURE__ */
|
|
402
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
475
403
|
labelledBy: "trusted-workloads",
|
|
476
404
|
title: "Trusted workloads",
|
|
477
405
|
description: "CI runs that may sign in as this service with the ID token their platform signs, when every claim of a binding matches. Nothing long-lived is stored.",
|
|
478
|
-
actions: /* @__PURE__ */
|
|
479
|
-
children: bindings.length === 0 ? /* @__PURE__ */
|
|
406
|
+
actions: /* @__PURE__ */ jsx(TrustWorkload, { serviceId }),
|
|
407
|
+
children: bindings.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
480
408
|
title: "No trusted workloads",
|
|
481
409
|
children: "CI can still use a token. Trust a workflow to let its runs sign in without one."
|
|
482
|
-
}) : /* @__PURE__ */
|
|
410
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
483
411
|
className: "dt-wrap",
|
|
484
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
485
413
|
className: "dt",
|
|
486
|
-
children: [/* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
415
|
+
/* @__PURE__ */ jsx("th", { children: "Workload" }),
|
|
416
|
+
/* @__PURE__ */ jsx("th", {
|
|
489
417
|
className: "col-shrink",
|
|
490
418
|
children: "Added (UTC)"
|
|
491
419
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ jsx("th", {
|
|
493
421
|
className: "col-shrink",
|
|
494
422
|
children: "Last used"
|
|
495
423
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ jsx("th", {
|
|
497
425
|
className: "col-actions",
|
|
498
|
-
children: /* @__PURE__ */
|
|
426
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
499
427
|
className: "visually-hidden",
|
|
500
428
|
children: "Actions"
|
|
501
429
|
})
|
|
502
430
|
})
|
|
503
|
-
] }) }), /* @__PURE__ */
|
|
431
|
+
] }) }), /* @__PURE__ */ jsx("tbody", { children: bindings.map((binding) => {
|
|
504
432
|
const state = status(binding.id);
|
|
505
433
|
const { title, detail } = summary(binding);
|
|
506
|
-
return /* @__PURE__ */
|
|
434
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("tr", {
|
|
507
435
|
className: rowClass(state),
|
|
508
436
|
children: [
|
|
509
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("span", {
|
|
510
438
|
className: "cell-account",
|
|
511
|
-
children: [binding.profile.startsWith("github") ? /* @__PURE__ */
|
|
439
|
+
children: [binding.profile.startsWith("github") ? /* @__PURE__ */ jsx(GitHub, { size: 15 }) : /* @__PURE__ */ jsx(Link, { size: 15 }), /* @__PURE__ */ jsxs("span", {
|
|
512
440
|
className: "cell-stack",
|
|
513
441
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ jsx("span", { children: binding.label ?? title }),
|
|
443
|
+
/* @__PURE__ */ jsx("small", { children: binding.label === null ? detail : `${title} · ${detail}` }),
|
|
444
|
+
/* @__PURE__ */ jsxs("details", {
|
|
517
445
|
className: "claims",
|
|
518
|
-
children: [/* @__PURE__ */
|
|
446
|
+
children: [/* @__PURE__ */ jsx("summary", { children: "Claims" }), /* @__PURE__ */ jsx(Claims, { binding })]
|
|
519
447
|
})
|
|
520
448
|
]
|
|
521
449
|
})]
|
|
522
450
|
}) }),
|
|
523
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ jsx("td", {
|
|
524
452
|
className: "nowrap",
|
|
525
|
-
children: /* @__PURE__ */
|
|
453
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
526
454
|
className: "cell-stack",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ jsx(Timestamp, { iso: binding.createdAt }), /* @__PURE__ */ jsxs("small", { children: ["by ", binding.createdBy] })]
|
|
528
456
|
})
|
|
529
457
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ jsx("td", {
|
|
531
459
|
className: "nowrap cell-muted",
|
|
532
|
-
children: binding.lastUsedAt === null ? "Never" : /* @__PURE__ */
|
|
460
|
+
children: binding.lastUsedAt === null ? "Never" : /* @__PURE__ */ jsx(Timestamp, {
|
|
533
461
|
iso: binding.lastUsedAt,
|
|
534
462
|
display: "relative"
|
|
535
463
|
})
|
|
536
464
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ jsx("td", {
|
|
538
466
|
className: "col-actions",
|
|
539
|
-
children: state.state === "pending" ? /* @__PURE__ */
|
|
540
|
-
trigger: /* @__PURE__ */
|
|
467
|
+
children: state.state === "pending" ? /* @__PURE__ */ jsx(RowPending, { status: state }) : /* @__PURE__ */ jsx(ConfirmButton, {
|
|
468
|
+
trigger: /* @__PURE__ */ jsxs("button", {
|
|
541
469
|
className: "act",
|
|
542
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ jsx(X, { size: 13 }), "Remove"]
|
|
543
471
|
}),
|
|
544
|
-
title: /* @__PURE__ */
|
|
472
|
+
title: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
545
473
|
"Stop trusting ",
|
|
546
474
|
binding.label ?? title,
|
|
547
475
|
"?"
|
|
@@ -552,7 +480,7 @@ function TrustedWorkloads({ serviceId, bindings }) {
|
|
|
552
480
|
})
|
|
553
481
|
})
|
|
554
482
|
]
|
|
555
|
-
}), /* @__PURE__ */
|
|
483
|
+
}), /* @__PURE__ */ jsx(RowFailure, {
|
|
556
484
|
status: state,
|
|
557
485
|
columns: 4,
|
|
558
486
|
onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
|
|
@@ -563,21 +491,21 @@ function TrustedWorkloads({ serviceId, bindings }) {
|
|
|
563
491
|
});
|
|
564
492
|
}
|
|
565
493
|
function Claims({ binding }) {
|
|
566
|
-
return /* @__PURE__ */
|
|
494
|
+
return /* @__PURE__ */ jsx("table", {
|
|
567
495
|
className: "claims-table",
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ jsxs("tbody", { children: [
|
|
497
|
+
/* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", { children: "iss" }), /* @__PURE__ */ jsx("td", {
|
|
570
498
|
className: "mono",
|
|
571
499
|
children: binding.issuer
|
|
572
500
|
})] }),
|
|
573
|
-
Object.entries(binding.claims).map(([name, value]) => /* @__PURE__ */
|
|
501
|
+
Object.entries(binding.claims).map(([name, value]) => /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
|
|
574
502
|
className: "mono",
|
|
575
503
|
children: name
|
|
576
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ jsx("td", {
|
|
577
505
|
className: "mono",
|
|
578
506
|
children: value
|
|
579
507
|
})] }, name)),
|
|
580
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", { children: "keys" }), /* @__PURE__ */ jsx("td", {
|
|
581
509
|
className: "mono",
|
|
582
510
|
children: binding.jwksUri
|
|
583
511
|
})] })
|
|
@@ -585,9 +513,9 @@ function Claims({ binding }) {
|
|
|
585
513
|
});
|
|
586
514
|
}
|
|
587
515
|
function TrustWorkload({ serviceId }) {
|
|
588
|
-
const [open, setOpen] =
|
|
589
|
-
const [form, setForm] =
|
|
590
|
-
const [plan, setPlan] =
|
|
516
|
+
const [open, setOpen] = useState(false);
|
|
517
|
+
const [form, setForm] = useState(EMPTY_FORM);
|
|
518
|
+
const [plan, setPlan] = useState(null);
|
|
591
519
|
const coffre = useCoffre();
|
|
592
520
|
const member = memberRef("service", serviceId);
|
|
593
521
|
const { pending, error, setError, run } = useAction();
|
|
@@ -624,104 +552,104 @@ function TrustWorkload({ serviceId }) {
|
|
|
624
552
|
onSuccess: setPlan
|
|
625
553
|
});
|
|
626
554
|
}
|
|
627
|
-
const field = (label, key, props = {}) => /* @__PURE__ */
|
|
555
|
+
const field = (label, key, props = {}) => /* @__PURE__ */ jsxs("label", {
|
|
628
556
|
className: "field",
|
|
629
557
|
children: [
|
|
630
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ jsx("span", {
|
|
631
559
|
className: "label",
|
|
632
560
|
children: label
|
|
633
561
|
}),
|
|
634
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ jsx("input", {
|
|
635
563
|
className: `input${props.mono ? " mono" : ""}`,
|
|
636
564
|
value: form[key],
|
|
637
565
|
placeholder: props.placeholder,
|
|
638
566
|
onChange: (event) => set({ [key]: event.target.value })
|
|
639
567
|
}),
|
|
640
|
-
props.hint !== void 0 && /* @__PURE__ */
|
|
568
|
+
props.hint !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
641
569
|
className: "hint",
|
|
642
570
|
children: props.hint
|
|
643
571
|
})
|
|
644
572
|
]
|
|
645
573
|
});
|
|
646
|
-
const ref = /* @__PURE__ */
|
|
574
|
+
const ref = /* @__PURE__ */ jsxs("div", {
|
|
647
575
|
className: "form-row",
|
|
648
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
649
577
|
className: "field",
|
|
650
578
|
style: { flex: "0 0 8rem" },
|
|
651
|
-
children: [/* @__PURE__ */
|
|
579
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
652
580
|
className: "label",
|
|
653
581
|
children: "At"
|
|
654
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */ jsxs("select", {
|
|
655
583
|
className: "select",
|
|
656
584
|
value: form.refKind,
|
|
657
585
|
onChange: (event) => set({ refKind: event.target.value }),
|
|
658
|
-
children: [/* @__PURE__ */
|
|
586
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
659
587
|
value: "branch",
|
|
660
588
|
children: "Branch"
|
|
661
|
-
}), /* @__PURE__ */
|
|
589
|
+
}), /* @__PURE__ */ jsx("option", {
|
|
662
590
|
value: "tag",
|
|
663
591
|
children: "Tag"
|
|
664
592
|
})]
|
|
665
593
|
})]
|
|
666
594
|
}), field(form.refKind === "branch" ? "Branch" : "Tag", "refName", { mono: true })]
|
|
667
595
|
});
|
|
668
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("button", {
|
|
669
597
|
className: "btn btn-sm",
|
|
670
598
|
onClick: () => setOpen(true),
|
|
671
|
-
children: [/* @__PURE__ */
|
|
672
|
-
}), /* @__PURE__ */
|
|
599
|
+
children: [/* @__PURE__ */ jsx(Plus, { size: 14 }), "Trust a workload"]
|
|
600
|
+
}), /* @__PURE__ */ jsx(Modal, {
|
|
673
601
|
open,
|
|
674
602
|
onOpenChange: (next) => next ? setOpen(true) : close(),
|
|
675
603
|
title: plan === null ? "Trust a workload" : "Review the binding",
|
|
676
|
-
children: plan === null ? /* @__PURE__ */
|
|
604
|
+
children: plan === null ? /* @__PURE__ */ jsxs("form", {
|
|
677
605
|
className: "form",
|
|
678
606
|
onSubmit: (event) => {
|
|
679
607
|
event.preventDefault();
|
|
680
608
|
review();
|
|
681
609
|
},
|
|
682
610
|
children: [
|
|
683
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ jsx("nav", {
|
|
684
612
|
className: "segmented",
|
|
685
613
|
"aria-label": "Platform",
|
|
686
614
|
children: [
|
|
687
615
|
"github",
|
|
688
616
|
"gitlab",
|
|
689
617
|
"other"
|
|
690
|
-
].map((platform) => /* @__PURE__ */
|
|
618
|
+
].map((platform) => /* @__PURE__ */ jsx("button", {
|
|
691
619
|
type: "button",
|
|
692
620
|
"aria-pressed": form.platform === platform,
|
|
693
621
|
onClick: () => set({ platform }),
|
|
694
622
|
children: platform === "github" ? "GitHub Actions" : platform === "gitlab" ? "GitLab" : "Other issuer"
|
|
695
623
|
}, platform))
|
|
696
624
|
}),
|
|
697
|
-
form.platform === "github" && /* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
625
|
+
form.platform === "github" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
626
|
+
/* @__PURE__ */ jsxs("nav", {
|
|
699
627
|
className: "segmented",
|
|
700
628
|
"aria-label": "Workflow",
|
|
701
|
-
children: [/* @__PURE__ */
|
|
629
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
702
630
|
type: "button",
|
|
703
631
|
"aria-pressed": !form.reusable,
|
|
704
632
|
onClick: () => set({ reusable: false }),
|
|
705
633
|
children: "A workflow of the repository"
|
|
706
|
-
}), /* @__PURE__ */
|
|
634
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
707
635
|
type: "button",
|
|
708
636
|
"aria-pressed": form.reusable,
|
|
709
637
|
onClick: () => set({ reusable: true }),
|
|
710
638
|
children: "A reusable workflow"
|
|
711
639
|
})]
|
|
712
640
|
}),
|
|
713
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ jsxs("div", {
|
|
714
642
|
className: "form-row",
|
|
715
643
|
children: [field("Repository", "repository", {
|
|
716
644
|
placeholder: "acme/api",
|
|
717
645
|
mono: true
|
|
718
|
-
}), /* @__PURE__ */
|
|
646
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
719
647
|
className: "field",
|
|
720
648
|
style: {
|
|
721
649
|
flex: "0 0 auto",
|
|
722
650
|
alignSelf: "end"
|
|
723
651
|
},
|
|
724
|
-
children: /* @__PURE__ */
|
|
652
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
725
653
|
className: "btn",
|
|
726
654
|
type: "button",
|
|
727
655
|
disabled: lookup.pending || form.repository.trim() === "",
|
|
@@ -732,20 +660,20 @@ function TrustWorkload({ serviceId }) {
|
|
|
732
660
|
ownerId: ids.ownerId
|
|
733
661
|
})
|
|
734
662
|
}),
|
|
735
|
-
children: [lookup.pending && /* @__PURE__ */
|
|
663
|
+
children: [lookup.pending && /* @__PURE__ */ jsx(Spinner, {}), "Look up IDs"]
|
|
736
664
|
})
|
|
737
665
|
})]
|
|
738
666
|
}),
|
|
739
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ jsxs("div", {
|
|
740
668
|
className: "form-row",
|
|
741
669
|
children: [!(form.reusable && form.anyRepository) && field("Repository ID", "repositoryId", { mono: true }), field("Owner ID", "ownerId", { mono: true })]
|
|
742
670
|
}),
|
|
743
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ jsxs("p", {
|
|
744
672
|
className: "hint",
|
|
745
673
|
children: [
|
|
746
674
|
"Bindings name IDs, which unlike names nobody else can take over. For a private repository:",
|
|
747
675
|
" ",
|
|
748
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ jsxs("span", {
|
|
749
677
|
className: "mono",
|
|
750
678
|
children: [
|
|
751
679
|
"gh api repos/",
|
|
@@ -755,8 +683,8 @@ function TrustWorkload({ serviceId }) {
|
|
|
755
683
|
})
|
|
756
684
|
]
|
|
757
685
|
}),
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
form.reusable ? /* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ jsx(ErrorLine, { error: lookup.error }),
|
|
687
|
+
form.reusable ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
760
688
|
field("Called workflow", "called", {
|
|
761
689
|
placeholder: "acme/deploy/.github/workflows/release.yml@refs/heads/main",
|
|
762
690
|
mono: true
|
|
@@ -771,9 +699,9 @@ function TrustWorkload({ serviceId }) {
|
|
|
771
699
|
mono: true,
|
|
772
700
|
hint: "Left out, every workflow of the repository at the ref below may call it."
|
|
773
701
|
}),
|
|
774
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ jsxs("label", {
|
|
775
703
|
className: "check",
|
|
776
|
-
children: [/* @__PURE__ */
|
|
704
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
777
705
|
type: "checkbox",
|
|
778
706
|
checked: form.anyRepository,
|
|
779
707
|
onChange: (event) => set({ anyRepository: event.target.checked })
|
|
@@ -783,23 +711,23 @@ function TrustWorkload({ serviceId }) {
|
|
|
783
711
|
placeholder: "deploy.yml",
|
|
784
712
|
mono: true
|
|
785
713
|
}),
|
|
786
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsxs("label", {
|
|
787
715
|
className: "field",
|
|
788
716
|
children: [
|
|
789
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ jsx("span", {
|
|
790
718
|
className: "label",
|
|
791
719
|
children: "Event"
|
|
792
720
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ jsx("select", {
|
|
794
722
|
className: "select",
|
|
795
723
|
value: form.event,
|
|
796
724
|
onChange: (event) => set({ event: event.target.value }),
|
|
797
|
-
children: GITHUB_EVENTS.map((event) => /* @__PURE__ */
|
|
725
|
+
children: GITHUB_EVENTS.map((event) => /* @__PURE__ */ jsx("option", {
|
|
798
726
|
value: event,
|
|
799
727
|
children: event
|
|
800
728
|
}, event))
|
|
801
729
|
}),
|
|
802
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ jsx("span", {
|
|
803
731
|
className: "hint",
|
|
804
732
|
children: "Pull requests and workflow_run are never trusted: their runs can carry a stranger's code."
|
|
805
733
|
})
|
|
@@ -807,23 +735,23 @@ function TrustWorkload({ serviceId }) {
|
|
|
807
735
|
}),
|
|
808
736
|
ref
|
|
809
737
|
] }),
|
|
810
|
-
form.platform === "gitlab" && /* @__PURE__ */
|
|
738
|
+
form.platform === "gitlab" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
811
739
|
field("GitLab", "gitlabUrl", {
|
|
812
740
|
placeholder: "https://gitlab.com",
|
|
813
741
|
hint: "Left empty, gitlab.com."
|
|
814
742
|
}),
|
|
815
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ jsxs("div", {
|
|
816
744
|
className: "form-row",
|
|
817
745
|
children: [field("Project", "project", {
|
|
818
746
|
placeholder: "acme/api",
|
|
819
747
|
mono: true
|
|
820
|
-
}), /* @__PURE__ */
|
|
748
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
821
749
|
className: "field",
|
|
822
750
|
style: {
|
|
823
751
|
flex: "0 0 auto",
|
|
824
752
|
alignSelf: "end"
|
|
825
753
|
},
|
|
826
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
827
755
|
className: "btn",
|
|
828
756
|
type: "button",
|
|
829
757
|
disabled: lookup.pending || form.project.trim() === "",
|
|
@@ -837,58 +765,58 @@ function TrustWorkload({ serviceId }) {
|
|
|
837
765
|
namespaceId: ids.namespaceId
|
|
838
766
|
})
|
|
839
767
|
}),
|
|
840
|
-
children: [lookup.pending && /* @__PURE__ */
|
|
768
|
+
children: [lookup.pending && /* @__PURE__ */ jsx(Spinner, {}), "Look up IDs"]
|
|
841
769
|
})
|
|
842
770
|
})]
|
|
843
771
|
}),
|
|
844
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ jsxs("div", {
|
|
845
773
|
className: "form-row",
|
|
846
774
|
children: [field("Project ID", "projectId", { mono: true }), field("Namespace ID", "namespaceId", { mono: true })]
|
|
847
775
|
}),
|
|
848
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ jsx(ErrorLine, { error: lookup.error }),
|
|
849
777
|
ref,
|
|
850
|
-
/* @__PURE__ */
|
|
778
|
+
/* @__PURE__ */ jsxs("label", {
|
|
851
779
|
className: "field",
|
|
852
780
|
children: [
|
|
853
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ jsx("span", {
|
|
854
782
|
className: "label",
|
|
855
783
|
children: "Pipeline source"
|
|
856
784
|
}),
|
|
857
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ jsx("select", {
|
|
858
786
|
className: "select",
|
|
859
787
|
value: form.source,
|
|
860
788
|
onChange: (event) => set({ source: event.target.value }),
|
|
861
|
-
children: GITLAB_PIPELINE_SOURCES.map((source) => /* @__PURE__ */
|
|
789
|
+
children: GITLAB_PIPELINE_SOURCES.map((source) => /* @__PURE__ */ jsx("option", {
|
|
862
790
|
value: source,
|
|
863
791
|
children: source
|
|
864
792
|
}, source))
|
|
865
793
|
}),
|
|
866
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ jsx("span", {
|
|
867
795
|
className: "hint",
|
|
868
796
|
children: "Merge-request pipelines are never trusted: they name another project."
|
|
869
797
|
})
|
|
870
798
|
]
|
|
871
799
|
})
|
|
872
800
|
] }),
|
|
873
|
-
form.platform === "other" && /* @__PURE__ */
|
|
801
|
+
form.platform === "other" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
874
802
|
field("Issuer", "issuer", { placeholder: "https://accounts.google.com" }),
|
|
875
803
|
field("Subject (sub)", "sub", {
|
|
876
804
|
mono: true,
|
|
877
805
|
hint: "You vouch for what this issuer's subject means: a Google service account's unique ID, say."
|
|
878
806
|
}),
|
|
879
|
-
/* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ jsxs("label", {
|
|
880
808
|
className: "field",
|
|
881
|
-
children: [/* @__PURE__ */
|
|
809
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
882
810
|
className: "label",
|
|
883
811
|
children: [
|
|
884
812
|
"Other claims, one ",
|
|
885
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ jsx("span", {
|
|
886
814
|
className: "mono",
|
|
887
815
|
children: "name=value"
|
|
888
816
|
}),
|
|
889
817
|
" a line"
|
|
890
818
|
]
|
|
891
|
-
}), /* @__PURE__ */
|
|
819
|
+
}), /* @__PURE__ */ jsx("textarea", {
|
|
892
820
|
className: "input mono",
|
|
893
821
|
rows: 3,
|
|
894
822
|
value: form.extra,
|
|
@@ -897,35 +825,35 @@ function TrustWorkload({ serviceId }) {
|
|
|
897
825
|
})
|
|
898
826
|
] }),
|
|
899
827
|
field("Label (optional)", "label", { placeholder: "Deploys to production" }),
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ jsx(ErrorLine, { error }),
|
|
829
|
+
/* @__PURE__ */ jsxs("div", {
|
|
902
830
|
className: "dialog-actions",
|
|
903
|
-
children: [/* @__PURE__ */
|
|
831
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
904
832
|
className: "btn",
|
|
905
833
|
type: "button",
|
|
906
834
|
onClick: close,
|
|
907
835
|
children: "Cancel"
|
|
908
|
-
}), /* @__PURE__ */
|
|
836
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
909
837
|
className: "btn btn-primary",
|
|
910
838
|
type: "submit",
|
|
911
839
|
disabled: pending,
|
|
912
|
-
children: [pending && /* @__PURE__ */
|
|
840
|
+
children: [pending && /* @__PURE__ */ jsx(Spinner, {}), "Review"]
|
|
913
841
|
})]
|
|
914
842
|
})
|
|
915
843
|
]
|
|
916
|
-
}) : /* @__PURE__ */
|
|
844
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
917
845
|
className: "form",
|
|
918
846
|
children: [
|
|
919
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
920
848
|
"Runs whose ID token carries exactly these claims will sign in as ",
|
|
921
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ jsx("span", {
|
|
922
850
|
className: "mono",
|
|
923
851
|
children: member
|
|
924
852
|
}),
|
|
925
853
|
", and read what it may read."
|
|
926
854
|
] }),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
plan.replaces.length > 0 && /* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ jsx(Claims, { binding: plan }),
|
|
856
|
+
plan.replaces.length > 0 && /* @__PURE__ */ jsxs(Notice, {
|
|
929
857
|
tone: "info",
|
|
930
858
|
children: [
|
|
931
859
|
"This replaces ",
|
|
@@ -934,15 +862,15 @@ function TrustWorkload({ serviceId }) {
|
|
|
934
862
|
"."
|
|
935
863
|
]
|
|
936
864
|
}),
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ jsx(ErrorLine, { error }),
|
|
866
|
+
/* @__PURE__ */ jsxs("div", {
|
|
939
867
|
className: "dialog-actions",
|
|
940
|
-
children: [/* @__PURE__ */
|
|
868
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
941
869
|
className: "btn",
|
|
942
870
|
type: "button",
|
|
943
871
|
onClick: () => setPlan(null),
|
|
944
872
|
children: "Back"
|
|
945
|
-
}), /* @__PURE__ */
|
|
873
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
946
874
|
className: "btn btn-primary",
|
|
947
875
|
type: "button",
|
|
948
876
|
disabled: pending,
|
|
@@ -950,7 +878,7 @@ function TrustWorkload({ serviceId }) {
|
|
|
950
878
|
affects: affects.bindings(member),
|
|
951
879
|
onSuccess: close
|
|
952
880
|
}),
|
|
953
|
-
children: [pending && /* @__PURE__ */
|
|
881
|
+
children: [pending && /* @__PURE__ */ jsx(Spinner, {}), "Save binding"]
|
|
954
882
|
})]
|
|
955
883
|
})
|
|
956
884
|
]
|
|
@@ -958,7 +886,8 @@ function TrustWorkload({ serviceId }) {
|
|
|
958
886
|
})] });
|
|
959
887
|
}
|
|
960
888
|
//#endregion
|
|
961
|
-
//#region src/
|
|
889
|
+
//#region src/pages/token.tsx
|
|
890
|
+
var Route = pageRoute();
|
|
962
891
|
function TokenPage() {
|
|
963
892
|
const { token } = Route.useParams();
|
|
964
893
|
const client = useCoffre();
|
|
@@ -969,20 +898,22 @@ function TokenPage() {
|
|
|
969
898
|
const { data: credentials } = useSuspenseQuery(queries.credentials(client, member, owner && auth.signin !== null));
|
|
970
899
|
const { data: bindings } = useSuspenseQuery(queries.bindings(client, member, owner && auth.signin !== null));
|
|
971
900
|
const active = report?.ok === true && report.report?.status === "active";
|
|
972
|
-
return /* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
902
|
+
/* @__PURE__ */ jsx(PrincipalPage, {
|
|
974
903
|
principalType: "service",
|
|
975
904
|
principalId: token
|
|
976
905
|
}),
|
|
977
|
-
active && credentials?.ok === true && /* @__PURE__ */
|
|
906
|
+
active && credentials?.ok === true && /* @__PURE__ */ jsx(ServiceTokens, {
|
|
978
907
|
serviceId: token,
|
|
979
908
|
tokens: credentials.tokens
|
|
980
909
|
}),
|
|
981
|
-
active && bindings?.ok === true && /* @__PURE__ */
|
|
910
|
+
active && bindings?.ok === true && /* @__PURE__ */ jsx(TrustedWorkloads, {
|
|
982
911
|
serviceId: token,
|
|
983
912
|
bindings: bindings.bindings
|
|
984
913
|
})
|
|
985
914
|
] });
|
|
986
915
|
}
|
|
987
916
|
//#endregion
|
|
988
|
-
export { TokenPage
|
|
917
|
+
export { TokenPage };
|
|
918
|
+
|
|
919
|
+
//# sourceMappingURL=token.js.map
|