@burdenoff/microfe-security 2026.1029.1 → 2026.1105.2

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.
@@ -9,7 +9,7 @@ import { useFeatureFlag as c } from "@burdenoff/fe-libs/shared/providers/shell";
9
9
  import { jsx as l } from "react/jsx-runtime";
10
10
  //#region src/security/SecurityRootBase.tsx
11
11
  var u = ({ mode: o, routes: s, footerLabel: u, ...d }) => {
12
- let { registerNavItems: f, registerFooterItems: p, basePath: m = "/" } = d, h = c(n.PROVIDERS_EXPERIMENTAL, !1), g = e(), _ = a(() => {
12
+ let { registerNavItems: f, registerFooterItems: p, basePath: m = "/" } = d, h = c(n.VAULT_INTEGRATIONS, !1), g = e(), _ = a(() => {
13
13
  let e = r(m, o, g);
14
14
  if (h || !e.children) return e;
15
15
  let t = (e) => e.filter((e) => e.id !== "security-providers");
@@ -1 +1 @@
1
- {"version":3,"file":"SecurityRootBase.js","names":[],"sources":["../../src/security/SecurityRootBase.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { SecurityProvider } from './providers/SecurityProvider';\nimport { useTr } from './hooks/useTr';\nimport type { NavItem, SecurityRootProps, SecurityMode } from './types';\nimport { SECURITY_FEATURE_FLAGS } from './constants/featureFlags';\nimport { getNavigationConfig } from './config/navigation';\n\ninterface SecurityRootBaseProps extends SecurityRootProps {\n mode: SecurityMode;\n routes: ReactNode;\n footerLabel: string;\n}\n\n/**\n * Inner component — runs *inside* `<FeatureFlagProvider>` so `useFeatureFlag`\n * always has a parent provider to read from. Prior to the split, the hook was\n * called above the provider, which threw in dev/test entry paths that didn't\n * have a shell-level feature-flag provider mounted above the MFE.\n */\nconst SecurityRootBaseWithFeatureFlags: FC<SecurityRootBaseProps> = ({\n mode,\n routes,\n footerLabel,\n ...props\n}) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const providersEnabled = useFeatureFlag(SECURITY_FEATURE_FLAGS.PROVIDERS_EXPERIMENTAL, false);\n const tr = useTr();\n\n // Strip the Providers child when the flag is off — otherwise admins see a\n // clickable nav link that silently redirects to the security home.\n const filteredNavItem = useMemo(() => {\n const navItem = getNavigationConfig(basePath, mode, tr);\n if (providersEnabled || !navItem.children) return navItem;\n const filterProviders = (items: NavItem[]): NavItem[] =>\n items.filter((c) => c.id !== 'security-providers');\n return { ...navItem, children: filterProviders(navItem.children) };\n }, [basePath, mode, providersEnabled, tr]);\n\n useEffect(() => {\n if (!registerNavItems) return;\n const cleanup = registerNavItems(filteredNavItem);\n return cleanup;\n }, [registerNavItems, filteredNavItem]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'security-status',\n label: footerLabel,\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, footerLabel]);\n\n return <SecurityProvider {...props}>{routes}</SecurityProvider>;\n};\n\n/**\n * Shared base for all Security root components.\n * Handles provider setup, nav/footer registration, and error boundary wrapping.\n *\n * Split into outer (ErrorBoundary + FeatureFlagProvider) and inner\n * (SecurityRootBaseWithFeatureFlags consumes useFeatureFlag) so the hook\n * always runs inside a provider — see comment on the inner component.\n */\nexport const SecurityRootBase: FC<SecurityRootBaseProps> = (props) => {\n const { workspaceId, mode } = props;\n const tr = useTr();\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'security.errorBoundary.message',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={mode === 'user'}\n >\n <SecurityRootBaseWithFeatureFlags {...props} />\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;AAuBA,IAAM,KAA+D,EACnE,SACA,WACA,gBACA,GAAG,QACC;CACJ,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,IAAmB,EAAe,EAAuB,wBAAwB,GAAM,EACvF,IAAK,GAAO,EAIZ,IAAkB,QAAc;EACpC,IAAM,IAAU,EAAoB,GAAU,GAAM,EAAG;AACvD,MAAI,KAAoB,CAAC,EAAQ,SAAU,QAAO;EAClD,IAAM,KAAmB,MACvB,EAAM,QAAQ,MAAM,EAAE,OAAO,qBAAqB;AACpD,SAAO;GAAE,GAAG;GAAS,UAAU,EAAgB,EAAQ,SAAS;GAAE;IACjE;EAAC;EAAU;EAAM;EAAkB;EAAG,CAAC;AAyB1C,QAvBA,QAAgB;AACT,QAEL,QADgB,EAAiB,EAAgB;IAEhD,CAAC,GAAkB,EAAgB,CAAC,EAEvC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAY,CAAC,EAE/B,kBAAC,GAAD;EAAkB,GAAI;YAAQ;EAA0B,CAAA;GAWpD,KAA+C,MAAU;CACpE,IAAM,EAAE,gBAAa,YAAS;AAE9B,QACE,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAJV,GAAO,CAMR,kCACA,qEACD;GACG,CAAA;YAGR,kBAAC,GAAD;GACE,aAAa,KAAe;GAC5B,SAAQ;GACR,gBAAgB,MAAS;aAEzB,kBAAC,GAAD,EAAkC,GAAI,GAAS,CAAA;GAC3B,CAAA;EACR,CAAA"}
1
+ {"version":3,"file":"SecurityRootBase.js","names":[],"sources":["../../src/security/SecurityRootBase.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { SecurityProvider } from './providers/SecurityProvider';\nimport { useTr } from './hooks/useTr';\nimport type { NavItem, SecurityRootProps, SecurityMode } from './types';\nimport { SECURITY_FEATURE_FLAGS } from './constants/featureFlags';\nimport { getNavigationConfig } from './config/navigation';\n\ninterface SecurityRootBaseProps extends SecurityRootProps {\n mode: SecurityMode;\n routes: ReactNode;\n footerLabel: string;\n}\n\n/**\n * Inner component — runs *inside* `<FeatureFlagProvider>` so `useFeatureFlag`\n * always has a parent provider to read from. Prior to the split, the hook was\n * called above the provider, which threw in dev/test entry paths that didn't\n * have a shell-level feature-flag provider mounted above the MFE.\n */\nconst SecurityRootBaseWithFeatureFlags: FC<SecurityRootBaseProps> = ({\n mode,\n routes,\n footerLabel,\n ...props\n}) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const providersEnabled = useFeatureFlag(SECURITY_FEATURE_FLAGS.VAULT_INTEGRATIONS, false);\n const tr = useTr();\n\n // Strip the Providers child when the flag is off — otherwise admins see a\n // clickable nav link that silently redirects to the security home.\n const filteredNavItem = useMemo(() => {\n const navItem = getNavigationConfig(basePath, mode, tr);\n if (providersEnabled || !navItem.children) return navItem;\n const filterProviders = (items: NavItem[]): NavItem[] =>\n items.filter((c) => c.id !== 'security-providers');\n return { ...navItem, children: filterProviders(navItem.children) };\n }, [basePath, mode, providersEnabled, tr]);\n\n useEffect(() => {\n if (!registerNavItems) return;\n const cleanup = registerNavItems(filteredNavItem);\n return cleanup;\n }, [registerNavItems, filteredNavItem]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'security-status',\n label: footerLabel,\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, footerLabel]);\n\n return <SecurityProvider {...props}>{routes}</SecurityProvider>;\n};\n\n/**\n * Shared base for all Security root components.\n * Handles provider setup, nav/footer registration, and error boundary wrapping.\n *\n * Split into outer (ErrorBoundary + FeatureFlagProvider) and inner\n * (SecurityRootBaseWithFeatureFlags consumes useFeatureFlag) so the hook\n * always runs inside a provider — see comment on the inner component.\n */\nexport const SecurityRootBase: FC<SecurityRootBaseProps> = (props) => {\n const { workspaceId, mode } = props;\n const tr = useTr();\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'security.errorBoundary.message',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={mode === 'user'}\n >\n <SecurityRootBaseWithFeatureFlags {...props} />\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;AAuBA,IAAM,KAA+D,EACnE,SACA,WACA,gBACA,GAAG,QACC;CACJ,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,IAAmB,EAAe,EAAuB,oBAAoB,GAAM,EACnF,IAAK,GAAO,EAIZ,IAAkB,QAAc;EACpC,IAAM,IAAU,EAAoB,GAAU,GAAM,EAAG;AACvD,MAAI,KAAoB,CAAC,EAAQ,SAAU,QAAO;EAClD,IAAM,KAAmB,MACvB,EAAM,QAAQ,MAAM,EAAE,OAAO,qBAAqB;AACpD,SAAO;GAAE,GAAG;GAAS,UAAU,EAAgB,EAAQ,SAAS;GAAE;IACjE;EAAC;EAAU;EAAM;EAAkB;EAAG,CAAC;AAyB1C,QAvBA,QAAgB;AACT,QAEL,QADgB,EAAiB,EAAgB;IAEhD,CAAC,GAAkB,EAAgB,CAAC,EAEvC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAY,CAAC,EAE/B,kBAAC,GAAD;EAAkB,GAAI;YAAQ;EAA0B,CAAA;GAWpD,KAA+C,MAAU;CACpE,IAAM,EAAE,gBAAa,YAAS;AAE9B,QACE,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAJV,GAAO,CAMR,kCACA,qEACD;GACG,CAAA;YAGR,kBAAC,GAAD;GACE,aAAa,KAAe;GAC5B,SAAQ;GACR,gBAAgB,MAAS;aAEzB,kBAAC,GAAD,EAAkC,GAAI,GAAS,CAAA;GAC3B,CAAA;EACR,CAAA"}
@@ -0,0 +1,288 @@
1
+ import { useTr as e } from "../hooks/useTr.js";
2
+ import { Badge as t, Button as n, Card as r, Input as i, Select as a } from "./ui.js";
3
+ import { ConfirmDialog as o } from "./ConfirmDialog.js";
4
+ import { useCreateExternalSecretProvider as s, useDeleteIntegration as c, useTestExternalSecretProvider as l, useUpdateExternalSecretProvider as u } from "../hooks/useProviderQueries.js";
5
+ import { CopyButton as d } from "./CopyButton.js";
6
+ import { EXTERNAL_PROVIDER_TYPES as f, externalProviderType as p, splitProviderValues as m } from "../constants/externalSecretProviders.js";
7
+ import { useState as h } from "react";
8
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
9
+ import { CheckCircle as v, KeyRound as y, Loader2 as b, Pencil as x, Plus as S, ShieldCheck as C, Trash2 as w, XCircle as T } from "lucide-react";
10
+ //#region src/security/components/ExternalSecretProviders.tsx
11
+ var E = /^[a-z][a-z0-9_-]{0,39}$/;
12
+ function D(e) {
13
+ return e instanceof Error ? e.message : String(e);
14
+ }
15
+ function O(e) {
16
+ let t = e?.providerConfig;
17
+ return !t || typeof t != "object" || Array.isArray(t) ? {} : Object.fromEntries(Object.entries(t).filter((e) => typeof e[1] == "string"));
18
+ }
19
+ var k = ({ vaultId: t, editing: o, onDone: c }) => {
20
+ let l = e(), [d, v] = h(o ? o.providerType : "AWS_SECRETS_MANAGER"), [y, x] = h(o?.displayName ?? ""), [S, C] = h(o?.referenceKey ?? ""), [w, T] = h(() => O(o)), [k, A] = h(null), [j, { loading: M }] = s(), [N, { loading: P }] = u(), F = M || P, I = p(d), L = (e) => !e.showIf || (w[e.showIf.field] ?? e.showIf.default) === e.showIf.equals, R = async (e) => {
21
+ e.preventDefault(), A(null);
22
+ let n = S.trim();
23
+ if (!E.test(n)) {
24
+ A(l("security.externalSecrets.errors.referenceKey", "The reference key must start with a lower-case letter and use only a-z, 0-9, \"-\" and \"_\" (at most 40)."));
25
+ return;
26
+ }
27
+ let { config: r, credentials: i } = m(I, w, L), a = Object.keys(i).length > 0;
28
+ try {
29
+ o ? await N({ variables: {
30
+ id: o.id,
31
+ input: {
32
+ displayName: y.trim() || I.label,
33
+ referenceKey: n,
34
+ providerConfig: r,
35
+ ...a ? { credentials: i } : {}
36
+ }
37
+ } }) : await j({ variables: { input: {
38
+ vaultId: t,
39
+ providerType: d,
40
+ displayName: y.trim() || I.label,
41
+ referenceKey: n,
42
+ providerConfig: r,
43
+ credentials: i
44
+ } } }), c();
45
+ } catch (e) {
46
+ A(D(e));
47
+ }
48
+ };
49
+ return /* @__PURE__ */ g(r, {
50
+ className: "p-5",
51
+ children: /* @__PURE__ */ _("form", {
52
+ className: "space-y-4",
53
+ onSubmit: (e) => void R(e),
54
+ children: [
55
+ /* @__PURE__ */ g("h3", {
56
+ className: "font-semibold text-text-primary",
57
+ children: o ? l("security.externalSecrets.form.editTitle", "Edit external secret provider") : l("security.externalSecrets.form.addTitle", "Add an external secret provider")
58
+ }),
59
+ /* @__PURE__ */ _("div", {
60
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
61
+ children: [
62
+ /* @__PURE__ */ g(a, {
63
+ id: "external-provider-type",
64
+ label: l("security.externalSecrets.form.type", "Provider"),
65
+ value: d,
66
+ disabled: !!o || F,
67
+ onChange: (e) => {
68
+ v(e), T({});
69
+ },
70
+ options: f.map((e) => ({
71
+ value: e.value,
72
+ label: l(`security.externalSecrets.types.${e.translationKey}`, e.label)
73
+ }))
74
+ }),
75
+ /* @__PURE__ */ g(i, {
76
+ id: "external-provider-name",
77
+ label: l("security.externalSecrets.form.displayName", "Name"),
78
+ value: y,
79
+ placeholder: I.label,
80
+ disabled: F,
81
+ onChange: (e) => x(e.target.value)
82
+ }),
83
+ /* @__PURE__ */ g(i, {
84
+ id: "external-provider-key",
85
+ label: l("security.externalSecrets.form.referenceKey", "Reference key"),
86
+ value: S,
87
+ placeholder: "aws",
88
+ disabled: F,
89
+ autoComplete: "off",
90
+ onChange: (e) => C(e.target.value)
91
+ })
92
+ ]
93
+ }),
94
+ /* @__PURE__ */ g("div", {
95
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
96
+ children: I.fields.filter(L).map((e) => e.options ? /* @__PURE__ */ g(a, {
97
+ id: `external-provider-${e.name}`,
98
+ label: l(`security.externalSecrets.fields.${e.name}`, e.label),
99
+ value: w[e.name] ?? e.options[0]?.value ?? "",
100
+ disabled: F,
101
+ onChange: (t) => T((n) => ({
102
+ ...n,
103
+ [e.name]: t
104
+ })),
105
+ options: e.options.map((e) => ({
106
+ value: e.value,
107
+ label: l(`security.externalSecrets.options.${e.value}`, e.label)
108
+ }))
109
+ }, e.name) : /* @__PURE__ */ g(i, {
110
+ id: `external-provider-${e.name}`,
111
+ label: l(`security.externalSecrets.fields.${e.name}`, e.label),
112
+ type: e.secret ? "password" : "text",
113
+ autoComplete: e.secret ? "new-password" : "off",
114
+ value: w[e.name] ?? "",
115
+ placeholder: e.secret && o?.hasCredentials ? l("security.externalSecrets.form.storedSecret", "Stored. Enter a new value to replace it.") : e.placeholder ?? "",
116
+ disabled: F,
117
+ onChange: (t) => T((n) => ({
118
+ ...n,
119
+ [e.name]: t.target.value
120
+ }))
121
+ }, e.name))
122
+ }),
123
+ /* @__PURE__ */ g("p", {
124
+ className: "text-xs text-text-secondary",
125
+ children: l("security.externalSecrets.form.credentialsNote", "Credentials are stored encrypted with this vault's key and are never shown again. Give them read-only access to the secrets connections need.")
126
+ }),
127
+ k && /* @__PURE__ */ g("p", {
128
+ role: "alert",
129
+ className: "text-sm text-status-error-text",
130
+ children: k
131
+ }),
132
+ /* @__PURE__ */ _("div", {
133
+ className: "flex justify-end gap-2",
134
+ children: [/* @__PURE__ */ g(n, {
135
+ variant: "outline",
136
+ onClick: c,
137
+ disabled: F,
138
+ children: l("security.common.actions.cancel", "Cancel")
139
+ }), /* @__PURE__ */ _(n, {
140
+ type: "submit",
141
+ disabled: F,
142
+ children: [F && /* @__PURE__ */ g(b, { className: "size-4 animate-spin" }), o ? l("security.common.actions.save", "Save") : l("security.externalSecrets.form.add", "Add provider")]
143
+ })]
144
+ })
145
+ ]
146
+ })
147
+ });
148
+ }, A = ({ row: i, onEdit: a, onDelete: o }) => {
149
+ let s = e(), [c, { loading: u }] = l(), [f, m] = h(null), S = p(i.providerType), E = `{{ $secrets.${i.referenceKey ?? ""}.${S.exampleName} }}`, O = f ?? (i.lastTestStatus ? {
150
+ success: i.lastTestStatus === "SUCCESS",
151
+ message: i.lastTestMessage ?? ""
152
+ } : null), k = async () => {
153
+ try {
154
+ let e = (await c({ variables: { id: i.id } })).data?.testVaultIntegration;
155
+ e && m({
156
+ success: e.success,
157
+ message: e.message
158
+ });
159
+ } catch (e) {
160
+ m({
161
+ success: !1,
162
+ message: D(e)
163
+ });
164
+ }
165
+ };
166
+ return /* @__PURE__ */ _(r, {
167
+ className: "space-y-3 p-5",
168
+ children: [
169
+ /* @__PURE__ */ _("div", {
170
+ className: "flex items-start justify-between gap-3",
171
+ children: [/* @__PURE__ */ _("div", {
172
+ className: "flex items-center gap-3",
173
+ children: [/* @__PURE__ */ g("div", {
174
+ className: "rounded-lg bg-bg-sunken p-2",
175
+ children: /* @__PURE__ */ g(y, { className: "size-5 text-text-secondary" })
176
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h3", {
177
+ className: "font-semibold text-text-primary",
178
+ children: i.displayName
179
+ }), /* @__PURE__ */ g("p", {
180
+ className: "text-xs text-text-secondary",
181
+ children: s(`security.externalSecrets.types.${S.translationKey}`, S.label)
182
+ })] })]
183
+ }), O && /* @__PURE__ */ _(t, {
184
+ variant: O.success ? "success" : "destructive",
185
+ className: "text-[10px] uppercase",
186
+ children: [O.success ? /* @__PURE__ */ g(v, { className: "size-3" }) : /* @__PURE__ */ g(T, { className: "size-3" }), O.success ? s("security.externalSecrets.card.connected", "Connected") : s("security.externalSecrets.card.failed", "Failed")]
187
+ })]
188
+ }),
189
+ /* @__PURE__ */ _("div", {
190
+ className: "space-y-1",
191
+ children: [/* @__PURE__ */ g("p", {
192
+ className: "text-xs font-medium text-text-secondary",
193
+ children: s("security.externalSecrets.card.reference", "Reference it in a connection field as")
194
+ }), /* @__PURE__ */ _("div", {
195
+ className: "flex items-center gap-2 rounded-md border border-border-subtle bg-bg-sunken px-2 py-1",
196
+ children: [/* @__PURE__ */ g("code", {
197
+ className: "flex-1 truncate font-mono text-xs text-text-primary",
198
+ children: E
199
+ }), /* @__PURE__ */ g(d, {
200
+ value: E,
201
+ autoClearMs: 0
202
+ })]
203
+ })]
204
+ }),
205
+ O && !O.success && O.message && /* @__PURE__ */ g("p", {
206
+ className: "text-xs text-status-error-text",
207
+ children: O.message
208
+ }),
209
+ /* @__PURE__ */ _("div", {
210
+ className: "flex flex-wrap gap-2 border-t border-border-subtle pt-3",
211
+ children: [
212
+ /* @__PURE__ */ _(n, {
213
+ variant: "outline",
214
+ size: "sm",
215
+ onClick: () => void k(),
216
+ disabled: u,
217
+ children: [u ? /* @__PURE__ */ g(b, { className: "size-4 animate-spin" }) : /* @__PURE__ */ g(C, { className: "size-4" }), s("security.externalSecrets.card.test", "Test")]
218
+ }),
219
+ /* @__PURE__ */ _(n, {
220
+ variant: "outline",
221
+ size: "sm",
222
+ onClick: a,
223
+ children: [/* @__PURE__ */ g(x, { className: "size-4" }), s("security.common.actions.edit", "Edit")]
224
+ }),
225
+ /* @__PURE__ */ _(n, {
226
+ variant: "ghost",
227
+ size: "sm",
228
+ onClick: o,
229
+ children: [/* @__PURE__ */ g(w, { className: "size-4" }), s("security.common.actions.delete", "Delete")]
230
+ })
231
+ ]
232
+ })
233
+ ]
234
+ });
235
+ }, j = ({ vaultId: t, rows: r }) => {
236
+ let i = e(), [a, s] = h(null), [l, u] = h(null), [d] = c(), f = r.filter((e) => e.referenceKey);
237
+ return /* @__PURE__ */ _("section", {
238
+ className: "space-y-4",
239
+ "aria-labelledby": "external-secret-providers-heading",
240
+ children: [
241
+ /* @__PURE__ */ _("div", {
242
+ className: "flex flex-wrap items-start justify-between gap-3",
243
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
244
+ id: "external-secret-providers-heading",
245
+ className: "text-lg font-semibold text-text-primary",
246
+ children: i("security.externalSecrets.title", "External secrets")
247
+ }), /* @__PURE__ */ g("p", {
248
+ className: "max-w-2xl text-sm text-text-secondary",
249
+ children: i("security.externalSecrets.description", "Connection fields can reference a secret that stays in your own secret manager. It is read only when the connection is used and is never stored here. Only people who can view this vault can reference its providers.")
250
+ })] }), a === null && /* @__PURE__ */ _(n, {
251
+ onClick: () => s("new"),
252
+ children: [/* @__PURE__ */ g(S, { className: "size-4" }), i("security.externalSecrets.add", "Add provider")]
253
+ })]
254
+ }),
255
+ a !== null && /* @__PURE__ */ g(k, {
256
+ vaultId: t,
257
+ editing: a === "new" ? null : a,
258
+ onDone: () => s(null)
259
+ }, a === "new" ? "new" : a.id),
260
+ f.length > 0 ? /* @__PURE__ */ g("div", {
261
+ className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
262
+ children: f.map((e) => /* @__PURE__ */ g(A, {
263
+ row: e,
264
+ onEdit: () => s(e),
265
+ onDelete: () => u(e)
266
+ }, e.id))
267
+ }) : a === null && /* @__PURE__ */ g("p", {
268
+ className: "rounded-md border border-dashed border-border-subtle p-4 text-sm text-text-secondary",
269
+ children: i("security.externalSecrets.empty", "No external secret providers in this vault yet. Add AWS Secrets Manager, HashiCorp Vault, 1Password Connect or Infisical.")
270
+ }),
271
+ /* @__PURE__ */ g(o, {
272
+ isOpen: l !== null,
273
+ onClose: () => u(null),
274
+ onConfirm: () => {
275
+ l && d({ variables: { id: l.id } }), u(null);
276
+ },
277
+ title: i("security.externalSecrets.delete.title", "Delete this provider?"),
278
+ description: i("security.externalSecrets.delete.description", "Connections that reference \"{{key}}\" will fail until it is added again.", { key: l?.referenceKey ?? "" }),
279
+ confirmLabel: i("security.common.actions.delete", "Delete"),
280
+ variant: "destructive"
281
+ })
282
+ ]
283
+ });
284
+ };
285
+ //#endregion
286
+ export { j as ExternalSecretProviders };
287
+
288
+ //# sourceMappingURL=ExternalSecretProviders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalSecretProviders.js","names":[],"sources":["../../../src/security/components/ExternalSecretProviders.tsx"],"sourcesContent":["/**\n * External secret providers of one vault (BOFF-9741).\n *\n * A provider lets connection fields reference a secret that stays in the workspace's own\n * secret manager: `{{ $secrets.<key>.<name> }}`. Its credentials are stored encrypted with the\n * vault's key and are write-only here: the form shows that they are stored, never what they are.\n * Only people who can view this vault can reference its providers.\n */\nimport { type FC, type FormEvent, useState } from 'react';\nimport {\n CheckCircle,\n KeyRound,\n Loader2,\n Pencil,\n Plus,\n ShieldCheck,\n Trash2,\n XCircle,\n} from 'lucide-react';\n\nimport { Badge, Button, Card, Input, Select } from './ui';\nimport { ConfirmDialog } from './ConfirmDialog';\nimport { CopyButton } from './CopyButton';\nimport { useTr } from '../hooks/useTr';\nimport {\n useCreateExternalSecretProvider,\n useDeleteIntegration,\n useTestExternalSecretProvider,\n useUpdateExternalSecretProvider,\n} from '../hooks/useProviderQueries';\nimport {\n EXTERNAL_PROVIDER_TYPES,\n type ExternalProviderField,\n type ExternalProviderTypeKey,\n externalProviderType,\n splitProviderValues,\n} from '../constants/externalSecretProviders';\n\nexport interface ExternalSecretProviderRow {\n id: string;\n providerType: string;\n displayName: string;\n referenceKey?: string | null;\n providerConfig?: unknown;\n hasCredentials?: boolean | null;\n lastTestedAt?: string | null;\n lastTestStatus?: string | null;\n lastTestMessage?: string | null;\n}\n\nconst REFERENCE_KEY = /^[a-z][a-z0-9_-]{0,39}$/;\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction configOf(row: ExternalSecretProviderRow | null): Record<string, string> {\n const config = row?.providerConfig;\n if (!config || typeof config !== 'object' || Array.isArray(config)) return {};\n return Object.fromEntries(\n Object.entries(config as Record<string, unknown>).filter(\n (entry): entry is [string, string] => typeof entry[1] === 'string'\n )\n );\n}\n\n/** Add or edit one provider. Credentials are blank on edit: typing replaces them. */\nconst ProviderForm: FC<{\n vaultId: string;\n editing: ExternalSecretProviderRow | null;\n onDone: () => void;\n}> = ({ vaultId, editing, onDone }) => {\n const tr = useTr();\n const [type, setType] = useState<ExternalProviderTypeKey>(\n (editing ? editing.providerType : 'AWS_SECRETS_MANAGER') as ExternalProviderTypeKey\n );\n const [displayName, setDisplayName] = useState(editing?.displayName ?? '');\n const [referenceKey, setReferenceKey] = useState(editing?.referenceKey ?? '');\n const [values, setValues] = useState<Record<string, string>>(() => configOf(editing));\n const [error, setError] = useState<string | null>(null);\n const [create, { loading: creating }] = useCreateExternalSecretProvider();\n const [update, { loading: updating }] = useUpdateExternalSecretProvider();\n const busy = creating || updating;\n const definition = externalProviderType(type);\n\n const visible = (field: ExternalProviderField): boolean =>\n !field.showIf || (values[field.showIf.field] ?? field.showIf.default) === field.showIf.equals;\n\n const submit = async (event: FormEvent) => {\n event.preventDefault();\n setError(null);\n const key = referenceKey.trim();\n if (!REFERENCE_KEY.test(key)) {\n setError(\n tr(\n 'security.externalSecrets.errors.referenceKey',\n 'The reference key must start with a lower-case letter and use only a-z, 0-9, \"-\" and \"_\" (at most 40).'\n )\n );\n return;\n }\n const { config, credentials } = splitProviderValues(definition, values, visible);\n const hasNewCredentials = Object.keys(credentials).length > 0;\n try {\n if (editing) {\n await update({\n variables: {\n id: editing.id,\n input: {\n displayName: displayName.trim() || definition.label,\n referenceKey: key,\n providerConfig: config,\n ...(hasNewCredentials ? { credentials } : {}),\n },\n },\n });\n } else {\n await create({\n variables: {\n input: {\n vaultId,\n providerType: type,\n displayName: displayName.trim() || definition.label,\n referenceKey: key,\n providerConfig: config,\n credentials,\n },\n },\n });\n }\n onDone();\n } catch (cause) {\n setError(messageOf(cause));\n }\n };\n\n return (\n <Card className=\"p-5\">\n <form className=\"space-y-4\" onSubmit={(event) => void submit(event)}>\n <h3 className=\"font-semibold text-text-primary\">\n {editing\n ? tr('security.externalSecrets.form.editTitle', 'Edit external secret provider')\n : tr('security.externalSecrets.form.addTitle', 'Add an external secret provider')}\n </h3>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <Select\n id=\"external-provider-type\"\n label={tr('security.externalSecrets.form.type', 'Provider')}\n value={type}\n disabled={Boolean(editing) || busy}\n onChange={(value) => {\n setType(value as ExternalProviderTypeKey);\n setValues({});\n }}\n options={EXTERNAL_PROVIDER_TYPES.map((entry) => ({\n value: entry.value,\n label: tr(`security.externalSecrets.types.${entry.translationKey}`, entry.label),\n }))}\n />\n <Input\n id=\"external-provider-name\"\n label={tr('security.externalSecrets.form.displayName', 'Name')}\n value={displayName}\n placeholder={definition.label}\n disabled={busy}\n onChange={(event) => setDisplayName(event.target.value)}\n />\n <Input\n id=\"external-provider-key\"\n label={tr('security.externalSecrets.form.referenceKey', 'Reference key')}\n value={referenceKey}\n placeholder=\"aws\"\n disabled={busy}\n autoComplete=\"off\"\n onChange={(event) => setReferenceKey(event.target.value)}\n />\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n {definition.fields.filter(visible).map((field) =>\n field.options ? (\n <Select\n key={field.name}\n id={`external-provider-${field.name}`}\n label={tr(`security.externalSecrets.fields.${field.name}`, field.label)}\n value={values[field.name] ?? field.options[0]?.value ?? ''}\n disabled={busy}\n onChange={(value) => setValues((current) => ({ ...current, [field.name]: value }))}\n options={field.options.map((option) => ({\n value: option.value,\n label: tr(`security.externalSecrets.options.${option.value}`, option.label),\n }))}\n />\n ) : (\n <Input\n key={field.name}\n id={`external-provider-${field.name}`}\n label={tr(`security.externalSecrets.fields.${field.name}`, field.label)}\n type={field.secret ? 'password' : 'text'}\n autoComplete={field.secret ? 'new-password' : 'off'}\n value={values[field.name] ?? ''}\n placeholder={\n field.secret && editing?.hasCredentials\n ? tr(\n 'security.externalSecrets.form.storedSecret',\n 'Stored. Enter a new value to replace it.'\n )\n : (field.placeholder ?? '')\n }\n disabled={busy}\n onChange={(event) =>\n setValues((current) => ({ ...current, [field.name]: event.target.value }))\n }\n />\n )\n )}\n </div>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'security.externalSecrets.form.credentialsNote',\n \"Credentials are stored encrypted with this vault's key and are never shown again. Give them read-only access to the secrets connections need.\"\n )}\n </p>\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n <div className=\"flex justify-end gap-2\">\n <Button variant=\"outline\" onClick={onDone} disabled={busy}>\n {tr('security.common.actions.cancel', 'Cancel')}\n </Button>\n <Button type=\"submit\" disabled={busy}>\n {busy && <Loader2 className=\"size-4 animate-spin\" />}\n {editing\n ? tr('security.common.actions.save', 'Save')\n : tr('security.externalSecrets.form.add', 'Add provider')}\n </Button>\n </div>\n </form>\n </Card>\n );\n};\n\nconst ProviderCard: FC<{\n row: ExternalSecretProviderRow;\n onEdit: () => void;\n onDelete: () => void;\n}> = ({ row, onEdit, onDelete }) => {\n const tr = useTr();\n const [test, { loading: testing }] = useTestExternalSecretProvider();\n const [result, setResult] = useState<{ success: boolean; message: string } | null>(null);\n const definition = externalProviderType(row.providerType);\n const example = `{{ $secrets.${row.referenceKey ?? ''}.${definition.exampleName} }}`;\n const status =\n result ??\n (row.lastTestStatus\n ? { success: row.lastTestStatus === 'SUCCESS', message: row.lastTestMessage ?? '' }\n : null);\n\n const runTest = async () => {\n try {\n const response = await test({ variables: { id: row.id } });\n const outcome = response.data?.testVaultIntegration;\n if (outcome) setResult({ success: outcome.success, message: outcome.message });\n } catch (cause) {\n setResult({ success: false, message: messageOf(cause) });\n }\n };\n\n return (\n <Card className=\"space-y-3 p-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"rounded-lg bg-bg-sunken p-2\">\n <KeyRound className=\"size-5 text-text-secondary\" />\n </div>\n <div>\n <h3 className=\"font-semibold text-text-primary\">{row.displayName}</h3>\n <p className=\"text-xs text-text-secondary\">\n {tr(`security.externalSecrets.types.${definition.translationKey}`, definition.label)}\n </p>\n </div>\n </div>\n {status && (\n <Badge\n variant={status.success ? 'success' : 'destructive'}\n className=\"text-[10px] uppercase\"\n >\n {status.success ? <CheckCircle className=\"size-3\" /> : <XCircle className=\"size-3\" />}\n {status.success\n ? tr('security.externalSecrets.card.connected', 'Connected')\n : tr('security.externalSecrets.card.failed', 'Failed')}\n </Badge>\n )}\n </div>\n <div className=\"space-y-1\">\n <p className=\"text-xs font-medium text-text-secondary\">\n {tr('security.externalSecrets.card.reference', 'Reference it in a connection field as')}\n </p>\n <div className=\"flex items-center gap-2 rounded-md border border-border-subtle bg-bg-sunken px-2 py-1\">\n <code className=\"flex-1 truncate font-mono text-xs text-text-primary\">{example}</code>\n <CopyButton value={example} autoClearMs={0} />\n </div>\n </div>\n {status && !status.success && status.message && (\n <p className=\"text-xs text-status-error-text\">{status.message}</p>\n )}\n <div className=\"flex flex-wrap gap-2 border-t border-border-subtle pt-3\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => void runTest()} disabled={testing}>\n {testing ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <ShieldCheck className=\"size-4\" />\n )}\n {tr('security.externalSecrets.card.test', 'Test')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={onEdit}>\n <Pencil className=\"size-4\" />\n {tr('security.common.actions.edit', 'Edit')}\n </Button>\n <Button variant=\"ghost\" size=\"sm\" onClick={onDelete}>\n <Trash2 className=\"size-4\" />\n {tr('security.common.actions.delete', 'Delete')}\n </Button>\n </div>\n </Card>\n );\n};\n\nexport const ExternalSecretProviders: FC<{\n vaultId: string;\n rows: ExternalSecretProviderRow[];\n}> = ({ vaultId, rows }) => {\n const tr = useTr();\n const [editing, setEditing] = useState<ExternalSecretProviderRow | 'new' | null>(null);\n const [deleting, setDeleting] = useState<ExternalSecretProviderRow | null>(null);\n const [deleteProvider] = useDeleteIntegration();\n const providers = rows.filter((row) => row.referenceKey);\n\n return (\n <section className=\"space-y-4\" aria-labelledby=\"external-secret-providers-heading\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div>\n <h2\n id=\"external-secret-providers-heading\"\n className=\"text-lg font-semibold text-text-primary\"\n >\n {tr('security.externalSecrets.title', 'External secrets')}\n </h2>\n <p className=\"max-w-2xl text-sm text-text-secondary\">\n {tr(\n 'security.externalSecrets.description',\n 'Connection fields can reference a secret that stays in your own secret manager. It is read only when the connection is used and is never stored here. Only people who can view this vault can reference its providers.'\n )}\n </p>\n </div>\n {editing === null && (\n <Button onClick={() => setEditing('new')}>\n <Plus className=\"size-4\" />\n {tr('security.externalSecrets.add', 'Add provider')}\n </Button>\n )}\n </div>\n\n {editing !== null && (\n <ProviderForm\n key={editing === 'new' ? 'new' : editing.id}\n vaultId={vaultId}\n editing={editing === 'new' ? null : editing}\n onDone={() => setEditing(null)}\n />\n )}\n\n {providers.length > 0 ? (\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-2\">\n {providers.map((row) => (\n <ProviderCard\n key={row.id}\n row={row}\n onEdit={() => setEditing(row)}\n onDelete={() => setDeleting(row)}\n />\n ))}\n </div>\n ) : (\n editing === null && (\n <p className=\"rounded-md border border-dashed border-border-subtle p-4 text-sm text-text-secondary\">\n {tr(\n 'security.externalSecrets.empty',\n 'No external secret providers in this vault yet. Add AWS Secrets Manager, HashiCorp Vault, 1Password Connect or Infisical.'\n )}\n </p>\n )\n )}\n\n <ConfirmDialog\n isOpen={deleting !== null}\n onClose={() => setDeleting(null)}\n onConfirm={() => {\n if (deleting) void deleteProvider({ variables: { id: deleting.id } });\n setDeleting(null);\n }}\n title={tr('security.externalSecrets.delete.title', 'Delete this provider?')}\n description={tr(\n 'security.externalSecrets.delete.description',\n 'Connections that reference \"{{key}}\" will fail until it is added again.',\n { key: deleting?.referenceKey ?? '' }\n )}\n confirmLabel={tr('security.common.actions.delete', 'Delete')}\n variant=\"destructive\"\n />\n </section>\n );\n};\n"],"mappings":";;;;;;;;;;AAkDA,IAAM,IAAgB;AAEtB,SAAS,EAAU,GAAwB;AACzC,QAAO,aAAiB,QAAQ,EAAM,UAAU,OAAO,EAAM;;AAG/D,SAAS,EAAS,GAA+D;CAC/E,IAAM,IAAS,GAAK;AAEpB,QADI,CAAC,KAAU,OAAO,KAAW,YAAY,MAAM,QAAQ,EAAO,GAAS,EAAE,GACtE,OAAO,YACZ,OAAO,QAAQ,EAAkC,CAAC,QAC/C,MAAqC,OAAO,EAAM,MAAO,SAC3D,CACF;;AAIH,IAAM,KAIA,EAAE,YAAS,YAAS,gBAAa;CACrC,IAAM,IAAK,GAAO,EACZ,CAAC,GAAM,KAAW,EACrB,IAAU,EAAQ,eAAe,sBACnC,EACK,CAAC,GAAa,KAAkB,EAAS,GAAS,eAAe,GAAG,EACpE,CAAC,GAAc,KAAmB,EAAS,GAAS,gBAAgB,GAAG,EACvE,CAAC,GAAQ,KAAa,QAAuC,EAAS,EAAQ,CAAC,EAC/E,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,CAAC,GAAQ,EAAE,SAAS,OAAc,GAAiC,EACnE,CAAC,GAAQ,EAAE,SAAS,OAAc,GAAiC,EACnE,IAAO,KAAY,GACnB,IAAa,EAAqB,EAAK,EAEvC,KAAW,MACf,CAAC,EAAM,WAAW,EAAO,EAAM,OAAO,UAAU,EAAM,OAAO,aAAa,EAAM,OAAO,QAEnF,IAAS,OAAO,MAAqB;AAEzC,EADA,EAAM,gBAAgB,EACtB,EAAS,KAAK;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,EAAY,KAAK;;IAEnB,OAAO,EAAG,yCAAyC,wBAAwB;IAC3E,aAAa,EACX,+CACA,6EACA,EAAE,KAAK,GAAU,gBAAgB,IAAI,CACtC;IACD,cAAc,EAAG,kCAAkC,SAAS;IAC5D,SAAQ;IACR,CAAA;GACM"}
@@ -1,22 +1,22 @@
1
1
  import { useTr as e } from "../hooks/useTr.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { Button as n } from "./ui.js";
4
- import { DEFAULT_PASSWORD_OPTIONS as r, calculatePasswordStrength as i, generatePassword as a } from "../utils/passwordGenerator.js";
5
- import { CopyButton as o } from "./CopyButton.js";
4
+ import { CopyButton as r } from "./CopyButton.js";
5
+ import { DEFAULT_PASSWORD_OPTIONS as i, calculatePasswordStrength as a, generatePassword as o } from "../utils/passwordGenerator.js";
6
6
  import { useCallback as s, useState as c } from "react";
7
7
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  import { RefreshCw as d } from "lucide-react";
9
9
  //#region src/security/components/PasswordGenerator.tsx
10
10
  var f = ({ onAccept: f, clipboardAutoClearMs: p = 3e4, className: m }) => {
11
- let h = e(), [g, _] = c(r), [v, y] = c(() => a(r)), b = s(() => {
12
- y(a(g));
11
+ let h = e(), [g, _] = c(i), [v, y] = c(() => o(i)), b = s(() => {
12
+ y(o(g));
13
13
  }, [g]), x = s((e, t) => {
14
14
  let n = {
15
15
  ...g,
16
16
  [e]: t
17
17
  };
18
- _(n), y(a(n));
19
- }, [g]), S = i(v);
18
+ _(n), y(o(n));
19
+ }, [g]), S = a(v);
20
20
  return /* @__PURE__ */ u("div", {
21
21
  className: t("space-y-4 rounded-lg border border-border-subtle p-4", m),
22
22
  children: [
@@ -34,7 +34,7 @@ var f = ({ onAccept: f, clipboardAutoClearMs: p = 3e4, className: m }) => {
34
34
  title: h("security.passwordGenerator.title", "Generate new password"),
35
35
  children: /* @__PURE__ */ l(d, { className: "size-4" })
36
36
  }),
37
- /* @__PURE__ */ l(o, {
37
+ /* @__PURE__ */ l(r, {
38
38
  value: v,
39
39
  autoClearMs: p
40
40
  })
@@ -0,0 +1,160 @@
1
+ //#region src/security/constants/externalSecretProviders.ts
2
+ var e = [
3
+ {
4
+ value: "AWS_SECRETS_MANAGER",
5
+ label: "AWS Secrets Manager",
6
+ translationKey: "awsSecretsManager",
7
+ exampleName: "prod/stripe.api_key",
8
+ fields: [
9
+ {
10
+ name: "region",
11
+ label: "Region",
12
+ placeholder: "us-east-1"
13
+ },
14
+ {
15
+ name: "accessKeyId",
16
+ label: "Access key ID",
17
+ secret: !0
18
+ },
19
+ {
20
+ name: "secretAccessKey",
21
+ label: "Secret access key",
22
+ secret: !0
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ value: "HASHICORP_VAULT",
28
+ label: "HashiCorp Vault",
29
+ translationKey: "hashicorpVault",
30
+ exampleName: "apps/stripe.api_key",
31
+ fields: [
32
+ {
33
+ name: "address",
34
+ label: "Address",
35
+ placeholder: "https://vault.example.com"
36
+ },
37
+ {
38
+ name: "mount",
39
+ label: "KV v2 mount",
40
+ placeholder: "secret"
41
+ },
42
+ {
43
+ name: "namespace",
44
+ label: "Namespace (optional)"
45
+ },
46
+ {
47
+ name: "authMethod",
48
+ label: "Sign-in method",
49
+ options: [{
50
+ value: "token",
51
+ label: "Token"
52
+ }, {
53
+ value: "approle",
54
+ label: "AppRole"
55
+ }]
56
+ },
57
+ {
58
+ name: "token",
59
+ label: "Token",
60
+ secret: !0,
61
+ showIf: {
62
+ field: "authMethod",
63
+ equals: "token",
64
+ default: "token"
65
+ }
66
+ },
67
+ {
68
+ name: "roleId",
69
+ label: "Role ID",
70
+ secret: !0,
71
+ showIf: {
72
+ field: "authMethod",
73
+ equals: "approle",
74
+ default: "token"
75
+ }
76
+ },
77
+ {
78
+ name: "secretId",
79
+ label: "Secret ID",
80
+ secret: !0,
81
+ showIf: {
82
+ field: "authMethod",
83
+ equals: "approle",
84
+ default: "token"
85
+ }
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ value: "ONEPASSWORD_CONNECT",
91
+ label: "1Password Connect",
92
+ translationKey: "onePasswordConnect",
93
+ exampleName: "Production/Stripe.password",
94
+ fields: [{
95
+ name: "host",
96
+ label: "Connect server URL",
97
+ placeholder: "https://connect.example.com"
98
+ }, {
99
+ name: "token",
100
+ label: "Access token",
101
+ secret: !0
102
+ }]
103
+ },
104
+ {
105
+ value: "INFISICAL",
106
+ label: "Infisical",
107
+ translationKey: "infisical",
108
+ exampleName: "STRIPE_API_KEY",
109
+ fields: [
110
+ {
111
+ name: "siteUrl",
112
+ label: "Site URL (optional)",
113
+ placeholder: "https://app.infisical.com"
114
+ },
115
+ {
116
+ name: "projectId",
117
+ label: "Project ID"
118
+ },
119
+ {
120
+ name: "environment",
121
+ label: "Environment",
122
+ placeholder: "prod"
123
+ },
124
+ {
125
+ name: "secretPath",
126
+ label: "Folder (optional)",
127
+ placeholder: "/"
128
+ },
129
+ {
130
+ name: "clientId",
131
+ label: "Machine identity client ID",
132
+ secret: !0
133
+ },
134
+ {
135
+ name: "clientSecret",
136
+ label: "Machine identity client secret",
137
+ secret: !0
138
+ }
139
+ ]
140
+ }
141
+ ];
142
+ function t(t) {
143
+ return e.find((e) => e.value === t) ?? e[0];
144
+ }
145
+ function n(e, t, n) {
146
+ let r = {}, i = {};
147
+ for (let a of e.fields) {
148
+ if (!n(a)) continue;
149
+ let e = (t[a.name] ?? a.options?.[0]?.value ?? "").trim();
150
+ e && (a.secret ? i[a.name] = e : r[a.name] = e);
151
+ }
152
+ return {
153
+ config: r,
154
+ credentials: i
155
+ };
156
+ }
157
+ //#endregion
158
+ export { e as EXTERNAL_PROVIDER_TYPES, t as externalProviderType, n as splitProviderValues };
159
+
160
+ //# sourceMappingURL=externalSecretProviders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"externalSecretProviders.js","names":[],"sources":["../../../src/security/constants/externalSecretProviders.ts"],"sourcesContent":["/**\n * What each external secret provider needs (BOFF-9741). Mirrors wspace-security-svc's\n * provider settings: `config` fields are stored as the provider's configuration, `secret` fields\n * are its write-only credentials.\n */\n\nexport type ExternalProviderTypeKey =\n | 'AWS_SECRETS_MANAGER'\n | 'HASHICORP_VAULT'\n | 'ONEPASSWORD_CONNECT'\n | 'INFISICAL';\n\nexport interface ExternalProviderField {\n name: string;\n label: string;\n /** Stored as a write-only credential rather than as configuration. */\n secret?: boolean;\n placeholder?: string;\n options?: Array<{ value: string; label: string }>;\n /** Shown only when another field has this value (`default` when it is unset). */\n showIf?: { field: string; equals: string; default: string };\n}\n\nexport interface ExternalProviderTypeDefinition {\n value: ExternalProviderTypeKey;\n label: string;\n translationKey: string;\n /** A name to show in the reference example. */\n exampleName: string;\n fields: ExternalProviderField[];\n}\n\nexport const EXTERNAL_PROVIDER_TYPES: ExternalProviderTypeDefinition[] = [\n {\n value: 'AWS_SECRETS_MANAGER',\n label: 'AWS Secrets Manager',\n translationKey: 'awsSecretsManager',\n exampleName: 'prod/stripe.api_key',\n fields: [\n { name: 'region', label: 'Region', placeholder: 'us-east-1' },\n { name: 'accessKeyId', label: 'Access key ID', secret: true },\n { name: 'secretAccessKey', label: 'Secret access key', secret: true },\n ],\n },\n {\n value: 'HASHICORP_VAULT',\n label: 'HashiCorp Vault',\n translationKey: 'hashicorpVault',\n exampleName: 'apps/stripe.api_key',\n fields: [\n { name: 'address', label: 'Address', placeholder: 'https://vault.example.com' },\n { name: 'mount', label: 'KV v2 mount', placeholder: 'secret' },\n { name: 'namespace', label: 'Namespace (optional)' },\n {\n name: 'authMethod',\n label: 'Sign-in method',\n options: [\n { value: 'token', label: 'Token' },\n { value: 'approle', label: 'AppRole' },\n ],\n },\n {\n name: 'token',\n label: 'Token',\n secret: true,\n showIf: { field: 'authMethod', equals: 'token', default: 'token' },\n },\n {\n name: 'roleId',\n label: 'Role ID',\n secret: true,\n showIf: { field: 'authMethod', equals: 'approle', default: 'token' },\n },\n {\n name: 'secretId',\n label: 'Secret ID',\n secret: true,\n showIf: { field: 'authMethod', equals: 'approle', default: 'token' },\n },\n ],\n },\n {\n value: 'ONEPASSWORD_CONNECT',\n label: '1Password Connect',\n translationKey: 'onePasswordConnect',\n exampleName: 'Production/Stripe.password',\n fields: [\n { name: 'host', label: 'Connect server URL', placeholder: 'https://connect.example.com' },\n { name: 'token', label: 'Access token', secret: true },\n ],\n },\n {\n value: 'INFISICAL',\n label: 'Infisical',\n translationKey: 'infisical',\n exampleName: 'STRIPE_API_KEY',\n fields: [\n { name: 'siteUrl', label: 'Site URL (optional)', placeholder: 'https://app.infisical.com' },\n { name: 'projectId', label: 'Project ID' },\n { name: 'environment', label: 'Environment', placeholder: 'prod' },\n { name: 'secretPath', label: 'Folder (optional)', placeholder: '/' },\n { name: 'clientId', label: 'Machine identity client ID', secret: true },\n { name: 'clientSecret', label: 'Machine identity client secret', secret: true },\n ],\n },\n];\n\nexport function externalProviderType(value: string): ExternalProviderTypeDefinition {\n return (\n EXTERNAL_PROVIDER_TYPES.find((entry) => entry.value === value) ??\n (EXTERNAL_PROVIDER_TYPES[0] as ExternalProviderTypeDefinition)\n );\n}\n\n/**\n * The form's values as provider configuration and credentials. Hidden and blank fields are left\n * out, so an empty credential field on edit keeps the stored one.\n */\nexport function splitProviderValues(\n definition: ExternalProviderTypeDefinition,\n values: Record<string, string>,\n visible: (field: ExternalProviderField) => boolean\n): { config: Record<string, string>; credentials: Record<string, string> } {\n const config: Record<string, string> = {};\n const credentials: Record<string, string> = {};\n for (const field of definition.fields) {\n if (!visible(field)) continue;\n const value = (values[field.name] ?? field.options?.[0]?.value ?? '').trim();\n if (!value) continue;\n if (field.secret) credentials[field.name] = value;\n else config[field.name] = value;\n }\n return { config, credentials };\n}\n"],"mappings":";AAgCA,IAAa,IAA4D;CACvE;EACE,OAAO;EACP,OAAO;EACP,gBAAgB;EAChB,aAAa;EACb,QAAQ;GACN;IAAE,MAAM;IAAU,OAAO;IAAU,aAAa;IAAa;GAC7D;IAAE,MAAM;IAAe,OAAO;IAAiB,QAAQ;IAAM;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CACF;AAED,SAAgB,EAAqB,GAA+C;AAClF,QACE,EAAwB,MAAM,MAAU,EAAM,UAAU,EAAM,IAC7D,EAAwB;;AAQ7B,SAAgB,EACd,GACA,GACA,GACyE;CACzE,IAAM,IAAiC,EAAE,EACnC,IAAsC,EAAE;AAC9C,MAAK,IAAM,KAAS,EAAW,QAAQ;AACrC,MAAI,CAAC,EAAQ,EAAM,CAAE;EACrB,IAAM,KAAS,EAAO,EAAM,SAAS,EAAM,UAAU,IAAI,SAAS,IAAI,MAAM;AACvE,QACD,EAAM,SAAQ,EAAY,EAAM,QAAQ,IACvC,EAAO,EAAM,QAAQ;;AAE5B,QAAO;EAAE;EAAQ;EAAa"}
@@ -10,7 +10,7 @@ var e = {
10
10
  MEMBER_INVITE: "security.member.invite",
11
11
  MEMBER_REMOVE: "security.member.remove",
12
12
  MEMBER_UPDATE_ROLE: "security.member.update_role",
13
- PROVIDERS_EXPERIMENTAL: "security.providers.experimental"
13
+ VAULT_INTEGRATIONS: "security.vault-integrations"
14
14
  };
15
15
  //#endregion
16
16
  export { e as SECURITY_FEATURE_FLAGS };
@@ -1 +1 @@
1
- {"version":3,"file":"featureFlags.js","names":[],"sources":["../../../src/security/constants/featureFlags.ts"],"sourcesContent":["/**\n * Per-page/sub-feature feature flag keys for the security module.\n * These are additive gates on top of RBAC permissions — a user with\n * `secret:delete` RBAC permission still needs the corresponding\n * feature flag enabled to access the operation.\n *\n * Flag keys follow the pattern: `security.{resource}.{action}`\n *\n * Reference: `~/products/dev/platform/context/commercial/feature-flags/` for integration guide.\n */\nexport const SECURITY_FEATURE_FLAGS = {\n /** Allow vault deletion (owners only in RBAC, this flag is an additional gate) */\n VAULT_DELETE: 'security.vault.delete',\n /** Allow vault lock/unlock operations */\n VAULT_LOCK: 'security.vault.lock',\n /** Allow vault settings changes */\n VAULT_UPDATE: 'security.vault.update',\n /** Allow vault export/backup */\n VAULT_EXPORT: 'security.vault.export',\n /** Allow secret rotation */\n SECRET_ROTATE: 'security.secret.rotate',\n /** Allow secret rollback to previous versions */\n SECRET_ROLLBACK: 'security.secret.rollback',\n /** Allow bulk secret operations (move/label/delete) */\n SECRET_BULK: 'security.secret.bulk',\n /** Allow member invitation */\n MEMBER_INVITE: 'security.member.invite',\n /** Allow member removal */\n MEMBER_REMOVE: 'security.member.remove',\n /** Allow role changes */\n MEMBER_UPDATE_ROLE: 'security.member.update_role',\n /** External vault provider integrations (AWS / Azure / GCP / HashiCorp). Off until backend adapters are GA. */\n PROVIDERS_EXPERIMENTAL: 'security.providers.experimental',\n} as const;\n\nexport type SecurityFeatureFlag =\n (typeof SECURITY_FEATURE_FLAGS)[keyof typeof SECURITY_FEATURE_FLAGS];\n"],"mappings":";AAUA,IAAa,IAAyB;CAEpC,cAAc;CAEd,YAAY;CAEZ,cAAc;CAEd,cAAc;CAEd,eAAe;CAEf,iBAAiB;CAEjB,aAAa;CAEb,eAAe;CAEf,eAAe;CAEf,oBAAoB;CAEpB,wBAAwB;CACzB"}
1
+ {"version":3,"file":"featureFlags.js","names":[],"sources":["../../../src/security/constants/featureFlags.ts"],"sourcesContent":["/**\n * Per-page/sub-feature feature flag keys for the security module.\n * These are additive gates on top of RBAC permissions — a user with\n * `secret:delete` RBAC permission still needs the corresponding\n * feature flag enabled to access the operation.\n *\n * Flag keys follow the pattern: `security.{resource}.{action}`\n *\n * Reference: `~/products/dev/platform/context/commercial/feature-flags/` for integration guide.\n */\nexport const SECURITY_FEATURE_FLAGS = {\n /** Allow vault deletion (owners only in RBAC, this flag is an additional gate) */\n VAULT_DELETE: 'security.vault.delete',\n /** Allow vault lock/unlock operations */\n VAULT_LOCK: 'security.vault.lock',\n /** Allow vault settings changes */\n VAULT_UPDATE: 'security.vault.update',\n /** Allow vault export/backup */\n VAULT_EXPORT: 'security.vault.export',\n /** Allow secret rotation */\n SECRET_ROTATE: 'security.secret.rotate',\n /** Allow secret rollback to previous versions */\n SECRET_ROLLBACK: 'security.secret.rollback',\n /** Allow bulk secret operations (move/label/delete) */\n SECRET_BULK: 'security.secret.bulk',\n /** Allow member invitation */\n MEMBER_INVITE: 'security.member.invite',\n /** Allow member removal */\n MEMBER_REMOVE: 'security.member.remove',\n /** Allow role changes */\n MEMBER_UPDATE_ROLE: 'security.member.update_role',\n /**\n * External secret providers (Security, Providers). The same previewable flag\n * wspace-security-svc enforces on create, update and sync (BOFF-9741), so a\n * workspace that turns on the preview gets the page and the API together.\n */\n VAULT_INTEGRATIONS: 'security.vault-integrations',\n} as const;\n\nexport type SecurityFeatureFlag =\n (typeof SECURITY_FEATURE_FLAGS)[keyof typeof SECURITY_FEATURE_FLAGS];\n"],"mappings":";AAUA,IAAa,IAAyB;CAEpC,cAAc;CAEd,YAAY;CAEZ,cAAc;CAEd,cAAc;CAEd,eAAe;CAEf,iBAAiB;CAEjB,aAAa;CAEb,eAAe;CAEf,eAAe;CAEf,oBAAoB;CAMpB,oBAAoB;CACrB"}