@burdenoff/microfe-security 2026.624.1 → 2026.625.1
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/security/components/ConfirmDialog.js +28 -37
- package/dist/security/components/ConfirmDialog.js.map +1 -1
- package/dist/security/components/ImportWizard.js +81 -88
- package/dist/security/components/ImportWizard.js.map +1 -1
- package/dist/security/components/SecretShareDialog.js +75 -86
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.js +21 -20
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultShareDialog.js +26 -40
- package/dist/security/components/VaultShareDialog.js.map +1 -1
- package/dist/security/components/ui.js +2 -2
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/pages/AccessReviewPage.js +52 -67
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +122 -142
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +118 -113
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js +73 -68
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +240 -253
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +89 -85
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +137 -183
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js +61 -59
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +66 -64
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import { Button as t,
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { AlertTriangle as
|
|
2
|
+
import { Button as t, Input as n } from "../components/ui.js";
|
|
3
|
+
import { useCallback as r, useEffect as i, useState as a } from "react";
|
|
4
|
+
import { useParams as o } from "react-router-dom";
|
|
5
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { AlertTriangle as u, Check as d, Copy as f, Eye as p, EyeOff as m, KeyRound as h, Loader2 as g, Lock as _, ShieldCheck as v } from "lucide-react";
|
|
7
|
+
import { GlassCard as y } from "@burdenoff/fe-libs/ui";
|
|
7
8
|
//#region src/security/pages/VaultShareViewer.tsx
|
|
8
9
|
var b = "query VaultShareLinkInfo($token: String!) {\n secretShareLinkInfo(token: $token) {\n vaultName secretName scope requiresPassword expiresAt expired revoked exhausted\n }\n}", x = "query AccessSharedSecret($token: String!, $password: String) {\n accessSharedSecret(token: $token, password: $password) {\n vaultName scope entries { id name key type value }\n }\n}";
|
|
9
10
|
function S(e) {
|
|
@@ -28,49 +29,49 @@ async function C(e, t, n) {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
var w = ({ entry: t }) => {
|
|
31
|
-
let [n, r] =
|
|
32
|
+
let [n, r] = a(!1), [i, o] = a(!1), s = async () => {
|
|
32
33
|
try {
|
|
33
|
-
await navigator.clipboard.writeText(t.value),
|
|
34
|
+
await navigator.clipboard.writeText(t.value), o(!0), setTimeout(() => o(!1), 1500);
|
|
34
35
|
} catch {}
|
|
35
36
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ l("div", {
|
|
37
38
|
className: "rounded-md border border-border-subtle/60 p-3",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ l("div", {
|
|
39
40
|
className: "flex items-center justify-between gap-2 mb-1.5",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ l("div", {
|
|
41
42
|
className: "min-w-0",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ c("p", {
|
|
43
44
|
className: "text-sm font-medium text-text-primary truncate",
|
|
44
45
|
children: t.name
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ c("p", {
|
|
46
47
|
className: "text-xs text-text-secondary font-mono truncate",
|
|
47
48
|
children: t.key
|
|
48
49
|
})]
|
|
49
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ l("div", {
|
|
50
51
|
className: "flex items-center gap-1",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ c("button", {
|
|
52
53
|
type: "button",
|
|
53
54
|
onClick: () => r((e) => !e),
|
|
54
55
|
className: "p-1.5 rounded hover:bg-accent text-text-secondary",
|
|
55
56
|
"aria-label": n ? "Hide value" : "Show value",
|
|
56
|
-
children:
|
|
57
|
-
}), /* @__PURE__ */
|
|
57
|
+
children: c(n ? m : p, { className: "size-4" })
|
|
58
|
+
}), /* @__PURE__ */ c("button", {
|
|
58
59
|
type: "button",
|
|
59
60
|
onClick: () => void s(),
|
|
60
61
|
className: "p-1.5 rounded hover:bg-accent text-text-secondary",
|
|
61
62
|
"aria-label": "Copy value",
|
|
62
|
-
children: i ? /* @__PURE__ */
|
|
63
|
+
children: i ? /* @__PURE__ */ c(d, { className: "size-4 text-status-success-text" }) : /* @__PURE__ */ c(f, { className: "size-4" })
|
|
63
64
|
})]
|
|
64
65
|
})]
|
|
65
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ c("pre", {
|
|
66
67
|
className: e("text-sm font-mono break-all whitespace-pre-wrap rounded bg-bg-sunken/50 px-3 py-2 text-text-primary", !n && "select-none blur-sm"),
|
|
67
68
|
children: n ? t.value : "••••••••••••••••"
|
|
68
69
|
})]
|
|
69
70
|
});
|
|
70
|
-
}, T = ({ apiGatewayUrl: e, token:
|
|
71
|
-
let
|
|
72
|
-
let { data: t, errorMessage: n } = await C(
|
|
73
|
-
token:
|
|
71
|
+
}, T = ({ apiGatewayUrl: e, token: d }) => {
|
|
72
|
+
let f = o(), p = d ?? f.token ?? "", m = S(e), [T, E] = a("loading"), [D, O] = a(null), [k, A] = a([]), [j, M] = a(""), [N, P] = a(""), [F, I] = a(null), [L, R] = a(!1), z = r(async (e) => {
|
|
73
|
+
let { data: t, errorMessage: n } = await C(m, x, {
|
|
74
|
+
token: p,
|
|
74
75
|
password: e ?? null
|
|
75
76
|
});
|
|
76
77
|
return n || !t?.accessSharedSecret ? {
|
|
@@ -80,15 +81,15 @@ var w = ({ entry: t }) => {
|
|
|
80
81
|
ok: !0,
|
|
81
82
|
entries: t.accessSharedSecret.entries
|
|
82
83
|
};
|
|
83
|
-
}, [
|
|
84
|
-
return
|
|
84
|
+
}, [m, p]);
|
|
85
|
+
return i(() => {
|
|
85
86
|
let e = !1;
|
|
86
87
|
return (async () => {
|
|
87
|
-
if (!
|
|
88
|
+
if (!p) {
|
|
88
89
|
E("unavailable"), M("This link is invalid.");
|
|
89
90
|
return;
|
|
90
91
|
}
|
|
91
|
-
let { data: t, errorMessage: n } = await C(
|
|
92
|
+
let { data: t, errorMessage: n } = await C(m, b, { token: p });
|
|
92
93
|
if (e) return;
|
|
93
94
|
let r = t?.secretShareLinkInfo ?? null;
|
|
94
95
|
if (n || !r) {
|
|
@@ -117,52 +118,53 @@ var w = ({ entry: t }) => {
|
|
|
117
118
|
e = !0;
|
|
118
119
|
};
|
|
119
120
|
}, [
|
|
121
|
+
p,
|
|
120
122
|
m,
|
|
121
|
-
h,
|
|
122
123
|
z
|
|
123
|
-
]), /* @__PURE__ */
|
|
124
|
-
className: "min-h-screen bg-bg-surface flex items-center justify-center p-4",
|
|
125
|
-
children: /* @__PURE__ */
|
|
124
|
+
]), /* @__PURE__ */ c("div", {
|
|
125
|
+
className: "min-h-screen bg-bg-surface bg-hero-mesh flex items-center justify-center p-4",
|
|
126
|
+
children: /* @__PURE__ */ l(y, {
|
|
127
|
+
treatment: "glass",
|
|
126
128
|
className: "w-full max-w-lg p-6 sm:p-8",
|
|
127
129
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ l("div", {
|
|
129
131
|
className: "flex items-center gap-2 mb-6",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ c("div", {
|
|
131
133
|
className: "p-2 rounded-lg bg-action-primary-bg/10",
|
|
132
|
-
children: /* @__PURE__ */
|
|
133
|
-
}), /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ c(v, { className: "size-5 text-primary" })
|
|
135
|
+
}), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h1", {
|
|
134
136
|
className: "text-lg font-semibold text-text-primary",
|
|
135
137
|
children: "Shared credential"
|
|
136
|
-
}), /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ c("p", {
|
|
137
139
|
className: "text-xs text-text-secondary",
|
|
138
140
|
children: "Confidential — do not forward this page"
|
|
139
141
|
})] })]
|
|
140
142
|
}),
|
|
141
|
-
T === "loading" && /* @__PURE__ */
|
|
143
|
+
T === "loading" && /* @__PURE__ */ l("div", {
|
|
142
144
|
className: "flex flex-col items-center justify-center py-12 gap-3",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ c(g, { className: "size-8 animate-spin text-primary/60" }), /* @__PURE__ */ c("p", {
|
|
144
146
|
className: "text-sm text-text-secondary",
|
|
145
147
|
children: "Opening secure link…"
|
|
146
148
|
})]
|
|
147
149
|
}),
|
|
148
|
-
T === "unavailable" && /* @__PURE__ */
|
|
150
|
+
T === "unavailable" && /* @__PURE__ */ l("div", {
|
|
149
151
|
className: "flex flex-col items-center justify-center py-10 gap-3 text-center",
|
|
150
152
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ c("div", {
|
|
152
154
|
className: "p-3 rounded-full bg-status-warning-bg-subtle",
|
|
153
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ c(u, { className: "size-7 text-status-warning-text" })
|
|
154
156
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ c("h2", {
|
|
156
158
|
className: "text-base font-semibold text-text-primary",
|
|
157
159
|
children: "Link unavailable"
|
|
158
160
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ c("p", {
|
|
160
162
|
className: "text-sm text-text-secondary max-w-sm",
|
|
161
163
|
children: j
|
|
162
164
|
})
|
|
163
165
|
]
|
|
164
166
|
}),
|
|
165
|
-
T === "password" && /* @__PURE__ */
|
|
167
|
+
T === "password" && /* @__PURE__ */ l("form", {
|
|
166
168
|
onSubmit: async (e) => {
|
|
167
169
|
e.preventDefault(), I(null), R(!0);
|
|
168
170
|
let t = await z(N);
|
|
@@ -170,14 +172,14 @@ var w = ({ entry: t }) => {
|
|
|
170
172
|
},
|
|
171
173
|
className: "space-y-4",
|
|
172
174
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ l("div", {
|
|
174
176
|
className: "flex items-center gap-2 rounded-md bg-bg-sunken/40 px-3 py-2",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ c(h, { className: "size-4 text-text-secondary" }), /* @__PURE__ */ c("p", {
|
|
176
178
|
className: "text-sm text-text-secondary",
|
|
177
179
|
children: "This link is protected. Enter the password to continue."
|
|
178
180
|
})]
|
|
179
181
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ c(n, {
|
|
181
183
|
id: "share-password",
|
|
182
184
|
label: "Password",
|
|
183
185
|
type: "password",
|
|
@@ -186,47 +188,47 @@ var w = ({ entry: t }) => {
|
|
|
186
188
|
autoFocus: !0,
|
|
187
189
|
required: !0
|
|
188
190
|
}),
|
|
189
|
-
F && /* @__PURE__ */
|
|
191
|
+
F && /* @__PURE__ */ c("p", {
|
|
190
192
|
className: "text-sm text-status-error-text",
|
|
191
193
|
children: F
|
|
192
194
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ l(t, {
|
|
194
196
|
type: "submit",
|
|
195
197
|
disabled: L || !N,
|
|
196
198
|
className: "w-full",
|
|
197
|
-
children: [L ? /* @__PURE__ */
|
|
199
|
+
children: [L ? /* @__PURE__ */ c(g, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(_, { className: "size-4" }), "Unlock"]
|
|
198
200
|
})
|
|
199
201
|
]
|
|
200
202
|
}),
|
|
201
|
-
T === "revealed" && /* @__PURE__ */
|
|
203
|
+
T === "revealed" && /* @__PURE__ */ l("div", {
|
|
202
204
|
className: "space-y-4",
|
|
203
205
|
children: [
|
|
204
|
-
D && /* @__PURE__ */
|
|
206
|
+
D && /* @__PURE__ */ c("p", {
|
|
205
207
|
className: "text-sm text-text-secondary",
|
|
206
|
-
children: D.scope === "VAULT" ? /* @__PURE__ */
|
|
208
|
+
children: D.scope === "VAULT" ? /* @__PURE__ */ l(s, { children: [
|
|
207
209
|
"Credentials from",
|
|
208
210
|
" ",
|
|
209
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ c("span", {
|
|
210
212
|
className: "font-medium text-text-primary",
|
|
211
213
|
children: D.vaultName
|
|
212
214
|
})
|
|
213
|
-
] }) : /* @__PURE__ */
|
|
215
|
+
] }) : /* @__PURE__ */ l(s, { children: [
|
|
214
216
|
"Shared from",
|
|
215
217
|
" ",
|
|
216
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ c("span", {
|
|
217
219
|
className: "font-medium text-text-primary",
|
|
218
220
|
children: D.vaultName
|
|
219
221
|
})
|
|
220
222
|
] })
|
|
221
223
|
}),
|
|
222
|
-
k.length === 0 ? /* @__PURE__ */
|
|
224
|
+
k.length === 0 ? /* @__PURE__ */ c("div", {
|
|
223
225
|
className: "rounded-md border border-border-subtle/60 bg-bg-sunken/30 px-3 py-4 text-center text-sm text-text-secondary",
|
|
224
226
|
children: "This share no longer contains any credentials."
|
|
225
|
-
}) : /* @__PURE__ */
|
|
227
|
+
}) : /* @__PURE__ */ c("div", {
|
|
226
228
|
className: "space-y-2",
|
|
227
|
-
children: k.map((e) => /* @__PURE__ */
|
|
229
|
+
children: k.map((e) => /* @__PURE__ */ c(w, { entry: e }, e.id))
|
|
228
230
|
}),
|
|
229
|
-
D?.expiresAt && /* @__PURE__ */
|
|
231
|
+
D?.expiresAt && /* @__PURE__ */ l("p", {
|
|
230
232
|
className: "text-xs text-text-secondary text-center pt-2",
|
|
231
233
|
children: ["This link expires ", new Date(D.expiresAt).toLocaleString()]
|
|
232
234
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VaultShareViewer.js","names":[],"sources":["../../../src/security/pages/VaultShareViewer.tsx"],"sourcesContent":["import { type FC, useCallback, useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ShieldCheck,\n Lock,\n Copy,\n Check,\n Eye,\n EyeOff,\n Loader2,\n AlertTriangle,\n KeyRound,\n} from 'lucide-react';\nimport { Button, Input, Card } from '../components/ui';\nimport { cn } from '../utils/cn';\n\n/**\n * Standalone, UNAUTHENTICATED viewer for a confidential credential share link.\n *\n * Mounted by the host shell at a public route (e.g. `/vault/share/:token`) —\n * deliberately OUTSIDE SecurityProvider/PermissionProvider so an external person\n * with no account can open it. It talks to the public GraphQL fields\n * (`secretShareLinkInfo` / `accessSharedSecret`, both `@rbac(public: true)`) via\n * raw fetch with no auth headers.\n */\ninterface VaultShareViewerProps {\n /** API gateway base, e.g. https://graphqlworkspaces.burdenoff.com. Falls back to same-origin. */\n apiGatewayUrl?: string;\n /** Override the token (otherwise read from the :token route param). */\n token?: string;\n}\n\ninterface LinkInfo {\n vaultName: string;\n secretName: string | null;\n scope: 'SECRET' | 'VAULT';\n requiresPassword: boolean;\n expiresAt: string | null;\n expired: boolean;\n revoked: boolean;\n exhausted: boolean;\n}\n\ninterface Entry {\n id: string;\n name: string;\n key: string;\n type: string;\n value: string;\n}\n\nconst INFO_QUERY = `query VaultShareLinkInfo($token: String!) {\n secretShareLinkInfo(token: $token) {\n vaultName secretName scope requiresPassword expiresAt expired revoked exhausted\n }\n}`;\n\nconst ACCESS_QUERY = `query AccessSharedSecret($token: String!, $password: String) {\n accessSharedSecret(token: $token, password: $password) {\n vaultName scope entries { id name key type value }\n }\n}`;\n\nfunction graphqlEndpoint(apiGatewayUrl?: string): string {\n const base = apiGatewayUrl?.replace(/\\/$/, '') ?? '';\n return base ? `${base}/workspaces/graphql` : '/workspaces/graphql';\n}\n\nasync function callGraphql<T>(\n endpoint: string,\n query: string,\n variables: Record<string, unknown>\n): Promise<{ data?: T; errorMessage?: string }> {\n try {\n const res = await fetch(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ query, variables }),\n // The token lives in the URL — keep it out of the Referer header and send\n // no ambient credentials (the bearer token is the only authorization).\n referrerPolicy: 'no-referrer',\n credentials: 'omit',\n });\n const json = (await res.json()) as { data?: T; errors?: Array<{ message?: string }> };\n if (json.errors && json.errors.length > 0) {\n return { errorMessage: json.errors[0]?.message ?? 'Request failed' };\n }\n return { data: json.data };\n } catch {\n return { errorMessage: 'Network error — please try again' };\n }\n}\n\nconst CopyableSecret: FC<{ entry: Entry }> = ({ entry }) => {\n const [shown, setShown] = useState(false);\n const [copied, setCopied] = useState(false);\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(entry.value);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n } catch {\n /* clipboard unavailable */\n }\n };\n return (\n <div className=\"rounded-md border border-border-subtle/60 p-3\">\n <div className=\"flex items-center justify-between gap-2 mb-1.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{entry.name}</p>\n <p className=\"text-xs text-text-secondary font-mono truncate\">{entry.key}</p>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => setShown((s) => !s)}\n className=\"p-1.5 rounded hover:bg-accent text-text-secondary\"\n aria-label={shown ? 'Hide value' : 'Show value'}\n >\n {shown ? <EyeOff className=\"size-4\" /> : <Eye className=\"size-4\" />}\n </button>\n <button\n type=\"button\"\n onClick={() => void copy()}\n className=\"p-1.5 rounded hover:bg-accent text-text-secondary\"\n aria-label=\"Copy value\"\n >\n {copied ? (\n <Check className=\"size-4 text-status-success-text\" />\n ) : (\n <Copy className=\"size-4\" />\n )}\n </button>\n </div>\n </div>\n <pre\n className={cn(\n 'text-sm font-mono break-all whitespace-pre-wrap rounded bg-bg-sunken/50 px-3 py-2 text-text-primary',\n !shown && 'select-none blur-sm'\n )}\n >\n {shown ? entry.value : '••••••••••••••••'}\n </pre>\n </div>\n );\n};\n\nexport const VaultShareViewer: FC<VaultShareViewerProps> = ({\n apiGatewayUrl,\n token: tokenProp,\n}) => {\n const params = useParams<{ token: string }>();\n const token = tokenProp ?? params.token ?? '';\n const endpoint = graphqlEndpoint(apiGatewayUrl);\n\n const [status, setStatus] = useState<'loading' | 'password' | 'revealed' | 'unavailable'>(\n 'loading'\n );\n const [info, setInfo] = useState<LinkInfo | null>(null);\n const [entries, setEntries] = useState<Entry[]>([]);\n const [unavailableReason, setUnavailableReason] = useState('');\n const [password, setPassword] = useState('');\n const [passwordError, setPasswordError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const reveal = useCallback(\n async (pwd?: string) => {\n const { data, errorMessage } = await callGraphql<{\n accessSharedSecret: { entries: Entry[] };\n }>(endpoint, ACCESS_QUERY, { token, password: pwd ?? null });\n if (errorMessage || !data?.accessSharedSecret) {\n return { ok: false as const, errorMessage: errorMessage ?? 'Unable to open this link' };\n }\n return { ok: true as const, entries: data.accessSharedSecret.entries };\n },\n [endpoint, token]\n );\n\n useEffect(() => {\n let cancelled = false;\n void (async () => {\n if (!token) {\n setStatus('unavailable');\n setUnavailableReason('This link is invalid.');\n return;\n }\n const { data, errorMessage } = await callGraphql<{ secretShareLinkInfo: LinkInfo | null }>(\n endpoint,\n INFO_QUERY,\n {\n token,\n }\n );\n if (cancelled) return;\n const i = data?.secretShareLinkInfo ?? null;\n if (errorMessage || !i) {\n setStatus('unavailable');\n setUnavailableReason('This link is invalid or no longer exists.');\n return;\n }\n setInfo(i);\n if (i.revoked) {\n setStatus('unavailable');\n setUnavailableReason('This link has been revoked by its owner.');\n return;\n }\n if (i.expired) {\n setStatus('unavailable');\n setUnavailableReason('This link has expired.');\n return;\n }\n if (i.exhausted) {\n setStatus('unavailable');\n setUnavailableReason('This link has reached its view limit.');\n return;\n }\n if (i.requiresPassword) {\n setStatus('password');\n return;\n }\n const result = await reveal();\n if (cancelled) return;\n if (result.ok) {\n setEntries(result.entries);\n setStatus('revealed');\n } else {\n setStatus('unavailable');\n setUnavailableReason(result.errorMessage);\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [token, endpoint, reveal]);\n\n const handlePasswordSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setPasswordError(null);\n setSubmitting(true);\n const result = await reveal(password);\n setSubmitting(false);\n if (result.ok) {\n setEntries(result.entries);\n setStatus('revealed');\n } else {\n setPasswordError(result.errorMessage);\n }\n };\n\n return (\n <div className=\"min-h-screen bg-bg-surface flex items-center justify-center p-4\">\n <Card className=\"w-full max-w-lg p-6 sm:p-8\">\n <div className=\"flex items-center gap-2 mb-6\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10\">\n <ShieldCheck className=\"size-5 text-primary\" />\n </div>\n <div>\n <h1 className=\"text-lg font-semibold text-text-primary\">Shared credential</h1>\n <p className=\"text-xs text-text-secondary\">Confidential — do not forward this page</p>\n </div>\n </div>\n\n {status === 'loading' && (\n <div className=\"flex flex-col items-center justify-center py-12 gap-3\">\n <Loader2 className=\"size-8 animate-spin text-primary/60\" />\n <p className=\"text-sm text-text-secondary\">Opening secure link…</p>\n </div>\n )}\n\n {status === 'unavailable' && (\n <div className=\"flex flex-col items-center justify-center py-10 gap-3 text-center\">\n <div className=\"p-3 rounded-full bg-status-warning-bg-subtle\">\n <AlertTriangle className=\"size-7 text-status-warning-text\" />\n </div>\n <h2 className=\"text-base font-semibold text-text-primary\">Link unavailable</h2>\n <p className=\"text-sm text-text-secondary max-w-sm\">{unavailableReason}</p>\n </div>\n )}\n\n {status === 'password' && (\n <form onSubmit={handlePasswordSubmit} className=\"space-y-4\">\n <div className=\"flex items-center gap-2 rounded-md bg-bg-sunken/40 px-3 py-2\">\n <KeyRound className=\"size-4 text-text-secondary\" />\n <p className=\"text-sm text-text-secondary\">\n This link is protected. Enter the password to continue.\n </p>\n </div>\n <Input\n id=\"share-password\"\n label=\"Password\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n autoFocus\n required\n />\n {passwordError && <p className=\"text-sm text-status-error-text\">{passwordError}</p>}\n <Button type=\"submit\" disabled={submitting || !password} className=\"w-full\">\n {submitting ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Lock className=\"size-4\" />\n )}\n Unlock\n </Button>\n </form>\n )}\n\n {status === 'revealed' && (\n <div className=\"space-y-4\">\n {info && (\n <p className=\"text-sm text-text-secondary\">\n {info.scope === 'VAULT' ? (\n <>\n Credentials from{' '}\n <span className=\"font-medium text-text-primary\">{info.vaultName}</span>\n </>\n ) : (\n <>\n Shared from{' '}\n <span className=\"font-medium text-text-primary\">{info.vaultName}</span>\n </>\n )}\n </p>\n )}\n {entries.length === 0 ? (\n <div className=\"rounded-md border border-border-subtle/60 bg-bg-sunken/30 px-3 py-4 text-center text-sm text-text-secondary\">\n This share no longer contains any credentials.\n </div>\n ) : (\n <div className=\"space-y-2\">\n {entries.map((entry) => (\n <CopyableSecret key={entry.id} entry={entry} />\n ))}\n </div>\n )}\n {info?.expiresAt && (\n <p className=\"text-xs text-text-secondary text-center pt-2\">\n This link expires {new Date(info.expiresAt).toLocaleString()}\n </p>\n )}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E;QACY;QACZ,kBAAC,QAAD;SAAM,WAAU;mBAAiC,EAAK;SAAiB,CAAA;QACtE,EAAA,CAAA;OAEH,CAAA;MAEL,EAAQ,WAAW,IAClB,kBAAC,OAAD;OAAK,WAAU;iBAA8G;OAEvH,CAAA,GAEN,kBAAC,OAAD;OAAK,WAAU;iBACZ,EAAQ,KAAK,MACZ,kBAAC,GAAD,EAAsC,UAAS,EAA1B,EAAM,GAAoB,CAC/C;OACE,CAAA;MAEP,GAAM,aACL,kBAAC,KAAD;OAAG,WAAU;iBAAb,CAA4D,sBACvC,IAAI,KAAK,EAAK,UAAU,CAAC,gBAAgB,CAC1D;;MAEF;;IAEH;;EACH,CAAA"}
|
|
1
|
+
{"version":3,"file":"VaultShareViewer.js","names":[],"sources":["../../../src/security/pages/VaultShareViewer.tsx"],"sourcesContent":["import { type FC, useCallback, useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ShieldCheck,\n Lock,\n Copy,\n Check,\n Eye,\n EyeOff,\n Loader2,\n AlertTriangle,\n KeyRound,\n} from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { Button, Input } from '../components/ui';\nimport { cn } from '../utils/cn';\n\n/**\n * Standalone, UNAUTHENTICATED viewer for a confidential credential share link.\n *\n * Mounted by the host shell at a public route (e.g. `/vault/share/:token`) —\n * deliberately OUTSIDE SecurityProvider/PermissionProvider so an external person\n * with no account can open it. It talks to the public GraphQL fields\n * (`secretShareLinkInfo` / `accessSharedSecret`, both `@rbac(public: true)`) via\n * raw fetch with no auth headers.\n */\ninterface VaultShareViewerProps {\n /** API gateway base, e.g. https://graphqlworkspaces.burdenoff.com. Falls back to same-origin. */\n apiGatewayUrl?: string;\n /** Override the token (otherwise read from the :token route param). */\n token?: string;\n}\n\ninterface LinkInfo {\n vaultName: string;\n secretName: string | null;\n scope: 'SECRET' | 'VAULT';\n requiresPassword: boolean;\n expiresAt: string | null;\n expired: boolean;\n revoked: boolean;\n exhausted: boolean;\n}\n\ninterface Entry {\n id: string;\n name: string;\n key: string;\n type: string;\n value: string;\n}\n\nconst INFO_QUERY = `query VaultShareLinkInfo($token: String!) {\n secretShareLinkInfo(token: $token) {\n vaultName secretName scope requiresPassword expiresAt expired revoked exhausted\n }\n}`;\n\nconst ACCESS_QUERY = `query AccessSharedSecret($token: String!, $password: String) {\n accessSharedSecret(token: $token, password: $password) {\n vaultName scope entries { id name key type value }\n }\n}`;\n\nfunction graphqlEndpoint(apiGatewayUrl?: string): string {\n const base = apiGatewayUrl?.replace(/\\/$/, '') ?? '';\n return base ? `${base}/workspaces/graphql` : '/workspaces/graphql';\n}\n\nasync function callGraphql<T>(\n endpoint: string,\n query: string,\n variables: Record<string, unknown>\n): Promise<{ data?: T; errorMessage?: string }> {\n try {\n const res = await fetch(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ query, variables }),\n // The token lives in the URL — keep it out of the Referer header and send\n // no ambient credentials (the bearer token is the only authorization).\n referrerPolicy: 'no-referrer',\n credentials: 'omit',\n });\n const json = (await res.json()) as { data?: T; errors?: Array<{ message?: string }> };\n if (json.errors && json.errors.length > 0) {\n return { errorMessage: json.errors[0]?.message ?? 'Request failed' };\n }\n return { data: json.data };\n } catch {\n return { errorMessage: 'Network error — please try again' };\n }\n}\n\nconst CopyableSecret: FC<{ entry: Entry }> = ({ entry }) => {\n const [shown, setShown] = useState(false);\n const [copied, setCopied] = useState(false);\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(entry.value);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n } catch {\n /* clipboard unavailable */\n }\n };\n return (\n <div className=\"rounded-md border border-border-subtle/60 p-3\">\n <div className=\"flex items-center justify-between gap-2 mb-1.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{entry.name}</p>\n <p className=\"text-xs text-text-secondary font-mono truncate\">{entry.key}</p>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => setShown((s) => !s)}\n className=\"p-1.5 rounded hover:bg-accent text-text-secondary\"\n aria-label={shown ? 'Hide value' : 'Show value'}\n >\n {shown ? <EyeOff className=\"size-4\" /> : <Eye className=\"size-4\" />}\n </button>\n <button\n type=\"button\"\n onClick={() => void copy()}\n className=\"p-1.5 rounded hover:bg-accent text-text-secondary\"\n aria-label=\"Copy value\"\n >\n {copied ? (\n <Check className=\"size-4 text-status-success-text\" />\n ) : (\n <Copy className=\"size-4\" />\n )}\n </button>\n </div>\n </div>\n <pre\n className={cn(\n 'text-sm font-mono break-all whitespace-pre-wrap rounded bg-bg-sunken/50 px-3 py-2 text-text-primary',\n !shown && 'select-none blur-sm'\n )}\n >\n {shown ? entry.value : '••••••••••••••••'}\n </pre>\n </div>\n );\n};\n\nexport const VaultShareViewer: FC<VaultShareViewerProps> = ({\n apiGatewayUrl,\n token: tokenProp,\n}) => {\n const params = useParams<{ token: string }>();\n const token = tokenProp ?? params.token ?? '';\n const endpoint = graphqlEndpoint(apiGatewayUrl);\n\n const [status, setStatus] = useState<'loading' | 'password' | 'revealed' | 'unavailable'>(\n 'loading'\n );\n const [info, setInfo] = useState<LinkInfo | null>(null);\n const [entries, setEntries] = useState<Entry[]>([]);\n const [unavailableReason, setUnavailableReason] = useState('');\n const [password, setPassword] = useState('');\n const [passwordError, setPasswordError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const reveal = useCallback(\n async (pwd?: string) => {\n const { data, errorMessage } = await callGraphql<{\n accessSharedSecret: { entries: Entry[] };\n }>(endpoint, ACCESS_QUERY, { token, password: pwd ?? null });\n if (errorMessage || !data?.accessSharedSecret) {\n return { ok: false as const, errorMessage: errorMessage ?? 'Unable to open this link' };\n }\n return { ok: true as const, entries: data.accessSharedSecret.entries };\n },\n [endpoint, token]\n );\n\n useEffect(() => {\n let cancelled = false;\n void (async () => {\n if (!token) {\n setStatus('unavailable');\n setUnavailableReason('This link is invalid.');\n return;\n }\n const { data, errorMessage } = await callGraphql<{ secretShareLinkInfo: LinkInfo | null }>(\n endpoint,\n INFO_QUERY,\n {\n token,\n }\n );\n if (cancelled) return;\n const i = data?.secretShareLinkInfo ?? null;\n if (errorMessage || !i) {\n setStatus('unavailable');\n setUnavailableReason('This link is invalid or no longer exists.');\n return;\n }\n setInfo(i);\n if (i.revoked) {\n setStatus('unavailable');\n setUnavailableReason('This link has been revoked by its owner.');\n return;\n }\n if (i.expired) {\n setStatus('unavailable');\n setUnavailableReason('This link has expired.');\n return;\n }\n if (i.exhausted) {\n setStatus('unavailable');\n setUnavailableReason('This link has reached its view limit.');\n return;\n }\n if (i.requiresPassword) {\n setStatus('password');\n return;\n }\n const result = await reveal();\n if (cancelled) return;\n if (result.ok) {\n setEntries(result.entries);\n setStatus('revealed');\n } else {\n setStatus('unavailable');\n setUnavailableReason(result.errorMessage);\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [token, endpoint, reveal]);\n\n const handlePasswordSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setPasswordError(null);\n setSubmitting(true);\n const result = await reveal(password);\n setSubmitting(false);\n if (result.ok) {\n setEntries(result.entries);\n setStatus('revealed');\n } else {\n setPasswordError(result.errorMessage);\n }\n };\n\n return (\n <div className=\"min-h-screen bg-bg-surface bg-hero-mesh flex items-center justify-center p-4\">\n <GlassCard treatment=\"glass\" className=\"w-full max-w-lg p-6 sm:p-8\">\n <div className=\"flex items-center gap-2 mb-6\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10\">\n <ShieldCheck className=\"size-5 text-primary\" />\n </div>\n <div>\n <h1 className=\"text-lg font-semibold text-text-primary\">Shared credential</h1>\n <p className=\"text-xs text-text-secondary\">Confidential — do not forward this page</p>\n </div>\n </div>\n\n {status === 'loading' && (\n <div className=\"flex flex-col items-center justify-center py-12 gap-3\">\n <Loader2 className=\"size-8 animate-spin text-primary/60\" />\n <p className=\"text-sm text-text-secondary\">Opening secure link…</p>\n </div>\n )}\n\n {status === 'unavailable' && (\n <div className=\"flex flex-col items-center justify-center py-10 gap-3 text-center\">\n <div className=\"p-3 rounded-full bg-status-warning-bg-subtle\">\n <AlertTriangle className=\"size-7 text-status-warning-text\" />\n </div>\n <h2 className=\"text-base font-semibold text-text-primary\">Link unavailable</h2>\n <p className=\"text-sm text-text-secondary max-w-sm\">{unavailableReason}</p>\n </div>\n )}\n\n {status === 'password' && (\n <form onSubmit={handlePasswordSubmit} className=\"space-y-4\">\n <div className=\"flex items-center gap-2 rounded-md bg-bg-sunken/40 px-3 py-2\">\n <KeyRound className=\"size-4 text-text-secondary\" />\n <p className=\"text-sm text-text-secondary\">\n This link is protected. Enter the password to continue.\n </p>\n </div>\n <Input\n id=\"share-password\"\n label=\"Password\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n autoFocus\n required\n />\n {passwordError && <p className=\"text-sm text-status-error-text\">{passwordError}</p>}\n <Button type=\"submit\" disabled={submitting || !password} className=\"w-full\">\n {submitting ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Lock className=\"size-4\" />\n )}\n Unlock\n </Button>\n </form>\n )}\n\n {status === 'revealed' && (\n <div className=\"space-y-4\">\n {info && (\n <p className=\"text-sm text-text-secondary\">\n {info.scope === 'VAULT' ? (\n <>\n Credentials from{' '}\n <span className=\"font-medium text-text-primary\">{info.vaultName}</span>\n </>\n ) : (\n <>\n Shared from{' '}\n <span className=\"font-medium text-text-primary\">{info.vaultName}</span>\n </>\n )}\n </p>\n )}\n {entries.length === 0 ? (\n <div className=\"rounded-md border border-border-subtle/60 bg-bg-sunken/30 px-3 py-4 text-center text-sm text-text-secondary\">\n This share no longer contains any credentials.\n </div>\n ) : (\n <div className=\"space-y-2\">\n {entries.map((entry) => (\n <CopyableSecret key={entry.id} entry={entry} />\n ))}\n </div>\n )}\n {info?.expiresAt && (\n <p className=\"text-xs text-text-secondary text-center pt-2\">\n This link expires {new Date(info.expiresAt).toLocaleString()}\n </p>\n )}\n </div>\n )}\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