@burdenoff/microfe-security 2026.601.4 → 2026.602.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/index.js CHANGED
@@ -3,5 +3,6 @@ import { useSecurityStore as t } from "./security/store/securityStore.js";
3
3
  import { SecurityRoot as n } from "./security/SecurityRoot.js";
4
4
  import { SecurityUserRoot as r } from "./security/SecurityUserRoot.js";
5
5
  import { SecurityAdminRoot as i } from "./security/SecurityAdminRoot.js";
6
+ import { VaultShareViewer as a } from "./security/pages/VaultShareViewer.js";
6
7
  import "./security/index.js";
7
- export { i as SecurityAdminRoot, n as SecurityRoot, r as SecurityUserRoot, e as useSecurity, t as useSecurityStore };
8
+ export { i as SecurityAdminRoot, n as SecurityRoot, r as SecurityUserRoot, a as VaultShareViewer, e as useSecurity, t as useSecurityStore };
@@ -0,0 +1,349 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { Badge as t, Button as n, Input as r, Select as i } from "./ui.js";
3
+ import { useCreateSecretShareLink as ee, useRevokeSecretShare as te, useSecretShares as ne, useShareSecretWithAccount as a } from "../hooks/useShareQueries.js";
4
+ import { useMemo as o, useState as s } from "react";
5
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { Check as d, Clock as f, Copy as re, Eye as p, KeyRound as ie, Link2 as m, Loader2 as h, Trash2 as g, UserPlus as _, Users as ae, X as v } from "lucide-react";
7
+ //#region src/security/components/SecretShareDialog.tsx
8
+ var oe = [{
9
+ value: "VIEWER",
10
+ label: "Viewer — can view the credential"
11
+ }, {
12
+ value: "EDITOR",
13
+ label: "Editor — can view and edit"
14
+ }], y = [
15
+ {
16
+ value: "",
17
+ label: "Never expires"
18
+ },
19
+ {
20
+ value: "3600000",
21
+ label: "1 hour"
22
+ },
23
+ {
24
+ value: "86400000",
25
+ label: "24 hours"
26
+ },
27
+ {
28
+ value: "604800000",
29
+ label: "7 days"
30
+ },
31
+ {
32
+ value: "2592000000",
33
+ label: "30 days"
34
+ }
35
+ ];
36
+ function b(e) {
37
+ if (!e) return null;
38
+ let t = Number(e);
39
+ return !Number.isFinite(t) || t <= 0 ? null : new Date(Date.now() + t).toISOString();
40
+ }
41
+ function x(e) {
42
+ return `${typeof window < "u" ? window.location.origin : ""}/vault/share/${e}`;
43
+ }
44
+ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className: ce }) => {
45
+ let [E, D] = s("people"), [O, k] = s(""), [A, le] = s("VIEWER"), [j, M] = s(""), [N, ue] = s("604800000"), [P, F] = s(""), [I, L] = s(""), [R, z] = s(null), [B, V] = s(!1), [H, U] = s(null), { data: W, loading: G, refetch: K } = ne(S ? w : null, T), [de, { loading: q }] = a(), [fe, { loading: J }] = ee(), [pe] = te(), Y = o(() => W?.secretShares?.items ?? [], [W]), X = o(() => Y.filter((e) => e.kind === "ACCOUNT"), [Y]), Z = o(() => Y.filter((e) => e.kind === "LINK"), [Y]);
46
+ if (!S) return null;
47
+ let Q = O.includes("@"), me = async (e) => {
48
+ e.preventDefault(), U(null);
49
+ let t = O.trim();
50
+ if (t) try {
51
+ await de({ variables: { input: {
52
+ vaultId: w,
53
+ secretId: T ?? null,
54
+ accountId: Q ? null : t,
55
+ email: Q ? t : null,
56
+ role: A,
57
+ label: t,
58
+ expiresAt: b(j)
59
+ } } }), k(""), M(""), await K();
60
+ } catch (e) {
61
+ U(e instanceof Error ? e.message : "Failed to share");
62
+ }
63
+ }, he = async (e) => {
64
+ e.preventDefault(), U(null), z(null);
65
+ try {
66
+ let e = I.trim() ? Number(I.trim()) : null, t = (await fe({ variables: { input: {
67
+ vaultId: w,
68
+ secretId: T ?? null,
69
+ role: "VIEWER",
70
+ expiresAt: b(N),
71
+ password: P.trim() || null,
72
+ maxViews: e && e > 0 ? Math.floor(e) : null
73
+ } } })).data?.createSecretShareLink?.token;
74
+ t && (z(x(t)), F(""), L("")), await K();
75
+ } catch (e) {
76
+ U(e instanceof Error ? e.message : "Failed to create link");
77
+ }
78
+ }, $ = async (e) => {
79
+ try {
80
+ await pe({ variables: { id: e } }), await K();
81
+ } catch (e) {
82
+ U(e instanceof Error ? e.message : "Failed to revoke");
83
+ }
84
+ }, ge = async () => {
85
+ if (R) try {
86
+ await navigator.clipboard.writeText(R), V(!0), setTimeout(() => V(!1), 1500);
87
+ } catch {}
88
+ }, _e = T ? "credential" : "vault";
89
+ return /* @__PURE__ */ u("div", {
90
+ className: "fixed inset-0 z-50 flex items-center justify-center p-4",
91
+ children: [/* @__PURE__ */ l("button", {
92
+ type: "button",
93
+ "aria-label": "Close dialog",
94
+ className: "absolute inset-0 bg-black/50 cursor-default",
95
+ onClick: C
96
+ }), /* @__PURE__ */ u("div", {
97
+ className: e("relative z-10 w-full max-w-lg rounded-lg bg-card border border-border shadow-lg flex flex-col max-h-[90vh]", ce),
98
+ children: [
99
+ /* @__PURE__ */ u("div", {
100
+ className: "flex items-center justify-between p-6 pb-4 border-b border-border/60",
101
+ children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("h2", {
102
+ className: "text-lg font-semibold text-foreground",
103
+ children: ["Share ", _e]
104
+ }), /* @__PURE__ */ u("p", {
105
+ className: "text-sm text-muted-foreground mt-0.5",
106
+ children: [
107
+ "Share ",
108
+ /* @__PURE__ */ l("span", {
109
+ className: "font-medium text-foreground",
110
+ children: se
111
+ }),
112
+ " selectively"
113
+ ]
114
+ })] }), /* @__PURE__ */ l("button", {
115
+ type: "button",
116
+ onClick: C,
117
+ className: "p-1 rounded hover:bg-accent text-muted-foreground",
118
+ children: /* @__PURE__ */ l(v, { className: "size-4" })
119
+ })]
120
+ }),
121
+ /* @__PURE__ */ u("div", {
122
+ className: "flex gap-1 px-6 pt-4",
123
+ children: [/* @__PURE__ */ u("button", {
124
+ type: "button",
125
+ onClick: () => D("people"),
126
+ className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors", E === "people" ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent"),
127
+ children: [/* @__PURE__ */ l(ae, { className: "size-4" }), " People"]
128
+ }), /* @__PURE__ */ u("button", {
129
+ type: "button",
130
+ onClick: () => D("link"),
131
+ className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors", E === "link" ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent"),
132
+ children: [/* @__PURE__ */ l(m, { className: "size-4" }), " Get link"]
133
+ })]
134
+ }),
135
+ /* @__PURE__ */ u("div", {
136
+ className: "overflow-y-auto p-6 pt-4 space-y-5",
137
+ children: [H && /* @__PURE__ */ l("div", {
138
+ className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
139
+ children: H
140
+ }), E === "people" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("form", {
141
+ onSubmit: me,
142
+ className: "space-y-3",
143
+ children: [
144
+ /* @__PURE__ */ l(r, {
145
+ id: "share-account",
146
+ label: "Account email or VibeControls account id",
147
+ type: "text",
148
+ value: O,
149
+ onChange: (e) => k(e.target.value),
150
+ placeholder: "colleague@example.com or account id",
151
+ required: !0
152
+ }),
153
+ /* @__PURE__ */ u("div", {
154
+ className: "grid grid-cols-2 gap-3",
155
+ children: [/* @__PURE__ */ l(i, {
156
+ label: "Access",
157
+ value: A,
158
+ onChange: le,
159
+ options: oe
160
+ }), /* @__PURE__ */ l(i, {
161
+ label: "Expires",
162
+ value: j,
163
+ onChange: M,
164
+ options: y
165
+ })]
166
+ }),
167
+ /* @__PURE__ */ l("div", {
168
+ className: "flex justify-end",
169
+ children: /* @__PURE__ */ u(n, {
170
+ type: "submit",
171
+ disabled: !O.trim() || q,
172
+ children: [q ? /* @__PURE__ */ l(h, { className: "size-4 animate-spin" }) : /* @__PURE__ */ l(_, { className: "size-4" }), "Share"]
173
+ })
174
+ })
175
+ ]
176
+ }), /* @__PURE__ */ u("div", {
177
+ className: "space-y-2",
178
+ children: [/* @__PURE__ */ l("h3", {
179
+ className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
180
+ children: "People with access"
181
+ }), G ? /* @__PURE__ */ l("div", {
182
+ className: "flex justify-center py-4",
183
+ children: /* @__PURE__ */ l(h, { className: "size-5 animate-spin text-muted-foreground" })
184
+ }) : X.length === 0 ? /* @__PURE__ */ l("p", {
185
+ className: "text-sm text-muted-foreground py-2",
186
+ children: "Not shared with anyone yet."
187
+ }) : /* @__PURE__ */ l("ul", {
188
+ className: "space-y-2",
189
+ children: X.map((e) => /* @__PURE__ */ u("li", {
190
+ className: "flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2",
191
+ children: [/* @__PURE__ */ u("div", {
192
+ className: "min-w-0",
193
+ children: [/* @__PURE__ */ l("p", {
194
+ className: "text-sm text-foreground truncate",
195
+ children: e.label || e.actorId
196
+ }), /* @__PURE__ */ u("div", {
197
+ className: "flex items-center gap-2 mt-0.5",
198
+ children: [/* @__PURE__ */ l(t, {
199
+ variant: "outline",
200
+ children: e.role
201
+ }), e.expiresAt && /* @__PURE__ */ u("span", {
202
+ className: "text-xs text-muted-foreground inline-flex items-center gap-1",
203
+ children: [/* @__PURE__ */ l(f, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
204
+ })]
205
+ })]
206
+ }), /* @__PURE__ */ l("button", {
207
+ type: "button",
208
+ onClick: () => void $(e.id),
209
+ className: "p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
210
+ "aria-label": "Revoke access",
211
+ children: /* @__PURE__ */ l(g, { className: "size-4" })
212
+ })]
213
+ }, e.id))
214
+ })]
215
+ })] }) : /* @__PURE__ */ u(c, { children: [
216
+ !T && /* @__PURE__ */ u("div", {
217
+ className: "rounded-md border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
218
+ children: [
219
+ "Anyone with this link can view ",
220
+ /* @__PURE__ */ l("strong", { children: "all current and future" }),
221
+ " credentials in this vault until it expires or you revoke it."
222
+ ]
223
+ }),
224
+ /* @__PURE__ */ u("form", {
225
+ onSubmit: he,
226
+ className: "space-y-3",
227
+ children: [
228
+ /* @__PURE__ */ u("div", {
229
+ className: "grid grid-cols-2 gap-3",
230
+ children: [/* @__PURE__ */ l(i, {
231
+ label: "Expires",
232
+ value: N,
233
+ onChange: ue,
234
+ options: y
235
+ }), /* @__PURE__ */ l(r, {
236
+ id: "link-max-views",
237
+ label: "Max views (optional)",
238
+ type: "number",
239
+ min: 1,
240
+ value: I,
241
+ onChange: (e) => L(e.target.value),
242
+ placeholder: "Unlimited"
243
+ })]
244
+ }),
245
+ /* @__PURE__ */ l(r, {
246
+ id: "link-password",
247
+ label: "Password (optional)",
248
+ type: "password",
249
+ value: P,
250
+ onChange: (e) => F(e.target.value),
251
+ placeholder: "Extra protection for the link"
252
+ }),
253
+ /* @__PURE__ */ l("div", {
254
+ className: "flex justify-end",
255
+ children: /* @__PURE__ */ u(n, {
256
+ type: "submit",
257
+ disabled: J,
258
+ children: [J ? /* @__PURE__ */ l(h, { className: "size-4 animate-spin" }) : /* @__PURE__ */ l(m, { className: "size-4" }), "Create link"]
259
+ })
260
+ })
261
+ ]
262
+ }),
263
+ R && /* @__PURE__ */ u("div", {
264
+ className: "rounded-md border border-status-success-border bg-status-success-bg-subtle p-3 space-y-2",
265
+ children: [/* @__PURE__ */ l("p", {
266
+ className: "text-xs font-medium text-status-success-text",
267
+ children: "Link created — copy it now, it won't be shown again."
268
+ }), /* @__PURE__ */ u("div", {
269
+ className: "flex items-center gap-2",
270
+ children: [/* @__PURE__ */ l("input", {
271
+ readOnly: !0,
272
+ value: R,
273
+ onFocus: (e) => e.currentTarget.select(),
274
+ className: "flex h-9 w-full rounded-md border border-border bg-background px-3 text-sm font-mono"
275
+ }), /* @__PURE__ */ l(n, {
276
+ type: "button",
277
+ variant: "outline",
278
+ size: "sm",
279
+ onClick: () => void ge(),
280
+ children: l(B ? d : re, { className: "size-4" })
281
+ })]
282
+ })]
283
+ }),
284
+ /* @__PURE__ */ u("div", {
285
+ className: "space-y-2",
286
+ children: [/* @__PURE__ */ l("h3", {
287
+ className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
288
+ children: "Active links"
289
+ }), G ? /* @__PURE__ */ l("div", {
290
+ className: "flex justify-center py-4",
291
+ children: /* @__PURE__ */ l(h, { className: "size-5 animate-spin text-muted-foreground" })
292
+ }) : Z.length === 0 ? /* @__PURE__ */ l("p", {
293
+ className: "text-sm text-muted-foreground py-2",
294
+ children: "No active links."
295
+ }) : /* @__PURE__ */ l("ul", {
296
+ className: "space-y-2",
297
+ children: Z.map((e) => /* @__PURE__ */ u("li", {
298
+ className: "flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2",
299
+ children: [/* @__PURE__ */ u("div", {
300
+ className: "min-w-0",
301
+ children: [/* @__PURE__ */ u("div", {
302
+ className: "flex items-center gap-2 flex-wrap",
303
+ children: [
304
+ /* @__PURE__ */ l(t, {
305
+ variant: e.status === "ACTIVE" ? "success" : "destructive",
306
+ children: e.status === "ACTIVE" ? "Active" : "Revoked"
307
+ }),
308
+ e.requiresPassword && /* @__PURE__ */ u("span", {
309
+ className: "text-xs text-muted-foreground inline-flex items-center gap-1",
310
+ children: [/* @__PURE__ */ l(ie, { className: "size-3" }), " Password"]
311
+ }),
312
+ /* @__PURE__ */ u("span", {
313
+ className: "text-xs text-muted-foreground inline-flex items-center gap-1",
314
+ children: [
315
+ /* @__PURE__ */ l(p, { className: "size-3" }),
316
+ e.viewCount,
317
+ e.maxViews ? `/${e.maxViews}` : "",
318
+ " views"
319
+ ]
320
+ }),
321
+ e.expiresAt && /* @__PURE__ */ u("span", {
322
+ className: "text-xs text-muted-foreground inline-flex items-center gap-1",
323
+ children: [/* @__PURE__ */ l(f, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
324
+ })
325
+ ]
326
+ }), /* @__PURE__ */ u("p", {
327
+ className: "text-xs text-muted-foreground mt-0.5",
328
+ children: ["Created ", new Date(e.createdAt).toLocaleString()]
329
+ })]
330
+ }), e.status === "ACTIVE" && /* @__PURE__ */ l("button", {
331
+ type: "button",
332
+ onClick: () => void $(e.id),
333
+ className: "p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
334
+ "aria-label": "Revoke link",
335
+ children: /* @__PURE__ */ l(g, { className: "size-4" })
336
+ })]
337
+ }, e.id))
338
+ })]
339
+ })
340
+ ] })]
341
+ })
342
+ ]
343
+ })]
344
+ });
345
+ };
346
+ //#endregion
347
+ export { S as SecretShareDialog };
348
+
349
+ //# sourceMappingURL=SecretShareDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecretShareDialog.js","names":[],"sources":["../../../src/security/components/SecretShareDialog.tsx"],"sourcesContent":["import { type FC, useMemo, useState } from 'react';\nimport {\n X,\n UserPlus,\n Link2,\n Copy,\n Check,\n Trash2,\n Loader2,\n Clock,\n Eye,\n KeyRound,\n Users,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { Button, Input, Select, Badge } from './ui';\nimport {\n useSecretShares,\n useShareSecretWithAccount,\n useCreateSecretShareLink,\n useRevokeSecretShare,\n} from '../hooks/useShareQueries';\n\ninterface SecretShareDialogProps {\n isOpen: boolean;\n onClose: () => void;\n /** Vault the credential lives in. */\n vaultId: string;\n /** When set, the share targets this single credential; otherwise the whole vault. */\n secretId?: string | null;\n /** Display name of the credential or vault being shared. */\n name: string;\n className?: string;\n}\n\ntype Tab = 'people' | 'link';\n\ninterface ShareRow {\n id: string;\n kind: string;\n role: string;\n status: string;\n scope: string;\n actorId?: string | null;\n actorType?: string | null;\n label?: string | null;\n requiresPassword: boolean;\n maxViews?: number | null;\n viewCount: number;\n expiresAt?: string | null;\n createdAt: string;\n}\n\nconst ROLE_OPTIONS = [\n { value: 'VIEWER', label: 'Viewer — can view the credential' },\n { value: 'EDITOR', label: 'Editor — can view and edit' },\n];\n\nconst EXPIRY_OPTIONS = [\n { value: '', label: 'Never expires' },\n { value: '3600000', label: '1 hour' },\n { value: '86400000', label: '24 hours' },\n { value: '604800000', label: '7 days' },\n { value: '2592000000', label: '30 days' },\n];\n\nfunction expiryToIso(value: string): string | null {\n if (!value) return null;\n const ms = Number(value);\n if (!Number.isFinite(ms) || ms <= 0) return null;\n return new Date(Date.now() + ms).toISOString();\n}\n\nfunction shareUrlFor(token: string): string {\n const origin = typeof window !== 'undefined' ? window.location.origin : '';\n return `${origin}/vault/share/${token}`;\n}\n\n/**\n * Selective credential sharing dialog. \"People\" grants a specific account\n * in-app access; \"Get link\" mints a confidential signed URL an external person\n * can open without an account.\n */\nexport const SecretShareDialog: FC<SecretShareDialogProps> = ({\n isOpen,\n onClose,\n vaultId,\n secretId,\n name,\n className,\n}) => {\n const [tab, setTab] = useState<Tab>('people');\n\n // People tab state\n const [account, setAccount] = useState('');\n const [accountRole, setAccountRole] = useState('VIEWER');\n const [accountExpiry, setAccountExpiry] = useState('');\n\n // Link tab state\n const [linkExpiry, setLinkExpiry] = useState('604800000'); // default 7 days\n const [linkPassword, setLinkPassword] = useState('');\n const [linkMaxViews, setLinkMaxViews] = useState('');\n const [createdUrl, setCreatedUrl] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n const [errorMsg, setErrorMsg] = useState<string | null>(null);\n\n const {\n data,\n loading: loadingShares,\n refetch,\n } = useSecretShares(isOpen ? vaultId : null, secretId);\n const [shareWithAccount, { loading: sharing }] = useShareSecretWithAccount();\n const [createLink, { loading: creatingLink }] = useCreateSecretShareLink();\n const [revokeShare] = useRevokeSecretShare();\n\n const shares = useMemo<ShareRow[]>(() => (data?.secretShares?.items ?? []) as ShareRow[], [data]);\n const accountShares = useMemo(() => shares.filter((s) => s.kind === 'ACCOUNT'), [shares]);\n const linkShares = useMemo(() => shares.filter((s) => s.kind === 'LINK'), [shares]);\n\n if (!isOpen) return null;\n\n const isEmail = account.includes('@');\n\n const handleShareAccount = async (e: React.FormEvent) => {\n e.preventDefault();\n setErrorMsg(null);\n const trimmed = account.trim();\n if (!trimmed) return;\n try {\n await shareWithAccount({\n variables: {\n input: {\n vaultId,\n secretId: secretId ?? null,\n accountId: isEmail ? null : trimmed,\n email: isEmail ? trimmed : null,\n role: accountRole,\n // Keep the human-entered identifier for the access list (actorId is opaque).\n label: trimmed,\n expiresAt: expiryToIso(accountExpiry),\n },\n },\n });\n setAccount('');\n setAccountExpiry('');\n await refetch();\n } catch (err) {\n setErrorMsg(err instanceof Error ? err.message : 'Failed to share');\n }\n };\n\n const handleCreateLink = async (e: React.FormEvent) => {\n e.preventDefault();\n setErrorMsg(null);\n setCreatedUrl(null);\n try {\n const maxViews = linkMaxViews.trim() ? Number(linkMaxViews.trim()) : null;\n const result = await createLink({\n variables: {\n input: {\n vaultId,\n secretId: secretId ?? null,\n role: 'VIEWER',\n expiresAt: expiryToIso(linkExpiry),\n password: linkPassword.trim() || null,\n maxViews: maxViews && maxViews > 0 ? Math.floor(maxViews) : null,\n },\n },\n });\n const token = result.data?.createSecretShareLink?.token;\n if (token) {\n setCreatedUrl(shareUrlFor(token));\n setLinkPassword('');\n setLinkMaxViews('');\n }\n await refetch();\n } catch (err) {\n setErrorMsg(err instanceof Error ? err.message : 'Failed to create link');\n }\n };\n\n const handleRevoke = async (id: string) => {\n try {\n await revokeShare({ variables: { id } });\n await refetch();\n } catch (err) {\n setErrorMsg(err instanceof Error ? err.message : 'Failed to revoke');\n }\n };\n\n const handleCopy = async () => {\n if (!createdUrl) return;\n try {\n await navigator.clipboard.writeText(createdUrl);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n } catch {\n /* clipboard unavailable — the input remains selectable */\n }\n };\n\n const scopeLabel = secretId ? 'credential' : 'vault';\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <button\n type=\"button\"\n aria-label=\"Close dialog\"\n className=\"absolute inset-0 bg-black/50 cursor-default\"\n onClick={onClose}\n />\n <div\n className={cn(\n 'relative z-10 w-full max-w-lg rounded-lg bg-card border border-border shadow-lg flex flex-col max-h-[90vh]',\n className\n )}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between p-6 pb-4 border-b border-border/60\">\n <div>\n <h2 className=\"text-lg font-semibold text-foreground\">Share {scopeLabel}</h2>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n Share <span className=\"font-medium text-foreground\">{name}</span> selectively\n </p>\n </div>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"p-1 rounded hover:bg-accent text-muted-foreground\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n\n {/* Tabs */}\n <div className=\"flex gap-1 px-6 pt-4\">\n <button\n type=\"button\"\n onClick={() => setTab('people')}\n className={cn(\n 'flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors',\n tab === 'people'\n ? 'bg-primary/10 text-primary'\n : 'text-muted-foreground hover:bg-accent'\n )}\n >\n <Users className=\"size-4\" /> People\n </button>\n <button\n type=\"button\"\n onClick={() => setTab('link')}\n className={cn(\n 'flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors',\n tab === 'link'\n ? 'bg-primary/10 text-primary'\n : 'text-muted-foreground hover:bg-accent'\n )}\n >\n <Link2 className=\"size-4\" /> Get link\n </button>\n </div>\n\n <div className=\"overflow-y-auto p-6 pt-4 space-y-5\">\n {errorMsg && (\n <div className=\"rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {errorMsg}\n </div>\n )}\n\n {tab === 'people' ? (\n <>\n <form onSubmit={handleShareAccount} className=\"space-y-3\">\n <Input\n id=\"share-account\"\n label=\"Account email or VibeControls account id\"\n type=\"text\"\n value={account}\n onChange={(e) => setAccount(e.target.value)}\n placeholder=\"colleague@example.com or account id\"\n required\n />\n <div className=\"grid grid-cols-2 gap-3\">\n <Select\n label=\"Access\"\n value={accountRole}\n onChange={setAccountRole}\n options={ROLE_OPTIONS}\n />\n <Select\n label=\"Expires\"\n value={accountExpiry}\n onChange={setAccountExpiry}\n options={EXPIRY_OPTIONS}\n />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" disabled={!account.trim() || sharing}>\n {sharing ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <UserPlus className=\"size-4\" />\n )}\n Share\n </Button>\n </div>\n </form>\n\n <div className=\"space-y-2\">\n <h3 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n People with access\n </h3>\n {loadingShares ? (\n <div className=\"flex justify-center py-4\">\n <Loader2 className=\"size-5 animate-spin text-muted-foreground\" />\n </div>\n ) : accountShares.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-2\">Not shared with anyone yet.</p>\n ) : (\n <ul className=\"space-y-2\">\n {accountShares.map((s) => (\n <li\n key={s.id}\n className=\"flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2\"\n >\n <div className=\"min-w-0\">\n <p className=\"text-sm text-foreground truncate\">{s.label || s.actorId}</p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <Badge variant=\"outline\">{s.role}</Badge>\n {s.expiresAt && (\n <span className=\"text-xs text-muted-foreground inline-flex items-center gap-1\">\n <Clock className=\"size-3\" />\n {new Date(s.expiresAt).toLocaleDateString()}\n </span>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => void handleRevoke(s.id)}\n className=\"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive\"\n aria-label=\"Revoke access\"\n >\n <Trash2 className=\"size-4\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n </>\n ) : (\n <>\n {!secretId && (\n <div className=\"rounded-md border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text\">\n Anyone with this link can view <strong>all current and future</strong> credentials\n in this vault until it expires or you revoke it.\n </div>\n )}\n <form onSubmit={handleCreateLink} className=\"space-y-3\">\n <div className=\"grid grid-cols-2 gap-3\">\n <Select\n label=\"Expires\"\n value={linkExpiry}\n onChange={setLinkExpiry}\n options={EXPIRY_OPTIONS}\n />\n <Input\n id=\"link-max-views\"\n label=\"Max views (optional)\"\n type=\"number\"\n min={1}\n value={linkMaxViews}\n onChange={(e) => setLinkMaxViews(e.target.value)}\n placeholder=\"Unlimited\"\n />\n </div>\n <Input\n id=\"link-password\"\n label=\"Password (optional)\"\n type=\"password\"\n value={linkPassword}\n onChange={(e) => setLinkPassword(e.target.value)}\n placeholder=\"Extra protection for the link\"\n />\n <div className=\"flex justify-end\">\n <Button type=\"submit\" disabled={creatingLink}>\n {creatingLink ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Link2 className=\"size-4\" />\n )}\n Create link\n </Button>\n </div>\n </form>\n\n {createdUrl && (\n <div className=\"rounded-md border border-status-success-border bg-status-success-bg-subtle p-3 space-y-2\">\n <p className=\"text-xs font-medium text-status-success-text\">\n Link created — copy it now, it won&apos;t be shown again.\n </p>\n <div className=\"flex items-center gap-2\">\n <input\n readOnly\n value={createdUrl}\n onFocus={(e) => e.currentTarget.select()}\n className=\"flex h-9 w-full rounded-md border border-border bg-background px-3 text-sm font-mono\"\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => void handleCopy()}\n >\n {copied ? <Check className=\"size-4\" /> : <Copy className=\"size-4\" />}\n </Button>\n </div>\n </div>\n )}\n\n <div className=\"space-y-2\">\n <h3 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Active links\n </h3>\n {loadingShares ? (\n <div className=\"flex justify-center py-4\">\n <Loader2 className=\"size-5 animate-spin text-muted-foreground\" />\n </div>\n ) : linkShares.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-2\">No active links.</p>\n ) : (\n <ul className=\"space-y-2\">\n {linkShares.map((s) => (\n <li\n key={s.id}\n className=\"flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2\"\n >\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <Badge variant={s.status === 'ACTIVE' ? 'success' : 'destructive'}>\n {s.status === 'ACTIVE' ? 'Active' : 'Revoked'}\n </Badge>\n {s.requiresPassword && (\n <span className=\"text-xs text-muted-foreground inline-flex items-center gap-1\">\n <KeyRound className=\"size-3\" /> Password\n </span>\n )}\n <span className=\"text-xs text-muted-foreground inline-flex items-center gap-1\">\n <Eye className=\"size-3\" />\n {s.viewCount}\n {s.maxViews ? `/${s.maxViews}` : ''} views\n </span>\n {s.expiresAt && (\n <span className=\"text-xs text-muted-foreground inline-flex items-center gap-1\">\n <Clock className=\"size-3\" />\n {new Date(s.expiresAt).toLocaleDateString()}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Created {new Date(s.createdAt).toLocaleString()}\n </p>\n </div>\n {s.status === 'ACTIVE' && (\n <button\n type=\"button\"\n onClick={() => void handleRevoke(s.id)}\n className=\"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive\"\n aria-label=\"Revoke link\"\n >\n <Trash2 className=\"size-4\" />\n </button>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n </>\n )}\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAqDA,IAAM,KAAe,CACnB;CAAE,OAAO;CAAU,OAAO;CAAoC,EAC9D;CAAE,OAAO;CAAU,OAAO;CAA8B,CACzD,EAEK,IAAiB;CACrB;EAAE,OAAO;EAAI,OAAO;EAAiB;CACrC;EAAE,OAAO;EAAW,OAAO;EAAU;CACrC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAa,OAAO;EAAU;CACvC;EAAE,OAAO;EAAc,OAAO;EAAW;CAC1C;AAED,SAAS,EAAY,GAA8B;AACjD,KAAI,CAAC,EAAO,QAAO;CACnB,IAAM,IAAK,OAAO,EAAM;AAExB,QADI,CAAC,OAAO,SAAS,EAAG,IAAI,KAAM,IAAU,OACrC,IAAI,KAAK,KAAK,KAAK,GAAG,EAAG,CAAC,aAAa;;AAGhD,SAAS,EAAY,GAAuB;AAE1C,QAAO,GADQ,OAAO,SAAW,MAAc,OAAO,SAAS,SAAS,GACvD,eA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GACJ,EAAW,WAAW,IACxB,kBAAC,KAAD;QAAG,WAAU;kBAAqC;QAAoB,CAAA,GAEtE,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAW,KAAK,MACf,kBAAC,MAAD;SAEE,WAAU;mBAFZ,CAIE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,OAAD;WAAK,WAAU;qBAAf;YACE,kBAAC,GAAD;aAAO,SAAS,EAAE,WAAW,WAAW,YAAY;uBACjD,EAAE,WAAW,WAAW,WAAW;aAC9B,CAAA;YACP,EAAE,oBACD,kBAAC,QAAD;aAAM,WAAU;uBAAhB,CACE,kBAAC,IAAD,EAAU,WAAU,UAAW,CAAA,EAAA,YAC1B;;YAET,kBAAC,QAAD;aAAM,WAAU;uBAAhB;cACE,kBAAC,GAAD,EAAK,WAAU,UAAW,CAAA;cACzB,EAAE;cACF,EAAE,WAAW,IAAI,EAAE,aAAa;cAAG;cAC/B;;YACN,EAAE,aACD,kBAAC,QAAD;aAAM,WAAU;uBAAhB,CACE,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA,EAC3B,IAAI,KAAK,EAAE,UAAU,CAAC,oBAAoB,CACtC;;YAEL;cACN,kBAAC,KAAD;WAAG,WAAU;qBAAb,CAAoD,YACzC,IAAI,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAC7C;aACA;aACL,EAAE,WAAW,YACZ,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,KAAK,EAAa,EAAE,GAAG;UACtC,WAAU;UACV,cAAW;oBAEX,kBAAC,GAAD,EAAQ,WAAU,UAAW,CAAA;UACtB,CAAA,CAER;WAvCE,EAAE,GAuCJ,CACL;QACC,CAAA,CAEH;;MACL,EAAA,CAAA,CAED;;IACF;KACF"}
@@ -1,13 +1,19 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { HeartPulse as t, Import as n, KeyRound as r, Plug as i, Shield as a, UserCheck as o } from "lucide-react";
2
+ import { HeartPulse as t, Import as n, KeyRound as r, Plug as i, Share2 as a, Shield as o, UserCheck as s } from "lucide-react";
3
3
  //#region src/security/config/navigation.tsx
4
- var s = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`), c = (t) => [{
4
+ var c = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`), l = (t) => [{
5
5
  id: "security-vaults",
6
6
  label: "Vaults",
7
7
  path: t,
8
8
  icon: /* @__PURE__ */ e(r, { size: 16 }),
9
9
  order: 10
10
- }], l = (a) => [
10
+ }, {
11
+ id: "security-shared-with-me",
12
+ label: "Shared with me",
13
+ path: c(t, "shared-with-me"),
14
+ icon: /* @__PURE__ */ e(a, { size: 16 }),
15
+ order: 20
16
+ }], u = (a) => [
11
17
  {
12
18
  id: "security-dashboard",
13
19
  label: "Security Health",
@@ -18,80 +24,87 @@ var s = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ?
18
24
  {
19
25
  id: "security-access-review",
20
26
  label: "Access Review",
21
- path: s(a, "access-review"),
22
- icon: /* @__PURE__ */ e(o, { size: 16 }),
27
+ path: c(a, "access-review"),
28
+ icon: /* @__PURE__ */ e(s, { size: 16 }),
23
29
  order: 30
24
30
  },
25
31
  {
26
32
  id: "security-providers",
27
33
  label: "Providers",
28
- path: s(a, "providers"),
34
+ path: c(a, "providers"),
29
35
  icon: /* @__PURE__ */ e(i, { size: 16 }),
30
36
  order: 40
31
37
  },
32
38
  {
33
39
  id: "security-import-export",
34
40
  label: "Import / Export",
35
- path: s(a, "import"),
41
+ path: c(a, "import"),
36
42
  icon: /* @__PURE__ */ e(n, { size: 16 }),
37
43
  order: 50
38
44
  },
39
45
  {
40
46
  id: "security-admin-vaults",
41
47
  label: "Vaults",
42
- path: s(a, "vaults"),
48
+ path: c(a, "vaults"),
43
49
  icon: /* @__PURE__ */ e(r, { size: 16 }),
44
50
  order: 60
45
51
  }
46
- ], u = (a) => [
52
+ ], d = (o) => [
47
53
  {
48
54
  id: "security-vaults",
49
55
  label: "Vaults",
50
- path: a,
56
+ path: o,
51
57
  icon: /* @__PURE__ */ e(r, { size: 16 }),
52
58
  order: 10
53
59
  },
60
+ {
61
+ id: "security-shared-with-me",
62
+ label: "Shared with me",
63
+ path: c(o, "shared-with-me"),
64
+ icon: /* @__PURE__ */ e(a, { size: 16 }),
65
+ order: 15
66
+ },
54
67
  {
55
68
  id: "security-import-export",
56
69
  label: "Import / Export",
57
- path: s(a, "import"),
70
+ path: c(o, "import"),
58
71
  icon: /* @__PURE__ */ e(n, { size: 16 }),
59
72
  order: 20
60
73
  },
61
74
  {
62
75
  id: "security-providers",
63
76
  label: "Providers",
64
- path: s(a, "providers"),
77
+ path: c(o, "providers"),
65
78
  icon: /* @__PURE__ */ e(i, { size: 16 }),
66
79
  order: 30
67
80
  },
68
81
  {
69
82
  id: "security-dashboard",
70
83
  label: "Security Health",
71
- path: s(a, "dashboard"),
84
+ path: c(o, "dashboard"),
72
85
  icon: /* @__PURE__ */ e(t, { size: 16 }),
73
86
  order: 50
74
87
  },
75
88
  {
76
89
  id: "security-access-review",
77
90
  label: "Access Review",
78
- path: s(a, "access-review"),
79
- icon: /* @__PURE__ */ e(o, { size: 16 }),
91
+ path: c(o, "access-review"),
92
+ icon: /* @__PURE__ */ e(s, { size: 16 }),
80
93
  order: 60
81
94
  }
82
- ], d = (t, n = "all") => {
83
- let r = n === "user" ? c(t) : n === "admin" ? l(t) : u(t);
95
+ ], f = (t, n = "all") => {
96
+ let r = n === "user" ? l(t) : n === "admin" ? u(t) : d(t);
84
97
  return {
85
98
  id: "security",
86
99
  label: "Security",
87
100
  path: t,
88
- icon: /* @__PURE__ */ e(a, { size: 20 }),
101
+ icon: /* @__PURE__ */ e(o, { size: 20 }),
89
102
  order: 10,
90
103
  group: "security",
91
104
  children: r
92
105
  };
93
106
  };
94
107
  //#endregion
95
- export { d as getNavigationConfig };
108
+ export { f as getNavigationConfig };
96
109
 
97
110
  //# sourceMappingURL=navigation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","names":[],"sources":["../../../src/security/config/navigation.tsx"],"sourcesContent":["import { Shield, KeyRound, Import, Plug, HeartPulse, UserCheck } from 'lucide-react';\nimport type { NavItem, SecurityMode } from '../types';\n\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\nconst userChildren = (basePath: string): NavItem[] => [\n {\n id: 'security-vaults',\n label: 'Vaults',\n path: basePath,\n icon: <KeyRound size={16} />,\n order: 10,\n },\n];\n\nconst adminChildren = (basePath: string): NavItem[] => [\n {\n id: 'security-dashboard',\n label: 'Security Health',\n path: basePath,\n icon: <HeartPulse size={16} />,\n order: 10,\n },\n // Audit Log nav item removed: canonical audit surface is `/admin/audit`\n // (wspace-activity-svc / global audit pipeline). Avoid duplicate visible\n // shell entries for the same audit journey.\n {\n id: 'security-access-review',\n label: 'Access Review',\n path: joinPath(basePath, 'access-review'),\n icon: <UserCheck size={16} />,\n order: 30,\n },\n {\n id: 'security-providers',\n label: 'Providers',\n path: joinPath(basePath, 'providers'),\n icon: <Plug size={16} />,\n order: 40,\n },\n {\n id: 'security-import-export',\n label: 'Import / Export',\n path: joinPath(basePath, 'import'),\n icon: <Import size={16} />,\n order: 50,\n },\n {\n id: 'security-admin-vaults',\n label: 'Vaults',\n path: joinPath(basePath, 'vaults'),\n icon: <KeyRound size={16} />,\n order: 60,\n },\n];\n\nconst allChildren = (basePath: string): NavItem[] => [\n {\n id: 'security-vaults',\n label: 'Vaults',\n path: basePath,\n icon: <KeyRound size={16} />,\n order: 10,\n },\n {\n id: 'security-import-export',\n label: 'Import / Export',\n path: joinPath(basePath, 'import'),\n icon: <Import size={16} />,\n order: 20,\n },\n {\n id: 'security-providers',\n label: 'Providers',\n path: joinPath(basePath, 'providers'),\n icon: <Plug size={16} />,\n order: 30,\n },\n // Audit Log nav item removed: see comment above. Canonical surface lives\n // under the admin shell at `/admin/audit`.\n {\n id: 'security-dashboard',\n label: 'Security Health',\n path: joinPath(basePath, 'dashboard'),\n icon: <HeartPulse size={16} />,\n order: 50,\n },\n {\n id: 'security-access-review',\n label: 'Access Review',\n path: joinPath(basePath, 'access-review'),\n icon: <UserCheck size={16} />,\n order: 60,\n },\n];\n\n/**\n * Returns navigation config filtered by mode.\n * - 'user': Vaults only (for product app shells)\n * - 'admin': Governance pages + Vaults (for admin-app)\n * - 'all': Everything (backward compat, default)\n */\nexport const getNavigationConfig = (basePath: string, mode: SecurityMode = 'all'): NavItem => {\n const children =\n mode === 'user'\n ? userChildren(basePath)\n : mode === 'admin'\n ? adminChildren(basePath)\n : allChildren(basePath);\n\n return {\n id: 'security',\n label: 'Security',\n path: basePath,\n icon: <Shield size={20} />,\n order: 10,\n group: 'security',\n children,\n };\n};\n"],"mappings":";;;AAGA,IAAM,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI,MAIhD,KAAgB,MAAgC,CACpD;CACE,IAAI;CACJ,OAAO;CACP,MAAM;CACN,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;CAC5B,OAAO;CACR,CACF,EAEK,KAAiB,MAAgC;CACrD;EACE,IAAI;EACJ,OAAO;EACP,MAAM;EACN,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;EAC9B,OAAO;EACR;CAID;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,gBAAgB;EACzC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;EAC7B,OAAO;EACR;CACD;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,YAAY;EACrC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;EACxB,OAAO;EACR;CACD;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,SAAS;EAClC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;EAC1B,OAAO;EACR;CACD;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,SAAS;EAClC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;EAC5B,OAAO;EACR;CACF,EAEK,KAAe,MAAgC;CACnD;EACE,IAAI;EACJ,OAAO;EACP,MAAM;EACN,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;EAC5B,OAAO;EACR;CACD;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,SAAS;EAClC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;EAC1B,OAAO;EACR;CACD;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,YAAY;EACrC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;EACxB,OAAO;EACR;CAGD;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,YAAY;EACrC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;EAC9B,OAAO;EACR;CACD;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,gBAAgB;EACzC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;EAC7B,OAAO;EACR;CACF,EAQY,KAAuB,GAAkB,IAAqB,UAAmB;CAC5F,IAAM,IACJ,MAAS,SACL,EAAa,EAAS,GACtB,MAAS,UACP,EAAc,EAAS,GACvB,EAAY,EAAS;AAE7B,QAAO;EACL,IAAI;EACJ,OAAO;EACP,MAAM;EACN,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;EAC1B,OAAO;EACP,OAAO;EACP;EACD"}
1
+ {"version":3,"file":"navigation.js","names":[],"sources":["../../../src/security/config/navigation.tsx"],"sourcesContent":["import { Shield, KeyRound, Import, Plug, HeartPulse, UserCheck, Share2 } from 'lucide-react';\nimport type { NavItem, SecurityMode } from '../types';\n\nconst joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n};\n\nconst userChildren = (basePath: string): NavItem[] => [\n {\n id: 'security-vaults',\n label: 'Vaults',\n path: basePath,\n icon: <KeyRound size={16} />,\n order: 10,\n },\n {\n id: 'security-shared-with-me',\n label: 'Shared with me',\n path: joinPath(basePath, 'shared-with-me'),\n icon: <Share2 size={16} />,\n order: 20,\n },\n];\n\nconst adminChildren = (basePath: string): NavItem[] => [\n {\n id: 'security-dashboard',\n label: 'Security Health',\n path: basePath,\n icon: <HeartPulse size={16} />,\n order: 10,\n },\n // Audit Log nav item removed: canonical audit surface is `/admin/audit`\n // (wspace-activity-svc / global audit pipeline). Avoid duplicate visible\n // shell entries for the same audit journey.\n {\n id: 'security-access-review',\n label: 'Access Review',\n path: joinPath(basePath, 'access-review'),\n icon: <UserCheck size={16} />,\n order: 30,\n },\n {\n id: 'security-providers',\n label: 'Providers',\n path: joinPath(basePath, 'providers'),\n icon: <Plug size={16} />,\n order: 40,\n },\n {\n id: 'security-import-export',\n label: 'Import / Export',\n path: joinPath(basePath, 'import'),\n icon: <Import size={16} />,\n order: 50,\n },\n {\n id: 'security-admin-vaults',\n label: 'Vaults',\n path: joinPath(basePath, 'vaults'),\n icon: <KeyRound size={16} />,\n order: 60,\n },\n];\n\nconst allChildren = (basePath: string): NavItem[] => [\n {\n id: 'security-vaults',\n label: 'Vaults',\n path: basePath,\n icon: <KeyRound size={16} />,\n order: 10,\n },\n {\n id: 'security-shared-with-me',\n label: 'Shared with me',\n path: joinPath(basePath, 'shared-with-me'),\n icon: <Share2 size={16} />,\n order: 15,\n },\n {\n id: 'security-import-export',\n label: 'Import / Export',\n path: joinPath(basePath, 'import'),\n icon: <Import size={16} />,\n order: 20,\n },\n {\n id: 'security-providers',\n label: 'Providers',\n path: joinPath(basePath, 'providers'),\n icon: <Plug size={16} />,\n order: 30,\n },\n // Audit Log nav item removed: see comment above. Canonical surface lives\n // under the admin shell at `/admin/audit`.\n {\n id: 'security-dashboard',\n label: 'Security Health',\n path: joinPath(basePath, 'dashboard'),\n icon: <HeartPulse size={16} />,\n order: 50,\n },\n {\n id: 'security-access-review',\n label: 'Access Review',\n path: joinPath(basePath, 'access-review'),\n icon: <UserCheck size={16} />,\n order: 60,\n },\n];\n\n/**\n * Returns navigation config filtered by mode.\n * - 'user': Vaults only (for product app shells)\n * - 'admin': Governance pages + Vaults (for admin-app)\n * - 'all': Everything (backward compat, default)\n */\nexport const getNavigationConfig = (basePath: string, mode: SecurityMode = 'all'): NavItem => {\n const children =\n mode === 'user'\n ? userChildren(basePath)\n : mode === 'admin'\n ? adminChildren(basePath)\n : allChildren(basePath);\n\n return {\n id: 'security',\n label: 'Security',\n path: basePath,\n icon: <Shield size={20} />,\n order: 10,\n group: 'security',\n children,\n };\n};\n"],"mappings":";;;AAGA,IAAM,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI,MAIhD,KAAgB,MAAgC,CACpD;CACE,IAAI;CACJ,OAAO;CACP,MAAM;CACN,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;CAC5B,OAAO;CACR,EACD;CACE,IAAI;CACJ,OAAO;CACP,MAAM,EAAS,GAAU,iBAAiB;CAC1C,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;CAC1B,OAAO;CACR,CACF,EAEK,KAAiB,MAAgC;CACrD;EACE,IAAI;EACJ,OAAO;EACP,MAAM;EACN,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;EAC9B,OAAO;EACR;CAID;EACE,IAAI;EACJ,OAAO;EACP,MAAM,EAAS,GAAU,gBAAgB;EACzC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAA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GACtB,MAAS,UACP,EAAc,EAAS,GACvB,EAAY,EAAS;AAE7B,QAAO;EACL,IAAI;EACJ,OAAO;EACP,MAAM;EACN,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;EAC1B,OAAO;EACP,OAAO;EACP;EACD"}
@@ -0,0 +1,31 @@
1
+ import { useCreateSecretShareLinkMutation as e, useMySharedCredentialsQuery as t, useRevealSharedCredentialLazyQuery as n, useRevokeSecretShareMutation as r, useSecretSharesQuery as i, useShareSecretWithAccountMutation as a } from "../../generated/wspace-operations.js";
2
+ //#region src/security/hooks/useShareQueries.ts
3
+ function o(e, t) {
4
+ return i({
5
+ variables: {
6
+ vaultId: e ?? "",
7
+ secretId: t ?? null
8
+ },
9
+ skip: !e,
10
+ fetchPolicy: "network-only"
11
+ });
12
+ }
13
+ function s() {
14
+ return t({ fetchPolicy: "network-only" });
15
+ }
16
+ function c() {
17
+ return n({ fetchPolicy: "network-only" });
18
+ }
19
+ function l() {
20
+ return a();
21
+ }
22
+ function u() {
23
+ return e();
24
+ }
25
+ function d() {
26
+ return r();
27
+ }
28
+ //#endregion
29
+ export { u as useCreateSecretShareLink, s as useMySharedCredentials, c as useRevealSharedCredential, d as useRevokeSecretShare, o as useSecretShares, l as useShareSecretWithAccount };
30
+
31
+ //# sourceMappingURL=useShareQueries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useShareQueries.js","names":[],"sources":["../../../src/security/hooks/useShareQueries.ts"],"sourcesContent":["import {\n useSecretSharesQuery,\n useMySharedCredentialsQuery,\n useRevealSharedCredentialLazyQuery,\n useShareSecretWithAccountMutation,\n useCreateSecretShareLinkMutation,\n useRevokeSecretShareMutation,\n useUpdateSecretShareRoleMutation,\n} from '../../generated/wspace-operations';\n\n/**\n * Shares on a vault (or a single secret when secretId is provided).\n * Skipped until a vaultId is known.\n */\nexport function useSecretShares(vaultId: string | null, secretId?: string | null) {\n return useSecretSharesQuery({\n variables: { vaultId: vaultId ?? '', secretId: secretId ?? null },\n skip: !vaultId,\n fetchPolicy: 'network-only',\n });\n}\n\n/** Credentials shared with the current actor across all workspaces. */\nexport function useMySharedCredentials() {\n return useMySharedCredentialsQuery({ fetchPolicy: 'network-only' });\n}\n\n/** Lazily reveal a credential shared with the current actor. */\nexport function useRevealSharedCredential() {\n return useRevealSharedCredentialLazyQuery({ fetchPolicy: 'network-only' });\n}\n\nexport function useShareSecretWithAccount() {\n return useShareSecretWithAccountMutation();\n}\n\nexport function useCreateSecretShareLink() {\n return useCreateSecretShareLinkMutation();\n}\n\nexport function useRevokeSecretShare() {\n return useRevokeSecretShareMutation();\n}\n\nexport function useUpdateSecretShareRole() {\n return useUpdateSecretShareRoleMutation();\n}\n"],"mappings":";;AAcA,SAAgB,EAAgB,GAAwB,GAA0B;AAChF,QAAO,EAAqB;EAC1B,WAAW;GAAE,SAAS,KAAW;GAAI,UAAU,KAAY;GAAM;EACjE,MAAM,CAAC;EACP,aAAa;EACd,CAAC;;AAIJ,SAAgB,IAAyB;AACvC,QAAO,EAA4B,EAAE,aAAa,gBAAgB,CAAC;;AAIrE,SAAgB,IAA4B;AAC1C,QAAO,EAAmC,EAAE,aAAa,gBAAgB,CAAC;;AAG5E,SAAgB,IAA4B;AAC1C,QAAO,GAAmC;;AAG5C,SAAgB,IAA2B;AACzC,QAAO,GAAkC;;AAG3C,SAAgB,IAAuB;AACrC,QAAO,GAA8B"}
@@ -3,3 +3,4 @@ import "./store/securityStore.js";
3
3
  import "./SecurityRoot.js";
4
4
  import "./SecurityUserRoot.js";
5
5
  import "./SecurityAdminRoot.js";
6
+ import "./pages/VaultShareViewer.js";