@coffre/ui 0.1.15 → 0.1.17

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.
Files changed (108) hide show
  1. package/dist/client/_coffre/assets/{account-DqjL4kP9.js → account-BoLGAxbD.js} +2 -2
  2. package/dist/client/_coffre/assets/{account-DGGcVkqt.js → account-CnnuRTDB.js} +1 -1
  3. package/dist/client/_coffre/assets/{affordances-B9nFwqIv.js → affordances-CEafRJcN.js} +1 -1
  4. package/dist/client/_coffre/assets/audit-CHSvKLWX.js +1 -0
  5. package/dist/client/_coffre/assets/audit-Cn4hmS4u.js +2 -0
  6. package/dist/client/_coffre/assets/{auth.device-CHHcm089.js → auth.device-Co5vrpaA.js} +2 -2
  7. package/dist/client/_coffre/assets/{auth.device-CFCn1DXA.js → auth.device-DAlqWacc.js} +1 -1
  8. package/dist/client/_coffre/assets/{directory-skRBmF1Y.js → directory-H8Eh3MnS.js} +1 -1
  9. package/dist/client/_coffre/assets/{dist-BHhATf1q.js → dist-Braunv_x.js} +1 -1
  10. package/dist/client/_coffre/assets/globals-CpMrgkV6.css +1 -0
  11. package/dist/client/_coffre/assets/{grants-BEmVXYg5.js → grants-DPDxJXU1.js} +1 -1
  12. package/dist/client/_coffre/assets/icons-Dc_-t0lp.js +1 -0
  13. package/dist/client/_coffre/assets/{index-Bo6udWLL.js → index-sUCIXRgJ.js} +3 -3
  14. package/dist/client/_coffre/assets/{link-Bg_PHv45.js → link-DBINMwm6.js} +1 -1
  15. package/dist/client/_coffre/assets/{login-GV0ZjCQy.js → login-BZFYfL1Y.js} +1 -1
  16. package/dist/client/_coffre/assets/login-CYCKWTOD.js +2 -0
  17. package/dist/client/_coffre/assets/{offboarding-CXV0KyMt.js → offboarding-Bwpftp3g.js} +1 -1
  18. package/dist/client/_coffre/assets/page-C_hnzdaR.js +1 -0
  19. package/dist/client/_coffre/assets/{preload-helper-CYFH1xAV.js → preload-helper-CLkO85Nq.js} +1 -1
  20. package/dist/client/_coffre/assets/{principal-page-BmgkTnAl.js → principal-page-DLho8TSJ.js} +1 -1
  21. package/dist/client/_coffre/assets/projects._project._environment-DHRRvQw0.js +3 -0
  22. package/dist/client/_coffre/assets/projects._project._environment-TLI-RjBZ.js +2 -0
  23. package/dist/client/_coffre/assets/projects._project.index-BO-8FZIY.js +2 -0
  24. package/dist/client/_coffre/assets/{projects._project.index-wjtfc8E6.js → projects._project.index-DGl921dP.js} +1 -1
  25. package/dist/client/_coffre/assets/{projects.index-dl7dfnGW.js → projects.index-BDn7Bhoo.js} +1 -1
  26. package/dist/client/_coffre/assets/{row-state-BzGdu73b.js → row-state-DJ-KLamZ.js} +1 -1
  27. package/dist/client/_coffre/assets/{settings-DnENNWn8.js → settings-q9G1QvR_.js} +1 -1
  28. package/dist/client/_coffre/assets/{suspense-Cnh1cNc1.js → suspense-O8sP0mEC.js} +1 -1
  29. package/dist/client/_coffre/assets/tokens._token-B_qczpT9.js +2 -0
  30. package/dist/client/_coffre/assets/tokens._token-T-sqwMbz.js +2 -0
  31. package/dist/client/_coffre/assets/{tokens.index-D4HYaFJl.js → tokens.index-CcXSZnAG.js} +1 -1
  32. package/dist/client/_coffre/assets/{ui-Ch0beQy-.js → ui-BXP2IqrW.js} +2 -2
  33. package/dist/client/_coffre/assets/{unregistered-wV1yqr9t.js → unregistered-D2JXJ90x.js} +1 -1
  34. package/dist/client/_coffre/assets/{use-action-cgaBRBBH.js → use-action-BpzKWhgg.js} +1 -1
  35. package/dist/client/_coffre/assets/use-change-CKj3Inq9.js +1 -0
  36. package/dist/client/_coffre/assets/{use-shell-BJwawvkh.js → use-shell-W0SusPkz.js} +1 -1
  37. package/dist/client/_coffre/assets/useQuery-B-lxFSES.js +1 -0
  38. package/dist/client/_coffre/assets/{useSuspenseQuery-BfnNEmf7.js → useSuspenseQuery-BZ-nzHST.js} +1 -1
  39. package/dist/client/_coffre/assets/users._user-Bb3BGYHl.js +1 -0
  40. package/dist/client/_coffre/assets/users._user-DXmvKrzE.js +2 -0
  41. package/dist/client/_coffre/assets/{users.index-C7_aZ0jb.js → users.index-BvzP3qwW.js} +1 -1
  42. package/dist/server/.vite/manifest.json +205 -205
  43. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js +162 -0
  44. package/dist/server/_coffre/assets/{account-BJtaf5d7.js → account-CV-a2IU2.js} +8 -8
  45. package/dist/server/_coffre/assets/{account-CL3AX6kY.js → account-hk6wcIXU.js} +4 -4
  46. package/dist/server/_coffre/assets/{audit-DiHTzVVe.js → audit-C1_Ej6YB.js} +2 -2
  47. package/dist/server/_coffre/assets/{audit-BtjuffEH.js → audit-qB9G2AQJ.js} +37 -9
  48. package/dist/server/_coffre/assets/{auth.device-8RMD0nyz.js → auth.device-6JRrWbSV.js} +4 -4
  49. package/dist/server/_coffre/assets/{auth.device-dUMx6Srl.js → auth.device-CLoAxC2T.js} +2 -2
  50. package/dist/server/_coffre/assets/{directory-9Jc5MEra.js → directory-B-_rqsPx.js} +5 -5
  51. package/dist/server/_coffre/assets/globals-CpMrgkV6.css +1 -0
  52. package/dist/server/_coffre/assets/{grants-D5-q8fXB.js → grants-DdKT11Ny.js} +5 -5
  53. package/dist/server/_coffre/assets/{icons-CWsTEfpn.js → icons-DOFT-eWB.js} +3 -2
  54. package/dist/server/_coffre/assets/{login-C80ImEsO.js → login-DRKUKkaW.js} +1 -1
  55. package/dist/server/_coffre/assets/{login-DmpfrcPB.js → login-DnwxVl4Y.js} +5 -5
  56. package/dist/server/_coffre/assets/{offboarding-CXIgvZbO.js → offboarding-CRz-K82H.js} +4 -4
  57. package/dist/server/_coffre/assets/{page-x4nICC9d.js → page-D6n45dcK.js} +28 -0
  58. package/dist/server/_coffre/assets/{principal-page-BO6Ijpqv.js → principal-page-C-EFwJQw.js} +11 -11
  59. package/dist/server/_coffre/assets/{projects._project._environment-BMqZsCfi.js → projects._project._environment-C6uybzeU.js} +9 -9
  60. package/dist/server/_coffre/assets/{projects._project._environment-BeXpetmJ.js → projects._project._environment-CS8DdSMY.js} +2 -2
  61. package/dist/server/_coffre/assets/{projects._project.index-B74-XdI3.js → projects._project.index-3CXwkyTh.js} +12 -12
  62. package/dist/server/_coffre/assets/{projects._project.index-DZ1KZvHR.js → projects._project.index-BGfcNpj0.js} +2 -2
  63. package/dist/server/_coffre/assets/{projects.index-D7F7hiVe.js → projects.index-iSoBpRFz.js} +7 -7
  64. package/dist/server/_coffre/assets/{router-fxr2e6Ht.js → router-9BTgJhWG.js} +20 -20
  65. package/dist/server/_coffre/assets/{row-state-CAItu3n_.js → row-state-C2P57xT1.js} +2 -2
  66. package/dist/server/_coffre/assets/{settings-DO8wvTmo.js → settings-BDQTF5XW.js} +3 -3
  67. package/dist/server/_coffre/assets/{suspense-WsBv84ga.js → suspense-C-2QfDd2.js} +1 -1
  68. package/dist/server/_coffre/assets/tokens._token-CrBMpcbN.js +988 -0
  69. package/dist/server/_coffre/assets/{tokens._token-DhcJxsf3.js → tokens._token-rY86Cjgp.js} +2 -2
  70. package/dist/server/_coffre/assets/{tokens.index-hvPM5IjY.js → tokens.index-Bq5qDW9q.js} +6 -6
  71. package/dist/server/_coffre/assets/{ui-DvlGkmaH.js → ui-Cc0CGMtr.js} +1 -1
  72. package/dist/server/_coffre/assets/{unregistered-DKdzrjVr.js → unregistered-D9ZKLOPJ.js} +3 -3
  73. package/dist/server/_coffre/assets/{use-action-D6KlY-sv.js → use-action-B-xpvVRO.js} +2 -2
  74. package/dist/server/_coffre/assets/{use-change-CAcOZo-a.js → use-change-C8BCf3oU.js} +20 -4
  75. package/dist/server/_coffre/assets/{use-shell-C-yuQ1hA.js → use-shell-DwOzEi87.js} +2 -2
  76. package/dist/server/_coffre/assets/{useQuery-MqmaAeUF.js → useQuery-CTe86qFq.js} +2 -2
  77. package/dist/server/_coffre/assets/{useSuspenseQuery-BDvlOPB7.js → useSuspenseQuery-CSoHzrMb.js} +2 -2
  78. package/dist/server/_coffre/assets/{users._user-dCIYuxyZ.js → users._user-BmLKYeo_.js} +2 -2
  79. package/dist/server/_coffre/assets/{users._user-pLdzKe1F.js → users._user-BmiHwQx3.js} +2 -2
  80. package/dist/server/_coffre/assets/{users.index-CDCDlQxN.js → users.index-BiEax90r.js} +6 -6
  81. package/dist/server/index.js +2 -2
  82. package/package.json +3 -3
  83. package/src/components/trusted-workloads.tsx +379 -0
  84. package/src/lib/audit-sentences.ts +26 -0
  85. package/src/lib/bindings.ts +111 -0
  86. package/src/lib/changes.ts +16 -0
  87. package/src/lib/queries.ts +16 -0
  88. package/src/routes/audit.tsx +7 -0
  89. package/src/routes/tokens.$token.tsx +3 -0
  90. package/src/styles/globals.css +43 -0
  91. package/dist/client/_coffre/assets/audit-CcQmaSan.js +0 -1
  92. package/dist/client/_coffre/assets/audit-XwuBA4r9.js +0 -2
  93. package/dist/client/_coffre/assets/globals-DCrHjrpD.css +0 -1
  94. package/dist/client/_coffre/assets/icons-BFziRUf9.js +0 -1
  95. package/dist/client/_coffre/assets/login-pzHGDqU5.js +0 -2
  96. package/dist/client/_coffre/assets/page-CDuo3uft.js +0 -1
  97. package/dist/client/_coffre/assets/projects._project._environment-5PA9NHET.js +0 -2
  98. package/dist/client/_coffre/assets/projects._project._environment-B-5I0ZFP.js +0 -3
  99. package/dist/client/_coffre/assets/projects._project.index-BzJQojbd.js +0 -2
  100. package/dist/client/_coffre/assets/tokens._token-BJiMX2TJ.js +0 -1
  101. package/dist/client/_coffre/assets/tokens._token-C2s6HHWK.js +0 -2
  102. package/dist/client/_coffre/assets/use-change-DIpkq9iI.js +0 -1
  103. package/dist/client/_coffre/assets/useQuery-BHCBwHtH.js +0 -1
  104. package/dist/client/_coffre/assets/users._user--OY2srG0.js +0 -1
  105. package/dist/client/_coffre/assets/users._user-Cj4NY0p5.js +0 -2
  106. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-C-_y9u60.js +0 -162
  107. package/dist/server/_coffre/assets/globals-DCrHjrpD.css +0 -1
  108. package/dist/server/_coffre/assets/tokens._token-CVWTFOM-.js +0 -286
@@ -1,7 +1,7 @@
1
1
  import { n as createFileRoute, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
2
- import { u as loadPrincipal } from "./page-x4nICC9d.js";
2
+ import { u as loadPrincipal } from "./page-D6n45dcK.js";
3
3
  //#region src/routes/tokens.$token.tsx
4
- var $$splitComponentImporter = () => import("./tokens._token-CVWTFOM-.js");
4
+ var $$splitComponentImporter = () => import("./tokens._token-CrBMpcbN.js");
5
5
  var Route = createFileRoute("/tokens/$token")({
6
6
  loader: ({ context: { client, queryClient }, params }) => loadPrincipal(queryClient, client, "service", params.token),
7
7
  component: lazyRouteComponent($$splitComponentImporter, "component")
@@ -1,10 +1,10 @@
1
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-x4nICC9d.js";
3
- import { t as useShell } from "./use-shell-C-yuQ1hA.js";
4
- import { t as useSuspenseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
5
- import { v as Key } from "./icons-CWsTEfpn.js";
6
- import { n as DirectoryTable, t as AddPrincipal } from "./directory-9Jc5MEra.js";
7
- import { n as RemovedList } from "./offboarding-CXIgvZbO.js";
2
+ import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-D6n45dcK.js";
3
+ import { t as useShell } from "./use-shell-DwOzEi87.js";
4
+ import { t as useSuspenseQuery } from "./useSuspenseQuery-CSoHzrMb.js";
5
+ import { v as Key } from "./icons-DOFT-eWB.js";
6
+ import { n as DirectoryTable, t as AddPrincipal } from "./directory-B-_rqsPx.js";
7
+ import { n as RemovedList } from "./offboarding-CRz-K82H.js";
8
8
  //#region src/routes/tokens.index.tsx?tsr-split=component
9
9
  var import_jsx_runtime = require_jsx_runtime();
10
10
  function TokensPage() {
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, o as __exportAll, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
2
  import { t as require_react_dom } from "./react-dom-bBoJXlK2.js";
3
- import { W as X, _ as Info, a as Check, n as AlertCircle, r as AlertTriangle, u as Copy, x as Loader } from "./icons-CWsTEfpn.js";
3
+ import { G as X, S as Loader, _ as Info, a as Check, n as AlertCircle, r as AlertTriangle, u as Copy } from "./icons-DOFT-eWB.js";
4
4
  //#region ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.3_@types+react@19.2.17_react@19.2.7/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
5
5
  var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
6
6
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
@@ -1,7 +1,7 @@
1
1
  import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
2
- import { n as ClosedDoor } from "./page-x4nICC9d.js";
3
- import { t as useShell } from "./use-shell-C-yuQ1hA.js";
4
- import { V as User } from "./icons-CWsTEfpn.js";
2
+ import { n as ClosedDoor } from "./page-D6n45dcK.js";
3
+ import { t as useShell } from "./use-shell-DwOzEi87.js";
4
+ import { H as User } from "./icons-DOFT-eWB.js";
5
5
  //#region src/routes/unregistered.tsx?tsr-split=component
6
6
  var import_jsx_runtime = require_jsx_runtime();
7
7
  /**
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { g as refresh, y as failureMessage } from "./page-x4nICC9d.js";
3
- import { f as useQueryClient } from "./suspense-WsBv84ga.js";
2
+ import { g as refresh, y as failureMessage } from "./page-D6n45dcK.js";
3
+ import { f as useQueryClient } from "./suspense-C-2QfDd2.js";
4
4
  //#region src/lib/use-action.ts
5
5
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, R as shouldThrowError, T as getDefaultState, b as memberRef, c as keys, g as refresh, j as hashKey, k as Subscribable, o as affects, v as Refusal, y as failureMessage } from "./page-x4nICC9d.js";
3
- import { f as useQueryClient } from "./suspense-WsBv84ga.js";
4
- import { o as announce } from "./row-state-CAItu3n_.js";
2
+ import { D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, R as shouldThrowError, T as getDefaultState, b as memberRef, c as keys, g as refresh, j as hashKey, k as Subscribable, o as affects, v as Refusal, y as failureMessage } from "./page-D6n45dcK.js";
3
+ import { f as useQueryClient } from "./suspense-C-2QfDd2.js";
4
+ import { o as announce } from "./row-state-C2P57xT1.js";
5
5
  //#region ../../node_modules/.pnpm/@tanstack+query-core@5.103.1/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
6
6
  /**
7
7
  * Observes a single mutation and derives a `MutationObserverResult` from it.
@@ -782,6 +782,22 @@ function revokeCredential(client, serviceId) {
782
782
  run: (token) => client.tokens.revoke(member, token.id)
783
783
  };
784
784
  }
785
+ /** Removing a trust binding: its tombstone, as far as the page goes, is the row leaving. */
786
+ function removeBinding(client, serviceId) {
787
+ const member = memberRef("service", serviceId);
788
+ return {
789
+ list: listOf([...keys.bindings(member), { allowed: true }], "bindings", (binding) => binding.id),
790
+ label: (binding) => binding.label === null ? "the binding" : `binding ${binding.label}`,
791
+ targets: (binding) => [removing(binding.id)],
792
+ removing: {
793
+ pending: "Removing…",
794
+ done: "removed",
795
+ failed: "Not removed."
796
+ },
797
+ affects: () => affects.bindings(member),
798
+ run: (binding) => client.bindings.remove(member, binding.id)
799
+ };
800
+ }
785
801
  function endSession(client) {
786
802
  return {
787
803
  list: listOf(keys.sessions, "sessions", (session) => session.id),
@@ -1209,4 +1225,4 @@ function useChangeStatus(list) {
1209
1225
  };
1210
1226
  }
1211
1227
  //#endregion
1212
- export { hasSecretEditConflict as C, projectAccessOptions as D, projectAccessLabel as E, unlinkIdentity as S, parseProjectAccess as T, renameEnvironment as _, archiveSecret as a, revokeGrant as b, createProject as c, environmentId as d, grantAccess as f, removeMember as g, projectsList as h, archiveEnvironment as i, directoryList as l, invite as m, useChangeStatus as n, changeRole as o, grantId as p, UnsavedEdits as r, createEnvironment as s, useChange as t, endSession as u, restoreSecret as v, secretChangeFor as w, saveSecrets as x, revokeCredential as y };
1228
+ export { unlinkIdentity as C, projectAccessLabel as D, parseProjectAccess as E, projectAccessOptions as O, saveSecrets as S, secretChangeFor as T, removeMember as _, archiveSecret as a, revokeCredential as b, createProject as c, environmentId as d, grantAccess as f, removeBinding as g, projectsList as h, archiveEnvironment as i, directoryList as l, invite as m, useChangeStatus as n, changeRole as o, grantId as p, UnsavedEdits as r, createEnvironment as s, useChange as t, endSession as u, renameEnvironment as v, hasSecretEditConflict as w, revokeGrant as x, restoreSecret as y };
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { C as useCoffre, D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, _ as shellOf, h as queries, k as Subscribable } from "./page-x4nICC9d.js";
3
- import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-WsBv84ga.js";
2
+ import { C as useCoffre, D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, _ as shellOf, h as queries, k as Subscribable } from "./page-D6n45dcK.js";
3
+ import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-C-2QfDd2.js";
4
4
  //#region ../../node_modules/.pnpm/@tanstack+query-core@5.103.1/node_modules/@tanstack/query-core/build/modern/queriesObserver.js
5
5
  function difference(array1, array2) {
6
6
  const excludeSet = new Set(array2);
@@ -1,5 +1,5 @@
1
- import { u as QueryObserver } from "./suspense-WsBv84ga.js";
2
- import { n as useBaseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
1
+ import { u as QueryObserver } from "./suspense-C-2QfDd2.js";
2
+ import { n as useBaseQuery } from "./useSuspenseQuery-CSoHzrMb.js";
3
3
  //#region ../../node_modules/.pnpm/@tanstack+react-query@5.103.1_react@19.2.7/node_modules/@tanstack/react-query/build/modern/useQuery.js
4
4
  function useQuery(options, queryClient) {
5
5
  return useBaseQuery(options, QueryObserver, queryClient);
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { D as notifyManager, N as noop } from "./page-x4nICC9d.js";
3
- import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-WsBv84ga.js";
2
+ import { D as notifyManager, N as noop } from "./page-D6n45dcK.js";
3
+ import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-C-2QfDd2.js";
4
4
  //#region ../../node_modules/.pnpm/@tanstack+react-query@5.103.1_react@19.2.7/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
5
5
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
6
  function useBaseQuery(options, Observer, queryClient) {
@@ -1,7 +1,7 @@
1
1
  import { n as createFileRoute, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
2
- import { u as loadPrincipal } from "./page-x4nICC9d.js";
2
+ import { u as loadPrincipal } from "./page-D6n45dcK.js";
3
3
  //#region src/routes/users.$user.tsx
4
- var $$splitComponentImporter = () => import("./users._user-pLdzKe1F.js");
4
+ var $$splitComponentImporter = () => import("./users._user-BmiHwQx3.js");
5
5
  var Route = createFileRoute("/users/$user")({
6
6
  loader: ({ context: { client, queryClient }, params }) => loadPrincipal(queryClient, client, "user", params.user),
7
7
  component: lazyRouteComponent($$splitComponentImporter, "component")
@@ -1,6 +1,6 @@
1
1
  import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
2
- import { t as Route } from "./users._user-dCIYuxyZ.js";
3
- import { t as PrincipalPage } from "./principal-page-BO6Ijpqv.js";
2
+ import { t as Route } from "./users._user-BmLKYeo_.js";
3
+ import { t as PrincipalPage } from "./principal-page-C-EFwJQw.js";
4
4
  //#region src/routes/users.$user.tsx?tsr-split=component
5
5
  var import_jsx_runtime = require_jsx_runtime();
6
6
  function UserPage() {
@@ -1,10 +1,10 @@
1
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-x4nICC9d.js";
3
- import { t as useShell } from "./use-shell-C-yuQ1hA.js";
4
- import { t as useSuspenseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
5
- import { U as Users } from "./icons-CWsTEfpn.js";
6
- import { n as DirectoryTable, t as AddPrincipal } from "./directory-9Jc5MEra.js";
7
- import { n as RemovedList } from "./offboarding-CXIgvZbO.js";
2
+ import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-D6n45dcK.js";
3
+ import { t as useShell } from "./use-shell-DwOzEi87.js";
4
+ import { t as useSuspenseQuery } from "./useSuspenseQuery-CSoHzrMb.js";
5
+ import { W as Users } from "./icons-DOFT-eWB.js";
6
+ import { n as DirectoryTable, t as AddPrincipal } from "./directory-B-_rqsPx.js";
7
+ import { n as RemovedList } from "./offboarding-CRz-K82H.js";
8
8
  //#region src/routes/users.index.tsx?tsr-split=component
9
9
  var import_jsx_runtime = require_jsx_runtime();
10
10
  function UsersPage() {
@@ -12381,7 +12381,7 @@ var HEADERS = { TSS_SHELL: "X-TSS_SHELL" };
12381
12381
  * the dev styles URL for route-scoped CSS collection.
12382
12382
  */
12383
12383
  async function getStartManifest(matchedRoutes) {
12384
- const { tsrStartManifest } = await import("./_coffre/assets/_tanstack-start-manifest_v-C-_y9u60.js");
12384
+ const { tsrStartManifest } = await import("./_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js");
12385
12385
  const startManifest = tsrStartManifest();
12386
12386
  let routes = startManifest.routes;
12387
12387
  routes[rootRouteId];
@@ -13508,7 +13508,7 @@ var getBaseManifest = getProdBaseManifest;
13508
13508
  var createEarlyHintsForRequest = createEarlyHintsCollector;
13509
13509
  async function loadEntries() {
13510
13510
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
13511
- import("./_coffre/assets/router-fxr2e6Ht.js"),
13511
+ import("./_coffre/assets/router-9BTgJhWG.js"),
13512
13512
  import("./_coffre/assets/start-DR3rN0St.js"),
13513
13513
  import("./_coffre/assets/empty-plugin-adapters-Cq4--YW-.js")
13514
13514
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/ui",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "coffre's pages: a prebuilt TanStack Start handler and its static files.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "dependencies": {
31
- "@coffre/client": "0.1.15"
31
+ "@coffre/client": "0.1.17"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@cloudflare/vite-plugin": "1.50.0",
@@ -53,7 +53,7 @@
53
53
  "typescript": "5.9.3",
54
54
  "vite": "8.1.5",
55
55
  "wrangler": "4.118.0",
56
- "@coffre/core": "0.1.15"
56
+ "@coffre/core": "0.1.17"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "vite build && rm dist/server/wrangler.json && tsdown && node ../../scripts/check-client-bundle.mjs",
@@ -0,0 +1,379 @@
1
+ import type { BindingPlan, BindingView } from '@coffre/client';
2
+ import { GITHUB_EVENTS, GITLAB_PIPELINE_SOURCES } from '@coffre/core/workloads';
3
+ import { Fragment, useState } from 'react';
4
+ import { bindingOf, EMPTY_FORM, summary, type Form, type RefKind } from '../lib/bindings';
5
+ import { removeBinding } from '../lib/changes';
6
+ import { memberRef, useCoffre } from '../lib/coffre';
7
+ import { affects } from '../lib/queries';
8
+ import { useAction } from '../lib/use-action';
9
+ import { useChange, useChangeStatus } from '../lib/use-change';
10
+ import { RowFailure, RowPending, rowClass } from './row-state';
11
+ import { Card } from './page';
12
+ import { ConfirmButton, EmptyState, ErrorLine, Modal, Notice, Spinner, Timestamp } from './ui';
13
+ import { GitHub, Link, Plus, X } from './icons';
14
+
15
+ /**
16
+ * The CI runs that may sign in as a service, by the ID token their platform
17
+ * signs for each run (docs/design/oidc.md). A run is trusted only when
18
+ * every claim of a binding matches exactly, so the claims are what the page
19
+ * shows, in full, before anything is saved.
20
+ */
21
+ export function TrustedWorkloads({ serviceId, bindings }: { serviceId: string; bindings: BindingView[] }) {
22
+ const change = removeBinding(useCoffre(), serviceId);
23
+ const remove = useChange(change);
24
+ const { status, dismiss } = useChangeStatus(change.list.queryKey);
25
+
26
+ return (
27
+ <Card
28
+ labelledBy="trusted-workloads"
29
+ title="Trusted workloads"
30
+ 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."
31
+ actions={<TrustWorkload serviceId={serviceId} />}
32
+ >
33
+ {bindings.length === 0 ? (
34
+ <EmptyState title="No trusted workloads">
35
+ CI can still use a token. Trust a workflow to let its runs sign in without one.
36
+ </EmptyState>
37
+ ) : (
38
+ <div className="dt-wrap">
39
+ <table className="dt">
40
+ <thead>
41
+ <tr>
42
+ <th>Workload</th>
43
+ <th className="col-shrink">Added (UTC)</th>
44
+ <th className="col-shrink">Last used</th>
45
+ <th className="col-actions">
46
+ <span className="visually-hidden">Actions</span>
47
+ </th>
48
+ </tr>
49
+ </thead>
50
+ <tbody>
51
+ {bindings.map((binding) => {
52
+ const state = status(binding.id);
53
+ const { title, detail } = summary(binding);
54
+ return (
55
+ <Fragment key={binding.id}>
56
+ <tr className={rowClass(state)}>
57
+ <td>
58
+ <span className="cell-account">
59
+ {binding.profile.startsWith('github') ? <GitHub size={15} /> : <Link size={15} />}
60
+ <span className="cell-stack">
61
+ <span>{binding.label ?? title}</span>
62
+ <small>{binding.label === null ? detail : `${title} · ${detail}`}</small>
63
+ <details className="claims">
64
+ <summary>Claims</summary>
65
+ <Claims binding={binding} />
66
+ </details>
67
+ </span>
68
+ </span>
69
+ </td>
70
+ <td className="nowrap">
71
+ <span className="cell-stack">
72
+ <Timestamp iso={binding.createdAt} />
73
+ <small>by {binding.createdBy}</small>
74
+ </span>
75
+ </td>
76
+ <td className="nowrap cell-muted">
77
+ {binding.lastUsedAt === null ? 'Never' : <Timestamp iso={binding.lastUsedAt} display="relative" />}
78
+ </td>
79
+ <td className="col-actions">
80
+ {state.state === 'pending' ? (
81
+ <RowPending status={state} />
82
+ ) : (
83
+ <ConfirmButton
84
+ trigger={
85
+ <button className="act">
86
+ <X size={13} />
87
+ Remove
88
+ </button>
89
+ }
90
+ title={<>Stop trusting {binding.label ?? title}?</>}
91
+ body="Its runs are refused from their next sign-in, and credentials they hold stop working. A binding removed is never trusted again; to trust the runs again, add a new one."
92
+ confirmLabel="Remove binding"
93
+ onConfirm={() => remove(binding)}
94
+ />
95
+ )}
96
+ </td>
97
+ </tr>
98
+ <RowFailure status={state} columns={4} onDismiss={() => state.state === 'failed' && dismiss(state.mutationId)} />
99
+ </Fragment>
100
+ );
101
+ })}
102
+ </tbody>
103
+ </table>
104
+ </div>
105
+ )}
106
+ </Card>
107
+ );
108
+ }
109
+
110
+ function Claims({ binding }: { binding: Pick<BindingPlan, 'issuer' | 'jwksUri' | 'claims'> }) {
111
+ return (
112
+ <table className="claims-table">
113
+ <tbody>
114
+ <tr>
115
+ <th>iss</th>
116
+ <td className="mono">{binding.issuer}</td>
117
+ </tr>
118
+ {Object.entries(binding.claims).map(([name, value]) => (
119
+ <tr key={name}>
120
+ <th className="mono">{name}</th>
121
+ <td className="mono">{value}</td>
122
+ </tr>
123
+ ))}
124
+ <tr>
125
+ <th>keys</th>
126
+ <td className="mono">{binding.jwksUri}</td>
127
+ </tr>
128
+ </tbody>
129
+ </table>
130
+ );
131
+ }
132
+
133
+ function TrustWorkload({ serviceId }: { serviceId: string }) {
134
+ const [open, setOpen] = useState(false);
135
+ const [form, setForm] = useState<Form>(EMPTY_FORM);
136
+ const [plan, setPlan] = useState<BindingPlan | null>(null);
137
+ const coffre = useCoffre();
138
+ const member = memberRef('service', serviceId);
139
+ const { pending, error, setError, run } = useAction();
140
+ const lookup = useAction();
141
+ const set = (changes: Partial<Form>) => {
142
+ setForm((current) => ({ ...current, ...changes }));
143
+ setPlan(null);
144
+ };
145
+ const input = () => ({ ...bindingOf(form), label: form.label.trim() === '' ? null : form.label.trim(), replaces: [] });
146
+
147
+ function close() {
148
+ setOpen(false);
149
+ setForm(EMPTY_FORM);
150
+ setPlan(null);
151
+ setError(null);
152
+ lookup.setError(null);
153
+ }
154
+
155
+ function review() {
156
+ let request: ReturnType<typeof input>;
157
+ try {
158
+ request = input();
159
+ } catch (problem) {
160
+ setError((problem as Error).message);
161
+ return;
162
+ }
163
+ void run(() => coffre.bindings.preview(member, request), { affects: [], onSuccess: setPlan });
164
+ }
165
+
166
+ const field = (label: string, key: keyof Form, props: { placeholder?: string; mono?: boolean; hint?: string } = {}) => (
167
+ <label className="field">
168
+ <span className="label">{label}</span>
169
+ <input
170
+ className={`input${props.mono ? ' mono' : ''}`}
171
+ value={form[key] as string}
172
+ placeholder={props.placeholder}
173
+ onChange={(event) => set({ [key]: event.target.value } as Partial<Form>)}
174
+ />
175
+ {props.hint !== undefined && <span className="hint">{props.hint}</span>}
176
+ </label>
177
+ );
178
+
179
+ const ref = (
180
+ <div className="form-row">
181
+ <label className="field" style={{ flex: '0 0 8rem' }}>
182
+ <span className="label">At</span>
183
+ <select className="select" value={form.refKind} onChange={(event) => set({ refKind: event.target.value as RefKind })}>
184
+ <option value="branch">Branch</option>
185
+ <option value="tag">Tag</option>
186
+ </select>
187
+ </label>
188
+ {field(form.refKind === 'branch' ? 'Branch' : 'Tag', 'refName', { mono: true })}
189
+ </div>
190
+ );
191
+
192
+ return (
193
+ <>
194
+ <button className="btn btn-sm" onClick={() => setOpen(true)}>
195
+ <Plus size={14} />
196
+ Trust a workload
197
+ </button>
198
+ <Modal open={open} onOpenChange={(next) => (next ? setOpen(true) : close())} title={plan === null ? 'Trust a workload' : 'Review the binding'}>
199
+ {plan === null ? (
200
+ <form
201
+ className="form"
202
+ onSubmit={(event) => {
203
+ event.preventDefault();
204
+ review();
205
+ }}
206
+ >
207
+ <nav className="segmented" aria-label="Platform">
208
+ {(['github', 'gitlab', 'other'] as const).map((platform) => (
209
+ <button key={platform} type="button" aria-pressed={form.platform === platform} onClick={() => set({ platform })}>
210
+ {platform === 'github' ? 'GitHub Actions' : platform === 'gitlab' ? 'GitLab' : 'Other issuer'}
211
+ </button>
212
+ ))}
213
+ </nav>
214
+
215
+ {form.platform === 'github' && (
216
+ <>
217
+ <nav className="segmented" aria-label="Workflow">
218
+ <button type="button" aria-pressed={!form.reusable} onClick={() => set({ reusable: false })}>
219
+ A workflow of the repository
220
+ </button>
221
+ <button type="button" aria-pressed={form.reusable} onClick={() => set({ reusable: true })}>
222
+ A reusable workflow
223
+ </button>
224
+ </nav>
225
+ <div className="form-row">
226
+ {field('Repository', 'repository', { placeholder: 'acme/api', mono: true })}
227
+ <div className="field" style={{ flex: '0 0 auto', alignSelf: 'end' }}>
228
+ <button
229
+ className="btn"
230
+ type="button"
231
+ disabled={lookup.pending || form.repository.trim() === ''}
232
+ onClick={() =>
233
+ void lookup.run(() => coffre.bindings.lookup({ github: form.repository.trim() }), {
234
+ affects: [],
235
+ onSuccess: (ids) => 'repositoryId' in ids && set({ repositoryId: ids.repositoryId, ownerId: ids.ownerId }),
236
+ })
237
+ }
238
+ >
239
+ {lookup.pending && <Spinner />}
240
+ Look up IDs
241
+ </button>
242
+ </div>
243
+ </div>
244
+ <div className="form-row">
245
+ {!(form.reusable && form.anyRepository) && field('Repository ID', 'repositoryId', { mono: true })}
246
+ {field('Owner ID', 'ownerId', { mono: true })}
247
+ </div>
248
+ <p className="hint">
249
+ Bindings name IDs, which unlike names nobody else can take over. For a private repository:{' '}
250
+ <span className="mono">gh api repos/{form.repository.trim() || 'acme/api'} --jq '.id, .owner.id'</span>
251
+ </p>
252
+ <ErrorLine error={lookup.error} />
253
+ {form.reusable ? (
254
+ <>
255
+ {field('Called workflow', 'called', { placeholder: 'acme/deploy/.github/workflows/release.yml@refs/heads/main', mono: true })}
256
+ {field("Its commit", 'sha', { placeholder: 'the full SHA it is trusted at', mono: true, hint: 'A new version of the workflow needs a new binding.' })}
257
+ {field('Calling workflow (optional)', 'workflow', { placeholder: 'deploy.yml', mono: true, hint: 'Left out, every workflow of the repository at the ref below may call it.' })}
258
+ <label className="check">
259
+ <input type="checkbox" checked={form.anyRepository} onChange={(event) => set({ anyRepository: event.target.checked })} />
260
+ Called from any repository of the organization
261
+ </label>
262
+ </>
263
+ ) : (
264
+ field('Workflow file', 'workflow', { placeholder: 'deploy.yml', mono: true })
265
+ )}
266
+ <label className="field">
267
+ <span className="label">Event</span>
268
+ <select className="select" value={form.event} onChange={(event) => set({ event: event.target.value })}>
269
+ {GITHUB_EVENTS.map((event) => (
270
+ <option key={event} value={event}>
271
+ {event}
272
+ </option>
273
+ ))}
274
+ </select>
275
+ <span className="hint">Pull requests and workflow_run are never trusted: their runs can carry a stranger's code.</span>
276
+ </label>
277
+ {ref}
278
+ </>
279
+ )}
280
+
281
+ {form.platform === 'gitlab' && (
282
+ <>
283
+ {field('GitLab', 'gitlabUrl', { placeholder: 'https://gitlab.com', hint: 'Left empty, gitlab.com.' })}
284
+ <div className="form-row">
285
+ {field('Project', 'project', { placeholder: 'acme/api', mono: true })}
286
+ <div className="field" style={{ flex: '0 0 auto', alignSelf: 'end' }}>
287
+ <button
288
+ className="btn"
289
+ type="button"
290
+ disabled={lookup.pending || form.project.trim() === ''}
291
+ onClick={() =>
292
+ void lookup.run(
293
+ () => coffre.bindings.lookup({ gitlab: form.project.trim(), ...(form.gitlabUrl.trim() === '' ? {} : { gitlabUrl: form.gitlabUrl.trim() }) }),
294
+ { affects: [], onSuccess: (ids) => 'projectId' in ids && set({ projectId: ids.projectId, namespaceId: ids.namespaceId }) },
295
+ )
296
+ }
297
+ >
298
+ {lookup.pending && <Spinner />}
299
+ Look up IDs
300
+ </button>
301
+ </div>
302
+ </div>
303
+ <div className="form-row">
304
+ {field('Project ID', 'projectId', { mono: true })}
305
+ {field('Namespace ID', 'namespaceId', { mono: true })}
306
+ </div>
307
+ <ErrorLine error={lookup.error} />
308
+ {ref}
309
+ <label className="field">
310
+ <span className="label">Pipeline source</span>
311
+ <select className="select" value={form.source} onChange={(event) => set({ source: event.target.value })}>
312
+ {GITLAB_PIPELINE_SOURCES.map((source) => (
313
+ <option key={source} value={source}>
314
+ {source}
315
+ </option>
316
+ ))}
317
+ </select>
318
+ <span className="hint">Merge-request pipelines are never trusted: they name another project.</span>
319
+ </label>
320
+ </>
321
+ )}
322
+
323
+ {form.platform === 'other' && (
324
+ <>
325
+ {field('Issuer', 'issuer', { placeholder: 'https://accounts.google.com' })}
326
+ {field('Subject (sub)', 'sub', { mono: true, hint: "You vouch for what this issuer's subject means: a Google service account's unique ID, say." })}
327
+ <label className="field">
328
+ <span className="label">Other claims, one <span className="mono">name=value</span> a line</span>
329
+ <textarea className="input mono" rows={3} value={form.extra} onChange={(event) => set({ extra: event.target.value })} />
330
+ </label>
331
+ </>
332
+ )}
333
+
334
+ {field('Label (optional)', 'label', { placeholder: 'Deploys to production' })}
335
+ <ErrorLine error={error} />
336
+ <div className="dialog-actions">
337
+ <button className="btn" type="button" onClick={close}>
338
+ Cancel
339
+ </button>
340
+ <button className="btn btn-primary" type="submit" disabled={pending}>
341
+ {pending && <Spinner />}
342
+ Review
343
+ </button>
344
+ </div>
345
+ </form>
346
+ ) : (
347
+ <div className="form">
348
+ <p>
349
+ Runs whose ID token carries exactly these claims will sign in as <span className="mono">{member}</span>, and read
350
+ what it may read.
351
+ </p>
352
+ <Claims binding={plan} />
353
+ {plan.replaces.length > 0 && (
354
+ <Notice tone="info">
355
+ This replaces {plan.replaces.length === 1 ? 'a binding' : `${plan.replaces.length} bindings`}
356
+ {plan.replaces.some((replaced) => replaced.why === 'keys_moved') ? ', since the issuer moved its keys' : ''}.
357
+ </Notice>
358
+ )}
359
+ <ErrorLine error={error} />
360
+ <div className="dialog-actions">
361
+ <button className="btn" type="button" onClick={() => setPlan(null)}>
362
+ Back
363
+ </button>
364
+ <button
365
+ className="btn btn-primary"
366
+ type="button"
367
+ disabled={pending}
368
+ onClick={() => void run(() => coffre.bindings.create(member, input()), { affects: affects.bindings(member), onSuccess: close })}
369
+ >
370
+ {pending && <Spinner />}
371
+ Save binding
372
+ </button>
373
+ </div>
374
+ </div>
375
+ )}
376
+ </Modal>
377
+ </>
378
+ );
379
+ }
@@ -223,6 +223,17 @@ const TEMPLATES: Record<string, Template> = {
223
223
  ? [...place(facts.entry), ` from ${destination(facts.entry)}`]
224
224
  : [plural(facts.count, 'secret'), ' of ', ...environmentOf(facts.entry), ` from ${destination(facts.entry)}`],
225
225
  },
226
+ // A binding trusts CI runs to sign in as a service; removing one is its tombstone.
227
+ 'token.bind': {
228
+ did: 'trusted CI runs to sign in as',
229
+ tried: 'trust CI runs to sign in as',
230
+ what: (facts) => subject(facts.entry),
231
+ },
232
+ 'token.unbind': {
233
+ did: 'stopped trusting CI runs to sign in as',
234
+ tried: 'stop trusting CI runs to sign in as',
235
+ what: (facts) => subject(facts.entry),
236
+ },
226
237
  'vault.tampered': {
227
238
  did: 'found',
228
239
  tried: 'check',
@@ -436,3 +447,18 @@ export function plain(parts: Part[]): string {
436
447
  )
437
448
  .join('');
438
449
  }
450
+
451
+ /**
452
+ * The CI run an entry was written for, as its issuer stated it at the
453
+ * exchange: `acme/api run 7001 at 3f2a9c1`, a GitLab pipeline, or the
454
+ * token's subject. Null for an entry no trust binding's credential wrote.
455
+ */
456
+ export function runLabel(run: { claims: Record<string, string | number> } | null): string | null {
457
+ if (run === null) return null;
458
+ const { claims } = run;
459
+ const text = (name: string) => (typeof claims[name] === 'string' || typeof claims[name] === 'number' ? String(claims[name]) : null);
460
+ const at = text('sha') === null ? '' : ` at ${text('sha')!.slice(0, 7)}`;
461
+ if (text('repository') !== null && text('run_id') !== null) return `${text('repository')} run ${text('run_id')}${at}`;
462
+ if (text('project_path') !== null && text('pipeline_id') !== null) return `${text('project_path')} pipeline ${text('pipeline_id')}${at}`;
463
+ return text('sub') === null ? 'a CI run' : `CI run ${text('sub')}`;
464
+ }