@burdenoff/microfe-security 2026.1105.2 → 2026.1109.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/dev/Dashboard.d.ts +4 -0
- package/dist/dev/SecurityApp.d.ts +10 -0
- package/dist/dev/main.d.ts +0 -0
- package/dist/dev/useDarkMode.d.ts +7 -0
- package/dist/generated/global-operations.d.ts +1 -0
- package/dist/generated/global-types.d.ts +27686 -0
- package/dist/generated/wspace-operations.d.ts +1948 -0
- package/dist/generated/wspace-operations.js +102 -103
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +147604 -0
- package/dist/generated/wspace-types.js +1 -2
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/security/SecurityAdminRoot.d.ts +17 -0
- package/dist/security/SecurityAdminRoot.js +10 -8
- package/dist/security/SecurityAdminRoot.js.map +1 -1
- package/dist/security/SecurityRoot.d.ts +16 -0
- package/dist/security/SecurityRoot.js +10 -8
- package/dist/security/SecurityRoot.js.map +1 -1
- package/dist/security/SecurityRootBase.d.ts +17 -0
- package/dist/security/SecurityRootBase.js +9 -10
- package/dist/security/SecurityRootBase.js.map +1 -1
- package/dist/security/SecurityUserRoot.d.ts +16 -0
- package/dist/security/SecurityUserRoot.js +10 -8
- package/dist/security/SecurityUserRoot.js.map +1 -1
- package/dist/security/components/ActivityTimeline.d.ts +10 -0
- package/dist/security/components/ActivityTimeline.js +14 -15
- package/dist/security/components/ActivityTimeline.js.map +1 -1
- package/dist/security/components/BulkActionBar.d.ts +7 -0
- package/dist/security/components/BulkActionBar.js +18 -19
- package/dist/security/components/BulkActionBar.js.map +1 -1
- package/dist/security/components/ConfirmDialog.d.ts +17 -0
- package/dist/security/components/ConfirmDialog.js +5 -6
- package/dist/security/components/ConfirmDialog.js.map +1 -1
- package/dist/security/components/CopyButton.d.ts +18 -0
- package/dist/security/components/CopyButton.js +30 -29
- package/dist/security/components/CopyButton.js.map +1 -1
- package/dist/security/components/ExportDialog.d.ts +5 -0
- package/dist/security/components/ExportDialog.js +22 -22
- package/dist/security/components/ExportDialog.js.map +1 -1
- package/dist/security/components/ExternalSecretProviders.d.ts +16 -0
- package/dist/security/components/ExternalSecretProviders.js +72 -73
- package/dist/security/components/ExternalSecretProviders.js.map +1 -1
- package/dist/security/components/ImportWizard.d.ts +5 -0
- package/dist/security/components/ImportWizard.js +28 -29
- package/dist/security/components/ImportWizard.js.map +1 -1
- package/dist/security/components/PageLayout.d.ts +32 -0
- package/dist/security/components/PageLayout.js +1 -2
- package/dist/security/components/PageLayout.js.map +1 -1
- package/dist/security/components/PasswordGenerator.d.ts +15 -0
- package/dist/security/components/PasswordGenerator.js +14 -15
- package/dist/security/components/PasswordGenerator.js.map +1 -1
- package/dist/security/components/RotationStatusBadge.d.ts +11 -0
- package/dist/security/components/RotationStatusBadge.js +5 -6
- package/dist/security/components/RotationStatusBadge.js.map +1 -1
- package/dist/security/components/SecretFormFields.d.ts +21 -0
- package/dist/security/components/SecretFormFields.js +40 -41
- package/dist/security/components/SecretFormFields.js.map +1 -1
- package/dist/security/components/SecretRow.d.ts +11 -0
- package/dist/security/components/SecretRow.js +14 -15
- package/dist/security/components/SecretRow.js.map +1 -1
- package/dist/security/components/SecretShareDialog.d.ts +19 -0
- package/dist/security/components/SecretShareDialog.js +106 -107
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecretTypeBadge.d.ts +11 -0
- package/dist/security/components/SecretTypeBadge.js +7 -8
- package/dist/security/components/SecretTypeBadge.js.map +1 -1
- package/dist/security/components/SecretTypeIcon.d.ts +12 -0
- package/dist/security/components/SecretTypeIcon.js +6 -7
- package/dist/security/components/SecretTypeIcon.js.map +1 -1
- package/dist/security/components/SecretValueDisplay.d.ts +24 -0
- package/dist/security/components/SecretValueDisplay.js +9 -10
- package/dist/security/components/SecretValueDisplay.js.map +1 -1
- package/dist/security/components/SecurityPermissionGuard.d.ts +14 -0
- package/dist/security/components/SecurityPermissionGuard.js +1 -2
- package/dist/security/components/SecurityPermissionGuard.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.d.ts +12 -0
- package/dist/security/components/SecurityScoreCard.js +14 -15
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultCard.d.ts +11 -0
- package/dist/security/components/VaultCard.js +8 -9
- package/dist/security/components/VaultCard.js.map +1 -1
- package/dist/security/components/VaultFormFields.d.ts +15 -0
- package/dist/security/components/VaultFormFields.js +8 -9
- package/dist/security/components/VaultFormFields.js.map +1 -1
- package/dist/security/components/VaultShareDialog.d.ts +14 -0
- package/dist/security/components/VaultShareDialog.js +12 -13
- package/dist/security/components/VaultShareDialog.js.map +1 -1
- package/dist/security/components/ui.d.ts +53 -0
- package/dist/security/components/ui.js +1 -2
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/config/navigation.d.ts +12 -0
- package/dist/security/config/navigation.js +1 -2
- package/dist/security/config/navigation.js.map +1 -1
- package/dist/security/constants/externalSecretProviders.d.ts +41 -0
- package/dist/security/constants/externalSecretProviders.js +1 -2
- package/dist/security/constants/externalSecretProviders.js.map +1 -1
- package/dist/security/constants/featureFlags.d.ts +39 -0
- package/dist/security/constants/featureFlags.js +1 -2
- package/dist/security/constants/featureFlags.js.map +1 -1
- package/dist/security/constants/permissions.d.ts +9 -0
- package/dist/security/constants/permissions.js +1 -2
- package/dist/security/constants/permissions.js.map +1 -1
- package/dist/security/constants/providers.d.ts +11 -0
- package/dist/security/constants/providers.js +1 -2
- package/dist/security/constants/providers.js.map +1 -1
- package/dist/security/constants/secretTypes.d.ts +16 -0
- package/dist/security/constants/secretTypes.js +1 -2
- package/dist/security/constants/secretTypes.js.map +1 -1
- package/dist/security/hooks/useAuditLog.d.ts +16 -0
- package/dist/security/hooks/useAuditLog.js +1 -2
- package/dist/security/hooks/useAuditLog.js.map +1 -1
- package/dist/security/hooks/useBulkSecretOperations.d.ts +6 -0
- package/dist/security/hooks/useBulkSecretOperations.js +1 -2
- package/dist/security/hooks/useBulkSecretOperations.js.map +1 -1
- package/dist/security/hooks/useImportExport.d.ts +53 -0
- package/dist/security/hooks/useImportExport.js +3 -4
- package/dist/security/hooks/useImportExport.js.map +1 -1
- package/dist/security/hooks/useProviderQueries.d.ts +9 -0
- package/dist/security/hooks/useProviderQueries.js +1 -2
- package/dist/security/hooks/useProviderQueries.js.map +1 -1
- package/dist/security/hooks/useSecretQueries.d.ts +7 -0
- package/dist/security/hooks/useSecretQueries.js +1 -2
- package/dist/security/hooks/useSecretQueries.js.map +1 -1
- package/dist/security/hooks/useSecretValue.d.ts +11 -0
- package/dist/security/hooks/useSecretValue.js +1 -2
- package/dist/security/hooks/useSecretValue.js.map +1 -1
- package/dist/security/hooks/useSecurityCacheInvalidation.d.ts +1 -0
- package/dist/security/hooks/useSecurityCacheInvalidation.js +1 -2
- package/dist/security/hooks/useSecurityCacheInvalidation.js.map +1 -1
- package/dist/security/hooks/useSecurityDashboard.d.ts +20 -0
- package/dist/security/hooks/useSecurityDashboard.js +1 -2
- package/dist/security/hooks/useSecurityDashboard.js.map +1 -1
- package/dist/security/hooks/useSecurityEventEmitter.d.ts +13 -0
- package/dist/security/hooks/useSecurityEventEmitter.js +1 -2
- package/dist/security/hooks/useSecurityEventEmitter.js.map +1 -1
- package/dist/security/hooks/useSecuritySubscriptions.d.ts +5 -0
- package/dist/security/hooks/useSecuritySubscriptions.js +1 -2
- package/dist/security/hooks/useSecuritySubscriptions.js.map +1 -1
- package/dist/security/hooks/useShareQueries.d.ts +13 -0
- package/dist/security/hooks/useShareQueries.js +1 -2
- package/dist/security/hooks/useShareQueries.js.map +1 -1
- package/dist/security/hooks/useTr.d.ts +16 -0
- package/dist/security/hooks/useTr.js +1 -2
- package/dist/security/hooks/useTr.js.map +1 -1
- package/dist/security/hooks/useVaultQueries.d.ts +12 -0
- package/dist/security/hooks/useVaultQueries.js +1 -2
- package/dist/security/hooks/useVaultQueries.js.map +1 -1
- package/dist/security/index.d.ts +32 -0
- package/dist/security/index.js +8 -7
- package/dist/security/pages/AccessReviewPage.d.ts +1 -0
- package/dist/security/pages/AccessReviewPage.js +31 -29
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.d.ts +1 -0
- package/dist/security/pages/AuditLogPage.js +16 -17
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ImportExportPage.d.ts +1 -0
- package/dist/security/pages/ImportExportPage.js +10 -11
- package/dist/security/pages/ImportExportPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.d.ts +1 -0
- package/dist/security/pages/ProviderDetailPage.js +82 -87
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.d.ts +1 -0
- package/dist/security/pages/ProvidersPage.js +20 -21
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.d.ts +1 -0
- package/dist/security/pages/SecretCreatePage.js +45 -50
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.d.ts +1 -0
- package/dist/security/pages/SecretDetailPage.js +52 -57
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.d.ts +1 -0
- package/dist/security/pages/SecurityDashboardPage.js +13 -14
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.d.ts +1 -0
- package/dist/security/pages/SharedWithMePage.js +32 -33
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultCreatePage.d.ts +1 -0
- package/dist/security/pages/VaultCreatePage.js +36 -38
- package/dist/security/pages/VaultCreatePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.d.ts +1 -0
- package/dist/security/pages/VaultDetailPage.js +81 -86
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultLandingPage.d.ts +9 -0
- package/dist/security/pages/VaultLandingPage.js +4 -5
- package/dist/security/pages/VaultLandingPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.d.ts +1 -0
- package/dist/security/pages/VaultSettingsPage.js +37 -42
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.d.ts +18 -0
- package/dist/security/pages/VaultShareViewer.js +17 -18
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.d.ts +1 -0
- package/dist/security/pages/VaultsDashboardPage.js +147 -148
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/dist/security/providers/SecurityProvider.d.ts +11 -0
- package/dist/security/providers/SecurityProvider.js +26 -29
- package/dist/security/providers/SecurityProvider.js.map +1 -1
- package/dist/security/routes/SecurityAdminRoutes.d.ts +6 -0
- package/dist/security/routes/SecurityAdminRoutes.js +1 -2
- package/dist/security/routes/SecurityAdminRoutes.js.map +1 -1
- package/dist/security/routes/SecurityRoutes.d.ts +18 -0
- package/dist/security/routes/SecurityRoutes.js +1 -2
- package/dist/security/routes/SecurityRoutes.js.map +1 -1
- package/dist/security/routes/SecurityUserRoutes.d.ts +10 -0
- package/dist/security/routes/SecurityUserRoutes.js +10 -11
- package/dist/security/routes/SecurityUserRoutes.js.map +1 -1
- package/dist/security/routes/routeUtils.d.ts +26 -0
- package/dist/security/routes/routeUtils.js +1 -2
- package/dist/security/routes/routeUtils.js.map +1 -1
- package/dist/security/store/securityStore.d.ts +33 -0
- package/dist/security/store/securityStore.js +1 -2
- package/dist/security/store/securityStore.js.map +1 -1
- package/dist/security/translations/en.d.ts +842 -0
- package/dist/security/translations/en.js +1 -2
- package/dist/security/translations/en.js.map +1 -1
- package/dist/security/translations/index.d.ts +1 -0
- package/dist/security/types/index.d.ts +282 -0
- package/dist/security/utils/clipboard.d.ts +11 -0
- package/dist/security/utils/clipboard.js +1 -2
- package/dist/security/utils/clipboard.js.map +1 -1
- package/dist/security/utils/cn.d.ts +5 -0
- package/dist/security/utils/cn.js +2 -3
- package/dist/security/utils/cn.js.map +1 -1
- package/dist/security/utils/fileParser.d.ts +17 -0
- package/dist/security/utils/fileParser.js +2 -11
- package/dist/security/utils/fileParser.js.map +1 -1
- package/dist/security/utils/i18n.d.ts +11 -0
- package/dist/security/utils/passwordGenerator.d.ts +21 -0
- package/dist/security/utils/passwordGenerator.js +1 -2
- package/dist/security/utils/passwordGenerator.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +62 -46
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useSecurityEventEmitter as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
import { PageLayout as e } from "../components/PageLayout.js";
|
|
2
|
+
import { SecretValueDisplay as ee } from "../components/SecretValueDisplay.js";
|
|
3
|
+
import { SecretTypeBadge as te } from "../components/SecretTypeBadge.js";
|
|
4
|
+
import { RotationStatusBadge as ne } from "../components/RotationStatusBadge.js";
|
|
5
|
+
import { ConfirmDialog as re } from "../components/ConfirmDialog.js";
|
|
6
|
+
import { SecretShareDialog as ie } from "../components/SecretShareDialog.js";
|
|
7
|
+
import { Badge as t, Button as n, Card as r } from "../components/ui.js";
|
|
8
|
+
import { useDeleteSecret as i, useGetSecret as a, useRollbackSecret as ae, useRotateSecret as oe } from "../hooks/useSecretQueries.js";
|
|
9
|
+
import { useSecurityEventEmitter as se } from "../hooks/useSecurityEventEmitter.js";
|
|
10
|
+
import { useGetSecretVersionsQuery as ce } from "../../generated/wspace-operations.js";
|
|
11
|
+
import { useSecretValue as le } from "../hooks/useSecretValue.js";
|
|
12
|
+
import { useSecurity as ue } from "../providers/SecurityProvider.js";
|
|
13
|
+
import { SecurityPermissionGuard as de } from "../components/SecurityPermissionGuard.js";
|
|
14
|
+
import { cn as o } from "../utils/cn.js";
|
|
15
|
+
import { useTr as fe } from "../hooks/useTr.js";
|
|
16
|
+
import { nativeConfirm as pe, nativeImpact as s, nativeNotify as c } from "../../utils/nativeBridge.js";
|
|
17
|
+
import { SECURITY_FEATURE_FLAGS as l } from "../constants/featureFlags.js";
|
|
18
18
|
import { useRef as me, useState as u } from "react";
|
|
19
19
|
import { useFeatureFlag as he, usePermission as d } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
20
20
|
import { useNavigate as ge, useParams as _e } from "react-router";
|
|
21
21
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
22
22
|
import { AlertTriangle as ve, ArrowLeft as m, Calendar as h, Clock as ye, History as g, KeyRound as _, Loader2 as v, RefreshCw as y, Share2 as b, Shield as be, Trash2 as xe } from "lucide-react";
|
|
23
23
|
import { CTAOverflowMenu as Se, Dialog as x, DialogContent as S, DialogHeader as C, DialogTitle as w, GlassCard as T, NextSteps as Ce, PagePurpose as we } from "@burdenoff/fe-libs/ui";
|
|
24
|
-
|
|
24
|
+
// src/security/pages/SecretDetailPage.tsx
|
|
25
25
|
function E() {
|
|
26
|
-
let { vaultId: E, secretId: D } = _e(), { basePath: O = "/", navigate: k } =
|
|
26
|
+
let { vaultId: E, secretId: D } = _e(), { basePath: O = "/", navigate: k } = ue(), Te = ge(), A = fe(), { data: Ee, loading: De, error: j, refetch: M } = a(D ?? null), N = Ee?.getSecret, { data: P, loading: Oe } = ce({
|
|
27
27
|
variables: {
|
|
28
28
|
secretId: D ?? "",
|
|
29
29
|
pagination: { limit: 50 }
|
|
30
30
|
},
|
|
31
31
|
skip: !D,
|
|
32
32
|
fetchPolicy: "network-only"
|
|
33
|
-
}), ke = P?.getSecretVersionsPaginated?.items ?? [], { value: Ae, reveal: F, hide: je, loading: Me, isRevealed: I } =
|
|
33
|
+
}), ke = P?.getSecretVersionsPaginated?.items ?? [], { value: Ae, reveal: F, hide: je, loading: Me, isRevealed: I } = le(D ?? ""), [Ne, { loading: Pe }] = i(), [Fe, { loading: L }] = oe(), [Ie, { loading: Le }] = ae(), { emit: R } = se(), Re = d("secret:delete"), z = d("secret:update"), B = d("secret:decrypt"), V = he(l.SECRET_ROTATE, !1), [ze, H] = u(!1), [Be, U] = u(!1), [Ve, W] = u(!1), G = me(null), K = () => {
|
|
34
34
|
W(!0), requestAnimationFrame(() => G.current?.focus());
|
|
35
35
|
}, [He, q] = u(!1), [J, Y] = u(""), Ue = (e) => {
|
|
36
36
|
k ? k(e) : Te(e);
|
|
@@ -41,25 +41,21 @@ function E() {
|
|
|
41
41
|
await Ne({ variables: { id: D } }), R("secret.deleted", {
|
|
42
42
|
secretId: D,
|
|
43
43
|
vaultId: E
|
|
44
|
-
}), H(!1),
|
|
44
|
+
}), H(!1), c("success"), X();
|
|
45
45
|
} catch (e) {
|
|
46
|
-
console.error("Failed to delete secret:", e),
|
|
46
|
+
console.error("Failed to delete secret:", e), c("error");
|
|
47
47
|
}
|
|
48
48
|
}, We = async () => {
|
|
49
|
-
|
|
50
|
-
let e = await
|
|
49
|
+
s("medium");
|
|
50
|
+
let e = await pe({
|
|
51
51
|
title: "Delete Secret",
|
|
52
52
|
message: "Delete this secret? This cannot be undone.",
|
|
53
53
|
okButtonTitle: "Delete",
|
|
54
54
|
cancelButtonTitle: "Cancel"
|
|
55
55
|
});
|
|
56
|
-
|
|
57
|
-
H(!0);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
e && await Z();
|
|
56
|
+
e === null ? H(!0) : e && await Z();
|
|
61
57
|
}, Ge = async () => {
|
|
62
|
-
if (
|
|
58
|
+
if (D && J.trim()) try {
|
|
63
59
|
await Fe({ variables: {
|
|
64
60
|
id: D,
|
|
65
61
|
newValue: J.trim()
|
|
@@ -83,7 +79,7 @@ function E() {
|
|
|
83
79
|
console.error("Failed to rollback secret:", e);
|
|
84
80
|
}
|
|
85
81
|
};
|
|
86
|
-
if (De && !N) return /* @__PURE__ */ f(
|
|
82
|
+
if (De && !N) return /* @__PURE__ */ f(e, {
|
|
87
83
|
title: A("security.secretDetail.loading.title", "Loading Secret..."),
|
|
88
84
|
breadcrumbs: [{
|
|
89
85
|
label: A("security.common.breadcrumbs.security", "Security"),
|
|
@@ -94,13 +90,13 @@ function E() {
|
|
|
94
90
|
children: /* @__PURE__ */ f(v, { className: "size-10 animate-spin text-primary/60" })
|
|
95
91
|
})
|
|
96
92
|
});
|
|
97
|
-
if (j || !N) return /* @__PURE__ */ f(
|
|
93
|
+
if (j || !N) return /* @__PURE__ */ f(e, {
|
|
98
94
|
title: A("security.common.errorPage.title", "Error"),
|
|
99
95
|
breadcrumbs: [{
|
|
100
96
|
label: A("security.common.breadcrumbs.security", "Security"),
|
|
101
97
|
path: O
|
|
102
98
|
}, { label: A("security.common.breadcrumbs.secret", "Secret") }],
|
|
103
|
-
children: /* @__PURE__ */ f(
|
|
99
|
+
children: /* @__PURE__ */ f(r, {
|
|
104
100
|
className: "p-8 text-center max-w-lg mx-auto mt-10",
|
|
105
101
|
children: /* @__PURE__ */ p("div", {
|
|
106
102
|
className: "flex flex-col items-center gap-4",
|
|
@@ -116,7 +112,7 @@ function E() {
|
|
|
116
112
|
className: "text-sm text-text-secondary mt-2",
|
|
117
113
|
children: j?.message ?? A("security.secretDetail.error.description", "Secret not found or access denied.")
|
|
118
114
|
})] }),
|
|
119
|
-
/* @__PURE__ */ p(
|
|
115
|
+
/* @__PURE__ */ p(n, {
|
|
120
116
|
variant: "outline",
|
|
121
117
|
onClick: X,
|
|
122
118
|
className: "mt-4",
|
|
@@ -127,7 +123,7 @@ function E() {
|
|
|
127
123
|
})
|
|
128
124
|
});
|
|
129
125
|
let Q = N.versionCount ?? 0, $ = N.lastRotatedAt ? "healthy" : void 0;
|
|
130
|
-
return /* @__PURE__ */ p(
|
|
126
|
+
return /* @__PURE__ */ p(e, {
|
|
131
127
|
title: N.name,
|
|
132
128
|
description: N.description ?? A("security.secretDetail.description", "View and manage this secret."),
|
|
133
129
|
breadcrumbs: [
|
|
@@ -158,7 +154,7 @@ function E() {
|
|
|
158
154
|
onSelect: () => void We()
|
|
159
155
|
}), /* @__PURE__ */ p("div", {
|
|
160
156
|
className: "flex flex-wrap items-center gap-2",
|
|
161
|
-
children: [/* @__PURE__ */ p(
|
|
157
|
+
children: [/* @__PURE__ */ p(n, {
|
|
162
158
|
variant: "outline",
|
|
163
159
|
size: "sm",
|
|
164
160
|
onClick: X,
|
|
@@ -214,14 +210,14 @@ function E() {
|
|
|
214
210
|
/* @__PURE__ */ p("div", {
|
|
215
211
|
className: "flex flex-wrap items-center gap-3",
|
|
216
212
|
children: [
|
|
217
|
-
/* @__PURE__ */ f(
|
|
218
|
-
$ && /* @__PURE__ */ f(
|
|
219
|
-
/* @__PURE__ */ f(
|
|
213
|
+
/* @__PURE__ */ f(te, { type: N.type }),
|
|
214
|
+
$ && /* @__PURE__ */ f(ne, { status: $ }),
|
|
215
|
+
/* @__PURE__ */ f(t, {
|
|
220
216
|
variant: "outline",
|
|
221
217
|
className: "bg-bg-surface/50",
|
|
222
218
|
children: A("security.secretDetail.status.label", "Status: {{status}}", { status: N.status })
|
|
223
219
|
}),
|
|
224
|
-
N.labels?.map((e) => /* @__PURE__ */ f(
|
|
220
|
+
N.labels?.map((e) => /* @__PURE__ */ f(t, {
|
|
225
221
|
variant: "outline",
|
|
226
222
|
className: "border-primary/20 text-primary",
|
|
227
223
|
children: e.label
|
|
@@ -247,7 +243,7 @@ function E() {
|
|
|
247
243
|
children: [/* @__PURE__ */ f(h, { className: "size-3.5" }), A("security.secretDetail.value.expires", "Expires: {{date}}", { date: new Date(N.expiresAt).toLocaleDateString() })]
|
|
248
244
|
})]
|
|
249
245
|
}),
|
|
250
|
-
/* @__PURE__ */ f(
|
|
246
|
+
/* @__PURE__ */ f(ee, {
|
|
251
247
|
value: Ae ?? "",
|
|
252
248
|
isRevealed: I,
|
|
253
249
|
onToggleReveal: B ? () => {
|
|
@@ -260,14 +256,14 @@ function E() {
|
|
|
260
256
|
children: A("security.secretDetail.value.note", "Secret values are decrypted on-demand and never stored in plain text.")
|
|
261
257
|
})
|
|
262
258
|
]
|
|
263
|
-
}), /* @__PURE__ */ p(
|
|
259
|
+
}), /* @__PURE__ */ p(r, {
|
|
264
260
|
className: "p-6 shadow-sm border-border-subtle/60",
|
|
265
261
|
children: [/* @__PURE__ */ p("div", {
|
|
266
262
|
className: "flex items-center justify-between mb-6",
|
|
267
263
|
children: [/* @__PURE__ */ p("h2", {
|
|
268
264
|
className: "text-lg font-bold text-text-primary flex items-center gap-2",
|
|
269
265
|
children: [/* @__PURE__ */ f(g, { className: "size-5 text-primary" }), A("security.secretDetail.history.title", "Version History")]
|
|
270
|
-
}), /* @__PURE__ */ f(
|
|
266
|
+
}), /* @__PURE__ */ f(t, {
|
|
271
267
|
variant: "outline",
|
|
272
268
|
className: "bg-bg-sunken font-mono",
|
|
273
269
|
children: A("security.secretDetail.history.totalVersions", "{{count}} total versions", { count: Q })
|
|
@@ -288,7 +284,7 @@ function E() {
|
|
|
288
284
|
className: "text-xs text-text-secondary",
|
|
289
285
|
children: A("security.secretDetail.history.lastUpdated", "Last updated {{date}}", { date: new Date(N.updatedAt).toLocaleString() })
|
|
290
286
|
})] })]
|
|
291
|
-
}), /* @__PURE__ */ f(
|
|
287
|
+
}), /* @__PURE__ */ f(t, {
|
|
292
288
|
variant: "success",
|
|
293
289
|
className: "text-[10px] uppercase",
|
|
294
290
|
children: A("security.common.status.active", "Active")
|
|
@@ -298,7 +294,7 @@ function E() {
|
|
|
298
294
|
children: [/* @__PURE__ */ f("p", {
|
|
299
295
|
className: "text-sm text-text-secondary",
|
|
300
296
|
children: A("security.secretDetail.history.available", "Historical versions are available. You can rollback to a previous state if needed.")
|
|
301
|
-
}), /* @__PURE__ */ f(
|
|
297
|
+
}), /* @__PURE__ */ f(n, {
|
|
302
298
|
variant: "outline",
|
|
303
299
|
size: "sm",
|
|
304
300
|
className: "mt-3",
|
|
@@ -310,7 +306,7 @@ function E() {
|
|
|
310
306
|
})]
|
|
311
307
|
}), /* @__PURE__ */ p("div", {
|
|
312
308
|
className: "space-y-6",
|
|
313
|
-
children: [/* @__PURE__ */ p(
|
|
309
|
+
children: [/* @__PURE__ */ p(r, {
|
|
314
310
|
className: "p-6 shadow-sm border-border-subtle/60 space-y-4",
|
|
315
311
|
children: [/* @__PURE__ */ f("h3", {
|
|
316
312
|
className: "font-bold text-sm uppercase tracking-wider text-text-secondary",
|
|
@@ -390,7 +386,7 @@ function E() {
|
|
|
390
386
|
}) : /* @__PURE__ */ f("div", {
|
|
391
387
|
className: "space-y-4",
|
|
392
388
|
children: ke.map((e) => /* @__PURE__ */ f("div", {
|
|
393
|
-
className:
|
|
389
|
+
className: o("p-4 rounded-lg border", e.version === N.version ? "bg-action-primary-bg/5 border-primary/20" : "bg-bg-surface border-border-subtle"),
|
|
394
390
|
children: /* @__PURE__ */ p("div", {
|
|
395
391
|
className: "flex items-center justify-between",
|
|
396
392
|
children: [/* @__PURE__ */ p("div", { children: [
|
|
@@ -399,7 +395,7 @@ function E() {
|
|
|
399
395
|
children: [/* @__PURE__ */ f("span", {
|
|
400
396
|
className: "font-semibold",
|
|
401
397
|
children: A("security.secretDetail.history.versionLabel", "Version {{version}}", { version: e.version })
|
|
402
|
-
}), e.version === N.version && /* @__PURE__ */ f(
|
|
398
|
+
}), e.version === N.version && /* @__PURE__ */ f(t, {
|
|
403
399
|
variant: "success",
|
|
404
400
|
className: "text-[10px] uppercase",
|
|
405
401
|
children: A("security.common.status.active", "Active")
|
|
@@ -416,11 +412,11 @@ function E() {
|
|
|
416
412
|
className: "text-sm mt-2",
|
|
417
413
|
children: e.changeReason
|
|
418
414
|
})
|
|
419
|
-
] }), e.version !== N.version && /* @__PURE__ */ f(
|
|
415
|
+
] }), e.version !== N.version && /* @__PURE__ */ f(de, {
|
|
420
416
|
permission: "secret:update",
|
|
421
|
-
featureFlagKey:
|
|
417
|
+
featureFlagKey: l.SECRET_ROLLBACK,
|
|
422
418
|
featureFlagDefault: !1,
|
|
423
|
-
children: /* @__PURE__ */ f(
|
|
419
|
+
children: /* @__PURE__ */ f(n, {
|
|
424
420
|
variant: "outline",
|
|
425
421
|
size: "sm",
|
|
426
422
|
onClick: () => Ke(e.version),
|
|
@@ -434,7 +430,7 @@ function E() {
|
|
|
434
430
|
})]
|
|
435
431
|
})
|
|
436
432
|
}),
|
|
437
|
-
/* @__PURE__ */ f(
|
|
433
|
+
/* @__PURE__ */ f(re, {
|
|
438
434
|
isOpen: ze,
|
|
439
435
|
onClose: () => H(!1),
|
|
440
436
|
onConfirm: Z,
|
|
@@ -484,17 +480,17 @@ function E() {
|
|
|
484
480
|
onChange: (e) => Y(e.target.value),
|
|
485
481
|
placeholder: A("security.secretDetail.rotate.placeholder", "Enter new secret value..."),
|
|
486
482
|
rows: 4,
|
|
487
|
-
className:
|
|
483
|
+
className: o("w-full rounded-md border border-border-subtle bg-bg-surface 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-text-secondary/50")
|
|
488
484
|
})]
|
|
489
485
|
}),
|
|
490
486
|
/* @__PURE__ */ p("div", {
|
|
491
487
|
className: "flex justify-end gap-3 pt-2",
|
|
492
|
-
children: [/* @__PURE__ */ f(
|
|
488
|
+
children: [/* @__PURE__ */ f(n, {
|
|
493
489
|
variant: "outline",
|
|
494
490
|
onClick: () => W(!1),
|
|
495
491
|
disabled: L,
|
|
496
492
|
children: A("security.common.actions.cancel", "Cancel")
|
|
497
|
-
}), /* @__PURE__ */ p(
|
|
493
|
+
}), /* @__PURE__ */ p(n, {
|
|
498
494
|
onClick: Ge,
|
|
499
495
|
disabled: L || !J.trim(),
|
|
500
496
|
children: [L ? /* @__PURE__ */ f(v, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(y, { className: "size-4" }), L ? A("security.secretDetail.rotate.loading", "Rotating...") : A("security.secretDetail.rotate.confirm", "Rotate Secret")]
|
|
@@ -504,7 +500,7 @@ function E() {
|
|
|
504
500
|
})
|
|
505
501
|
})
|
|
506
502
|
}),
|
|
507
|
-
E && D && /* @__PURE__ */ f(
|
|
503
|
+
E && D && /* @__PURE__ */ f(ie, {
|
|
508
504
|
isOpen: Be,
|
|
509
505
|
onClose: () => U(!1),
|
|
510
506
|
vaultId: E,
|
|
@@ -514,7 +510,6 @@ function E() {
|
|
|
514
510
|
]
|
|
515
511
|
});
|
|
516
512
|
}
|
|
517
|
-
//#endregion
|
|
518
513
|
export { E as SecretDetailPage };
|
|
519
514
|
|
|
520
515
|
//# sourceMappingURL=SecretDetailPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretDetailPage.js","names":[],"sources":["../../../src/security/pages/SecretDetailPage.tsx"],"sourcesContent":["import { useState, useRef } from 'react';\nimport { useParams, useNavigate } from 'react-router';\nimport {\n ArrowLeft,\n Edit2,\n Trash2,\n RefreshCw,\n History,\n Loader2,\n AlertTriangle,\n Clock,\n KeyRound,\n Shield,\n Calendar,\n Share2,\n} from 'lucide-react';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n GlassCard,\n CTAOverflowMenu,\n type CTAAction,\n PagePurpose,\n NextSteps,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecretValueDisplay } from '../components/SecretValueDisplay';\nimport { SecretTypeBadge } from '../components/SecretTypeBadge';\nimport { RotationStatusBadge } from '../components/RotationStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { SecretShareDialog } from '../components/SecretShareDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useGetSecret,\n useDeleteSecret,\n useRotateSecret,\n useRollbackSecret,\n} from '../hooks/useSecretQueries';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useGetSecretVersionsQuery } from '../../generated/wspace-operations';\nimport { useSecretValue } from '../hooks/useSecretValue';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { SecurityPermissionGuard } from '../components/SecurityPermissionGuard';\nimport { usePermission, useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { SECURITY_FEATURE_FLAGS } from '../constants/featureFlags';\nimport type { SecretType, RotationStatus } from '../types';\n\nexport function SecretDetailPage() {\n const { vaultId, secretId } = useParams<{ vaultId: string; secretId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n\n const tr = useTr();\n\n const { data: secretData, loading, error, refetch } = useGetSecret(secretId ?? null);\n const secret = secretData?.getSecret;\n\n const { data: versionsData, loading: versionsLoading } = useGetSecretVersionsQuery({\n variables: { secretId: secretId ?? '', pagination: { limit: 50 } },\n skip: !secretId,\n fetchPolicy: 'network-only',\n });\n const versions = versionsData?.getSecretVersionsPaginated?.items ?? [];\n\n const {\n value: decryptedValue,\n reveal,\n hide,\n loading: decrypting,\n isRevealed,\n } = useSecretValue(secretId ?? '');\n\n const [deleteSecret, { loading: deletingSecret }] = useDeleteSecret();\n const [rotateSecret, { loading: rotating }] = useRotateSecret();\n const [rollbackSecret, { loading: rollingBack }] = useRollbackSecret();\n const { emit } = useSecurityEventEmitter();\n\n const canDeleteSecret = usePermission('secret:delete');\n const canUpdateSecret = usePermission('secret:update');\n const canDecryptSecret = usePermission('secret:decrypt');\n const featureSecretRotate = useFeatureFlag(SECURITY_FEATURE_FLAGS.SECRET_ROTATE, false);\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n const [showShareDialog, setShowShareDialog] = useState(false);\n const [showRotatePrompt, setShowRotatePrompt] = useState(false);\n const rotateValueRef = useRef<HTMLTextAreaElement>(null);\n const openRotatePrompt = () => {\n setShowRotatePrompt(true);\n // Focus next frame so the textarea has been mounted by then.\n requestAnimationFrame(() => rotateValueRef.current?.focus());\n };\n const [showHistoryModal, setShowHistoryModal] = useState(false);\n const [newRotationValue, setNewRotationValue] = useState('');\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => {\n handleNavigate(`${basePath}/vaults/${vaultId}`);\n };\n\n const handleDelete = async () => {\n if (!secretId) return;\n try {\n await deleteSecret({ variables: { id: secretId } });\n emit('secret.deleted', { secretId, vaultId });\n setShowDeleteConfirm(false);\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Failed to delete secret:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Secret',\n message: 'Delete this secret? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n const handleRotate = async () => {\n if (!secretId || !newRotationValue.trim()) return;\n try {\n await rotateSecret({ variables: { id: secretId, newValue: newRotationValue.trim() } });\n emit('secret.rotated', { secretId, vaultId });\n setShowRotatePrompt(false);\n setNewRotationValue('');\n refetch();\n } catch (err) {\n console.error('Failed to rotate secret:', err);\n }\n };\n\n const handleRollback = async (version: number) => {\n if (!secretId) return;\n try {\n await rollbackSecret({ variables: { id: secretId, version } });\n emit('secret.rollback', { secretId, vaultId });\n refetch();\n setShowHistoryModal(false);\n } catch (err) {\n console.error('Failed to rollback secret:', err);\n }\n };\n\n if (loading && !secret) {\n return (\n <PageLayout\n title={tr('security.secretDetail.loading.title', 'Loading Secret...')}\n breadcrumbs={[\n { label: tr('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tr('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 className=\"size-10 animate-spin text-primary/60\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error || !secret) {\n return (\n <PageLayout\n title={tr('security.common.errorPage.title', 'Error')}\n breadcrumbs={[\n { label: tr('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tr('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <Card className=\"p-8 text-center max-w-lg mx-auto mt-10\">\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div>\n <h3 className=\"text-lg font-bold text-text-primary\">\n {tr('security.secretDetail.error.title', 'Failed to load secret')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-2\">\n {error?.message ??\n tr(\n 'security.secretDetail.error.description',\n 'Secret not found or access denied.'\n )}\n </p>\n </div>\n <Button variant=\"outline\" onClick={handleBack} className=\"mt-4\">\n <ArrowLeft className=\"size-4\" />\n {tr('security.secretDetail.actions.backToVault', 'Go Back to Vault')}\n </Button>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const versionCount = secret.versionCount ?? 0;\n const rotationStatus: RotationStatus | undefined = secret.lastRotatedAt ? 'healthy' : undefined;\n\n return (\n <PageLayout\n title={secret.name}\n description={\n secret.description ??\n tr('security.secretDetail.description', 'View and manage this secret.')\n }\n breadcrumbs={[\n { label: tr('security.common.breadcrumbs.security', 'Security'), path: basePath },\n {\n label: tr('security.common.breadcrumbs.vault', 'Vault'),\n path: `${basePath}/vaults/${vaultId}`,\n },\n { label: secret.name },\n ]}\n actions={(() => {\n // Boff UI 2.0: keep \"Back\" as a quiet navigation button; collapse the\n // secondary actions (share / rotate / delete) into the overflow menu.\n // Gating preserved: rotate needs secret:update + SECRET_ROTATE flag.\n const overflowActions: CTAAction[] = [];\n if (canUpdateSecret) {\n overflowActions.push({\n label: tr('security.common.actions.share', 'Share'),\n icon: <Share2 className=\"size-4\" />,\n onSelect: () => setShowShareDialog(true),\n });\n }\n if (canUpdateSecret && featureSecretRotate) {\n overflowActions.push({\n label: tr('security.secretDetail.actions.rotate', 'Rotate'),\n icon: <RefreshCw className=\"size-4\" />,\n onSelect: openRotatePrompt,\n });\n }\n if (canDeleteSecret) {\n overflowActions.push({\n label: tr('security.common.actions.delete', 'Delete'),\n icon: <Trash2 className=\"size-4\" />,\n intent: 'destructive',\n onSelect: () => void requestDelete(),\n });\n }\n return (\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">\n {tr('security.secretDetail.actions.backToVault', 'Back to Vault')}\n </span>\n <span className=\"sm:hidden\">{tr('security.common.actions.back', 'Back')}</span>\n </Button>\n <CTAOverflowMenu actions={overflowActions} />\n </div>\n );\n })()}\n >\n <div className=\"space-y-6\">\n <PagePurpose icon={<KeyRound className=\"size-4\" />}>\n {tr(\n 'security.secretDetail.purpose',\n 'This is a single secret — an encrypted credential such as an API key, password or connection string. Reveal and copy its value when you need it (every reveal is logged), rotate it to a new value while keeping the old one in version history, roll back to a previous version, or share it securely with someone outside this vault.'\n )}\n </PagePurpose>\n\n {(canDecryptSecret || canUpdateSecret) && (\n <NextSteps\n storageKey=\"security-secret-detail\"\n steps={[\n ...(canDecryptSecret\n ? [\n {\n id: 'reveal',\n label: tr('security.secretDetail.next.reveal', 'Reveal the value'),\n description: tr(\n 'security.secretDetail.next.revealDesc',\n 'Decrypt and copy this secret when you need it.'\n ),\n icon: <KeyRound className=\"size-4\" />,\n onClick: isRevealed ? undefined : () => void reveal(),\n done: isRevealed,\n },\n ]\n : []),\n ...(canUpdateSecret\n ? [\n {\n id: 'share',\n label: tr('security.secretDetail.next.share', 'Share this secret'),\n description: tr(\n 'security.secretDetail.next.shareDesc',\n 'Send a confidential, expiring link to someone.'\n ),\n icon: <Share2 className=\"size-4\" />,\n onClick: () => setShowShareDialog(true),\n },\n ]\n : []),\n ...(canUpdateSecret && featureSecretRotate\n ? [\n {\n id: 'rotate',\n label: tr('security.secretDetail.next.rotate', 'Rotate the value'),\n description: tr(\n 'security.secretDetail.next.rotateDesc',\n 'Replace the value and keep the old one in history.'\n ),\n icon: <RefreshCw className=\"size-4\" />,\n onClick: openRotatePrompt,\n },\n ]\n : []),\n ]}\n />\n )}\n\n {/* Status and Info */}\n <div className=\"flex flex-wrap items-center gap-3\">\n <SecretTypeBadge type={secret.type as SecretType} />\n {rotationStatus && <RotationStatusBadge status={rotationStatus} />}\n <Badge variant=\"outline\" className=\"bg-bg-surface/50\">\n {tr('security.secretDetail.status.label', 'Status: {{status}}', {\n status: secret.status,\n })}\n </Badge>\n {secret.labels?.map((label: any) => (\n <Badge key={label.id} variant=\"outline\" className=\"border-primary/20 text-primary\">\n {label.label}\n </Badge>\n ))}\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n {/* Main Info */}\n <div className=\"md:col-span-2 space-y-6\">\n {/* Secret Value — the single emphasis zone on this page */}\n <GlassCard treatment=\"glass\" glow className=\"p-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <KeyRound className=\"size-5 text-primary\" />\n {tr('security.secretDetail.value.title', 'Secret Value')}\n </h2>\n {secret.expiresAt && (\n <div className=\"flex items-center gap-1.5 text-xs text-warning\">\n <Calendar className=\"size-3.5\" />\n {tr('security.secretDetail.value.expires', 'Expires: {{date}}', {\n date: new Date(secret.expiresAt).toLocaleDateString(),\n })}\n </div>\n )}\n </div>\n <SecretValueDisplay\n value={decryptedValue ?? ''}\n isRevealed={isRevealed}\n onToggleReveal={\n canDecryptSecret\n ? () => {\n if (isRevealed) {\n hide();\n } else {\n void reveal();\n }\n }\n : undefined\n }\n isLoading={decrypting}\n />\n <p className=\"text-xs text-text-secondary mt-4 italic\">\n {tr(\n 'security.secretDetail.value.note',\n 'Secret values are decrypted on-demand and never stored in plain text.'\n )}\n </p>\n </GlassCard>\n\n {/* Version History Summary */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <History className=\"size-5 text-primary\" />\n {tr('security.secretDetail.history.title', 'Version History')}\n </h2>\n <Badge variant=\"outline\" className=\"bg-bg-sunken font-mono\">\n {tr('security.secretDetail.history.totalVersions', '{{count}} total versions', {\n count: versionCount,\n })}\n </Badge>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between p-4 rounded-lg bg-action-primary-bg/5 border border-primary/10\">\n <div className=\"flex items-center gap-3\">\n <div className=\"size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-primary text-xs font-bold tabular-nums\">\n v{secret.version ?? versionCount}\n </div>\n <div>\n <p className=\"text-sm font-semibold\">\n {tr(\n 'security.secretDetail.history.currentVersion',\n 'Current Active Version'\n )}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.history.lastUpdated', 'Last updated {{date}}', {\n date: new Date(secret.updatedAt).toLocaleString(),\n })}\n </p>\n </div>\n </div>\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tr('security.common.status.active', 'Active')}\n </Badge>\n </div>\n\n {versionCount > 1 && (\n <div className=\"text-center py-4 border-2 border-dashed border-border-subtle/40 rounded-lg bg-bg-sunken/20\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'security.secretDetail.history.available',\n 'Historical versions are available. You can rollback to a previous state if needed.'\n )}\n </p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"mt-3\"\n onClick={() => setShowHistoryModal(true)}\n >\n {tr('security.secretDetail.history.viewFull', 'View Full History')}\n </Button>\n </div>\n )}\n </div>\n </Card>\n </div>\n\n {/* Sidebar Info */}\n <div className=\"space-y-6\">\n <Card className=\"p-6 shadow-sm border-border-subtle/60 space-y-4\">\n <h3 className=\"font-bold text-sm uppercase tracking-wider text-text-secondary\">\n {tr('security.secretDetail.details.title', 'Details')}\n </h3>\n\n <div className=\"space-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.keyIdentifier', 'Key Identifier')}\n </p>\n <code className=\"text-xs font-mono bg-bg-sunken px-1.5 py-0.5 rounded block mt-1 overflow-hidden text-ellipsis whitespace-nowrap\">\n {secret.key}\n </code>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.createdBy', 'Created By')}\n </p>\n <p className=\"text-sm font-medium mt-1\">{secret.createdBy}</p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.createdAt', 'Created At')}\n </p>\n <div className=\"flex items-center gap-1.5 text-sm mt-1\">\n <Clock className=\"size-3.5\" />\n {new Date(secret.createdAt).toLocaleDateString()}\n </div>\n </div>\n {secret.lastRotatedAt && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.lastRotation', 'Last Rotation')}\n </p>\n <p className=\"text-sm mt-1\">\n {new Date(secret.lastRotatedAt).toLocaleString()}\n </p>\n </div>\n )}\n </div>\n </Card>\n\n <GlassCard treatment=\"insight\" className=\"p-6 space-y-4\">\n <h3 className=\"font-bold text-sm text-primary flex items-center gap-2\">\n <Shield className=\"size-4\" />\n {tr('security.secretDetail.security.title', 'Security')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tr(\n 'security.secretDetail.security.description',\n 'This secret is protected by 256-bit encryption. All access is logged and monitored for suspicious activity.'\n )}\n </p>\n </GlassCard>\n </div>\n </div>\n </div>\n\n {/* Version History Modal */}\n <Dialog\n open={showHistoryModal}\n onOpenChange={(open) => {\n if (!open) setShowHistoryModal(false);\n }}\n >\n <DialogContent className=\"max-w-2xl border-primary/20 max-h-[80vh] flex flex-col gap-0 p-0\">\n <DialogHeader className=\"p-6 border-b border-border-subtle text-left\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <History className=\"size-5\" />\n </div>\n <DialogTitle className=\"text-xl font-bold\">\n {tr('security.secretDetail.history.modalTitle', 'Version History')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <div className=\"p-6 overflow-y-auto flex-1\">\n {versionsLoading ? (\n <div className=\"flex justify-center py-8\">\n <Loader2 className=\"size-8 animate-spin text-primary/60\" />\n </div>\n ) : (\n <div className=\"space-y-4\">\n {versions.map((v: any) => (\n <div\n key={v.id}\n className={cn(\n 'p-4 rounded-lg border',\n v.version === secret.version\n ? 'bg-action-primary-bg/5 border-primary/20'\n : 'bg-bg-surface border-border-subtle'\n )}\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2\">\n <span className=\"font-semibold\">\n {tr(\n 'security.secretDetail.history.versionLabel',\n 'Version {{version}}',\n {\n version: v.version,\n }\n )}\n </span>\n {v.version === secret.version && (\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tr('security.common.status.active', 'Active')}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'security.secretDetail.history.versionMeta',\n '{date} by {createdBy}',\n {\n date: new Date(v.createdAt).toLocaleString(),\n createdBy: v.createdBy,\n }\n )}\n </p>\n {v.changeReason && <p className=\"text-sm mt-2\">{v.changeReason}</p>}\n </div>\n {v.version !== secret.version && (\n <SecurityPermissionGuard\n permission=\"secret:update\"\n featureFlagKey={SECURITY_FEATURE_FLAGS.SECRET_ROLLBACK}\n featureFlagDefault={false}\n >\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleRollback(v.version)}\n disabled={rollingBack}\n >\n {tr('security.secretDetail.actions.rollback', 'Rollback')}\n </Button>\n </SecurityPermissionGuard>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </DialogContent>\n </Dialog>\n\n {/* Delete confirmation */}\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title={tr('security.secretDetail.delete.title', 'Delete Secret')}\n description={tr(\n 'security.secretDetail.delete.description',\n 'Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.',\n { name: secret.name }\n )}\n confirmLabel={\n deletingSecret\n ? tr('security.secretDetail.delete.deleting', 'Deleting...')\n : tr('security.secretDetail.delete.confirm', 'Delete Secret')\n }\n variant=\"destructive\"\n />\n\n {/* Rotate prompt */}\n <Dialog\n open={showRotatePrompt}\n onOpenChange={(open) => {\n if (!open) setShowRotatePrompt(false);\n }}\n >\n <DialogContent className=\"max-w-md border-primary/20\">\n <div className=\"space-y-4\">\n <DialogHeader className=\"text-left\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <RefreshCw className=\"size-5\" />\n </div>\n <DialogTitle className=\"text-xl font-bold\">\n {tr('security.secretDetail.rotate.title', 'Rotate Secret')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'security.secretDetail.rotate.description',\n 'Enter a new value for {name}. The current value will be moved to version history.',\n { name: secret.name }\n )}\n </p>\n\n <div className=\"space-y-2\">\n <label htmlFor=\"new-secret-value\" className=\"text-sm font-medium\">\n {tr('security.secretDetail.rotate.newValue', 'New Secret Value')}\n </label>\n <textarea\n id=\"new-secret-value\"\n aria-label={tr('security.secretDetail.rotate.newValue', 'New Secret Value')}\n ref={rotateValueRef}\n value={newRotationValue}\n onChange={(e) => setNewRotationValue(e.target.value)}\n placeholder={tr(\n 'security.secretDetail.rotate.placeholder',\n 'Enter new secret value...'\n )}\n rows={4}\n className={cn(\n 'w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono transition-all',\n 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary',\n 'placeholder:text-text-secondary/50'\n )}\n />\n </div>\n\n <div className=\"flex justify-end gap-3 pt-2\">\n <Button\n variant=\"outline\"\n onClick={() => setShowRotatePrompt(false)}\n disabled={rotating}\n >\n {tr('security.common.actions.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleRotate} disabled={rotating || !newRotationValue.trim()}>\n {rotating ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"size-4\" />\n )}\n {rotating\n ? tr('security.secretDetail.rotate.loading', 'Rotating...')\n : tr('security.secretDetail.rotate.confirm', 'Rotate Secret')}\n </Button>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n\n {vaultId && secretId && (\n <SecretShareDialog\n isOpen={showShareDialog}\n onClose={() => setShowShareDialog(false)}\n vaultId={vaultId}\n secretId={secretId}\n name={secret.name}\n />\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,IAAmB;CACjC,IAAM,EAAE,YAAS,gBAAa,IAAkD,EAC1E,EAAE,cAAW,KAAK,UAAU,MAAkB,IAAa,EAC3D,KAAiB,IAAa,EAE9B,IAAK,GAAO,EAEZ,EAAE,MAAM,IAAY,aAAS,UAAO,eAAY,GAAa,KAAY,KAAK,EAC9E,IAAS,IAAY,WAErB,EAAE,MAAM,GAAc,SAAS,OAAoB,GAA0B;EACjF,WAAW;GAAE,UAAU,KAAY;GAAI,YAAY,EAAE,OAAO,IAAI;GAAE;EAClE,MAAM,CAAC;EACP,aAAa;EACd,CAAC,EACI,KAAW,GAAc,4BAA4B,SAAS,EAAE,EAEhE,EACJ,OAAO,IACP,WACA,UACA,SAAS,IACT,kBACE,GAAe,KAAY,GAAG,EAE5B,CAAC,IAAc,EAAE,SAAS,QAAoB,GAAiB,EAC/D,CAAC,IAAc,EAAE,SAAS,OAAc,IAAi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QAAQ;IACR,eAAe,EAAmB,GAAM;IAC/B;IACC;IACV,MAAM,EAAO;IACb,CAAA;GAEO"}
|
|
1
|
+
{"version":3,"file":"SecretDetailPage.js","names":["SecretDetailPage","useParams","shellNavigate","useSecurity","routerNavigate","useNavigate","tr","useTr","secretData","useGetSecret","secretId","secret","versionsData","versionsLoading","useGetSecretVersionsQuery","versions","decryptedValue","decrypting","useSecretValue","deleteSecret","deletingSecret","useDeleteSecret","rotateSecret","rotating","useRotateSecret","rollbackSecret","rollingBack","useRollbackSecret","useSecurityEventEmitter","canDeleteSecret","usePermission","canUpdateSecret","canDecryptSecret","featureSecretRotate","useFeatureFlag","SECURITY_FEATURE_FLAGS","showDeleteConfirm","setShowDeleteConfirm","useState","showShareDialog","setShowShareDialog","showRotatePrompt","setShowRotatePrompt","rotateValueRef","useRef","openRotatePrompt","showHistoryModal","setShowHistoryModal","newRotationValue","setNewRotationValue","handleNavigate","path","handleBack","basePath","vaultId","handleDelete","emit","nativeNotify","err","requestDelete","result","nativeConfirm","handleRotate","refetch","handleRollback","loading","PageLayout","Loader2","error","Card","AlertTriangle","Button","ArrowLeft","versionCount","rotationStatus","overflowActions","Share2","RefreshCw","Trash2","CTAOverflowMenu","PagePurpose","KeyRound","NextSteps","isRevealed","reveal","SecretTypeBadge","RotationStatusBadge","Badge","label","GlassCard","Calendar","SecretValueDisplay","hide","History","Clock","Shield","Dialog","open","DialogContent","DialogHeader","DialogTitle","cn","v","SecurityPermissionGuard","ConfirmDialog","SecretShareDialog"],"sources":["../../../src/security/pages/SecretDetailPage.tsx"],"sourcesContent":["import { useState, useRef } from 'react';\nimport { useParams, useNavigate } from 'react-router';\nimport {\n ArrowLeft,\n Edit2,\n Trash2,\n RefreshCw,\n History,\n Loader2,\n AlertTriangle,\n Clock,\n KeyRound,\n Shield,\n Calendar,\n Share2,\n} from 'lucide-react';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n GlassCard,\n CTAOverflowMenu,\n type CTAAction,\n PagePurpose,\n NextSteps,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecretValueDisplay } from '../components/SecretValueDisplay';\nimport { SecretTypeBadge } from '../components/SecretTypeBadge';\nimport { RotationStatusBadge } from '../components/RotationStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { SecretShareDialog } from '../components/SecretShareDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useGetSecret,\n useDeleteSecret,\n useRotateSecret,\n useRollbackSecret,\n} from '../hooks/useSecretQueries';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useGetSecretVersionsQuery } from '../../generated/wspace-operations';\nimport { useSecretValue } from '../hooks/useSecretValue';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { SecurityPermissionGuard } from '../components/SecurityPermissionGuard';\nimport { usePermission, useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { SECURITY_FEATURE_FLAGS } from '../constants/featureFlags';\nimport type { SecretType, RotationStatus } from '../types';\n\nexport function SecretDetailPage() {\n const { vaultId, secretId } = useParams<{ vaultId: string; secretId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n\n const tr = useTr();\n\n const { data: secretData, loading, error, refetch } = useGetSecret(secretId ?? null);\n const secret = secretData?.getSecret;\n\n const { data: versionsData, loading: versionsLoading } = useGetSecretVersionsQuery({\n variables: { secretId: secretId ?? '', pagination: { limit: 50 } },\n skip: !secretId,\n fetchPolicy: 'network-only',\n });\n const versions = versionsData?.getSecretVersionsPaginated?.items ?? [];\n\n const {\n value: decryptedValue,\n reveal,\n hide,\n loading: decrypting,\n isRevealed,\n } = useSecretValue(secretId ?? '');\n\n const [deleteSecret, { loading: deletingSecret }] = useDeleteSecret();\n const [rotateSecret, { loading: rotating }] = useRotateSecret();\n const [rollbackSecret, { loading: rollingBack }] = useRollbackSecret();\n const { emit } = useSecurityEventEmitter();\n\n const canDeleteSecret = usePermission('secret:delete');\n const canUpdateSecret = usePermission('secret:update');\n const canDecryptSecret = usePermission('secret:decrypt');\n const featureSecretRotate = useFeatureFlag(SECURITY_FEATURE_FLAGS.SECRET_ROTATE, false);\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n const [showShareDialog, setShowShareDialog] = useState(false);\n const [showRotatePrompt, setShowRotatePrompt] = useState(false);\n const rotateValueRef = useRef<HTMLTextAreaElement>(null);\n const openRotatePrompt = () => {\n setShowRotatePrompt(true);\n // Focus next frame so the textarea has been mounted by then.\n requestAnimationFrame(() => rotateValueRef.current?.focus());\n };\n const [showHistoryModal, setShowHistoryModal] = useState(false);\n const [newRotationValue, setNewRotationValue] = useState('');\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => {\n handleNavigate(`${basePath}/vaults/${vaultId}`);\n };\n\n const handleDelete = async () => {\n if (!secretId) return;\n try {\n await deleteSecret({ variables: { id: secretId } });\n emit('secret.deleted', { secretId, vaultId });\n setShowDeleteConfirm(false);\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Failed to delete secret:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Secret',\n message: 'Delete this secret? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n const handleRotate = async () => {\n if (!secretId || !newRotationValue.trim()) return;\n try {\n await rotateSecret({ variables: { id: secretId, newValue: newRotationValue.trim() } });\n emit('secret.rotated', { secretId, vaultId });\n setShowRotatePrompt(false);\n setNewRotationValue('');\n refetch();\n } catch (err) {\n console.error('Failed to rotate secret:', err);\n }\n };\n\n const handleRollback = async (version: number) => {\n if (!secretId) return;\n try {\n await rollbackSecret({ variables: { id: secretId, version } });\n emit('secret.rollback', { secretId, vaultId });\n refetch();\n setShowHistoryModal(false);\n } catch (err) {\n console.error('Failed to rollback secret:', err);\n }\n };\n\n if (loading && !secret) {\n return (\n <PageLayout\n title={tr('security.secretDetail.loading.title', 'Loading Secret...')}\n breadcrumbs={[\n { label: tr('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tr('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 className=\"size-10 animate-spin text-primary/60\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error || !secret) {\n return (\n <PageLayout\n title={tr('security.common.errorPage.title', 'Error')}\n breadcrumbs={[\n { label: tr('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tr('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <Card className=\"p-8 text-center max-w-lg mx-auto mt-10\">\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div>\n <h3 className=\"text-lg font-bold text-text-primary\">\n {tr('security.secretDetail.error.title', 'Failed to load secret')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-2\">\n {error?.message ??\n tr(\n 'security.secretDetail.error.description',\n 'Secret not found or access denied.'\n )}\n </p>\n </div>\n <Button variant=\"outline\" onClick={handleBack} className=\"mt-4\">\n <ArrowLeft className=\"size-4\" />\n {tr('security.secretDetail.actions.backToVault', 'Go Back to Vault')}\n </Button>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const versionCount = secret.versionCount ?? 0;\n const rotationStatus: RotationStatus | undefined = secret.lastRotatedAt ? 'healthy' : undefined;\n\n return (\n <PageLayout\n title={secret.name}\n description={\n secret.description ??\n tr('security.secretDetail.description', 'View and manage this secret.')\n }\n breadcrumbs={[\n { label: tr('security.common.breadcrumbs.security', 'Security'), path: basePath },\n {\n label: tr('security.common.breadcrumbs.vault', 'Vault'),\n path: `${basePath}/vaults/${vaultId}`,\n },\n { label: secret.name },\n ]}\n actions={(() => {\n // Boff UI 2.0: keep \"Back\" as a quiet navigation button; collapse the\n // secondary actions (share / rotate / delete) into the overflow menu.\n // Gating preserved: rotate needs secret:update + SECRET_ROTATE flag.\n const overflowActions: CTAAction[] = [];\n if (canUpdateSecret) {\n overflowActions.push({\n label: tr('security.common.actions.share', 'Share'),\n icon: <Share2 className=\"size-4\" />,\n onSelect: () => setShowShareDialog(true),\n });\n }\n if (canUpdateSecret && featureSecretRotate) {\n overflowActions.push({\n label: tr('security.secretDetail.actions.rotate', 'Rotate'),\n icon: <RefreshCw className=\"size-4\" />,\n onSelect: openRotatePrompt,\n });\n }\n if (canDeleteSecret) {\n overflowActions.push({\n label: tr('security.common.actions.delete', 'Delete'),\n icon: <Trash2 className=\"size-4\" />,\n intent: 'destructive',\n onSelect: () => void requestDelete(),\n });\n }\n return (\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">\n {tr('security.secretDetail.actions.backToVault', 'Back to Vault')}\n </span>\n <span className=\"sm:hidden\">{tr('security.common.actions.back', 'Back')}</span>\n </Button>\n <CTAOverflowMenu actions={overflowActions} />\n </div>\n );\n })()}\n >\n <div className=\"space-y-6\">\n <PagePurpose icon={<KeyRound className=\"size-4\" />}>\n {tr(\n 'security.secretDetail.purpose',\n 'This is a single secret — an encrypted credential such as an API key, password or connection string. Reveal and copy its value when you need it (every reveal is logged), rotate it to a new value while keeping the old one in version history, roll back to a previous version, or share it securely with someone outside this vault.'\n )}\n </PagePurpose>\n\n {(canDecryptSecret || canUpdateSecret) && (\n <NextSteps\n storageKey=\"security-secret-detail\"\n steps={[\n ...(canDecryptSecret\n ? [\n {\n id: 'reveal',\n label: tr('security.secretDetail.next.reveal', 'Reveal the value'),\n description: tr(\n 'security.secretDetail.next.revealDesc',\n 'Decrypt and copy this secret when you need it.'\n ),\n icon: <KeyRound className=\"size-4\" />,\n onClick: isRevealed ? undefined : () => void reveal(),\n done: isRevealed,\n },\n ]\n : []),\n ...(canUpdateSecret\n ? [\n {\n id: 'share',\n label: tr('security.secretDetail.next.share', 'Share this secret'),\n description: tr(\n 'security.secretDetail.next.shareDesc',\n 'Send a confidential, expiring link to someone.'\n ),\n icon: <Share2 className=\"size-4\" />,\n onClick: () => setShowShareDialog(true),\n },\n ]\n : []),\n ...(canUpdateSecret && featureSecretRotate\n ? [\n {\n id: 'rotate',\n label: tr('security.secretDetail.next.rotate', 'Rotate the value'),\n description: tr(\n 'security.secretDetail.next.rotateDesc',\n 'Replace the value and keep the old one in history.'\n ),\n icon: <RefreshCw className=\"size-4\" />,\n onClick: openRotatePrompt,\n },\n ]\n : []),\n ]}\n />\n )}\n\n {/* Status and Info */}\n <div className=\"flex flex-wrap items-center gap-3\">\n <SecretTypeBadge type={secret.type as SecretType} />\n {rotationStatus && <RotationStatusBadge status={rotationStatus} />}\n <Badge variant=\"outline\" className=\"bg-bg-surface/50\">\n {tr('security.secretDetail.status.label', 'Status: {{status}}', {\n status: secret.status,\n })}\n </Badge>\n {secret.labels?.map((label: any) => (\n <Badge key={label.id} variant=\"outline\" className=\"border-primary/20 text-primary\">\n {label.label}\n </Badge>\n ))}\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n {/* Main Info */}\n <div className=\"md:col-span-2 space-y-6\">\n {/* Secret Value — the single emphasis zone on this page */}\n <GlassCard treatment=\"glass\" glow className=\"p-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <KeyRound className=\"size-5 text-primary\" />\n {tr('security.secretDetail.value.title', 'Secret Value')}\n </h2>\n {secret.expiresAt && (\n <div className=\"flex items-center gap-1.5 text-xs text-warning\">\n <Calendar className=\"size-3.5\" />\n {tr('security.secretDetail.value.expires', 'Expires: {{date}}', {\n date: new Date(secret.expiresAt).toLocaleDateString(),\n })}\n </div>\n )}\n </div>\n <SecretValueDisplay\n value={decryptedValue ?? ''}\n isRevealed={isRevealed}\n onToggleReveal={\n canDecryptSecret\n ? () => {\n if (isRevealed) {\n hide();\n } else {\n void reveal();\n }\n }\n : undefined\n }\n isLoading={decrypting}\n />\n <p className=\"text-xs text-text-secondary mt-4 italic\">\n {tr(\n 'security.secretDetail.value.note',\n 'Secret values are decrypted on-demand and never stored in plain text.'\n )}\n </p>\n </GlassCard>\n\n {/* Version History Summary */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <History className=\"size-5 text-primary\" />\n {tr('security.secretDetail.history.title', 'Version History')}\n </h2>\n <Badge variant=\"outline\" className=\"bg-bg-sunken font-mono\">\n {tr('security.secretDetail.history.totalVersions', '{{count}} total versions', {\n count: versionCount,\n })}\n </Badge>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between p-4 rounded-lg bg-action-primary-bg/5 border border-primary/10\">\n <div className=\"flex items-center gap-3\">\n <div className=\"size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-primary text-xs font-bold tabular-nums\">\n v{secret.version ?? versionCount}\n </div>\n <div>\n <p className=\"text-sm font-semibold\">\n {tr(\n 'security.secretDetail.history.currentVersion',\n 'Current Active Version'\n )}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.history.lastUpdated', 'Last updated {{date}}', {\n date: new Date(secret.updatedAt).toLocaleString(),\n })}\n </p>\n </div>\n </div>\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tr('security.common.status.active', 'Active')}\n </Badge>\n </div>\n\n {versionCount > 1 && (\n <div className=\"text-center py-4 border-2 border-dashed border-border-subtle/40 rounded-lg bg-bg-sunken/20\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'security.secretDetail.history.available',\n 'Historical versions are available. You can rollback to a previous state if needed.'\n )}\n </p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"mt-3\"\n onClick={() => setShowHistoryModal(true)}\n >\n {tr('security.secretDetail.history.viewFull', 'View Full History')}\n </Button>\n </div>\n )}\n </div>\n </Card>\n </div>\n\n {/* Sidebar Info */}\n <div className=\"space-y-6\">\n <Card className=\"p-6 shadow-sm border-border-subtle/60 space-y-4\">\n <h3 className=\"font-bold text-sm uppercase tracking-wider text-text-secondary\">\n {tr('security.secretDetail.details.title', 'Details')}\n </h3>\n\n <div className=\"space-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.keyIdentifier', 'Key Identifier')}\n </p>\n <code className=\"text-xs font-mono bg-bg-sunken px-1.5 py-0.5 rounded block mt-1 overflow-hidden text-ellipsis whitespace-nowrap\">\n {secret.key}\n </code>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.createdBy', 'Created By')}\n </p>\n <p className=\"text-sm font-medium mt-1\">{secret.createdBy}</p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.createdAt', 'Created At')}\n </p>\n <div className=\"flex items-center gap-1.5 text-sm mt-1\">\n <Clock className=\"size-3.5\" />\n {new Date(secret.createdAt).toLocaleDateString()}\n </div>\n </div>\n {secret.lastRotatedAt && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tr('security.secretDetail.details.lastRotation', 'Last Rotation')}\n </p>\n <p className=\"text-sm mt-1\">\n {new Date(secret.lastRotatedAt).toLocaleString()}\n </p>\n </div>\n )}\n </div>\n </Card>\n\n <GlassCard treatment=\"insight\" className=\"p-6 space-y-4\">\n <h3 className=\"font-bold text-sm text-primary flex items-center gap-2\">\n <Shield className=\"size-4\" />\n {tr('security.secretDetail.security.title', 'Security')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tr(\n 'security.secretDetail.security.description',\n 'This secret is protected by 256-bit encryption. All access is logged and monitored for suspicious activity.'\n )}\n </p>\n </GlassCard>\n </div>\n </div>\n </div>\n\n {/* Version History Modal */}\n <Dialog\n open={showHistoryModal}\n onOpenChange={(open) => {\n if (!open) setShowHistoryModal(false);\n }}\n >\n <DialogContent className=\"max-w-2xl border-primary/20 max-h-[80vh] flex flex-col gap-0 p-0\">\n <DialogHeader className=\"p-6 border-b border-border-subtle text-left\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <History className=\"size-5\" />\n </div>\n <DialogTitle className=\"text-xl font-bold\">\n {tr('security.secretDetail.history.modalTitle', 'Version History')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <div className=\"p-6 overflow-y-auto flex-1\">\n {versionsLoading ? (\n <div className=\"flex justify-center py-8\">\n <Loader2 className=\"size-8 animate-spin text-primary/60\" />\n </div>\n ) : (\n <div className=\"space-y-4\">\n {versions.map((v: any) => (\n <div\n key={v.id}\n className={cn(\n 'p-4 rounded-lg border',\n v.version === secret.version\n ? 'bg-action-primary-bg/5 border-primary/20'\n : 'bg-bg-surface border-border-subtle'\n )}\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2\">\n <span className=\"font-semibold\">\n {tr(\n 'security.secretDetail.history.versionLabel',\n 'Version {{version}}',\n {\n version: v.version,\n }\n )}\n </span>\n {v.version === secret.version && (\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tr('security.common.status.active', 'Active')}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'security.secretDetail.history.versionMeta',\n '{date} by {createdBy}',\n {\n date: new Date(v.createdAt).toLocaleString(),\n createdBy: v.createdBy,\n }\n )}\n </p>\n {v.changeReason && <p className=\"text-sm mt-2\">{v.changeReason}</p>}\n </div>\n {v.version !== secret.version && (\n <SecurityPermissionGuard\n permission=\"secret:update\"\n featureFlagKey={SECURITY_FEATURE_FLAGS.SECRET_ROLLBACK}\n featureFlagDefault={false}\n >\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleRollback(v.version)}\n disabled={rollingBack}\n >\n {tr('security.secretDetail.actions.rollback', 'Rollback')}\n </Button>\n </SecurityPermissionGuard>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </DialogContent>\n </Dialog>\n\n {/* Delete confirmation */}\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title={tr('security.secretDetail.delete.title', 'Delete Secret')}\n description={tr(\n 'security.secretDetail.delete.description',\n 'Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.',\n { name: secret.name }\n )}\n confirmLabel={\n deletingSecret\n ? tr('security.secretDetail.delete.deleting', 'Deleting...')\n : tr('security.secretDetail.delete.confirm', 'Delete Secret')\n }\n variant=\"destructive\"\n />\n\n {/* Rotate prompt */}\n <Dialog\n open={showRotatePrompt}\n onOpenChange={(open) => {\n if (!open) setShowRotatePrompt(false);\n }}\n >\n <DialogContent className=\"max-w-md border-primary/20\">\n <div className=\"space-y-4\">\n <DialogHeader className=\"text-left\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <RefreshCw className=\"size-5\" />\n </div>\n <DialogTitle className=\"text-xl font-bold\">\n {tr('security.secretDetail.rotate.title', 'Rotate Secret')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'security.secretDetail.rotate.description',\n 'Enter a new value for {name}. The current value will be moved to version history.',\n { name: secret.name }\n )}\n </p>\n\n <div className=\"space-y-2\">\n <label htmlFor=\"new-secret-value\" className=\"text-sm font-medium\">\n {tr('security.secretDetail.rotate.newValue', 'New Secret Value')}\n </label>\n <textarea\n id=\"new-secret-value\"\n aria-label={tr('security.secretDetail.rotate.newValue', 'New Secret Value')}\n ref={rotateValueRef}\n value={newRotationValue}\n onChange={(e) => setNewRotationValue(e.target.value)}\n placeholder={tr(\n 'security.secretDetail.rotate.placeholder',\n 'Enter new secret value...'\n )}\n rows={4}\n className={cn(\n 'w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono transition-all',\n 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary',\n 'placeholder:text-text-secondary/50'\n )}\n />\n </div>\n\n <div className=\"flex justify-end gap-3 pt-2\">\n <Button\n variant=\"outline\"\n onClick={() => setShowRotatePrompt(false)}\n disabled={rotating}\n >\n {tr('security.common.actions.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleRotate} disabled={rotating || !newRotationValue.trim()}>\n {rotating ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"size-4\" />\n )}\n {rotating\n ? tr('security.secretDetail.rotate.loading', 'Rotating...')\n : tr('security.secretDetail.rotate.confirm', 'Rotate Secret')}\n </Button>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n\n {vaultId && secretId && (\n <SecretShareDialog\n isOpen={showShareDialog}\n onClose={() => setShowShareDialog(false)}\n vaultId={vaultId}\n secretId={secretId}\n name={secret.name}\n />\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgBA,IAAmB;CACjC,IAAM,EAAE,YAAS,gBAAaC,GAAiD,GACzE,EAAE,cAAW,KAAK,UAAUC,MAAkBC,GAAY,GAC1DC,KAAiBC,GAAY,GAE7BC,IAAKC,GAAM,GAEX,EAAE,MAAMC,IAAY,aAAS,UAAO,eAAYC,EAAaC,KAAY,IAAI,GAC7EC,IAASH,IAAY,WAErB,EAAE,MAAMI,GAAc,SAASC,OAAoBC,GAA0B;EACjF,WAAW;GAAE,UAAUJ,KAAY;GAAI,YAAY,EAAE,OAAO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,UAAA,CACGzB,IACC,kBAAC4C,GAAD,EAAS,WAAU,sBAAuB,CAAA,IAE1C,kBAACU,GAAD,EAAW,WAAU,SAAU,CAAA,GAEhCtD,IACGjB,EAAG,wCAAwC,aAAa,IACxDA,EAAG,wCAAwC,eAAe,CACxD;QACL,CAAA,CAAA;;MACF;;IACQ,CAAA;GACT,CAAA;GAEPgD,KAAW5C,KACV,kBAAC+F,IAAD;IACE,QAAQlE;IACR,eAAeC,EAAmB,EAAK;IAC9B;IACC;IACV,MAAM7B,EAAO;GACd,CAAA;EAEO;;AAEhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SecurityDashboardPage(): import('react').JSX.Element;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { PageLayout as e } from "../components/PageLayout.js";
|
|
2
|
+
import { SecurityScoreCard as t } from "../components/SecurityScoreCard.js";
|
|
3
|
+
import { ActivityTimeline as n } from "../components/ActivityTimeline.js";
|
|
4
4
|
import { Badge as r, Card as i } from "../components/ui.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useSecurityDashboard as a } from "../hooks/useSecurityDashboard.js";
|
|
6
|
+
import { useSecurity as o } from "../providers/SecurityProvider.js";
|
|
7
|
+
import { useTr as s } from "../hooks/useTr.js";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
import { AlertTriangle as u, FileSearch as d, KeyRound as f, Loader2 as p, Lock as m, Plus as h, Shield as g, Users as _ } from "lucide-react";
|
|
10
10
|
import { GlassCard as v, IllustratedEmptyState as y, NextSteps as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
|
|
11
|
-
|
|
11
|
+
// src/security/pages/SecurityDashboardPage.tsx
|
|
12
12
|
function S() {
|
|
13
|
-
let { basePath: S = "/", navigate: C } =
|
|
13
|
+
let { basePath: S = "/", navigate: C } = o(), { dashboard: w, loading: T, error: E } = a(), D = s(), O = (e) => {
|
|
14
14
|
C ? C(e) : window.location.assign(e);
|
|
15
15
|
};
|
|
16
|
-
return T ? /* @__PURE__ */ c(
|
|
16
|
+
return T ? /* @__PURE__ */ c(e, {
|
|
17
17
|
title: D("security.dashboard.title", "Security Health"),
|
|
18
18
|
breadcrumbs: [{
|
|
19
19
|
label: D("security.nav.security", "Security"),
|
|
@@ -23,7 +23,7 @@ function S() {
|
|
|
23
23
|
className: "flex items-center justify-center py-16",
|
|
24
24
|
children: /* @__PURE__ */ c(p, { className: "size-8 animate-spin text-primary" })
|
|
25
25
|
})
|
|
26
|
-
}) : E ? /* @__PURE__ */ c(
|
|
26
|
+
}) : E ? /* @__PURE__ */ c(e, {
|
|
27
27
|
title: D("security.dashboard.title", "Security Health"),
|
|
28
28
|
breadcrumbs: [{
|
|
29
29
|
label: D("security.nav.security", "Security"),
|
|
@@ -42,7 +42,7 @@ function S() {
|
|
|
42
42
|
})] })]
|
|
43
43
|
})
|
|
44
44
|
})
|
|
45
|
-
}) : /* @__PURE__ */ c(
|
|
45
|
+
}) : /* @__PURE__ */ c(e, {
|
|
46
46
|
title: D("security.dashboard.title", "Security Health"),
|
|
47
47
|
description: D("security.dashboard.description", "Overview of your workspace security posture."),
|
|
48
48
|
breadcrumbs: [{
|
|
@@ -85,7 +85,7 @@ function S() {
|
|
|
85
85
|
/* @__PURE__ */ l("div", {
|
|
86
86
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */ c(
|
|
88
|
+
/* @__PURE__ */ c(t, {
|
|
89
89
|
score: w.healthScore,
|
|
90
90
|
glow: !0
|
|
91
91
|
}),
|
|
@@ -172,7 +172,7 @@ function S() {
|
|
|
172
172
|
children: [/* @__PURE__ */ c("h2", {
|
|
173
173
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
174
174
|
children: D("security.dashboard.recentActivity", "Recent Activity")
|
|
175
|
-
}), w.recentActivity.length > 0 ? /* @__PURE__ */ c(
|
|
175
|
+
}), w.recentActivity.length > 0 ? /* @__PURE__ */ c(n, { entries: w.recentActivity }) : /* @__PURE__ */ c(y, {
|
|
176
176
|
illustration: "empty-data",
|
|
177
177
|
title: D("security.dashboard.noActivity", "No recent activity to display.")
|
|
178
178
|
})]
|
|
@@ -181,7 +181,6 @@ function S() {
|
|
|
181
181
|
})
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
//#endregion
|
|
185
184
|
export { S as SecurityDashboardPage };
|
|
186
185
|
|
|
187
186
|
//# sourceMappingURL=SecurityDashboardPage.js.map
|