@burdenoff/microfe-security 2026.601.4 → 2026.602.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.
- package/dist/generated/wspace-operations.js +243 -84
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/security/components/SecretShareDialog.js +349 -0
- package/dist/security/components/SecretShareDialog.js.map +1 -0
- package/dist/security/config/navigation.js +32 -19
- package/dist/security/config/navigation.js.map +1 -1
- package/dist/security/hooks/useAuditLog.js +2 -3
- package/dist/security/hooks/useAuditLog.js.map +1 -1
- package/dist/security/hooks/useShareQueries.js +31 -0
- package/dist/security/hooks/useShareQueries.js.map +1 -0
- package/dist/security/index.js +1 -0
- package/dist/security/pages/AuditLogPage.js +20 -2
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +215 -203
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +115 -0
- package/dist/security/pages/SharedWithMePage.js.map +1 -0
- package/dist/security/pages/VaultDetailPage.js +214 -195
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js +242 -0
- package/dist/security/pages/VaultShareViewer.js.map +1 -0
- package/dist/security/routes/SecurityRoutes.js +8 -4
- package/dist/security/routes/SecurityRoutes.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,272 +3,277 @@ import { SECURITY_FEATURE_FLAGS as t } from "../constants/featureFlags.js";
|
|
|
3
3
|
import { cn as n } from "../utils/cn.js";
|
|
4
4
|
import { PageLayout as r } from "../components/PageLayout.js";
|
|
5
5
|
import { Badge as i, Button as a, Card as o } from "../components/ui.js";
|
|
6
|
-
import { translateWithFallback as
|
|
7
|
-
import { ConfirmDialog as
|
|
8
|
-
import { useGetSecretVersionsQuery as
|
|
9
|
-
import { useSecurityEventEmitter as
|
|
10
|
-
import { useDeleteSecret as
|
|
11
|
-
import { nativeConfirm as
|
|
12
|
-
import { SecurityPermissionGuard as
|
|
13
|
-
import { SecretValueDisplay as
|
|
14
|
-
import { SecretTypeBadge as
|
|
15
|
-
import { RotationStatusBadge as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
6
|
+
import { translateWithFallback as s } from "../utils/i18n.js";
|
|
7
|
+
import { ConfirmDialog as c } from "../components/ConfirmDialog.js";
|
|
8
|
+
import { useGetSecretVersionsQuery as ee } from "../../generated/wspace-operations.js";
|
|
9
|
+
import { useSecurityEventEmitter as te } from "../hooks/useSecurityEventEmitter.js";
|
|
10
|
+
import { useDeleteSecret as ne, useGetSecret as re, useRollbackSecret as ie, useRotateSecret as ae } from "../hooks/useSecretQueries.js";
|
|
11
|
+
import { nativeConfirm as oe, nativeImpact as se, nativeNotify as l } from "../../utils/nativeBridge.js";
|
|
12
|
+
import { SecurityPermissionGuard as u } from "../components/SecurityPermissionGuard.js";
|
|
13
|
+
import { SecretValueDisplay as d } from "../components/SecretValueDisplay.js";
|
|
14
|
+
import { SecretTypeBadge as f } from "../components/SecretTypeBadge.js";
|
|
15
|
+
import { RotationStatusBadge as p } from "../components/RotationStatusBadge.js";
|
|
16
|
+
import { SecretShareDialog as m } from "../components/SecretShareDialog.js";
|
|
17
|
+
import { useSecretValue as h } from "../hooks/useSecretValue.js";
|
|
18
|
+
import { useRef as ce, useState as g } from "react";
|
|
19
|
+
import { usePermission as _ } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
20
|
+
import { useNavigate as le, useParams as ue } from "react-router-dom";
|
|
21
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
22
|
+
import { AlertTriangle as de, ArrowLeft as b, Calendar as fe, Clock as pe, History as x, KeyRound as me, Loader2 as S, RefreshCw as C, Share2 as he, Shield as ge, Trash2 as w, X as T } from "lucide-react";
|
|
23
|
+
import { useI18n as E } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
23
24
|
//#region src/security/pages/SecretDetailPage.tsx
|
|
24
|
-
function
|
|
25
|
-
let { vaultId:
|
|
25
|
+
function D() {
|
|
26
|
+
let { vaultId: D, secretId: O } = ue(), { basePath: k = "/", navigate: A } = e(), { t: j } = E(), M = le(), { data: N, loading: P, error: F, refetch: I } = re(O ?? null), L = N?.getSecret, { data: _e, loading: ve } = ee({
|
|
26
27
|
variables: {
|
|
27
|
-
secretId:
|
|
28
|
+
secretId: O ?? "",
|
|
28
29
|
pagination: { limit: 50 }
|
|
29
30
|
},
|
|
30
|
-
skip: !
|
|
31
|
+
skip: !O,
|
|
31
32
|
fetchPolicy: "network-only"
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, [Ae, K] = m(!1), [q, J] = m(""), Y = (e, t, n) => ee(A, e, t, n), je = (e) => {
|
|
37
|
-
k ? k(e) : j(e);
|
|
33
|
+
}), ye = _e?.getSecretVersionsPaginated?.items ?? [], { value: be, reveal: xe, hide: Se, loading: Ce, isRevealed: R } = h(O ?? ""), [we, { loading: Te }] = ne(), [Ee, { loading: z }] = ae(), [De, { loading: Oe }] = ie(), { emit: B } = te(), ke = _("secret:delete"), Ae = _("secret:update"), je = _("secret:decrypt"), [Me, V] = g(!1), [Ne, H] = g(!1), [Pe, U] = g(!1), W = ce(null), Fe = () => {
|
|
34
|
+
U(!0), requestAnimationFrame(() => W.current?.focus());
|
|
35
|
+
}, [G, K] = g(!1), [q, J] = g(""), Y = (e, t, n) => s(j, e, t, n), Ie = (e) => {
|
|
36
|
+
A ? A(e) : M(e);
|
|
38
37
|
}, X = () => {
|
|
39
|
-
|
|
38
|
+
Ie(`${k}/vaults/${D}`);
|
|
40
39
|
}, Z = async () => {
|
|
41
|
-
if (
|
|
42
|
-
await
|
|
43
|
-
secretId:
|
|
44
|
-
vaultId:
|
|
45
|
-
}),
|
|
40
|
+
if (O) try {
|
|
41
|
+
await we({ variables: { id: O } }), B("secret.deleted", {
|
|
42
|
+
secretId: O,
|
|
43
|
+
vaultId: D
|
|
44
|
+
}), V(!1), l("success"), X();
|
|
46
45
|
} catch (e) {
|
|
47
|
-
console.error("Failed to delete secret:", e),
|
|
46
|
+
console.error("Failed to delete secret:", e), l("error");
|
|
48
47
|
}
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
let e = await
|
|
48
|
+
}, Le = async () => {
|
|
49
|
+
se("medium");
|
|
50
|
+
let e = await oe({
|
|
52
51
|
title: "Delete Secret",
|
|
53
52
|
message: "Delete this secret? This cannot be undone.",
|
|
54
53
|
okButtonTitle: "Delete",
|
|
55
54
|
cancelButtonTitle: "Cancel"
|
|
56
55
|
});
|
|
57
56
|
if (e === null) {
|
|
58
|
-
|
|
57
|
+
V(!0);
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
61
60
|
e && await Z();
|
|
62
|
-
},
|
|
63
|
-
if (!(!
|
|
64
|
-
await
|
|
65
|
-
id:
|
|
61
|
+
}, Re = async () => {
|
|
62
|
+
if (!(!O || !q.trim())) try {
|
|
63
|
+
await Ee({ variables: {
|
|
64
|
+
id: O,
|
|
66
65
|
newValue: q.trim()
|
|
67
|
-
} }),
|
|
68
|
-
secretId:
|
|
69
|
-
vaultId:
|
|
70
|
-
}),
|
|
66
|
+
} }), B("secret.rotated", {
|
|
67
|
+
secretId: O,
|
|
68
|
+
vaultId: D
|
|
69
|
+
}), U(!1), J(""), I();
|
|
71
70
|
} catch (e) {
|
|
72
71
|
console.error("Failed to rotate secret:", e);
|
|
73
72
|
}
|
|
74
|
-
},
|
|
75
|
-
if (
|
|
76
|
-
await
|
|
77
|
-
id:
|
|
73
|
+
}, ze = async (e) => {
|
|
74
|
+
if (O) try {
|
|
75
|
+
await De({ variables: {
|
|
76
|
+
id: O,
|
|
78
77
|
version: e
|
|
79
|
-
} }),
|
|
80
|
-
secretId:
|
|
81
|
-
vaultId:
|
|
82
|
-
}),
|
|
78
|
+
} }), B("secret.rollback", {
|
|
79
|
+
secretId: O,
|
|
80
|
+
vaultId: D
|
|
81
|
+
}), I(), K(!1);
|
|
83
82
|
} catch (e) {
|
|
84
83
|
console.error("Failed to rollback secret:", e);
|
|
85
84
|
}
|
|
86
85
|
};
|
|
87
|
-
if (
|
|
86
|
+
if (P && !L) return /* @__PURE__ */ v(r, {
|
|
88
87
|
title: Y("security.secretDetail.loading.title", "Loading Secret..."),
|
|
89
88
|
breadcrumbs: [{
|
|
90
89
|
label: Y("security.common.breadcrumbs.security", "Security"),
|
|
91
|
-
path:
|
|
90
|
+
path: k
|
|
92
91
|
}, { label: Y("security.common.breadcrumbs.secret", "Secret") }],
|
|
93
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ v("div", {
|
|
94
93
|
className: "flex items-center justify-center py-20",
|
|
95
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ v(S, { className: "size-10 animate-spin text-primary/60" })
|
|
96
95
|
})
|
|
97
96
|
});
|
|
98
|
-
if (
|
|
97
|
+
if (F || !L) return /* @__PURE__ */ v(r, {
|
|
99
98
|
title: Y("security.common.errorPage.title", "Error"),
|
|
100
99
|
breadcrumbs: [{
|
|
101
100
|
label: Y("security.common.breadcrumbs.security", "Security"),
|
|
102
|
-
path:
|
|
101
|
+
path: k
|
|
103
102
|
}, { label: Y("security.common.breadcrumbs.secret", "Secret") }],
|
|
104
|
-
children: /* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ v(o, {
|
|
105
104
|
className: "p-8 text-center max-w-lg mx-auto mt-10",
|
|
106
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ y("div", {
|
|
107
106
|
className: "flex flex-col items-center gap-4",
|
|
108
107
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ v("div", {
|
|
110
109
|
className: "p-3 rounded-full bg-destructive/10",
|
|
111
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ v(de, { className: "size-8 text-destructive" })
|
|
112
111
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h3", {
|
|
114
113
|
className: "text-lg font-bold text-foreground",
|
|
115
114
|
children: Y("security.secretDetail.error.title", "Failed to load secret")
|
|
116
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ v("p", {
|
|
117
116
|
className: "text-sm text-muted-foreground mt-2",
|
|
118
|
-
children:
|
|
117
|
+
children: F?.message ?? Y("security.secretDetail.error.description", "Secret not found or access denied.")
|
|
119
118
|
})] }),
|
|
120
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ y(a, {
|
|
121
120
|
variant: "outline",
|
|
122
121
|
onClick: X,
|
|
123
122
|
className: "mt-4",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ v(b, { className: "size-4" }), Y("security.secretDetail.actions.backToVault", "Go Back to Vault")]
|
|
125
124
|
})
|
|
126
125
|
]
|
|
127
126
|
})
|
|
128
127
|
})
|
|
129
128
|
});
|
|
130
|
-
let Q =
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
title:
|
|
133
|
-
description:
|
|
129
|
+
let Q = L.versionCount ?? 0, $ = L.lastRotatedAt ? "healthy" : void 0;
|
|
130
|
+
return /* @__PURE__ */ y(r, {
|
|
131
|
+
title: L.name,
|
|
132
|
+
description: L.description ?? Y("security.secretDetail.description", "View and manage this secret."),
|
|
134
133
|
breadcrumbs: [
|
|
135
134
|
{
|
|
136
135
|
label: Y("security.common.breadcrumbs.security", "Security"),
|
|
137
|
-
path:
|
|
136
|
+
path: k
|
|
138
137
|
},
|
|
139
138
|
{
|
|
140
139
|
label: Y("security.common.breadcrumbs.vault", "Vault"),
|
|
141
|
-
path: `${
|
|
140
|
+
path: `${k}/vaults/${D}`
|
|
142
141
|
},
|
|
143
|
-
{ label:
|
|
142
|
+
{ label: L.name }
|
|
144
143
|
],
|
|
145
|
-
actions: /* @__PURE__ */
|
|
144
|
+
actions: /* @__PURE__ */ y("div", {
|
|
146
145
|
className: "flex flex-wrap items-center gap-2",
|
|
147
146
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ y(a, {
|
|
149
148
|
variant: "outline",
|
|
150
149
|
size: "sm",
|
|
151
150
|
onClick: X,
|
|
152
151
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ v(b, { className: "size-4" }),
|
|
153
|
+
/* @__PURE__ */ v("span", {
|
|
155
154
|
className: "hidden sm:inline",
|
|
156
155
|
children: Y("security.secretDetail.actions.backToVault", "Back to Vault")
|
|
157
156
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ v("span", {
|
|
159
158
|
className: "sm:hidden",
|
|
160
159
|
children: Y("security.common.actions.back", "Back")
|
|
161
160
|
})
|
|
162
161
|
]
|
|
163
162
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
163
|
+
Ae && /* @__PURE__ */ y(a, {
|
|
164
|
+
variant: "outline",
|
|
165
|
+
size: "sm",
|
|
166
|
+
onClick: () => H(!0),
|
|
167
|
+
children: [/* @__PURE__ */ v(he, { className: "size-4" }), Y("security.common.actions.share", "Share")]
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ v(u, {
|
|
165
170
|
permission: "secret:update",
|
|
166
171
|
featureFlagKey: t.SECRET_ROTATE,
|
|
167
172
|
featureFlagDefault: !1,
|
|
168
|
-
children: /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ y(a, {
|
|
169
174
|
variant: "outline",
|
|
170
175
|
size: "sm",
|
|
171
|
-
onClick:
|
|
172
|
-
children: [/* @__PURE__ */
|
|
176
|
+
onClick: Fe,
|
|
177
|
+
children: [/* @__PURE__ */ v(C, { className: "size-4" }), Y("security.secretDetail.actions.rotate", "Rotate")]
|
|
173
178
|
})
|
|
174
179
|
}),
|
|
175
|
-
|
|
180
|
+
ke && /* @__PURE__ */ y(a, {
|
|
176
181
|
variant: "outline",
|
|
177
182
|
size: "sm",
|
|
178
183
|
className: "text-destructive hover:bg-destructive/10 border-destructive/20",
|
|
179
|
-
onClick: () => void
|
|
180
|
-
children: [/* @__PURE__ */
|
|
184
|
+
onClick: () => void Le(),
|
|
185
|
+
children: [/* @__PURE__ */ v(w, { className: "size-4" }), Y("security.common.actions.delete", "Delete")]
|
|
181
186
|
})
|
|
182
187
|
]
|
|
183
188
|
}),
|
|
184
189
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ y("div", {
|
|
186
191
|
className: "space-y-6",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ y("div", {
|
|
188
193
|
className: "flex flex-wrap items-center gap-3",
|
|
189
194
|
children: [
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
$ && /* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ v(f, { type: L.type }),
|
|
196
|
+
$ && /* @__PURE__ */ v(p, { status: $ }),
|
|
197
|
+
/* @__PURE__ */ v(i, {
|
|
193
198
|
variant: "outline",
|
|
194
199
|
className: "bg-background/50",
|
|
195
|
-
children: Y("security.secretDetail.status.label", "Status: {status}", { status:
|
|
200
|
+
children: Y("security.secretDetail.status.label", "Status: {status}", { status: L.status })
|
|
196
201
|
}),
|
|
197
|
-
|
|
202
|
+
L.labels?.map((e) => /* @__PURE__ */ v(i, {
|
|
198
203
|
variant: "outline",
|
|
199
204
|
className: "border-primary/20 text-primary",
|
|
200
205
|
children: e.label
|
|
201
206
|
}, e.id))
|
|
202
207
|
]
|
|
203
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ y("div", {
|
|
204
209
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ y("div", {
|
|
206
211
|
className: "md:col-span-2 space-y-6",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ y(o, {
|
|
208
213
|
className: "p-6 shadow-sm border-border/60",
|
|
209
214
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ y("div", {
|
|
211
216
|
className: "flex items-center justify-between mb-4",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
213
218
|
className: "text-lg font-bold text-foreground flex items-center gap-2",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
215
|
-
}),
|
|
219
|
+
children: [/* @__PURE__ */ v(me, { className: "size-5 text-primary" }), Y("security.secretDetail.value.title", "Secret Value")]
|
|
220
|
+
}), L.expiresAt && /* @__PURE__ */ y("div", {
|
|
216
221
|
className: "flex items-center gap-1.5 text-xs text-warning",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ v(fe, { className: "size-3.5" }), Y("security.secretDetail.value.expires", "Expires: {date}", { date: new Date(L.expiresAt).toLocaleDateString() })]
|
|
218
223
|
})]
|
|
219
224
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
value:
|
|
222
|
-
isRevealed:
|
|
223
|
-
onToggleReveal:
|
|
224
|
-
|
|
225
|
+
/* @__PURE__ */ v(d, {
|
|
226
|
+
value: be ?? "",
|
|
227
|
+
isRevealed: R,
|
|
228
|
+
onToggleReveal: je ? () => {
|
|
229
|
+
R ? Se() : xe();
|
|
225
230
|
} : void 0,
|
|
226
|
-
isLoading:
|
|
231
|
+
isLoading: Ce
|
|
227
232
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ v("p", {
|
|
229
234
|
className: "text-xs text-muted-foreground mt-4 italic",
|
|
230
235
|
children: Y("security.secretDetail.value.note", "Secret values are decrypted on-demand and never stored in plain text.")
|
|
231
236
|
})
|
|
232
237
|
]
|
|
233
|
-
}), /* @__PURE__ */
|
|
238
|
+
}), /* @__PURE__ */ y(o, {
|
|
234
239
|
className: "p-6 shadow-sm border-border/60",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ y("div", {
|
|
236
241
|
className: "flex items-center justify-between mb-6",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
238
243
|
className: "text-lg font-bold text-foreground flex items-center gap-2",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
-
}), /* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ v(x, { className: "size-5 text-primary" }), Y("security.secretDetail.history.title", "Version History")]
|
|
245
|
+
}), /* @__PURE__ */ v(i, {
|
|
241
246
|
variant: "outline",
|
|
242
247
|
className: "bg-muted font-mono",
|
|
243
248
|
children: Y("security.secretDetail.history.totalVersions", "{count} total versions", { count: Q })
|
|
244
249
|
})]
|
|
245
|
-
}), /* @__PURE__ */
|
|
250
|
+
}), /* @__PURE__ */ y("div", {
|
|
246
251
|
className: "space-y-4",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ y("div", {
|
|
248
253
|
className: "flex items-center justify-between p-4 rounded-lg bg-primary/5 border border-primary/10",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ y("div", {
|
|
250
255
|
className: "flex items-center gap-3",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ y("div", {
|
|
252
257
|
className: "size-8 rounded-full bg-primary/10 flex items-center justify-center text-primary text-xs font-bold",
|
|
253
|
-
children: ["v",
|
|
254
|
-
}), /* @__PURE__ */
|
|
258
|
+
children: ["v", L.version ?? Q]
|
|
259
|
+
}), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
255
260
|
className: "text-sm font-semibold",
|
|
256
261
|
children: Y("security.secretDetail.history.currentVersion", "Current Active Version")
|
|
257
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ v("p", {
|
|
258
263
|
className: "text-xs text-muted-foreground",
|
|
259
|
-
children: Y("security.secretDetail.history.lastUpdated", "Last updated {date}", { date: new Date(
|
|
264
|
+
children: Y("security.secretDetail.history.lastUpdated", "Last updated {date}", { date: new Date(L.updatedAt).toLocaleString() })
|
|
260
265
|
})] })]
|
|
261
|
-
}), /* @__PURE__ */
|
|
266
|
+
}), /* @__PURE__ */ v(i, {
|
|
262
267
|
variant: "success",
|
|
263
268
|
className: "text-[10px] uppercase",
|
|
264
269
|
children: Y("security.common.status.active", "Active")
|
|
265
270
|
})]
|
|
266
|
-
}), Q > 1 && /* @__PURE__ */
|
|
271
|
+
}), Q > 1 && /* @__PURE__ */ y("div", {
|
|
267
272
|
className: "text-center py-4 border-2 border-dashed border-border/40 rounded-lg bg-muted/20",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ v("p", {
|
|
269
274
|
className: "text-sm text-muted-foreground",
|
|
270
275
|
children: Y("security.secretDetail.history.available", "Historical versions are available. You can rollback to a previous state if needed.")
|
|
271
|
-
}), /* @__PURE__ */
|
|
276
|
+
}), /* @__PURE__ */ v(a, {
|
|
272
277
|
variant: "outline",
|
|
273
278
|
size: "sm",
|
|
274
279
|
className: "mt-3",
|
|
@@ -278,52 +283,52 @@ function E() {
|
|
|
278
283
|
})]
|
|
279
284
|
})]
|
|
280
285
|
})]
|
|
281
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ y("div", {
|
|
282
287
|
className: "space-y-6",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ y(o, {
|
|
284
289
|
className: "p-6 shadow-sm border-border/60 space-y-4",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
286
291
|
className: "font-bold text-sm uppercase tracking-wider text-muted-foreground",
|
|
287
292
|
children: Y("security.secretDetail.details.title", "Details")
|
|
288
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ y("div", {
|
|
289
294
|
className: "space-y-3",
|
|
290
295
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
292
297
|
className: "text-xs text-muted-foreground",
|
|
293
298
|
children: Y("security.secretDetail.details.keyIdentifier", "Key Identifier")
|
|
294
|
-
}), /* @__PURE__ */
|
|
299
|
+
}), /* @__PURE__ */ v("code", {
|
|
295
300
|
className: "text-xs font-mono bg-muted px-1.5 py-0.5 rounded block mt-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
296
|
-
children:
|
|
301
|
+
children: L.key
|
|
297
302
|
})] }),
|
|
298
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
299
304
|
className: "text-xs text-muted-foreground",
|
|
300
305
|
children: Y("security.secretDetail.details.createdBy", "Created By")
|
|
301
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ v("p", {
|
|
302
307
|
className: "text-sm font-medium mt-1",
|
|
303
|
-
children:
|
|
308
|
+
children: L.createdBy
|
|
304
309
|
})] }),
|
|
305
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
306
311
|
className: "text-xs text-muted-foreground",
|
|
307
312
|
children: Y("security.secretDetail.details.createdAt", "Created At")
|
|
308
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ y("div", {
|
|
309
314
|
className: "flex items-center gap-1.5 text-sm mt-1",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ v(pe, { className: "size-3.5" }), new Date(L.createdAt).toLocaleDateString()]
|
|
311
316
|
})] }),
|
|
312
|
-
|
|
317
|
+
L.lastRotatedAt && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
313
318
|
className: "text-xs text-muted-foreground",
|
|
314
319
|
children: Y("security.secretDetail.details.lastRotation", "Last Rotation")
|
|
315
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ v("p", {
|
|
316
321
|
className: "text-sm mt-1",
|
|
317
|
-
children: new Date(
|
|
322
|
+
children: new Date(L.lastRotatedAt).toLocaleString()
|
|
318
323
|
})] })
|
|
319
324
|
]
|
|
320
325
|
})]
|
|
321
|
-
}), /* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ y(o, {
|
|
322
327
|
className: "p-6 shadow-sm border-border/60 space-y-4 bg-primary/5 border-primary/10",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
324
329
|
className: "font-bold text-sm text-primary flex items-center gap-2",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
326
|
-
}), /* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ v(ge, { className: "size-4" }), Y("security.secretDetail.security.title", "Security")]
|
|
331
|
+
}), /* @__PURE__ */ v("p", {
|
|
327
332
|
className: "text-xs text-muted-foreground leading-relaxed",
|
|
328
333
|
children: Y("security.secretDetail.security.description", "This secret is protected by 256-bit encryption. All access is logged and monitored for suspicious activity.")
|
|
329
334
|
})]
|
|
@@ -331,75 +336,75 @@ function E() {
|
|
|
331
336
|
})]
|
|
332
337
|
})]
|
|
333
338
|
}),
|
|
334
|
-
|
|
339
|
+
G && /* @__PURE__ */ y("div", {
|
|
335
340
|
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ v("button", {
|
|
337
342
|
type: "button",
|
|
338
343
|
"aria-label": "Close version history",
|
|
339
344
|
className: "absolute inset-0 bg-background/80 backdrop-blur-sm animate-in fade-in duration-200 cursor-default",
|
|
340
345
|
onClick: () => K(!1)
|
|
341
|
-
}), /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ y(o, {
|
|
342
347
|
className: "relative z-10 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-200 border-primary/20 max-h-[80vh] flex flex-col",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ y("div", {
|
|
344
349
|
className: "flex items-center justify-between p-6 border-b border-border",
|
|
345
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ y("div", {
|
|
346
351
|
className: "flex items-center gap-3",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ v("div", {
|
|
348
353
|
className: "p-2 rounded-full bg-primary/10 text-primary",
|
|
349
|
-
children: /* @__PURE__ */
|
|
350
|
-
}), /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ v(x, { className: "size-5" })
|
|
355
|
+
}), /* @__PURE__ */ v("h2", {
|
|
351
356
|
className: "text-xl font-bold text-foreground",
|
|
352
357
|
children: Y("security.secretDetail.history.modalTitle", "Version History")
|
|
353
358
|
})]
|
|
354
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ v("button", {
|
|
355
360
|
type: "button",
|
|
356
361
|
onClick: () => K(!1),
|
|
357
362
|
className: "p-2 rounded-md hover:bg-muted text-muted-foreground transition-colors",
|
|
358
|
-
children: /* @__PURE__ */
|
|
363
|
+
children: /* @__PURE__ */ v(T, { className: "size-5" })
|
|
359
364
|
})]
|
|
360
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ v("div", {
|
|
361
366
|
className: "p-6 overflow-y-auto flex-1",
|
|
362
|
-
children:
|
|
367
|
+
children: ve ? /* @__PURE__ */ v("div", {
|
|
363
368
|
className: "flex justify-center py-8",
|
|
364
|
-
children: /* @__PURE__ */
|
|
365
|
-
}) : /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ v(S, { className: "size-8 animate-spin text-primary/60" })
|
|
370
|
+
}) : /* @__PURE__ */ v("div", {
|
|
366
371
|
className: "space-y-4",
|
|
367
|
-
children:
|
|
368
|
-
className: n("p-4 rounded-lg border", e.version ===
|
|
369
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: ye.map((e) => /* @__PURE__ */ v("div", {
|
|
373
|
+
className: n("p-4 rounded-lg border", e.version === L.version ? "bg-primary/5 border-primary/20" : "bg-card border-border"),
|
|
374
|
+
children: /* @__PURE__ */ y("div", {
|
|
370
375
|
className: "flex items-center justify-between",
|
|
371
|
-
children: [/* @__PURE__ */
|
|
372
|
-
/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
377
|
+
/* @__PURE__ */ y("div", {
|
|
373
378
|
className: "flex items-center gap-2",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ v("span", {
|
|
375
380
|
className: "font-semibold",
|
|
376
381
|
children: Y("security.secretDetail.history.versionLabel", "Version {version}", { version: e.version })
|
|
377
|
-
}), e.version ===
|
|
382
|
+
}), e.version === L.version && /* @__PURE__ */ v(i, {
|
|
378
383
|
variant: "success",
|
|
379
384
|
className: "text-[10px] uppercase",
|
|
380
385
|
children: Y("security.common.status.active", "Active")
|
|
381
386
|
})]
|
|
382
387
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ v("p", {
|
|
384
389
|
className: "text-xs text-muted-foreground mt-1",
|
|
385
390
|
children: Y("security.secretDetail.history.versionMeta", "{date} by {createdBy}", {
|
|
386
391
|
date: new Date(e.createdAt).toLocaleString(),
|
|
387
392
|
createdBy: e.createdBy
|
|
388
393
|
})
|
|
389
394
|
}),
|
|
390
|
-
e.changeReason && /* @__PURE__ */
|
|
395
|
+
e.changeReason && /* @__PURE__ */ v("p", {
|
|
391
396
|
className: "text-sm mt-2",
|
|
392
397
|
children: e.changeReason
|
|
393
398
|
})
|
|
394
|
-
] }), e.version !==
|
|
399
|
+
] }), e.version !== L.version && /* @__PURE__ */ v(u, {
|
|
395
400
|
permission: "secret:update",
|
|
396
401
|
featureFlagKey: t.SECRET_ROLLBACK,
|
|
397
402
|
featureFlagDefault: !1,
|
|
398
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ v(a, {
|
|
399
404
|
variant: "outline",
|
|
400
405
|
size: "sm",
|
|
401
|
-
onClick: () =>
|
|
402
|
-
disabled:
|
|
406
|
+
onClick: () => ze(e.version),
|
|
407
|
+
disabled: Oe,
|
|
403
408
|
children: Y("security.secretDetail.actions.rollback", "Rollback")
|
|
404
409
|
})
|
|
405
410
|
})]
|
|
@@ -409,51 +414,51 @@ function E() {
|
|
|
409
414
|
})]
|
|
410
415
|
})]
|
|
411
416
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
isOpen:
|
|
414
|
-
onClose: () =>
|
|
417
|
+
/* @__PURE__ */ v(c, {
|
|
418
|
+
isOpen: Me,
|
|
419
|
+
onClose: () => V(!1),
|
|
415
420
|
onConfirm: Z,
|
|
416
421
|
title: Y("security.secretDetail.delete.title", "Delete Secret"),
|
|
417
|
-
description: Y("security.secretDetail.delete.description", "Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.", { name:
|
|
418
|
-
confirmLabel:
|
|
422
|
+
description: Y("security.secretDetail.delete.description", "Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.", { name: L.name }),
|
|
423
|
+
confirmLabel: Te ? Y("security.secretDetail.delete.deleting", "Deleting...") : Y("security.secretDetail.delete.confirm", "Delete Secret"),
|
|
419
424
|
variant: "destructive"
|
|
420
425
|
}),
|
|
421
|
-
|
|
426
|
+
Pe && /* @__PURE__ */ y("div", {
|
|
422
427
|
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ v("button", {
|
|
424
429
|
type: "button",
|
|
425
430
|
"aria-label": "Close rotate dialog",
|
|
426
431
|
className: "absolute inset-0 bg-background/80 backdrop-blur-sm animate-in fade-in duration-200 cursor-default",
|
|
427
|
-
onClick: () =>
|
|
428
|
-
}), /* @__PURE__ */
|
|
432
|
+
onClick: () => U(!1)
|
|
433
|
+
}), /* @__PURE__ */ v(o, {
|
|
429
434
|
className: "relative z-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-200 border-primary/20",
|
|
430
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ y("div", {
|
|
431
436
|
className: "p-6 space-y-4",
|
|
432
437
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ y("div", {
|
|
434
439
|
className: "flex items-center gap-3",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ v("div", {
|
|
436
441
|
className: "p-2 rounded-full bg-primary/10 text-primary",
|
|
437
|
-
children: /* @__PURE__ */
|
|
438
|
-
}), /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ v(C, { className: "size-5" })
|
|
443
|
+
}), /* @__PURE__ */ v("h2", {
|
|
439
444
|
className: "text-xl font-bold text-foreground",
|
|
440
445
|
children: Y("security.secretDetail.rotate.title", "Rotate Secret")
|
|
441
446
|
})]
|
|
442
447
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ v("p", {
|
|
444
449
|
className: "text-sm text-muted-foreground",
|
|
445
|
-
children: Y("security.secretDetail.rotate.description", "Enter a new value for {name}. The current value will be moved to version history.", { name:
|
|
450
|
+
children: Y("security.secretDetail.rotate.description", "Enter a new value for {name}. The current value will be moved to version history.", { name: L.name })
|
|
446
451
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ y("div", {
|
|
448
453
|
className: "space-y-2",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ v("label", {
|
|
450
455
|
htmlFor: "new-secret-value",
|
|
451
456
|
className: "text-sm font-medium",
|
|
452
457
|
children: Y("security.secretDetail.rotate.newValue", "New Secret Value")
|
|
453
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ v("textarea", {
|
|
454
459
|
id: "new-secret-value",
|
|
455
460
|
"aria-label": Y("security.secretDetail.rotate.newValue", "New Secret Value"),
|
|
456
|
-
ref:
|
|
461
|
+
ref: W,
|
|
457
462
|
value: q,
|
|
458
463
|
onChange: (e) => J(e.target.value),
|
|
459
464
|
placeholder: Y("security.secretDetail.rotate.placeholder", "Enter new secret value..."),
|
|
@@ -461,27 +466,34 @@ function E() {
|
|
|
461
466
|
className: n("w-full rounded-md border border-border bg-background px-3 py-2 text-sm font-mono transition-all", "focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary", "placeholder:text-muted-foreground/50")
|
|
462
467
|
})]
|
|
463
468
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ y("div", {
|
|
465
470
|
className: "flex justify-end gap-3 pt-2",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ v(a, {
|
|
467
472
|
variant: "outline",
|
|
468
|
-
onClick: () =>
|
|
469
|
-
disabled:
|
|
473
|
+
onClick: () => U(!1),
|
|
474
|
+
disabled: z,
|
|
470
475
|
children: Y("security.common.actions.cancel", "Cancel")
|
|
471
|
-
}), /* @__PURE__ */
|
|
472
|
-
onClick:
|
|
473
|
-
disabled:
|
|
474
|
-
children: [
|
|
476
|
+
}), /* @__PURE__ */ y(a, {
|
|
477
|
+
onClick: Re,
|
|
478
|
+
disabled: z || !q.trim(),
|
|
479
|
+
children: [z ? /* @__PURE__ */ v(S, { className: "size-4 animate-spin" }) : /* @__PURE__ */ v(C, { className: "size-4" }), z ? Y("security.secretDetail.rotate.loading", "Rotating...") : Y("security.secretDetail.rotate.confirm", "Rotate Secret")]
|
|
475
480
|
})]
|
|
476
481
|
})
|
|
477
482
|
]
|
|
478
483
|
})
|
|
479
484
|
})]
|
|
485
|
+
}),
|
|
486
|
+
D && O && /* @__PURE__ */ v(m, {
|
|
487
|
+
isOpen: Ne,
|
|
488
|
+
onClose: () => H(!1),
|
|
489
|
+
vaultId: D,
|
|
490
|
+
secretId: O,
|
|
491
|
+
name: L.name
|
|
480
492
|
})
|
|
481
493
|
]
|
|
482
494
|
});
|
|
483
495
|
}
|
|
484
496
|
//#endregion
|
|
485
|
-
export {
|
|
497
|
+
export { D as SecretDetailPage };
|
|
486
498
|
|
|
487
499
|
//# sourceMappingURL=SecretDetailPage.js.map
|