@burdenoff/microfe-security 2026.625.2 → 2026.626.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/security/pages/AccessReviewPage.js +116 -85
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.js +32 -26
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ImportExportPage.js +23 -17
- package/dist/security/pages/ImportExportPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +194 -177
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +17 -14
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js +76 -70
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +325 -290
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +103 -67
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +16 -12
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultCreatePage.js +65 -58
- package/dist/security/pages/VaultCreatePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +213 -183
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.js +137 -113
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +83 -79
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -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-dom';\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} 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 { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { translateWithFallback } from '../utils/i18n';\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 { t } = useI18n();\n const routerNavigate = useNavigate();\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 const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\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={tx('security.secretDetail.loading.title', 'Loading Secret...')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('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={tx('security.common.errorPage.title', 'Error')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('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 {tx('security.secretDetail.error.title', 'Failed to load secret')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-2\">\n {error?.message ??\n tx(\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 {tx('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 tx('security.secretDetail.description', 'View and manage this secret.')\n }\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n {\n label: tx('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: tx('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: tx('security.secretDetail.actions.rotate', 'Rotate'),\n icon: <RefreshCw className=\"size-4\" />,\n onSelect: openRotatePrompt,\n });\n }\n if (canDeleteSecret) {\n overflowActions.push({\n label: tx('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 {tx('security.secretDetail.actions.backToVault', 'Back to Vault')}\n </span>\n <span className=\"sm:hidden\">{tx('security.common.actions.back', 'Back')}</span>\n </Button>\n <CTAOverflowMenu actions={overflowActions} />\n </div>\n );\n })()}\n >\n <div className=\"space-y-6\">\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 {tx('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\" 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 {tx('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 {tx('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 {tx(\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 {tx('security.secretDetail.history.title', 'Version History')}\n </h2>\n <Badge variant=\"outline\" className=\"bg-bg-sunken font-mono\">\n {tx('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 {tx(\n 'security.secretDetail.history.currentVersion',\n 'Current Active Version'\n )}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tx('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 {tx('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 {tx(\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 {tx('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 {tx('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 {tx('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 {tx('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 {tx('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 {tx('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 {tx('security.secretDetail.security.title', 'Security')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tx(\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 {tx('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 {tx(\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 {tx('security.common.status.active', 'Active')}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tx(\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 {tx('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={tx('security.secretDetail.delete.title', 'Delete Secret')}\n description={tx(\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 ? tx('security.secretDetail.delete.deleting', 'Deleting...')\n : tx('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 {tx('security.secretDetail.rotate.title', 'Rotate Secret')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <p className=\"text-sm text-text-secondary\">\n {tx(\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 {tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n </label>\n <textarea\n id=\"new-secret-value\"\n aria-label={tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n ref={rotateValueRef}\n value={newRotationValue}\n onChange={(e) => setNewRotationValue(e.target.value)}\n placeholder={tx(\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 {tx('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 ? tx('security.secretDetail.rotate.loading', 'Rotating...')\n : tx('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":";;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgB,IAAmB;CACjC,IAAM,EAAE,YAAS,gBAAa,GAAkD,EAC1E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,EAAE,SAAM,GAAS,EACjB,KAAiB,IAAa,EAE9B,EAAE,MAAM,IAAY,aAAS,UAAO,eAAY,GAAa,KAAY,KAAK,EAC9E,IAAS,IAAY,WAErB,EAAE,MAAM,IAAc,SAAS,OAAoB,GAA0B;EACjF,WAAW;GAAE,UAAU,KAAY;GAAI,YAAY,EAAE,OAAO,IAAI;GAAE;EAClE,MAAM,CAAC;EACP,aAAa;EACd,CAAC,EACI,KAAW,IAAc,4BAA4B,SAAS,EAAE,EAEhE,EACJ,OAAO,IACP,YACA,UACA,SAAS,GACT,kBACE,GAAe,KAAY,GAAG,EAE5B,CAAC,IAAc,EAAE,SAAS,QAAoB,IAAiB,EAC/D,CAAC,IAAc,EAAE,SAAS,OAAc,GAAiB,EACzD,CAAC,IAAgB,EAAE,SAAS,QAAiB,GAAmB,EAChE,EAAE,YAAS,IAAyB,EAEpC,KAAkB,EAAc,gBAAgB,EAChD,IAAkB,EAAc,gBAAgB,EAChD,KAAmB,EAAc,iBAAiB,EAClD,KAAsB,GAAe,EAAuB,eAAe,GAAM,EAEjF,CAAC,IAAmB,KAAwB,EAAS,GAAM,EAC3D,CAAC,IAAiB,KAAsB,EAAS,GAAM,EACvD,CAAC,IAAkB,KAAuB,EAAS,GAAM,EACzD,IAAiB,GAA4B,KAAK,EAClD,WAAyB;AAG7B,EAFA,EAAoB,GAAK,EAEzB,4BAA4B,EAAe,SAAS,OAAO,CAAC;IAExD,CAAC,IAAkB,KAA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ACF;;KACM,CAAA;IACT,CAAA;GAER,KAAW,KACV,kBAAC,IAAD;IACE,QAAQ;IACR,eAAe,EAAmB,GAAM;IAC/B;IACC;IACV,MAAM,EAAO;IACb,CAAA;GAEO"}
|
|
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-dom';\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 { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { translateWithFallback } from '../utils/i18n';\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 { t } = useI18n();\n const routerNavigate = useNavigate();\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 const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\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={tx('security.secretDetail.loading.title', 'Loading Secret...')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('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={tx('security.common.errorPage.title', 'Error')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('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 {tx('security.secretDetail.error.title', 'Failed to load secret')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-2\">\n {error?.message ??\n tx(\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 {tx('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 tx('security.secretDetail.description', 'View and manage this secret.')\n }\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n {\n label: tx('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: tx('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: tx('security.secretDetail.actions.rotate', 'Rotate'),\n icon: <RefreshCw className=\"size-4\" />,\n onSelect: openRotatePrompt,\n });\n }\n if (canDeleteSecret) {\n overflowActions.push({\n label: tx('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 {tx('security.secretDetail.actions.backToVault', 'Back to Vault')}\n </span>\n <span className=\"sm:hidden\">{tx('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 {tx(\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: tx('security.secretDetail.next.reveal', 'Reveal the value'),\n description: tx(\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: tx('security.secretDetail.next.share', 'Share this secret'),\n description: tx(\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: tx('security.secretDetail.next.rotate', 'Rotate the value'),\n description: tx(\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 {tx('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 {tx('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 {tx('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 {tx(\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 {tx('security.secretDetail.history.title', 'Version History')}\n </h2>\n <Badge variant=\"outline\" className=\"bg-bg-sunken font-mono\">\n {tx('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 {tx(\n 'security.secretDetail.history.currentVersion',\n 'Current Active Version'\n )}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tx('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 {tx('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 {tx(\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 {tx('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 {tx('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 {tx('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 {tx('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 {tx('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 {tx('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 {tx('security.secretDetail.security.title', 'Security')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tx(\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 {tx('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 {tx(\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 {tx('security.common.status.active', 'Active')}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tx(\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 {tx('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={tx('security.secretDetail.delete.title', 'Delete Secret')}\n description={tx(\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 ? tx('security.secretDetail.delete.deleting', 'Deleting...')\n : tx('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 {tx('security.secretDetail.rotate.title', 'Rotate Secret')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <p className=\"text-sm text-text-secondary\">\n {tx(\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 {tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n </label>\n <textarea\n id=\"new-secret-value\"\n aria-label={tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n ref={rotateValueRef}\n value={newRotationValue}\n onChange={(e) => setNewRotationValue(e.target.value)}\n placeholder={tx(\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 {tx('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 ? tx('security.secretDetail.rotate.loading', 'Rotating...')\n : tx('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":";;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgB,IAAmB;CACjC,IAAM,EAAE,YAAS,gBAAa,IAAkD,EAC1E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,EAAE,UAAM,IAAS,EACjB,KAAiB,IAAa,EAE9B,EAAE,MAAM,IAAY,aAAS,UAAO,eAAY,GAAa,KAAY,KAAK,EAC9E,IAAS,IAAY,WAErB,EAAE,MAAM,IAAc,SAAS,OAAoB,GAA0B;EACjF,WAAW;GAAE,UAAU,KAAY;GAAI,YAAY,EAAE,OAAO,IAAI;GAAE;EAClE,MAAM,CAAC;EACP,aAAa;EACd,CAAC,EACI,KAAW,IAAc,4BAA4B,SAAS,EAAE,EAEhE,EACJ,OAAO,IACP,WACA,SACA,SAAS,IACT,kBACE,GAAe,KAAY,GAAG,EAE5B,CAAC,IAAc,EAAE,SAAS,QAAoB,IAAiB,EAC/D,CAAC,IAAc,EAAE,SAAS,OAAc,GAAiB,EACzD,CAAC,IAAgB,EAAE,SAAS,QAAiB,IAAmB,EAChE,EAAE,YAAS,IAAyB,EAEpC,KAAkB,EAAc,gBAAgB,EAChD,IAAkB,EAAc,gBAAgB,EAChD,IAAmB,EAAc,iBAAiB,EAClD,IAAsB,GAAe,EAAuB,eAAe,GAAM,EAEjF,CAAC,IAAmB,KAAwB,EAAS,GAAM,EAC3D,CAAC,IAAiB,KAAsB,EAAS,GAAM,EACvD,CAAC,IAAkB,KAAuB,EAAS,GAAM,EACzD,IAAiB,GAA4B,KAAK,EAClD,UAAyB;AAG7B,EAFA,EAAoB,GAAK,EAEzB,4BAA4B,EAAe,SAAS,OAAO,C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AAD;QAAG,WAAU;kBACV,EACC,4CACA,qFACA,EAAE,MAAM,EAAO,MAAM,CACtB;QACC,CAAA;OAEJ,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,SAAD;SAAO,SAAQ;SAAmB,WAAU;mBACzC,EAAG,yCAAyC,mBAAmB;SAC1D,CAAA,EACR,kBAAC,YAAD;SACE,IAAG;SACH,cAAY,EAAG,yCAAyC,mBAAmB;SAC3E,KAAK;SACL,OAAO;SACP,WAAW,MAAM,EAAoB,EAAE,OAAO,MAAM;SACpD,aAAa,EACX,4CACA,4BACD;SACD,MAAM;SACN,WAAW,EACT,0GACA,8EACA,qCACD;SACD,CAAA,CACE;;OAEN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD;SACE,SAAQ;SACR,eAAe,EAAoB,GAAM;SACzC,UAAU;mBAET,EAAG,kCAAkC,SAAS;SACxC,CAAA,EACT,kBAAC,GAAD;SAAQ,SAAS;SAAc,UAAU,KAAY,CAAC,EAAiB,MAAM;mBAA7E,CACG,IACC,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAE3C,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA,EAEjC,IACG,EAAG,wCAAwC,cAAc,GACzD,EAAG,wCAAwC,gBAAgB,CACxD;WACL;;OACF;;KACM,CAAA;IACT,CAAA;GAER,KAAW,KACV,kBAAC,IAAD;IACE,QAAQ;IACR,eAAe,EAAmB,GAAM;IAC/B;IACC;IACV,MAAM,EAAO;IACb,CAAA;GAEO"}
|
|
@@ -6,140 +6,176 @@ import { SecurityScoreCard as a } from "../components/SecurityScoreCard.js";
|
|
|
6
6
|
import { ActivityTimeline as o } from "../components/ActivityTimeline.js";
|
|
7
7
|
import { useSecurityDashboard as s } from "../hooks/useSecurityDashboard.js";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
-
import { AlertTriangle as u,
|
|
10
|
-
import {
|
|
11
|
-
import { useI18n as
|
|
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
|
+
import { GlassCard as v, IllustratedEmptyState as y, NextSteps as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
12
|
//#region src/security/pages/SecurityDashboardPage.tsx
|
|
13
|
-
function
|
|
14
|
-
let { basePath:
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
function C() {
|
|
14
|
+
let { basePath: C = "/", navigate: w } = e(), { dashboard: T, loading: E, error: D } = s(), { t: O } = S(), k = (e, t) => i(O, e, t), A = (e) => {
|
|
15
|
+
w ? w(e) : window.location.assign(e);
|
|
16
|
+
};
|
|
17
|
+
return E ? /* @__PURE__ */ c(t, {
|
|
18
|
+
title: k("security.dashboard.title", "Security Health"),
|
|
17
19
|
breadcrumbs: [{
|
|
18
|
-
label:
|
|
19
|
-
path:
|
|
20
|
-
}, { label:
|
|
20
|
+
label: k("security.nav.security", "Security"),
|
|
21
|
+
path: C
|
|
22
|
+
}, { label: k("security.nav.health", "Health") }],
|
|
21
23
|
children: /* @__PURE__ */ c("div", {
|
|
22
24
|
className: "flex items-center justify-center py-16",
|
|
23
|
-
children: /* @__PURE__ */ c(
|
|
25
|
+
children: /* @__PURE__ */ c(p, { className: "size-8 animate-spin text-primary" })
|
|
24
26
|
})
|
|
25
|
-
}) :
|
|
26
|
-
title:
|
|
27
|
+
}) : D ? /* @__PURE__ */ c(t, {
|
|
28
|
+
title: k("security.dashboard.title", "Security Health"),
|
|
27
29
|
breadcrumbs: [{
|
|
28
|
-
label:
|
|
29
|
-
path:
|
|
30
|
-
}, { label:
|
|
30
|
+
label: k("security.nav.security", "Security"),
|
|
31
|
+
path: C
|
|
32
|
+
}, { label: k("security.nav.health", "Health") }],
|
|
31
33
|
children: /* @__PURE__ */ c(r, {
|
|
32
34
|
className: "p-6",
|
|
33
35
|
children: /* @__PURE__ */ l("div", {
|
|
34
36
|
className: "flex items-start gap-4",
|
|
35
37
|
children: [/* @__PURE__ */ c(u, { className: "size-6 text-status-error-text" }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h3", {
|
|
36
38
|
className: "font-semibold text-status-error-text",
|
|
37
|
-
children:
|
|
39
|
+
children: k("security.dashboard.error", "Failed to load dashboard")
|
|
38
40
|
}), /* @__PURE__ */ c("p", {
|
|
39
41
|
className: "text-sm text-text-secondary mt-1",
|
|
40
|
-
children:
|
|
42
|
+
children: D.message
|
|
41
43
|
})] })]
|
|
42
44
|
})
|
|
43
45
|
})
|
|
44
46
|
}) : /* @__PURE__ */ c(t, {
|
|
45
|
-
title:
|
|
46
|
-
description:
|
|
47
|
+
title: k("security.dashboard.title", "Security Health"),
|
|
48
|
+
description: k("security.dashboard.description", "Overview of your workspace security posture."),
|
|
47
49
|
breadcrumbs: [{
|
|
48
|
-
label:
|
|
49
|
-
path:
|
|
50
|
-
}, { label:
|
|
50
|
+
label: k("security.nav.security", "Security"),
|
|
51
|
+
path: C
|
|
52
|
+
}, { label: k("security.nav.health", "Health") }],
|
|
51
53
|
children: /* @__PURE__ */ l("div", {
|
|
52
54
|
className: "space-y-6",
|
|
53
55
|
children: [
|
|
56
|
+
/* @__PURE__ */ c(x, {
|
|
57
|
+
icon: /* @__PURE__ */ c(g, { className: "size-4" }),
|
|
58
|
+
children: k("security.dashboard.purpose", "This is the security health overview for your workspace. It rolls up how many vaults, secrets and members you have, flags vaults that are currently locked, and shows recent security activity — so you can spot risks (stale secrets, locked vaults, unusual access) at a glance before they become incidents.")
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ c(b, {
|
|
61
|
+
storageKey: "security-dashboard",
|
|
62
|
+
steps: [
|
|
63
|
+
{
|
|
64
|
+
id: "create-vault",
|
|
65
|
+
label: k("security.dashboard.next.createVault", "Create a vault"),
|
|
66
|
+
description: k("security.dashboard.next.createVaultDesc", "Group related credentials into a secure container."),
|
|
67
|
+
icon: /* @__PURE__ */ c(h, { className: "size-4" }),
|
|
68
|
+
onClick: () => A(`${C}/vaults/new`)
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "review-access",
|
|
72
|
+
label: k("security.dashboard.next.reviewAccess", "Review who has access"),
|
|
73
|
+
description: k("security.dashboard.next.reviewAccessDesc", "Check member roles across every vault."),
|
|
74
|
+
icon: /* @__PURE__ */ c(_, { className: "size-4" }),
|
|
75
|
+
onClick: () => A(`${C}?tab=access-review`)
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "audit",
|
|
79
|
+
label: k("security.dashboard.next.audit", "Inspect the audit log"),
|
|
80
|
+
description: k("security.dashboard.next.auditDesc", "See every security action taken recently."),
|
|
81
|
+
icon: /* @__PURE__ */ c(d, { className: "size-4" }),
|
|
82
|
+
onClick: () => A(`${C}?tab=audit`)
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}),
|
|
54
86
|
/* @__PURE__ */ l("div", {
|
|
55
87
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
56
88
|
children: [
|
|
57
89
|
/* @__PURE__ */ c(a, {
|
|
58
|
-
score:
|
|
90
|
+
score: T.healthScore,
|
|
59
91
|
glow: !0
|
|
60
92
|
}),
|
|
61
|
-
/* @__PURE__ */ l(
|
|
93
|
+
/* @__PURE__ */ l(v, {
|
|
62
94
|
treatment: "metric",
|
|
63
95
|
className: "p-5",
|
|
64
96
|
children: [/* @__PURE__ */ l("div", {
|
|
65
97
|
className: "flex items-center gap-2 text-text-secondary mb-1",
|
|
66
|
-
children: [/* @__PURE__ */ c(
|
|
98
|
+
children: [/* @__PURE__ */ c(m, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
67
99
|
className: "text-xs font-medium uppercase tracking-wider",
|
|
68
|
-
children:
|
|
100
|
+
children: k("security.dashboard.vaults", "Vaults")
|
|
69
101
|
})]
|
|
70
102
|
}), /* @__PURE__ */ c("p", {
|
|
71
103
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
72
|
-
children:
|
|
104
|
+
children: T.totalVaults
|
|
73
105
|
})]
|
|
74
106
|
}),
|
|
75
|
-
/* @__PURE__ */ l(
|
|
107
|
+
/* @__PURE__ */ l(v, {
|
|
76
108
|
treatment: "metric",
|
|
77
109
|
className: "p-5",
|
|
78
110
|
children: [/* @__PURE__ */ l("div", {
|
|
79
111
|
className: "flex items-center gap-2 text-text-secondary mb-1",
|
|
80
|
-
children: [/* @__PURE__ */ c(
|
|
112
|
+
children: [/* @__PURE__ */ c(f, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
81
113
|
className: "text-xs font-medium uppercase tracking-wider",
|
|
82
|
-
children:
|
|
114
|
+
children: k("security.dashboard.secrets", "Secrets")
|
|
83
115
|
})]
|
|
84
116
|
}), /* @__PURE__ */ c("p", {
|
|
85
117
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
86
|
-
children:
|
|
118
|
+
children: T.totalSecrets
|
|
87
119
|
})]
|
|
88
120
|
}),
|
|
89
|
-
/* @__PURE__ */ l(
|
|
121
|
+
/* @__PURE__ */ l(v, {
|
|
90
122
|
treatment: "metric",
|
|
91
123
|
className: "p-5",
|
|
92
124
|
children: [/* @__PURE__ */ l("div", {
|
|
93
125
|
className: "flex items-center gap-2 text-text-secondary mb-1",
|
|
94
|
-
children: [/* @__PURE__ */ c(
|
|
126
|
+
children: [/* @__PURE__ */ c(_, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
95
127
|
className: "text-xs font-medium uppercase tracking-wider",
|
|
96
|
-
children:
|
|
128
|
+
children: k("security.dashboard.members", "Members")
|
|
97
129
|
})]
|
|
98
130
|
}), /* @__PURE__ */ c("p", {
|
|
99
131
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
100
|
-
children:
|
|
132
|
+
children: T.totalMembers
|
|
101
133
|
})]
|
|
102
134
|
})
|
|
103
135
|
]
|
|
104
136
|
}),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
className: "font-semibold text-text-primary",
|
|
111
|
-
children: w("security.dashboard.lockedVaults", "Locked Vaults")
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ c(n, {
|
|
114
|
-
variant: "warning",
|
|
115
|
-
children: b.lockedVaults.length
|
|
116
|
-
})
|
|
117
|
-
]
|
|
118
|
-
}), /* @__PURE__ */ c("ul", {
|
|
119
|
-
className: "space-y-2",
|
|
120
|
-
children: b.lockedVaults.slice(0, 5).map((e) => /* @__PURE__ */ l("li", {
|
|
121
|
-
className: "text-sm text-text-secondary flex items-center gap-2",
|
|
137
|
+
T.lockedVaults.length > 0 && /* @__PURE__ */ l(v, {
|
|
138
|
+
treatment: "insight",
|
|
139
|
+
className: "p-5",
|
|
140
|
+
children: [/* @__PURE__ */ l("div", {
|
|
141
|
+
className: "flex items-center gap-2 mb-3",
|
|
122
142
|
children: [
|
|
123
|
-
/* @__PURE__ */ c(
|
|
124
|
-
/* @__PURE__ */ c("
|
|
125
|
-
className: "
|
|
126
|
-
children:
|
|
143
|
+
/* @__PURE__ */ c(m, { className: "size-5 text-status-warning-text" }),
|
|
144
|
+
/* @__PURE__ */ c("h3", {
|
|
145
|
+
className: "font-semibold text-text-primary",
|
|
146
|
+
children: k("security.dashboard.lockedVaults", "Locked Vaults")
|
|
127
147
|
}),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
children:
|
|
131
|
-
})
|
|
148
|
+
/* @__PURE__ */ c(n, {
|
|
149
|
+
variant: "warning",
|
|
150
|
+
children: T.lockedVaults.length
|
|
151
|
+
})
|
|
132
152
|
]
|
|
133
|
-
},
|
|
134
|
-
|
|
153
|
+
}), /* @__PURE__ */ c("ul", {
|
|
154
|
+
className: "space-y-2",
|
|
155
|
+
children: T.lockedVaults.slice(0, 5).map((e) => /* @__PURE__ */ l("li", {
|
|
156
|
+
className: "text-sm text-text-secondary flex items-center gap-2",
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ c(m, { className: "size-3 text-status-warning-text shrink-0" }),
|
|
159
|
+
/* @__PURE__ */ c("span", {
|
|
160
|
+
className: "truncate",
|
|
161
|
+
children: e.name
|
|
162
|
+
}),
|
|
163
|
+
e.lockedAt ? /* @__PURE__ */ l("span", {
|
|
164
|
+
className: "text-xs text-text-secondary ml-auto tabular-nums",
|
|
165
|
+
children: ["since ", new Date(e.lockedAt).toLocaleDateString()]
|
|
166
|
+
}) : null
|
|
167
|
+
]
|
|
168
|
+
}, e.id))
|
|
169
|
+
})]
|
|
170
|
+
}),
|
|
135
171
|
/* @__PURE__ */ l(r, {
|
|
136
172
|
className: "p-6",
|
|
137
173
|
children: [/* @__PURE__ */ c("h2", {
|
|
138
174
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
139
|
-
children:
|
|
140
|
-
}),
|
|
175
|
+
children: k("security.dashboard.recentActivity", "Recent Activity")
|
|
176
|
+
}), T.recentActivity.length > 0 ? /* @__PURE__ */ c(o, { entries: T.recentActivity }) : /* @__PURE__ */ c(y, {
|
|
141
177
|
illustration: "empty-data",
|
|
142
|
-
title:
|
|
178
|
+
title: k("security.dashboard.noActivity", "No recent activity to display.")
|
|
143
179
|
})]
|
|
144
180
|
})
|
|
145
181
|
]
|
|
@@ -147,6 +183,6 @@ function y() {
|
|
|
147
183
|
});
|
|
148
184
|
}
|
|
149
185
|
//#endregion
|
|
150
|
-
export {
|
|
186
|
+
export { C as SecurityDashboardPage };
|
|
151
187
|
|
|
152
188
|
//# sourceMappingURL=SecurityDashboardPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityDashboardPage.js","names":[],"sources":["../../../src/security/pages/SecurityDashboardPage.tsx"],"sourcesContent":["import { Shield, AlertTriangle, KeyRound, Lock, Loader2, Users } from 'lucide-react';\nimport { GlassCard, EmphasisPanel, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecurityScoreCard } from '../components/SecurityScoreCard';\nimport { ActivityTimeline } from '../components/ActivityTimeline';\nimport { Card, Badge } from '../components/ui';\nimport { useSecurityDashboard } from '../hooks/useSecurityDashboard';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { translateWithFallback } from '../utils/i18n';\n\nexport function SecurityDashboardPage() {\n const { basePath = '/' } = useSecurity();\n const { dashboard, loading, error } = useSecurityDashboard();\n const { t } = useI18n();\n const tr = (key: string, fallback: string) => translateWithFallback(t, key, fallback);\n\n if (loading) {\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <Card className=\"p-6\">\n <div className=\"flex items-start gap-4\">\n <AlertTriangle className=\"size-6 text-status-error-text\" />\n <div>\n <h3 className=\"font-semibold text-status-error-text\">\n {tr('security.dashboard.error', 'Failed to load dashboard')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-1\">{error.message}</p>\n </div>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n description={tr(\n 'security.dashboard.description',\n 'Overview of your workspace security posture.'\n )}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <div className=\"space-y-6\">\n {/* Score and stats */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n <SecurityScoreCard score={dashboard.healthScore} glow />\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <Lock className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.vaults', 'Vaults')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalVaults}\n </p>\n </GlassCard>\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <KeyRound className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.secrets', 'Secrets')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalSecrets}\n </p>\n </GlassCard>\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <Users className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.members', 'Members')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalMembers}\n </p>\n </GlassCard>\n </div>\n\n {/* Vault status overview — the one zone that needs attention */}\n {dashboard.lockedVaults.length > 0 && (\n <EmphasisPanel>\n <div className=\"flex items-center gap-2 mb-3\">\n <Lock className=\"size-5 text-status-warning-text\" />\n <h3 className=\"font-semibold text-text-primary\">\n {tr('security.dashboard.lockedVaults', 'Locked Vaults')}\n </h3>\n <Badge variant=\"warning\">{dashboard.lockedVaults.length}</Badge>\n </div>\n <ul className=\"space-y-2\">\n {dashboard.lockedVaults.slice(0, 5).map((v: any) => (\n <li key={v.id} className=\"text-sm text-text-secondary flex items-center gap-2\">\n <Lock className=\"size-3 text-status-warning-text shrink-0\" />\n <span className=\"truncate\">{v.name}</span>\n {v.lockedAt ? (\n <span className=\"text-xs text-text-secondary ml-auto tabular-nums\">\n since {new Date(v.lockedAt).toLocaleDateString()}\n </span>\n ) : null}\n </li>\n ))}\n </ul>\n </EmphasisPanel>\n )}\n\n {/* Recent Activity */}\n <Card className=\"p-6\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('security.dashboard.recentActivity', 'Recent Activity')}\n </h2>\n {dashboard.recentActivity.length > 0 ? (\n <ActivityTimeline entries={dashboard.recentActivity} />\n ) : (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('security.dashboard.noActivity', 'No recent activity to display.')}\n />\n )}\n </Card>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,IAAwB;CACtC,IAAM,EAAE,cAAW,QAAQ,GAAa,EAClC,EAAE,cAAW,YAAS,aAAU,GAAsB,EACtD,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAAqB,EAAsB,GAAG,GAAK,EAAS;AA0CrF,QAxCI,IAEA,kBAAC,GAAD;EACE,OAAO,EAAG,4BAA4B,kBAAkB;EACxD,aAAa,CACX;GAAE,OAAO,EAAG,yBAAyB,WAAW;GAAE,MAAM;GAAU,EAClE,EAAE,OAAO,EAAG,uBAAuB,SAAS,EAAE,CAC/C;YAED,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD,EAAS,WAAU,oCAAqC,CAAA;GACpD,CAAA;EACK,CAAA,GAIb,IAEA,kBAAC,GAAD;EACE,OAAO,EAAG,4BAA4B,kBAAkB;EACxD,aAAa,CACX;GAAE,OAAO,EAAG,yBAAyB,WAAW;GAAE,MAAM;GAAU,EAClE,EAAE,OAAO,EAAG,uBAAuB,SAAS,EAAE,CAC/C;YAED,kBAAC,GAAD;GAAM,WAAU;aACd,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAe,WAAU,iCAAkC,CAAA,EAC3D,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eACX,EAAG,4BAA4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BACV,EAAU;QACT,CAAA,CACM;;MACR;;IAGL,EAAU,aAAa,SAAS,KAC/B,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD,EAAM,WAAU,mCAAoC,CAAA;MACpD,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAG,mCAAmC,gBAAgB;OACpD,CAAA;MACL,kBAAC,GAAD;OAAO,SAAQ;iBAAW,EAAU,aAAa;OAAe,CAAA;MAC5D;QACN,kBAAC,MAAD;KAAI,WAAU;eACX,EAAU,aAAa,MAAM,GAAG,EAAE,CAAC,KAAK,MACvC,kBAAC,MAAD;MAAe,WAAU;gBAAzB;OACE,kBAAC,GAAD,EAAM,WAAU,4CAA6C,CAAA;OAC7D,kBAAC,QAAD;QAAM,WAAU;kBAAY,EAAE;QAAY,CAAA;OACzC,EAAE,WACD,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CAAmE,UAC1D,IAAI,KAAK,EAAE,SAAS,CAAC,oBAAoB,CAC3C;YACL;OACD;QARI,EAAE,GAQN,CACL;KACC,CAAA,CACS,EAAA,CAAA;IAIlB,kBAAC,GAAD;KAAM,WAAU;eAAhB,CACE,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAG,qCAAqC,kBAAkB;MACxD,CAAA,EACJ,EAAU,eAAe,SAAS,IACjC,kBAAC,GAAD,EAAkB,SAAS,EAAU,gBAAkB,CAAA,GAEvD,kBAAC,GAAD;MACE,cAAa;MACb,OAAO,EAAG,iCAAiC,iCAAiC;MAC5E,CAAA,CAEC;;IACH;;EACK,CAAA"}
|
|
1
|
+
{"version":3,"file":"SecurityDashboardPage.js","names":[],"sources":["../../../src/security/pages/SecurityDashboardPage.tsx"],"sourcesContent":["import { Shield, AlertTriangle, KeyRound, Lock, Loader2, Users, Plus, FileSearch } from 'lucide-react';\nimport {\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecurityScoreCard } from '../components/SecurityScoreCard';\nimport { ActivityTimeline } from '../components/ActivityTimeline';\nimport { Card, Badge } from '../components/ui';\nimport { useSecurityDashboard } from '../hooks/useSecurityDashboard';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { translateWithFallback } from '../utils/i18n';\n\nexport function SecurityDashboardPage() {\n const { basePath = '/', navigate } = useSecurity();\n const { dashboard, loading, error } = useSecurityDashboard();\n const { t } = useI18n();\n const tr = (key: string, fallback: string) => translateWithFallback(t, key, fallback);\n const go = (path: string) => {\n if (navigate) navigate(path);\n else window.location.assign(path);\n };\n\n if (loading) {\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <Card className=\"p-6\">\n <div className=\"flex items-start gap-4\">\n <AlertTriangle className=\"size-6 text-status-error-text\" />\n <div>\n <h3 className=\"font-semibold text-status-error-text\">\n {tr('security.dashboard.error', 'Failed to load dashboard')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-1\">{error.message}</p>\n </div>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n description={tr(\n 'security.dashboard.description',\n 'Overview of your workspace security posture.'\n )}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <div className=\"space-y-6\">\n <PagePurpose icon={<Shield className=\"size-4\" />}>\n {tr(\n 'security.dashboard.purpose',\n 'This is the security health overview for your workspace. It rolls up how many vaults, secrets and members you have, flags vaults that are currently locked, and shows recent security activity — so you can spot risks (stale secrets, locked vaults, unusual access) at a glance before they become incidents.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"security-dashboard\"\n steps={[\n {\n id: 'create-vault',\n label: tr('security.dashboard.next.createVault', 'Create a vault'),\n description: tr(\n 'security.dashboard.next.createVaultDesc',\n 'Group related credentials into a secure container.'\n ),\n icon: <Plus className=\"size-4\" />,\n onClick: () => go(`${basePath}/vaults/new`),\n },\n {\n id: 'review-access',\n label: tr('security.dashboard.next.reviewAccess', 'Review who has access'),\n description: tr(\n 'security.dashboard.next.reviewAccessDesc',\n 'Check member roles across every vault.'\n ),\n icon: <Users className=\"size-4\" />,\n onClick: () => go(`${basePath}?tab=access-review`),\n },\n {\n id: 'audit',\n label: tr('security.dashboard.next.audit', 'Inspect the audit log'),\n description: tr(\n 'security.dashboard.next.auditDesc',\n 'See every security action taken recently.'\n ),\n icon: <FileSearch className=\"size-4\" />,\n onClick: () => go(`${basePath}?tab=audit`),\n },\n ]}\n />\n\n {/* Score and stats */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n <SecurityScoreCard score={dashboard.healthScore} glow />\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <Lock className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.vaults', 'Vaults')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalVaults}\n </p>\n </GlassCard>\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <KeyRound className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.secrets', 'Secrets')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalSecrets}\n </p>\n </GlassCard>\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <Users className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.members', 'Members')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalMembers}\n </p>\n </GlassCard>\n </div>\n\n {/* Locked-vault callout — a secondary attention zone. The single page\n emphasis stays on the glowing SecurityScoreCard above, so this uses\n an insight treatment rather than a competing EmphasisPanel. */}\n {dashboard.lockedVaults.length > 0 && (\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex items-center gap-2 mb-3\">\n <Lock className=\"size-5 text-status-warning-text\" />\n <h3 className=\"font-semibold text-text-primary\">\n {tr('security.dashboard.lockedVaults', 'Locked Vaults')}\n </h3>\n <Badge variant=\"warning\">{dashboard.lockedVaults.length}</Badge>\n </div>\n <ul className=\"space-y-2\">\n {dashboard.lockedVaults.slice(0, 5).map((v: any) => (\n <li key={v.id} className=\"text-sm text-text-secondary flex items-center gap-2\">\n <Lock className=\"size-3 text-status-warning-text shrink-0\" />\n <span className=\"truncate\">{v.name}</span>\n {v.lockedAt ? (\n <span className=\"text-xs text-text-secondary ml-auto tabular-nums\">\n since {new Date(v.lockedAt).toLocaleDateString()}\n </span>\n ) : null}\n </li>\n ))}\n </ul>\n </GlassCard>\n )}\n\n {/* Recent Activity */}\n <Card className=\"p-6\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('security.dashboard.recentActivity', 'Recent Activity')}\n </h2>\n {dashboard.recentActivity.length > 0 ? (\n <ActivityTimeline entries={dashboard.recentActivity} />\n ) : (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('security.dashboard.noActivity', 'No recent activity to display.')}\n />\n )}\n </Card>\n </div>\n </PageLayout>\n );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ACjC,kBAAC,GAAD,EAAkB,SAAS,EAAU,gBAAkB,CAAA,GAEvD,kBAAC,GAAD;MACE,cAAa;MACb,OAAO,EAAG,iCAAiC,iCAAiC;MAC5E,CAAA,CAEC;;IACH;;EACK,CAAA"}
|
|
@@ -7,10 +7,10 @@ import { useMySharedCredentials as s, useRevealSharedCredential as c } from "../
|
|
|
7
7
|
import { useState as l } from "react";
|
|
8
8
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
9
|
import { Check as f, Clock as p, Copy as m, Eye as h, EyeOff as g, FolderKey as _, KeyRound as v, Loader2 as y } from "lucide-react";
|
|
10
|
-
import { IllustratedEmptyState as b } from "@burdenoff/fe-libs/ui";
|
|
11
|
-
import { useI18n as
|
|
10
|
+
import { IllustratedEmptyState as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
12
|
//#region src/security/pages/SharedWithMePage.tsx
|
|
13
|
-
var
|
|
13
|
+
var C = ({ entry: e }) => {
|
|
14
14
|
let [n, r] = l(!1), [i, a] = l(!1), o = async () => {
|
|
15
15
|
try {
|
|
16
16
|
await navigator.clipboard.writeText(e.value), a(!0), setTimeout(() => a(!1), 1500);
|
|
@@ -44,7 +44,7 @@ var S = ({ entry: e }) => {
|
|
|
44
44
|
children: n ? e.value : "••••••••••••"
|
|
45
45
|
})]
|
|
46
46
|
});
|
|
47
|
-
},
|
|
47
|
+
}, w = ({ share: e }) => {
|
|
48
48
|
let [t, { data: n, loading: o }] = c(), s = n?.revealSharedCredential?.entries ?? [], l = n?.revealSharedCredential?.vaultName, f = s.length > 0;
|
|
49
49
|
return /* @__PURE__ */ d(a, {
|
|
50
50
|
className: "p-4",
|
|
@@ -83,20 +83,24 @@ var S = ({ entry: e }) => {
|
|
|
83
83
|
children: [l && /* @__PURE__ */ d("p", {
|
|
84
84
|
className: "text-xs text-text-secondary",
|
|
85
85
|
children: ["From ", l]
|
|
86
|
-
}), s.map((e) => /* @__PURE__ */ u(
|
|
86
|
+
}), s.map((e) => /* @__PURE__ */ u(C, { entry: e }, e.id))]
|
|
87
87
|
})]
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
|
-
function
|
|
91
|
-
let { basePath: t = "/" } = e(), { t: r } =
|
|
92
|
-
return /* @__PURE__ */
|
|
90
|
+
function T() {
|
|
91
|
+
let { basePath: t = "/" } = e(), { t: r } = S(), i = (e, t) => o(r, e, t), { data: a, loading: c } = s(), l = a?.mySharedCredentials?.items ?? [];
|
|
92
|
+
return /* @__PURE__ */ d(n, {
|
|
93
93
|
title: i("security.sharedWithMe.title", "Shared with me"),
|
|
94
94
|
description: i("security.sharedWithMe.description", "Credentials other people have shared with your account."),
|
|
95
95
|
breadcrumbs: [{
|
|
96
96
|
label: i("security.common.breadcrumbs.security", "Security"),
|
|
97
97
|
path: t
|
|
98
98
|
}, { label: i("security.sharedWithMe.title", "Shared with me") }],
|
|
99
|
-
children:
|
|
99
|
+
children: [/* @__PURE__ */ u(x, {
|
|
100
|
+
icon: /* @__PURE__ */ u(_, { className: "size-4" }),
|
|
101
|
+
className: "mb-6",
|
|
102
|
+
children: i("security.sharedWithMe.purpose", "This is everything other people have shared directly with your account — individual secrets or whole vaults you do not own. Reveal a value only when you actually need it; each reveal is recorded, and some shares are time-limited and will stop working after they expire.")
|
|
103
|
+
}), c ? /* @__PURE__ */ u("div", {
|
|
100
104
|
className: "flex items-center justify-center py-20",
|
|
101
105
|
children: /* @__PURE__ */ u(y, { className: "size-10 animate-spin text-primary/60" })
|
|
102
106
|
}) : l.length === 0 ? /* @__PURE__ */ u(b, {
|
|
@@ -105,11 +109,11 @@ function w() {
|
|
|
105
109
|
description: i("security.sharedWithMe.empty.description", "When someone shares a credential with your account, it will appear here.")
|
|
106
110
|
}) : /* @__PURE__ */ u("div", {
|
|
107
111
|
className: "space-y-3",
|
|
108
|
-
children: l.map((e) => /* @__PURE__ */ u(
|
|
109
|
-
})
|
|
112
|
+
children: l.map((e) => /* @__PURE__ */ u(w, { share: e }, e.id))
|
|
113
|
+
})]
|
|
110
114
|
});
|
|
111
115
|
}
|
|
112
116
|
//#endregion
|
|
113
|
-
export {
|
|
117
|
+
export { T as SharedWithMePage };
|
|
114
118
|
|
|
115
119
|
//# sourceMappingURL=SharedWithMePage.js.map
|