@coffre/ui 0.6.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{audit-sentence-BVv_9_nq.js → audit-sentence-C_wMpAqr.js} +99 -26
- package/dist/chunks/audit-sentence-C_wMpAqr.js.map +1 -0
- package/dist/chunks/{connected-apps-rBF9XUob.js → connected-apps-Bn5rEoV2.js} +2 -2
- package/dist/chunks/{connected-apps-rBF9XUob.js.map → connected-apps-Bn5rEoV2.js.map} +1 -1
- package/dist/chunks/{delete-place-CkGezx5R.js → delete-place-CQCDHkne.js} +3 -3
- package/dist/chunks/{delete-place-CkGezx5R.js.map → delete-place-CQCDHkne.js.map} +1 -1
- package/dist/chunks/{directory-SRN01yP6.js → directory-BQNOdze_.js} +6 -5
- package/dist/chunks/{directory-SRN01yP6.js.map → directory-BQNOdze_.js.map} +1 -1
- package/dist/chunks/{grants-1E1vqkM0.js → grants-CJIBrkod.js} +3 -3
- package/dist/chunks/{grants-1E1vqkM0.js.map → grants-CJIBrkod.js.map} +1 -1
- package/dist/chunks/{offboarding-Bt7KSixm.js → offboarding-CrgwaetA.js} +3 -3
- package/dist/chunks/offboarding-CrgwaetA.js.map +1 -0
- package/dist/chunks/personal-tokens-B8rkT-DI.js +138 -0
- package/dist/chunks/personal-tokens-B8rkT-DI.js.map +1 -0
- package/dist/chunks/{principal-page-Cbx2l6XL.js → principal-page-Cv5PheS9.js} +25 -12
- package/dist/chunks/principal-page-Cv5PheS9.js.map +1 -0
- package/dist/chunks/{project-page-DKo2AFYg.js → project-page-BI--vjt3.js} +2 -2
- package/dist/chunks/{project-page-DKo2AFYg.js.map → project-page-BI--vjt3.js.map} +1 -1
- package/dist/chunks/{queries-BvSw1xBN.js → queries-epz4MIuW.js} +19 -5
- package/dist/chunks/queries-epz4MIuW.js.map +1 -0
- package/dist/chunks/{references-DCoSPtvw.js → references-DImfw0cz.js} +3 -3
- package/dist/chunks/{references-DCoSPtvw.js.map → references-DImfw0cz.js.map} +1 -1
- package/dist/chunks/{role-field-D98CvNEg.js → role-field-C1KhNaIR.js} +2 -2
- package/dist/chunks/{role-field-D98CvNEg.js.map → role-field-C1KhNaIR.js.map} +1 -1
- package/dist/chunks/{use-action-Bv7yQ0DW.js → use-action-BB-RcHo1.js} +2 -2
- package/dist/chunks/{use-action-Bv7yQ0DW.js.map → use-action-BB-RcHo1.js.map} +1 -1
- package/dist/chunks/{use-change-DIQTGXER.js → use-change-CQyDpCqw.js} +268 -17
- package/dist/chunks/use-change-CQyDpCqw.js.map +1 -0
- package/dist/chunks/{use-shell-DhFoHjDS.js → use-shell-C_NmvCt_.js} +2 -2
- package/dist/chunks/{use-shell-DhFoHjDS.js.map → use-shell-C_NmvCt_.js.map} +1 -1
- package/dist/index.d.ts +33 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/pages/account.d.ts +1 -1
- package/dist/pages/account.js +26 -9
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/audit.js +52 -32
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/environment.js +520 -192
- package/dist/pages/environment.js.map +1 -1
- package/dist/pages/login.js +1 -1
- package/dist/pages/project-access.js +8 -8
- package/dist/pages/project-access.js.map +1 -1
- package/dist/pages/project-environments.js +106 -19
- package/dist/pages/project-environments.js.map +1 -1
- package/dist/pages/project-settings.js +6 -6
- package/dist/pages/project.js +1 -1
- package/dist/pages/projects.js +4 -4
- package/dist/pages/service-account.js +278 -29
- package/dist/pages/service-account.js.map +1 -1
- package/dist/pages/service-accounts.js +4 -4
- package/dist/pages/settings.js +4 -4
- package/dist/pages/unregistered.js +1 -1
- package/dist/pages/user.js +5 -5
- package/dist/pages/users.js +4 -4
- package/package.json +3 -3
- package/src/components/actions-log.tsx +2 -1
- package/src/components/directory.tsx +1 -0
- package/src/components/generate-value.tsx +15 -7
- package/src/components/offboarding.tsx +1 -1
- package/src/components/personal-tokens.tsx +131 -0
- package/src/components/principal-page.tsx +20 -3
- package/src/components/regenerate.tsx +72 -0
- package/src/components/service-tokens.tsx +3 -3
- package/src/components/trusted-workloads.tsx +177 -8
- package/src/lib/audit-sentences.ts +110 -12
- package/src/lib/bindings.ts +41 -3
- package/src/lib/changes.ts +155 -20
- package/src/lib/generate.ts +3 -146
- package/src/lib/queries.ts +15 -4
- package/src/lib/recipes.ts +63 -0
- package/src/lib/reveal.ts +7 -1
- package/src/lib/secret-edit-batch.ts +64 -5
- package/src/options.ts +5 -1
- package/src/pages/account.tsx +27 -5
- package/src/pages/audit.tsx +23 -7
- package/src/pages/environment.tsx +357 -39
- package/src/pages/project-access.tsx +1 -1
- package/src/pages/project-environments.tsx +85 -12
- package/src/parity.ts +19 -2
- package/src/styles/globals.css +56 -3
- package/dist/chunks/audit-sentence-BVv_9_nq.js.map +0 -1
- package/dist/chunks/offboarding-Bt7KSixm.js.map +0 -1
- package/dist/chunks/principal-page-Cbx2l6XL.js.map +0 -1
- package/dist/chunks/queries-BvSw1xBN.js.map +0 -1
- package/dist/chunks/use-change-DIQTGXER.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as listsAccess, t as affects, v as queries, x as signInWays } from "../chunks/queries-
|
|
1
|
+
import { a as listsAccess, t as affects, v as queries, x as signInWays } from "../chunks/queries-epz4MIuW.js";
|
|
2
2
|
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, x as usePreferences } from "../chunks/ui-2kwXXfrX.js";
|
|
3
3
|
import { F as Link, G as Plus, M as Key, O as GitHub, c as statusOf, s as memberRef, st as X, t as Card, u as useCoffre, v as CheckCircle } from "../chunks/page-JTORvh-N.js";
|
|
4
4
|
import { a as rowClass, i as RowPending, r as RowFailure } from "../chunks/row-state-BsIHspy4.js";
|
|
5
|
-
import { t as useShell } from "../chunks/use-shell-
|
|
6
|
-
import {
|
|
5
|
+
import { t as useShell } from "../chunks/use-shell-C_NmvCt_.js";
|
|
6
|
+
import { A as revokeCredential, T as removeBinding, n as useChangeStatus, t as useChange } from "../chunks/use-change-CQyDpCqw.js";
|
|
7
7
|
import { t as pageRoute } from "../chunks/page-route-Drfw7lmn.js";
|
|
8
|
-
import { t as useAction } from "../chunks/use-action-
|
|
8
|
+
import { t as useAction } from "../chunks/use-action-BB-RcHo1.js";
|
|
9
9
|
import { t as MultiCombobox } from "../chunks/multi-combobox-CsIXihuc.js";
|
|
10
|
-
import { n as PrincipalLayout, r as ActionsLog, t as PrincipalAccess } from "../chunks/principal-page-
|
|
10
|
+
import { n as PrincipalLayout, r as ActionsLog, t as PrincipalAccess } from "../chunks/principal-page-Cv5PheS9.js";
|
|
11
11
|
import { Fragment, useEffect, useId, useState } from "react";
|
|
12
12
|
import { ROLES, ROLE_NAMES, assignableToEnvironment, credentialScopeInWords } from "@coffre/core/access";
|
|
13
13
|
import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
@@ -97,7 +97,7 @@ var LIFETIMES = [
|
|
|
97
97
|
* one place, this dialog, for as long as it stays open: coffre keeps a hash.
|
|
98
98
|
*/
|
|
99
99
|
function ServiceTokens({ serviceId, tokens, grants }) {
|
|
100
|
-
const change = revokeCredential(useCoffre(), serviceId);
|
|
100
|
+
const change = revokeCredential(useCoffre(), memberRef("service", serviceId));
|
|
101
101
|
const revoke = useChange(change);
|
|
102
102
|
const { status, dismiss } = useChangeStatus(change.list.queryKey);
|
|
103
103
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Card, {
|
|
@@ -394,10 +394,18 @@ function summary(binding) {
|
|
|
394
394
|
detail: `${claimValues(binding.claims.pipeline_source).join(", ")} at ${claims.ref_type} ${claims.ref}`
|
|
395
395
|
};
|
|
396
396
|
return {
|
|
397
|
-
title:
|
|
397
|
+
title: issuerName(binding.issuer),
|
|
398
398
|
detail: `sub ${claims.sub}`
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
|
+
/** An issuer as a title: its host, when it is a URL; a binding that carries its keys may name any string. */
|
|
402
|
+
function issuerName(issuer) {
|
|
403
|
+
try {
|
|
404
|
+
return new URL(issuer).host || issuer;
|
|
405
|
+
} catch {
|
|
406
|
+
return issuer;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
401
409
|
/** The scope the dialog asks for: the person's, or none, for the server's own. */
|
|
402
410
|
function askedScope(choice) {
|
|
403
411
|
return choice.chosen ? { scope: choice.scope } : {};
|
|
@@ -433,7 +441,8 @@ var EMPTY_FORM = {
|
|
|
433
441
|
sources: ["push"],
|
|
434
442
|
issuer: "",
|
|
435
443
|
sub: "",
|
|
436
|
-
extra: ""
|
|
444
|
+
extra: "",
|
|
445
|
+
jwks: ""
|
|
437
446
|
};
|
|
438
447
|
/** What a GitHub App's listing tells of names' IDs: each repository's, and its owner's, once each. */
|
|
439
448
|
function listedIds(repositories) {
|
|
@@ -596,12 +605,32 @@ function bindingOf(form, found = null) {
|
|
|
596
605
|
if (at <= 0) throw new Error(`"${line}" is not <claim>=<value>`);
|
|
597
606
|
claims[line.slice(0, at).trim()] = line.slice(at + 1).trim();
|
|
598
607
|
}
|
|
608
|
+
const jwks = keySetOf(form.jwks);
|
|
599
609
|
return {
|
|
600
610
|
profile: "custom",
|
|
601
611
|
issuer: needed(form.issuer, "The issuer"),
|
|
602
|
-
claims
|
|
612
|
+
claims,
|
|
613
|
+
...jwks === void 0 ? {} : { jwks }
|
|
603
614
|
};
|
|
604
615
|
}
|
|
616
|
+
/** The key set pasted in a field, or undefined for none; throws a sentence when it is not one. */
|
|
617
|
+
function keySetOf(text) {
|
|
618
|
+
if (text.trim() === "") return void 0;
|
|
619
|
+
let value;
|
|
620
|
+
try {
|
|
621
|
+
value = JSON.parse(text);
|
|
622
|
+
} catch {
|
|
623
|
+
throw new Error("The keys are not JSON: paste the issuer's key set, { \"keys\": [ … ] }");
|
|
624
|
+
}
|
|
625
|
+
const keys = value?.keys;
|
|
626
|
+
if (!Array.isArray(keys)) throw new Error("The keys are a key set, { \"keys\": [ … ] }, as kubectl get --raw /openid/v1/jwks prints it");
|
|
627
|
+
return { keys };
|
|
628
|
+
}
|
|
629
|
+
/** Where a binding's keys come from, in a line: the URL coffre fetches, or the keys uploaded with it, by `kid` or thumbprint. */
|
|
630
|
+
function keysOf(binding) {
|
|
631
|
+
if (binding.keys === null) return binding.jwksUri;
|
|
632
|
+
return `Uploaded: ${binding.keys.map((key) => `${key.kid ?? key.thumbprint} (${key.alg})`).join(", ")}`;
|
|
633
|
+
}
|
|
605
634
|
/**
|
|
606
635
|
* A GitHub repository's or owner's IDs, looked up through coffre once its
|
|
607
636
|
* name has rested in the field for `LOOKUP_PAUSE_MS`, or at once when the
|
|
@@ -784,7 +813,15 @@ function TrustedWorkloads({ serviceId, bindings, grants }) {
|
|
|
784
813
|
/* @__PURE__ */ jsx("small", { children: binding.label === null ? detail : `${title} · ${detail}` }),
|
|
785
814
|
/* @__PURE__ */ jsxs("details", {
|
|
786
815
|
className: "claims",
|
|
787
|
-
children: [
|
|
816
|
+
children: [
|
|
817
|
+
/* @__PURE__ */ jsx("summary", { children: "Claims" }),
|
|
818
|
+
/* @__PURE__ */ jsx(Claims, { binding }),
|
|
819
|
+
binding.keys !== null && /* @__PURE__ */ jsx(ReplaceKeys, {
|
|
820
|
+
serviceId,
|
|
821
|
+
issuer: binding.issuer,
|
|
822
|
+
bindings
|
|
823
|
+
})
|
|
824
|
+
]
|
|
788
825
|
})
|
|
789
826
|
]
|
|
790
827
|
})]
|
|
@@ -879,11 +916,181 @@ function Claims({ binding }) {
|
|
|
879
916
|
})] }, name)),
|
|
880
917
|
/* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", { children: "keys" }), /* @__PURE__ */ jsx("td", {
|
|
881
918
|
className: "mono",
|
|
882
|
-
children: binding
|
|
919
|
+
children: keysOf(binding)
|
|
883
920
|
})] })
|
|
884
921
|
] })
|
|
885
922
|
});
|
|
886
923
|
}
|
|
924
|
+
/**
|
|
925
|
+
* New keys, pasted, for the service's bindings on an issuer whose keys they
|
|
926
|
+
* carry: when the issuer rotates its keys. Each binding is replaced by one
|
|
927
|
+
* the same but for them, as the review says before anything is saved.
|
|
928
|
+
*/
|
|
929
|
+
function ReplaceKeys({ serviceId, issuer, bindings }) {
|
|
930
|
+
const [open, setOpen] = useState(false);
|
|
931
|
+
const [text, setText] = useState("");
|
|
932
|
+
const [preview, setPreview] = useState(null);
|
|
933
|
+
const plan = preview?.plan ?? null;
|
|
934
|
+
const coffre = useCoffre();
|
|
935
|
+
const member = memberRef("service", serviceId);
|
|
936
|
+
const { pending, error, setError, run } = useAction();
|
|
937
|
+
const on = bindings.filter((binding) => binding.issuer === issuer).length;
|
|
938
|
+
function close() {
|
|
939
|
+
setOpen(false);
|
|
940
|
+
setText("");
|
|
941
|
+
setPreview(null);
|
|
942
|
+
setError(null);
|
|
943
|
+
}
|
|
944
|
+
function review() {
|
|
945
|
+
let jwks;
|
|
946
|
+
try {
|
|
947
|
+
const pasted = keySetOf(text);
|
|
948
|
+
if (pasted === void 0) throw new Error("Paste the issuer's key set");
|
|
949
|
+
jwks = pasted;
|
|
950
|
+
} catch (problem) {
|
|
951
|
+
setError(problem.message);
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
run(() => coffre.bindings.previewKeys(member, {
|
|
955
|
+
issuer,
|
|
956
|
+
jwks
|
|
957
|
+
}), {
|
|
958
|
+
affects: [],
|
|
959
|
+
onSuccess: (next) => setPreview({
|
|
960
|
+
plan: next,
|
|
961
|
+
jwks
|
|
962
|
+
})
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("button", {
|
|
966
|
+
className: "act",
|
|
967
|
+
type: "button",
|
|
968
|
+
onClick: () => setOpen(true),
|
|
969
|
+
children: [/* @__PURE__ */ jsx(Key, { size: 13 }), "Replace keys"]
|
|
970
|
+
}), /* @__PURE__ */ jsx(Modal, {
|
|
971
|
+
open,
|
|
972
|
+
onOpenChange: (next) => next ? setOpen(true) : close(),
|
|
973
|
+
title: preview === null ? "Replace keys" : "Review the keys",
|
|
974
|
+
children: preview === null || plan === null ? /* @__PURE__ */ jsxs("form", {
|
|
975
|
+
className: "form",
|
|
976
|
+
onSubmit: (event) => {
|
|
977
|
+
event.preventDefault();
|
|
978
|
+
review();
|
|
979
|
+
},
|
|
980
|
+
children: [
|
|
981
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
982
|
+
"The ",
|
|
983
|
+
on === 1 ? "binding" : `${on} bindings`,
|
|
984
|
+
" of ",
|
|
985
|
+
/* @__PURE__ */ jsxs("span", {
|
|
986
|
+
className: "mono",
|
|
987
|
+
children: ["service:", serviceId]
|
|
988
|
+
}),
|
|
989
|
+
" on",
|
|
990
|
+
" ",
|
|
991
|
+
/* @__PURE__ */ jsx("span", {
|
|
992
|
+
className: "mono",
|
|
993
|
+
children: issuer
|
|
994
|
+
}),
|
|
995
|
+
" will verify tokens with these keys alone. While the issuer rotates, paste a set that holds the old key and the new, and tokens signed with either sign in."
|
|
996
|
+
] }),
|
|
997
|
+
/* @__PURE__ */ jsxs("label", {
|
|
998
|
+
className: "field",
|
|
999
|
+
children: [
|
|
1000
|
+
/* @__PURE__ */ jsx("span", {
|
|
1001
|
+
className: "label",
|
|
1002
|
+
children: "Keys"
|
|
1003
|
+
}),
|
|
1004
|
+
/* @__PURE__ */ jsx("textarea", {
|
|
1005
|
+
className: "input mono",
|
|
1006
|
+
rows: 6,
|
|
1007
|
+
value: text,
|
|
1008
|
+
spellCheck: false,
|
|
1009
|
+
placeholder: "{ \"keys\": [ … ] }",
|
|
1010
|
+
onChange: (event) => {
|
|
1011
|
+
setText(event.target.value);
|
|
1012
|
+
setError(null);
|
|
1013
|
+
}
|
|
1014
|
+
}),
|
|
1015
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1016
|
+
className: "hint",
|
|
1017
|
+
children: ["From a Kubernetes cluster: ", /* @__PURE__ */ jsx("span", {
|
|
1018
|
+
className: "mono",
|
|
1019
|
+
children: "kubectl get --raw /openid/v1/jwks"
|
|
1020
|
+
})]
|
|
1021
|
+
})
|
|
1022
|
+
]
|
|
1023
|
+
}),
|
|
1024
|
+
/* @__PURE__ */ jsx(ErrorLine, { error }),
|
|
1025
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1026
|
+
className: "dialog-actions",
|
|
1027
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
1028
|
+
className: "btn",
|
|
1029
|
+
type: "button",
|
|
1030
|
+
onClick: close,
|
|
1031
|
+
children: "Cancel"
|
|
1032
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
1033
|
+
className: "btn btn-primary",
|
|
1034
|
+
type: "submit",
|
|
1035
|
+
disabled: pending,
|
|
1036
|
+
children: [pending && /* @__PURE__ */ jsx(Spinner, {}), "Review"]
|
|
1037
|
+
})]
|
|
1038
|
+
})
|
|
1039
|
+
]
|
|
1040
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
1041
|
+
className: "form",
|
|
1042
|
+
children: [
|
|
1043
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
1044
|
+
plan.replaces.length === 1 ? "Its binding" : `Its ${plan.replaces.length} bindings`,
|
|
1045
|
+
" on ",
|
|
1046
|
+
/* @__PURE__ */ jsx("span", {
|
|
1047
|
+
className: "mono",
|
|
1048
|
+
children: issuer
|
|
1049
|
+
}),
|
|
1050
|
+
" ",
|
|
1051
|
+
plan.replaces.length === 1 ? "is" : "are",
|
|
1052
|
+
" replaced by ",
|
|
1053
|
+
plan.replaces.length === 1 ? "one" : "ones",
|
|
1054
|
+
" the same but for these keys. Credentials ",
|
|
1055
|
+
plan.replaces.length === 1 ? "it" : "they",
|
|
1056
|
+
" issued, five minutes each at most, end at once."
|
|
1057
|
+
] }),
|
|
1058
|
+
/* @__PURE__ */ jsx("table", {
|
|
1059
|
+
className: "claims-table",
|
|
1060
|
+
children: /* @__PURE__ */ jsx("tbody", { children: plan.keys.map((key) => /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
|
|
1061
|
+
className: "mono",
|
|
1062
|
+
children: key.alg
|
|
1063
|
+
}), /* @__PURE__ */ jsx("td", {
|
|
1064
|
+
className: "mono",
|
|
1065
|
+
children: key.kid ?? key.thumbprint
|
|
1066
|
+
})] }, key.thumbprint)) })
|
|
1067
|
+
}),
|
|
1068
|
+
/* @__PURE__ */ jsx(ErrorLine, { error }),
|
|
1069
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1070
|
+
className: "dialog-actions",
|
|
1071
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
1072
|
+
className: "btn",
|
|
1073
|
+
type: "button",
|
|
1074
|
+
onClick: () => setPreview(null),
|
|
1075
|
+
children: "Back"
|
|
1076
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
1077
|
+
className: "btn btn-primary",
|
|
1078
|
+
type: "button",
|
|
1079
|
+
disabled: pending,
|
|
1080
|
+
onClick: () => void run(() => coffre.bindings.replaceKeys(member, {
|
|
1081
|
+
issuer,
|
|
1082
|
+
jwks: preview.jwks
|
|
1083
|
+
}), {
|
|
1084
|
+
affects: affects.bindings(member),
|
|
1085
|
+
onSuccess: close
|
|
1086
|
+
}),
|
|
1087
|
+
children: [pending && /* @__PURE__ */ jsx(Spinner, {}), "Save keys"]
|
|
1088
|
+
})]
|
|
1089
|
+
})
|
|
1090
|
+
]
|
|
1091
|
+
})
|
|
1092
|
+
})] });
|
|
1093
|
+
}
|
|
887
1094
|
/** Beside `pull_request` and `workflow_run` in the events' list: they run code nobody reviewed, said in full once chosen. */
|
|
888
1095
|
function exposureNote(event) {
|
|
889
1096
|
return EVENT_EXPOSURE[event] === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
@@ -1011,6 +1218,7 @@ function TrustWorkload({ serviceId, grants, bindings }) {
|
|
|
1011
1218
|
});
|
|
1012
1219
|
const [choice, setChoice] = useState(whole);
|
|
1013
1220
|
const [plan, setPlan] = useState(null);
|
|
1221
|
+
const [reviewed, setReviewed] = useState(null);
|
|
1014
1222
|
const coffre = useCoffre();
|
|
1015
1223
|
const member = memberRef("service", serviceId);
|
|
1016
1224
|
const { pending, error, setError, run } = useAction();
|
|
@@ -1062,6 +1270,7 @@ function TrustWorkload({ serviceId, grants, bindings }) {
|
|
|
1062
1270
|
affects: [],
|
|
1063
1271
|
onSuccess: (next) => {
|
|
1064
1272
|
setPlan(next);
|
|
1273
|
+
setReviewed(request);
|
|
1065
1274
|
setChoice((current) => planned(current, next));
|
|
1066
1275
|
}
|
|
1067
1276
|
});
|
|
@@ -1321,29 +1530,69 @@ function TrustWorkload({ serviceId, grants, bindings }) {
|
|
|
1321
1530
|
})
|
|
1322
1531
|
] }),
|
|
1323
1532
|
form.platform === "other" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1324
|
-
field("Issuer", "issuer", {
|
|
1533
|
+
field("Issuer", "issuer", {
|
|
1534
|
+
placeholder: "https://accounts.google.com",
|
|
1535
|
+
hint: form.jwks.trim() === "" ? void 0 : "Exactly as its tokens name it in iss: with its keys pasted below, coffre asks it nothing."
|
|
1536
|
+
}),
|
|
1325
1537
|
field("Subject (sub)", "sub", {
|
|
1326
1538
|
mono: true,
|
|
1327
1539
|
hint: "You vouch for what this issuer's subject means: a Google service account's unique ID, say."
|
|
1328
1540
|
}),
|
|
1329
1541
|
/* @__PURE__ */ jsxs("label", {
|
|
1330
1542
|
className: "field",
|
|
1331
|
-
children: [
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1543
|
+
children: [
|
|
1544
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1545
|
+
className: "label",
|
|
1546
|
+
children: [
|
|
1547
|
+
"Other claims, one ",
|
|
1548
|
+
/* @__PURE__ */ jsx("span", {
|
|
1549
|
+
className: "mono",
|
|
1550
|
+
children: "name=value"
|
|
1551
|
+
}),
|
|
1552
|
+
" a line"
|
|
1553
|
+
]
|
|
1554
|
+
}),
|
|
1555
|
+
/* @__PURE__ */ jsx("textarea", {
|
|
1556
|
+
className: "input mono",
|
|
1557
|
+
rows: 3,
|
|
1558
|
+
value: form.extra,
|
|
1559
|
+
spellCheck: false,
|
|
1560
|
+
placeholder: "kubernetes.io.serviceaccount.uid=…",
|
|
1561
|
+
onChange: (event) => set({ extra: event.target.value })
|
|
1562
|
+
}),
|
|
1563
|
+
/* @__PURE__ */ jsx("span", {
|
|
1564
|
+
className: "hint",
|
|
1565
|
+
children: "A nested claim goes by its path, its names joined by dots."
|
|
1566
|
+
})
|
|
1567
|
+
]
|
|
1568
|
+
}),
|
|
1569
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1570
|
+
className: "field",
|
|
1571
|
+
children: [
|
|
1572
|
+
/* @__PURE__ */ jsx("span", {
|
|
1573
|
+
className: "label",
|
|
1574
|
+
children: "Keys (optional)"
|
|
1575
|
+
}),
|
|
1576
|
+
/* @__PURE__ */ jsx("textarea", {
|
|
1577
|
+
className: "input mono",
|
|
1578
|
+
rows: 3,
|
|
1579
|
+
value: form.jwks,
|
|
1580
|
+
spellCheck: false,
|
|
1581
|
+
placeholder: "{ \"keys\": [ … ] }",
|
|
1582
|
+
onChange: (event) => set({ jwks: event.target.value })
|
|
1583
|
+
}),
|
|
1584
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1585
|
+
className: "hint",
|
|
1586
|
+
children: [
|
|
1587
|
+
"Left empty, coffre fetches the issuer's keys. Paste them for one it cannot reach, such as a private Kubernetes cluster:",
|
|
1588
|
+
" ",
|
|
1589
|
+
/* @__PURE__ */ jsx("span", {
|
|
1590
|
+
className: "mono",
|
|
1591
|
+
children: "kubectl get --raw /openid/v1/jwks"
|
|
1592
|
+
})
|
|
1593
|
+
]
|
|
1594
|
+
})
|
|
1595
|
+
]
|
|
1347
1596
|
})
|
|
1348
1597
|
] }),
|
|
1349
1598
|
/* @__PURE__ */ jsx(ScopePicker, {
|
|
@@ -1416,7 +1665,7 @@ function TrustWorkload({ serviceId, grants, bindings }) {
|
|
|
1416
1665
|
type: "button",
|
|
1417
1666
|
disabled: pending,
|
|
1418
1667
|
onClick: () => void run(() => coffre.bindings.create(member, {
|
|
1419
|
-
...
|
|
1668
|
+
...reviewed,
|
|
1420
1669
|
scope: plan.scope
|
|
1421
1670
|
}), {
|
|
1422
1671
|
affects: affects.bindings(member),
|