@burdenoff/microfe-security 2026.624.2 → 2026.625.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/security/components/PageLayout.js +35 -18
- package/dist/security/components/PageLayout.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.js +29 -27
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultCard.js +8 -1
- package/dist/security/components/VaultCard.js.map +1 -1
- package/dist/security/components/ui.js +9 -17
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/pages/AccessReviewPage.js +42 -42
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.js +63 -62
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +125 -127
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +130 -125
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js +73 -68
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +141 -149
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +92 -85
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +49 -49
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +136 -183
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.js +191 -196
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js +61 -59
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +74 -69
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretCreatePage.js","names":[],"sources":["../../../src/security/pages/SecretCreatePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams, useNavigate } from 'react-router-dom';\nimport { Save, ArrowLeft, Loader2, ShieldCheck, Info, AlertTriangle } from 'lucide-react';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecretFormFields } from '../components/SecretFormFields';\nimport { Button, Card } from '../components/ui';\nimport { useCreateSecret } from '../hooks/useSecretQueries';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { SecurityPermissionGuard } from '../components/SecurityPermissionGuard';\nimport { cn } from '../utils/cn';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { translateWithFallback } from '../utils/i18n';\nimport type { SecretType } from '../types';\nimport { nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\n/**\n * Detect Apollo-shaped errors structurally (works across Apollo v3 and v4).\n * Apollo errors carry `graphQLErrors`, `networkError`, or `clientErrors` —\n * those messages are already shaped for client display. Other thrown Errors\n * fall through to the generic translation to avoid leaking internal details.\n */\nfunction isApolloError(err: unknown): err is Error {\n return (\n err instanceof Error &&\n ('graphQLErrors' in err || 'networkError' in err || 'clientErrors' in err)\n );\n}\n\nexport function SecretCreatePage() {\n const { vaultId } = useParams<{ vaultId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\n\n const [createSecret, { loading: creating }] = useCreateSecret();\n const { emit } = useSecurityEventEmitter();\n\n const [type, setType] = useState<SecretType>('CREDENTIAL');\n const [name, setName] = useState('');\n const [value, setValue] = useState('');\n const [description, setDescription] = useState('');\n const [labels, setLabels] = useState<string[]>([]);\n const [error, setError] = useState<string | null>(null);\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 handleSave = async () => {\n void nativeImpact('light');\n if (!name.trim()) {\n setError(tx('security.secretCreate.error.nameRequired', 'Name is required.'));\n return;\n }\n if (!value.trim()) {\n setError(tx('security.secretCreate.error.valueRequired', 'Value is required.'));\n return;\n }\n\n setError(null);\n\n try {\n const result = await createSecret({\n variables: {\n input: {\n vaultId: vaultId ?? '',\n name: name.trim(),\n key: name\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, '_')\n .replace(/[^a-z0-9_]/g, ''),\n value: value.trim(),\n type,\n description: description.trim() || undefined,\n tags: labels.length > 0 ? labels : undefined,\n },\n },\n });\n // Apollo v4 exposes a single aggregated `error` on the mutation result.\n if (result.error) {\n setError(\n result.error.message ??\n tx('security.secretCreate.error.createFailed', 'Failed to create secret')\n );\n void nativeNotify('error');\n return;\n }\n\n if (result.data?.createSecret?.id) {\n emit('secret.created', { secretId: result.data.createSecret.id, vaultId });\n void nativeNotify('success');\n handleBack();\n return;\n }\n\n // No data and no errors — surface a generic failure rather than navigate away silently.\n setError(tx('security.secretCreate.error.createFailed', 'Failed to create secret'));\n void nativeNotify('error');\n } catch (err) {\n // Only surface raw error messages that come from Apollo — those are\n // already shaped for client consumption. Anything else falls back to\n // the generic translation to avoid leaking internal details into the UI.\n setError(\n isApolloError(err)\n ? err.message\n : tx('security.secretCreate.error.createFailed', 'Failed to create secret')\n );\n void nativeNotify('error');\n }\n };\n\n return (\n <SecurityPermissionGuard permission=\"secret:create\">\n <PageLayout\n title={tx('security.secretCreate.title', 'Add New Secret')}\n description={tx(\n 'security.secretCreate.description',\n 'Store a new credential, API key, or sensitive text securely.'\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: tx('security.secretCreate.breadcrumb', 'New Secret') },\n ]}\n actions={\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleBack}\n aria-label={tx('security.secretCreate.actions.backToVault', 'Back to Vault')}\n >\n <ArrowLeft className=\"size-4\" />\n {tx('security.secretCreate.actions.backToVault', 'Back to Vault')}\n </Button>\n }\n >\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-8\">\n <div className=\"lg:col-span-2\">\n <Card className=\"p-6 shadow-md border-border-subtle/60\">\n <SecretFormFields\n type={type}\n onTypeChange={setType}\n name={name}\n onNameChange={setName}\n value={value}\n onValueChange={setValue}\n description={description}\n onDescriptionChange={setDescription}\n labels={labels}\n onLabelsChange={setLabels}\n />\n\n {error && (\n <div className=\"mt-6 p-3 rounded-md bg-status-error-bg/10 text-status-error-text text-sm border border-status-error-border/20 flex items-start gap-2\">\n <AlertTriangle className=\"size-4 shrink-0 mt-0.5\" />\n {error}\n </div>\n )}\n\n <div className=\"flex justify-end gap-3 mt-8 pt-6 border-t border-border-subtle/60\">\n <Button\n variant=\"outline\"\n onClick={handleBack}\n disabled={creating}\n aria-label={tx('security.secretCreate.actions.cancel', 'Cancel')}\n >\n {tx('security.secretCreate.actions.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSave} disabled={creating || !name.trim() || !value.trim()}>\n {creating ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n {creating\n ? tx('security.secretCreate.actions.creating', 'Creating...')\n : tx('security.secretCreate.actions.createSecret', 'Create Secret')}\n </Button>\n </div>\n </Card>\n </div>\n\n <div className=\"space-y-6\">\n <Card className=\"p-6 bg-action-primary-bg/5 border-primary/10 shadow-sm\">\n <h3 className=\"text-sm font-bold text-primary flex items-center gap-2 mb-3 uppercase tracking-wider\">\n <ShieldCheck className=\"size-4\" />\n {tx('security.secretCreate.secureStorage.title', 'Secure Storage')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tx(\n 'security.secretCreate.secureStorage.description',\n 'Your secret will be encrypted using a vault-specific key derived from the master encryption system. Once saved, the plain-text value is never shown unless explicitly revealed by an authorized user.'\n )}\n </p>\n </Card>\n\n <Card className=\"p-6 border-border-subtle/60 shadow-sm\">\n <h3 className=\"text-sm font-bold text-text-primary flex items-center gap-2 mb-3\">\n <Info className=\"size-4 text-text-secondary\" />\n {tx('security.secretCreate.namingTips.title', 'Naming Tips')}\n </h3>\n <ul className=\"text-xs text-text-secondary space-y-2 list-disc pl-4\">\n <li>\n {tx(\n 'security.secretCreate.namingTips.productionDb',\n 'Use descriptive names like Production Database URL'\n )}\n </li>\n <li>\n {tx(\n 'security.secretCreate.namingTips.autoKey',\n 'A unique key will be automatically generated from the name'\n )}\n </li>\n <li>\n {tx(\n 'security.secretCreate.namingTips.labels',\n 'You can add labels to group secrets by environment or project'\n )}\n </li>\n </ul>\n </Card>\n </div>\n </div>\n </PageLayout>\n </SecurityPermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAS,EAAc,GAA4B;AACjD,QACE,aAAe,UACd,mBAAmB,KAAO,kBAAkB,KAAO,kBAAkB;;AAI1E,SAAgB,IAAmB;CACjC,IAAM,EAAE,eAAY,GAAgC,EAC9C,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,IAAiB,GAAa,EAC9B,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MACzC,EAAsB,GAAG,GAAK,GAAU,EAAO,EAE3C,CAAC,GAAc,EAAE,SAAS,OAAc,GAAiB,EACzD,EAAE,YAAS,GAAyB,EAEpC,CAAC,GAAM,KAAW,EAAqB,aAAa,EACpD,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAQ,KAAa,EAAmB,EAAE,CAAC,EAC5C,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,KAAkB,MAAiB;AACvC,EAAI,IACF,E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W,CAAA,EACjC,EAAG,6CAA6C,iBAAiB,CAC/D;UACL,kBAAC,KAAD;OAAG,WAAU;iBACV,EACC,mDACA,wMACD;OACC,CAAA,CACC;SAEP,kBAAC,GAAD;MAAM,WAAU;gBAAhB,CACE,kBAAC,MAAD;OAAI,WAAU;iBAAd,CACE,kBAAC,GAAD,EAAM,WAAU,8BAA+B,CAAA,EAC9C,EAAG,0CAA0C,cAAc,CACzD;UACL,kBAAC,MAAD;OAAI,WAAU;iBAAd;QACE,kBAAC,MAAD,EAAA,UACG,EACC,iDACA,qDACD,EACE,CAAA;QACL,kBAAC,MAAD,EAAA,UACG,EACC,4CACA,6DACD,EACE,CAAA;QACL,kBAAC,MAAD,EAAA,UACG,EACC,2CACA,gEACD,EACE,CAAA;QACF;SACA;QACH;OACF;;GACK,CAAA;EACW,CAAA"}
|
|
1
|
+
{"version":3,"file":"SecretCreatePage.js","names":[],"sources":["../../../src/security/pages/SecretCreatePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams, useNavigate } from 'react-router-dom';\nimport { Save, ArrowLeft, Loader2, ShieldCheck, Info, AlertTriangle } from 'lucide-react';\nimport { GlassCard, ShowMore } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecretFormFields } from '../components/SecretFormFields';\nimport { Button, Card } from '../components/ui';\nimport { useCreateSecret } from '../hooks/useSecretQueries';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { SecurityPermissionGuard } from '../components/SecurityPermissionGuard';\nimport { cn } from '../utils/cn';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { translateWithFallback } from '../utils/i18n';\nimport type { SecretType } from '../types';\nimport { nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\n/**\n * Detect Apollo-shaped errors structurally (works across Apollo v3 and v4).\n * Apollo errors carry `graphQLErrors`, `networkError`, or `clientErrors` —\n * those messages are already shaped for client display. Other thrown Errors\n * fall through to the generic translation to avoid leaking internal details.\n */\nfunction isApolloError(err: unknown): err is Error {\n return (\n err instanceof Error &&\n ('graphQLErrors' in err || 'networkError' in err || 'clientErrors' in err)\n );\n}\n\nexport function SecretCreatePage() {\n const { vaultId } = useParams<{ vaultId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\n\n const [createSecret, { loading: creating }] = useCreateSecret();\n const { emit } = useSecurityEventEmitter();\n\n const [type, setType] = useState<SecretType>('CREDENTIAL');\n const [name, setName] = useState('');\n const [value, setValue] = useState('');\n const [description, setDescription] = useState('');\n const [labels, setLabels] = useState<string[]>([]);\n const [error, setError] = useState<string | null>(null);\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 handleSave = async () => {\n void nativeImpact('light');\n if (!name.trim()) {\n setError(tx('security.secretCreate.error.nameRequired', 'Name is required.'));\n return;\n }\n if (!value.trim()) {\n setError(tx('security.secretCreate.error.valueRequired', 'Value is required.'));\n return;\n }\n\n setError(null);\n\n try {\n const result = await createSecret({\n variables: {\n input: {\n vaultId: vaultId ?? '',\n name: name.trim(),\n key: name\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, '_')\n .replace(/[^a-z0-9_]/g, ''),\n value: value.trim(),\n type,\n description: description.trim() || undefined,\n tags: labels.length > 0 ? labels : undefined,\n },\n },\n });\n // Apollo v4 exposes a single aggregated `error` on the mutation result.\n if (result.error) {\n setError(\n result.error.message ??\n tx('security.secretCreate.error.createFailed', 'Failed to create secret')\n );\n void nativeNotify('error');\n return;\n }\n\n if (result.data?.createSecret?.id) {\n emit('secret.created', { secretId: result.data.createSecret.id, vaultId });\n void nativeNotify('success');\n handleBack();\n return;\n }\n\n // No data and no errors — surface a generic failure rather than navigate away silently.\n setError(tx('security.secretCreate.error.createFailed', 'Failed to create secret'));\n void nativeNotify('error');\n } catch (err) {\n // Only surface raw error messages that come from Apollo — those are\n // already shaped for client consumption. Anything else falls back to\n // the generic translation to avoid leaking internal details into the UI.\n setError(\n isApolloError(err)\n ? err.message\n : tx('security.secretCreate.error.createFailed', 'Failed to create secret')\n );\n void nativeNotify('error');\n }\n };\n\n return (\n <SecurityPermissionGuard permission=\"secret:create\">\n <PageLayout\n title={tx('security.secretCreate.title', 'Add New Secret')}\n description={tx(\n 'security.secretCreate.description',\n 'Store a new credential, API key, or sensitive text securely.'\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: tx('security.secretCreate.breadcrumb', 'New Secret') },\n ]}\n actions={\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleBack}\n aria-label={tx('security.secretCreate.actions.backToVault', 'Back to Vault')}\n >\n <ArrowLeft className=\"size-4\" />\n {tx('security.secretCreate.actions.backToVault', 'Back to Vault')}\n </Button>\n }\n >\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-8\">\n <div className=\"lg:col-span-2\">\n <Card className=\"p-6 shadow-md border-border-subtle/60\">\n <SecretFormFields\n type={type}\n onTypeChange={setType}\n name={name}\n onNameChange={setName}\n value={value}\n onValueChange={setValue}\n description={description}\n onDescriptionChange={setDescription}\n labels={labels}\n onLabelsChange={setLabels}\n />\n\n {error && (\n <div className=\"mt-6 p-3 rounded-md bg-status-error-bg/10 text-status-error-text text-sm border border-status-error-border/20 flex items-start gap-2\">\n <AlertTriangle className=\"size-4 shrink-0 mt-0.5\" />\n {error}\n </div>\n )}\n\n <div className=\"flex justify-end gap-3 mt-8 pt-6 border-t border-border-subtle/60\">\n <Button\n variant=\"outline\"\n onClick={handleBack}\n disabled={creating}\n aria-label={tx('security.secretCreate.actions.cancel', 'Cancel')}\n >\n {tx('security.secretCreate.actions.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSave} disabled={creating || !name.trim() || !value.trim()}>\n {creating ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Save className=\"size-4\" />\n )}\n {creating\n ? tx('security.secretCreate.actions.creating', 'Creating...')\n : tx('security.secretCreate.actions.createSecret', 'Create Secret')}\n </Button>\n </div>\n </Card>\n </div>\n\n <div className=\"space-y-6\">\n <GlassCard treatment=\"insight\" className=\"p-6\">\n <h3 className=\"text-sm font-bold text-primary flex items-center gap-2 mb-3 uppercase tracking-wider\">\n <ShieldCheck className=\"size-4\" />\n {tx('security.secretCreate.secureStorage.title', 'Secure Storage')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tx(\n 'security.secretCreate.secureStorage.description',\n 'Your secret will be encrypted using a vault-specific key derived from the master encryption system. Once saved, the plain-text value is never shown unless explicitly revealed by an authorized user.'\n )}\n </p>\n </GlassCard>\n\n <Card className=\"p-6\">\n <h3 className=\"text-sm font-bold text-text-primary flex items-center gap-2 mb-3\">\n <Info className=\"size-4 text-text-secondary\" />\n {tx('security.secretCreate.namingTips.title', 'Naming Tips')}\n </h3>\n <ShowMore collapsedHeight={64}>\n <ul className=\"text-xs text-text-secondary space-y-2 list-disc pl-4\">\n <li>\n {tx(\n 'security.secretCreate.namingTips.productionDb',\n 'Use descriptive names like Production Database URL'\n )}\n </li>\n <li>\n {tx(\n 'security.secretCreate.namingTips.autoKey',\n 'A unique key will be automatically generated from the name'\n )}\n </li>\n <li>\n {tx(\n 'security.secretCreate.namingTips.labels',\n 'You can add labels to group secrets by environment or project'\n )}\n </li>\n </ul>\n </ShowMore>\n </Card>\n </div>\n </div>\n </PageLayout>\n </SecurityPermissionGuard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,SAAS,EAAc,GAA4B;AACjD,QACE,aAAe,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
|
|
6
6
|
import { translateWithFallback as ee } from "../utils/i18n.js";
|
|
7
7
|
import { ConfirmDialog as te } from "../components/ConfirmDialog.js";
|
|
8
8
|
import { useGetSecretVersionsQuery as ne } from "../../generated/wspace-operations.js";
|
|
9
|
-
import { useSecurityEventEmitter as
|
|
10
|
-
import { useDeleteSecret as
|
|
11
|
-
import { nativeConfirm as
|
|
12
|
-
import { SecurityPermissionGuard as
|
|
13
|
-
import { SecretValueDisplay as
|
|
14
|
-
import { SecretTypeBadge as
|
|
15
|
-
import { RotationStatusBadge as
|
|
16
|
-
import { SecretShareDialog as
|
|
17
|
-
import { useSecretValue as
|
|
18
|
-
import { useRef as
|
|
19
|
-
import { usePermission as
|
|
20
|
-
import { useNavigate as
|
|
9
|
+
import { useSecurityEventEmitter as re } from "../hooks/useSecurityEventEmitter.js";
|
|
10
|
+
import { useDeleteSecret as ie, useGetSecret as ae, useRollbackSecret as s, useRotateSecret as c } from "../hooks/useSecretQueries.js";
|
|
11
|
+
import { nativeConfirm as l, nativeImpact as u, nativeNotify as d } from "../../utils/nativeBridge.js";
|
|
12
|
+
import { SecurityPermissionGuard as oe } from "../components/SecurityPermissionGuard.js";
|
|
13
|
+
import { SecretValueDisplay as se } from "../components/SecretValueDisplay.js";
|
|
14
|
+
import { SecretTypeBadge as ce } from "../components/SecretTypeBadge.js";
|
|
15
|
+
import { RotationStatusBadge as le } from "../components/RotationStatusBadge.js";
|
|
16
|
+
import { SecretShareDialog as ue } from "../components/SecretShareDialog.js";
|
|
17
|
+
import { useSecretValue as de } from "../hooks/useSecretValue.js";
|
|
18
|
+
import { useRef as fe, useState as f } from "react";
|
|
19
|
+
import { useFeatureFlag as pe, usePermission as p } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
20
|
+
import { useNavigate as me, useParams as m } from "react-router-dom";
|
|
21
21
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
22
|
-
import { AlertTriangle as
|
|
23
|
-
import { Dialog as
|
|
24
|
-
import { useI18n as
|
|
22
|
+
import { AlertTriangle as he, ArrowLeft as _, Calendar as v, Clock as y, History as b, KeyRound as ge, Loader2 as x, RefreshCw as S, Share2 as _e, Shield as ve, Trash2 as ye } from "lucide-react";
|
|
23
|
+
import { CTAOverflowMenu as be, Dialog as C, DialogContent as w, DialogHeader as T, DialogTitle as E, GlassCard as D } from "@burdenoff/fe-libs/ui";
|
|
24
|
+
import { useI18n as O } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
25
25
|
//#region src/security/pages/SecretDetailPage.tsx
|
|
26
|
-
function
|
|
27
|
-
let { vaultId:
|
|
26
|
+
function k() {
|
|
27
|
+
let { vaultId: k, secretId: A } = m(), { basePath: j = "/", navigate: M } = e(), { t: N } = O(), xe = me(), { data: Se, loading: Ce, error: P, refetch: F } = ae(A ?? null), I = Se?.getSecret, { data: we, loading: Te } = ne({
|
|
28
28
|
variables: {
|
|
29
|
-
secretId:
|
|
29
|
+
secretId: A ?? "",
|
|
30
30
|
pagination: { limit: 50 }
|
|
31
31
|
},
|
|
32
|
-
skip: !
|
|
32
|
+
skip: !A,
|
|
33
33
|
fetchPolicy: "network-only"
|
|
34
|
-
}),
|
|
34
|
+
}), Ee = we?.getSecretVersionsPaginated?.items ?? [], { value: De, reveal: Oe, hide: ke, loading: L, isRevealed: R } = de(A ?? ""), [Ae, { loading: je }] = ie(), [Me, { loading: z }] = c(), [Ne, { loading: Pe }] = s(), { emit: B } = re(), Fe = p("secret:delete"), V = p("secret:update"), Ie = p("secret:decrypt"), Le = pe(t.SECRET_ROTATE, !1), [Re, H] = f(!1), [ze, U] = f(!1), [Be, W] = f(!1), G = fe(null), Ve = () => {
|
|
35
35
|
W(!0), requestAnimationFrame(() => G.current?.focus());
|
|
36
|
-
}, [
|
|
37
|
-
|
|
36
|
+
}, [He, K] = f(!1), [q, J] = f(""), Y = (e, t, n) => ee(N, e, t, n), Ue = (e) => {
|
|
37
|
+
M ? M(e) : xe(e);
|
|
38
38
|
}, X = () => {
|
|
39
|
-
|
|
39
|
+
Ue(`${j}/vaults/${k}`);
|
|
40
40
|
}, Z = async () => {
|
|
41
|
-
if (
|
|
42
|
-
await
|
|
43
|
-
secretId:
|
|
44
|
-
vaultId:
|
|
41
|
+
if (A) try {
|
|
42
|
+
await Ae({ variables: { id: A } }), B("secret.deleted", {
|
|
43
|
+
secretId: A,
|
|
44
|
+
vaultId: k
|
|
45
45
|
}), H(!1), d("success"), X();
|
|
46
46
|
} catch (e) {
|
|
47
47
|
console.error("Failed to delete secret:", e), d("error");
|
|
48
48
|
}
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
let e = await
|
|
49
|
+
}, We = async () => {
|
|
50
|
+
u("medium");
|
|
51
|
+
let e = await l({
|
|
52
52
|
title: "Delete Secret",
|
|
53
53
|
message: "Delete this secret? This cannot be undone.",
|
|
54
54
|
okButtonTitle: "Delete",
|
|
@@ -59,47 +59,47 @@ function D() {
|
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
e && await Z();
|
|
62
|
-
},
|
|
63
|
-
if (!(!
|
|
64
|
-
await
|
|
65
|
-
id:
|
|
62
|
+
}, Ge = async () => {
|
|
63
|
+
if (!(!A || !q.trim())) try {
|
|
64
|
+
await Me({ variables: {
|
|
65
|
+
id: A,
|
|
66
66
|
newValue: q.trim()
|
|
67
|
-
} }),
|
|
68
|
-
secretId:
|
|
69
|
-
vaultId:
|
|
70
|
-
}), W(!1), J(""),
|
|
67
|
+
} }), B("secret.rotated", {
|
|
68
|
+
secretId: A,
|
|
69
|
+
vaultId: k
|
|
70
|
+
}), W(!1), J(""), F();
|
|
71
71
|
} catch (e) {
|
|
72
72
|
console.error("Failed to rotate secret:", e);
|
|
73
73
|
}
|
|
74
|
-
},
|
|
75
|
-
if (
|
|
76
|
-
await
|
|
77
|
-
id:
|
|
74
|
+
}, Ke = async (e) => {
|
|
75
|
+
if (A) try {
|
|
76
|
+
await Ne({ variables: {
|
|
77
|
+
id: A,
|
|
78
78
|
version: e
|
|
79
|
-
} }),
|
|
80
|
-
secretId:
|
|
81
|
-
vaultId:
|
|
82
|
-
}),
|
|
79
|
+
} }), B("secret.rollback", {
|
|
80
|
+
secretId: A,
|
|
81
|
+
vaultId: k
|
|
82
|
+
}), F(), K(!1);
|
|
83
83
|
} catch (e) {
|
|
84
84
|
console.error("Failed to rollback secret:", e);
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
if (
|
|
87
|
+
if (Ce && !I) return /* @__PURE__ */ h(r, {
|
|
88
88
|
title: Y("security.secretDetail.loading.title", "Loading Secret..."),
|
|
89
89
|
breadcrumbs: [{
|
|
90
90
|
label: Y("security.common.breadcrumbs.security", "Security"),
|
|
91
|
-
path:
|
|
91
|
+
path: j
|
|
92
92
|
}, { label: Y("security.common.breadcrumbs.secret", "Secret") }],
|
|
93
93
|
children: /* @__PURE__ */ h("div", {
|
|
94
94
|
className: "flex items-center justify-center py-20",
|
|
95
|
-
children: /* @__PURE__ */ h(
|
|
95
|
+
children: /* @__PURE__ */ h(x, { className: "size-10 animate-spin text-primary/60" })
|
|
96
96
|
})
|
|
97
97
|
});
|
|
98
|
-
if (
|
|
98
|
+
if (P || !I) return /* @__PURE__ */ h(r, {
|
|
99
99
|
title: Y("security.common.errorPage.title", "Error"),
|
|
100
100
|
breadcrumbs: [{
|
|
101
101
|
label: Y("security.common.breadcrumbs.security", "Security"),
|
|
102
|
-
path:
|
|
102
|
+
path: j
|
|
103
103
|
}, { label: Y("security.common.breadcrumbs.secret", "Secret") }],
|
|
104
104
|
children: /* @__PURE__ */ h(o, {
|
|
105
105
|
className: "p-8 text-center max-w-lg mx-auto mt-10",
|
|
@@ -108,14 +108,14 @@ function D() {
|
|
|
108
108
|
children: [
|
|
109
109
|
/* @__PURE__ */ h("div", {
|
|
110
110
|
className: "p-3 rounded-full bg-status-error-bg/10",
|
|
111
|
-
children: /* @__PURE__ */ h(
|
|
111
|
+
children: /* @__PURE__ */ h(he, { className: "size-8 text-status-error-text" })
|
|
112
112
|
}),
|
|
113
113
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h3", {
|
|
114
114
|
className: "text-lg font-bold text-text-primary",
|
|
115
115
|
children: Y("security.secretDetail.error.title", "Failed to load secret")
|
|
116
116
|
}), /* @__PURE__ */ h("p", {
|
|
117
117
|
className: "text-sm text-text-secondary mt-2",
|
|
118
|
-
children:
|
|
118
|
+
children: P?.message ?? Y("security.secretDetail.error.description", "Secret not found or access denied.")
|
|
119
119
|
})] }),
|
|
120
120
|
/* @__PURE__ */ g(a, {
|
|
121
121
|
variant: "outline",
|
|
@@ -127,25 +127,39 @@ function D() {
|
|
|
127
127
|
})
|
|
128
128
|
})
|
|
129
129
|
});
|
|
130
|
-
let Q =
|
|
130
|
+
let Q = I.versionCount ?? 0, $ = I.lastRotatedAt ? "healthy" : void 0;
|
|
131
131
|
return /* @__PURE__ */ g(r, {
|
|
132
|
-
title:
|
|
133
|
-
description:
|
|
132
|
+
title: I.name,
|
|
133
|
+
description: I.description ?? Y("security.secretDetail.description", "View and manage this secret."),
|
|
134
134
|
breadcrumbs: [
|
|
135
135
|
{
|
|
136
136
|
label: Y("security.common.breadcrumbs.security", "Security"),
|
|
137
|
-
path:
|
|
137
|
+
path: j
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
label: Y("security.common.breadcrumbs.vault", "Vault"),
|
|
141
|
-
path: `${
|
|
141
|
+
path: `${j}/vaults/${k}`
|
|
142
142
|
},
|
|
143
|
-
{ label:
|
|
143
|
+
{ label: I.name }
|
|
144
144
|
],
|
|
145
|
-
actions:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
actions: (() => {
|
|
146
|
+
let e = [];
|
|
147
|
+
return V && e.push({
|
|
148
|
+
label: Y("security.common.actions.share", "Share"),
|
|
149
|
+
icon: /* @__PURE__ */ h(_e, { className: "size-4" }),
|
|
150
|
+
onSelect: () => U(!0)
|
|
151
|
+
}), V && Le && e.push({
|
|
152
|
+
label: Y("security.secretDetail.actions.rotate", "Rotate"),
|
|
153
|
+
icon: /* @__PURE__ */ h(S, { className: "size-4" }),
|
|
154
|
+
onSelect: Ve
|
|
155
|
+
}), Fe && e.push({
|
|
156
|
+
label: Y("security.common.actions.delete", "Delete"),
|
|
157
|
+
icon: /* @__PURE__ */ h(ye, { className: "size-4" }),
|
|
158
|
+
intent: "destructive",
|
|
159
|
+
onSelect: () => void We()
|
|
160
|
+
}), /* @__PURE__ */ g("div", {
|
|
161
|
+
className: "flex flex-wrap items-center gap-2",
|
|
162
|
+
children: [/* @__PURE__ */ g(a, {
|
|
149
163
|
variant: "outline",
|
|
150
164
|
size: "sm",
|
|
151
165
|
onClick: X,
|
|
@@ -160,47 +174,23 @@ function D() {
|
|
|
160
174
|
children: Y("security.common.actions.back", "Back")
|
|
161
175
|
})
|
|
162
176
|
]
|
|
163
|
-
}),
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
size: "sm",
|
|
167
|
-
onClick: () => U(!0),
|
|
168
|
-
children: [/* @__PURE__ */ h(_e, { className: "size-4" }), Y("security.common.actions.share", "Share")]
|
|
169
|
-
}),
|
|
170
|
-
/* @__PURE__ */ h(f, {
|
|
171
|
-
permission: "secret:update",
|
|
172
|
-
featureFlagKey: t.SECRET_ROTATE,
|
|
173
|
-
featureFlagDefault: !1,
|
|
174
|
-
children: /* @__PURE__ */ g(a, {
|
|
175
|
-
variant: "outline",
|
|
176
|
-
size: "sm",
|
|
177
|
-
onClick: Le,
|
|
178
|
-
children: [/* @__PURE__ */ h(x, { className: "size-4" }), Y("security.secretDetail.actions.rotate", "Rotate")]
|
|
179
|
-
})
|
|
180
|
-
}),
|
|
181
|
-
je && /* @__PURE__ */ g(a, {
|
|
182
|
-
variant: "outline",
|
|
183
|
-
size: "sm",
|
|
184
|
-
className: "text-status-error-text hover:bg-status-error-bg/10 border-status-error-border/20",
|
|
185
|
-
onClick: () => void Be(),
|
|
186
|
-
children: [/* @__PURE__ */ h(ye, { className: "size-4" }), Y("security.common.actions.delete", "Delete")]
|
|
187
|
-
})
|
|
188
|
-
]
|
|
189
|
-
}),
|
|
177
|
+
}), /* @__PURE__ */ h(be, { actions: e })]
|
|
178
|
+
});
|
|
179
|
+
})(),
|
|
190
180
|
children: [
|
|
191
181
|
/* @__PURE__ */ g("div", {
|
|
192
182
|
className: "space-y-6",
|
|
193
183
|
children: [/* @__PURE__ */ g("div", {
|
|
194
184
|
className: "flex flex-wrap items-center gap-3",
|
|
195
185
|
children: [
|
|
196
|
-
/* @__PURE__ */ h(
|
|
197
|
-
$ && /* @__PURE__ */ h(
|
|
186
|
+
/* @__PURE__ */ h(ce, { type: I.type }),
|
|
187
|
+
$ && /* @__PURE__ */ h(le, { status: $ }),
|
|
198
188
|
/* @__PURE__ */ h(i, {
|
|
199
189
|
variant: "outline",
|
|
200
190
|
className: "bg-bg-surface/50",
|
|
201
|
-
children: Y("security.secretDetail.status.label", "Status: {status}", { status:
|
|
191
|
+
children: Y("security.secretDetail.status.label", "Status: {status}", { status: I.status })
|
|
202
192
|
}),
|
|
203
|
-
|
|
193
|
+
I.labels?.map((e) => /* @__PURE__ */ h(i, {
|
|
204
194
|
variant: "outline",
|
|
205
195
|
className: "border-primary/20 text-primary",
|
|
206
196
|
children: e.label
|
|
@@ -210,26 +200,27 @@ function D() {
|
|
|
210
200
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
211
201
|
children: [/* @__PURE__ */ g("div", {
|
|
212
202
|
className: "md:col-span-2 space-y-6",
|
|
213
|
-
children: [/* @__PURE__ */ g(
|
|
214
|
-
|
|
203
|
+
children: [/* @__PURE__ */ g(D, {
|
|
204
|
+
treatment: "glass",
|
|
205
|
+
className: "p-6",
|
|
215
206
|
children: [
|
|
216
207
|
/* @__PURE__ */ g("div", {
|
|
217
208
|
className: "flex items-center justify-between mb-4",
|
|
218
209
|
children: [/* @__PURE__ */ g("h2", {
|
|
219
210
|
className: "text-lg font-bold text-text-primary flex items-center gap-2",
|
|
220
211
|
children: [/* @__PURE__ */ h(ge, { className: "size-5 text-primary" }), Y("security.secretDetail.value.title", "Secret Value")]
|
|
221
|
-
}),
|
|
212
|
+
}), I.expiresAt && /* @__PURE__ */ g("div", {
|
|
222
213
|
className: "flex items-center gap-1.5 text-xs text-warning",
|
|
223
|
-
children: [/* @__PURE__ */ h(
|
|
214
|
+
children: [/* @__PURE__ */ h(v, { className: "size-3.5" }), Y("security.secretDetail.value.expires", "Expires: {date}", { date: new Date(I.expiresAt).toLocaleDateString() })]
|
|
224
215
|
})]
|
|
225
216
|
}),
|
|
226
|
-
/* @__PURE__ */ h(
|
|
227
|
-
value:
|
|
228
|
-
isRevealed:
|
|
229
|
-
onToggleReveal:
|
|
230
|
-
|
|
217
|
+
/* @__PURE__ */ h(se, {
|
|
218
|
+
value: De ?? "",
|
|
219
|
+
isRevealed: R,
|
|
220
|
+
onToggleReveal: Ie ? () => {
|
|
221
|
+
R ? ke() : Oe();
|
|
231
222
|
} : void 0,
|
|
232
|
-
isLoading:
|
|
223
|
+
isLoading: L
|
|
233
224
|
}),
|
|
234
225
|
/* @__PURE__ */ h("p", {
|
|
235
226
|
className: "text-xs text-text-secondary mt-4 italic",
|
|
@@ -242,7 +233,7 @@ function D() {
|
|
|
242
233
|
className: "flex items-center justify-between mb-6",
|
|
243
234
|
children: [/* @__PURE__ */ g("h2", {
|
|
244
235
|
className: "text-lg font-bold text-text-primary flex items-center gap-2",
|
|
245
|
-
children: [/* @__PURE__ */ h(
|
|
236
|
+
children: [/* @__PURE__ */ h(b, { className: "size-5 text-primary" }), Y("security.secretDetail.history.title", "Version History")]
|
|
246
237
|
}), /* @__PURE__ */ h(i, {
|
|
247
238
|
variant: "outline",
|
|
248
239
|
className: "bg-bg-sunken font-mono",
|
|
@@ -255,14 +246,14 @@ function D() {
|
|
|
255
246
|
children: [/* @__PURE__ */ g("div", {
|
|
256
247
|
className: "flex items-center gap-3",
|
|
257
248
|
children: [/* @__PURE__ */ g("div", {
|
|
258
|
-
className: "size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-primary text-xs font-bold",
|
|
259
|
-
children: ["v",
|
|
249
|
+
className: "size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-primary text-xs font-bold tabular-nums",
|
|
250
|
+
children: ["v", I.version ?? Q]
|
|
260
251
|
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
|
|
261
252
|
className: "text-sm font-semibold",
|
|
262
253
|
children: Y("security.secretDetail.history.currentVersion", "Current Active Version")
|
|
263
254
|
}), /* @__PURE__ */ h("p", {
|
|
264
255
|
className: "text-xs text-text-secondary",
|
|
265
|
-
children: Y("security.secretDetail.history.lastUpdated", "Last updated {date}", { date: new Date(
|
|
256
|
+
children: Y("security.secretDetail.history.lastUpdated", "Last updated {date}", { date: new Date(I.updatedAt).toLocaleString() })
|
|
266
257
|
})] })]
|
|
267
258
|
}), /* @__PURE__ */ h(i, {
|
|
268
259
|
variant: "success",
|
|
@@ -299,33 +290,34 @@ function D() {
|
|
|
299
290
|
children: Y("security.secretDetail.details.keyIdentifier", "Key Identifier")
|
|
300
291
|
}), /* @__PURE__ */ h("code", {
|
|
301
292
|
className: "text-xs font-mono bg-bg-sunken px-1.5 py-0.5 rounded block mt-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
302
|
-
children:
|
|
293
|
+
children: I.key
|
|
303
294
|
})] }),
|
|
304
295
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
|
|
305
296
|
className: "text-xs text-text-secondary",
|
|
306
297
|
children: Y("security.secretDetail.details.createdBy", "Created By")
|
|
307
298
|
}), /* @__PURE__ */ h("p", {
|
|
308
299
|
className: "text-sm font-medium mt-1",
|
|
309
|
-
children:
|
|
300
|
+
children: I.createdBy
|
|
310
301
|
})] }),
|
|
311
302
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
|
|
312
303
|
className: "text-xs text-text-secondary",
|
|
313
304
|
children: Y("security.secretDetail.details.createdAt", "Created At")
|
|
314
305
|
}), /* @__PURE__ */ g("div", {
|
|
315
306
|
className: "flex items-center gap-1.5 text-sm mt-1",
|
|
316
|
-
children: [/* @__PURE__ */ h(
|
|
307
|
+
children: [/* @__PURE__ */ h(y, { className: "size-3.5" }), new Date(I.createdAt).toLocaleDateString()]
|
|
317
308
|
})] }),
|
|
318
|
-
|
|
309
|
+
I.lastRotatedAt && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
|
|
319
310
|
className: "text-xs text-text-secondary",
|
|
320
311
|
children: Y("security.secretDetail.details.lastRotation", "Last Rotation")
|
|
321
312
|
}), /* @__PURE__ */ h("p", {
|
|
322
313
|
className: "text-sm mt-1",
|
|
323
|
-
children: new Date(
|
|
314
|
+
children: new Date(I.lastRotatedAt).toLocaleString()
|
|
324
315
|
})] })
|
|
325
316
|
]
|
|
326
317
|
})]
|
|
327
|
-
}), /* @__PURE__ */ g(
|
|
328
|
-
|
|
318
|
+
}), /* @__PURE__ */ g(D, {
|
|
319
|
+
treatment: "insight",
|
|
320
|
+
className: "p-6 space-y-4",
|
|
329
321
|
children: [/* @__PURE__ */ g("h3", {
|
|
330
322
|
className: "font-bold text-sm text-primary flex items-center gap-2",
|
|
331
323
|
children: [/* @__PURE__ */ h(ve, { className: "size-4" }), Y("security.secretDetail.security.title", "Security")]
|
|
@@ -337,34 +329,34 @@ function D() {
|
|
|
337
329
|
})]
|
|
338
330
|
})]
|
|
339
331
|
}),
|
|
340
|
-
/* @__PURE__ */ h(
|
|
341
|
-
open:
|
|
332
|
+
/* @__PURE__ */ h(C, {
|
|
333
|
+
open: He,
|
|
342
334
|
onOpenChange: (e) => {
|
|
343
335
|
e || K(!1);
|
|
344
336
|
},
|
|
345
|
-
children: /* @__PURE__ */ g(
|
|
337
|
+
children: /* @__PURE__ */ g(w, {
|
|
346
338
|
className: "max-w-2xl border-primary/20 max-h-[80vh] flex flex-col gap-0 p-0",
|
|
347
|
-
children: [/* @__PURE__ */ h(
|
|
339
|
+
children: [/* @__PURE__ */ h(T, {
|
|
348
340
|
className: "p-6 border-b border-border-subtle text-left",
|
|
349
341
|
children: /* @__PURE__ */ g("div", {
|
|
350
342
|
className: "flex items-center gap-3",
|
|
351
343
|
children: [/* @__PURE__ */ h("div", {
|
|
352
344
|
className: "p-2 rounded-full bg-action-primary-bg/10 text-primary",
|
|
353
|
-
children: /* @__PURE__ */ h(
|
|
354
|
-
}), /* @__PURE__ */ h(
|
|
345
|
+
children: /* @__PURE__ */ h(b, { className: "size-5" })
|
|
346
|
+
}), /* @__PURE__ */ h(E, {
|
|
355
347
|
className: "text-xl font-bold",
|
|
356
348
|
children: Y("security.secretDetail.history.modalTitle", "Version History")
|
|
357
349
|
})]
|
|
358
350
|
})
|
|
359
351
|
}), /* @__PURE__ */ h("div", {
|
|
360
352
|
className: "p-6 overflow-y-auto flex-1",
|
|
361
|
-
children:
|
|
353
|
+
children: Te ? /* @__PURE__ */ h("div", {
|
|
362
354
|
className: "flex justify-center py-8",
|
|
363
|
-
children: /* @__PURE__ */ h(
|
|
355
|
+
children: /* @__PURE__ */ h(x, { className: "size-8 animate-spin text-primary/60" })
|
|
364
356
|
}) : /* @__PURE__ */ h("div", {
|
|
365
357
|
className: "space-y-4",
|
|
366
|
-
children:
|
|
367
|
-
className: n("p-4 rounded-lg border", e.version ===
|
|
358
|
+
children: Ee.map((e) => /* @__PURE__ */ h("div", {
|
|
359
|
+
className: n("p-4 rounded-lg border", e.version === I.version ? "bg-action-primary-bg/5 border-primary/20" : "bg-bg-surface border-border-subtle"),
|
|
368
360
|
children: /* @__PURE__ */ g("div", {
|
|
369
361
|
className: "flex items-center justify-between",
|
|
370
362
|
children: [/* @__PURE__ */ g("div", { children: [
|
|
@@ -373,7 +365,7 @@ function D() {
|
|
|
373
365
|
children: [/* @__PURE__ */ h("span", {
|
|
374
366
|
className: "font-semibold",
|
|
375
367
|
children: Y("security.secretDetail.history.versionLabel", "Version {version}", { version: e.version })
|
|
376
|
-
}), e.version ===
|
|
368
|
+
}), e.version === I.version && /* @__PURE__ */ h(i, {
|
|
377
369
|
variant: "success",
|
|
378
370
|
className: "text-[10px] uppercase",
|
|
379
371
|
children: Y("security.common.status.active", "Active")
|
|
@@ -390,15 +382,15 @@ function D() {
|
|
|
390
382
|
className: "text-sm mt-2",
|
|
391
383
|
children: e.changeReason
|
|
392
384
|
})
|
|
393
|
-
] }), e.version !==
|
|
385
|
+
] }), e.version !== I.version && /* @__PURE__ */ h(oe, {
|
|
394
386
|
permission: "secret:update",
|
|
395
387
|
featureFlagKey: t.SECRET_ROLLBACK,
|
|
396
388
|
featureFlagDefault: !1,
|
|
397
389
|
children: /* @__PURE__ */ h(a, {
|
|
398
390
|
variant: "outline",
|
|
399
391
|
size: "sm",
|
|
400
|
-
onClick: () =>
|
|
401
|
-
disabled:
|
|
392
|
+
onClick: () => Ke(e.version),
|
|
393
|
+
disabled: Pe,
|
|
402
394
|
children: Y("security.secretDetail.actions.rollback", "Rollback")
|
|
403
395
|
})
|
|
404
396
|
})]
|
|
@@ -409,32 +401,32 @@ function D() {
|
|
|
409
401
|
})
|
|
410
402
|
}),
|
|
411
403
|
/* @__PURE__ */ h(te, {
|
|
412
|
-
isOpen:
|
|
404
|
+
isOpen: Re,
|
|
413
405
|
onClose: () => H(!1),
|
|
414
406
|
onConfirm: Z,
|
|
415
407
|
title: Y("security.secretDetail.delete.title", "Delete Secret"),
|
|
416
|
-
description: Y("security.secretDetail.delete.description", "Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.", { name:
|
|
417
|
-
confirmLabel:
|
|
408
|
+
description: Y("security.secretDetail.delete.description", "Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.", { name: I.name }),
|
|
409
|
+
confirmLabel: je ? Y("security.secretDetail.delete.deleting", "Deleting...") : Y("security.secretDetail.delete.confirm", "Delete Secret"),
|
|
418
410
|
variant: "destructive"
|
|
419
411
|
}),
|
|
420
|
-
/* @__PURE__ */ h(
|
|
421
|
-
open:
|
|
412
|
+
/* @__PURE__ */ h(C, {
|
|
413
|
+
open: Be,
|
|
422
414
|
onOpenChange: (e) => {
|
|
423
415
|
e || W(!1);
|
|
424
416
|
},
|
|
425
|
-
children: /* @__PURE__ */ h(
|
|
417
|
+
children: /* @__PURE__ */ h(w, {
|
|
426
418
|
className: "max-w-md border-primary/20",
|
|
427
419
|
children: /* @__PURE__ */ g("div", {
|
|
428
420
|
className: "space-y-4",
|
|
429
421
|
children: [
|
|
430
|
-
/* @__PURE__ */ h(
|
|
422
|
+
/* @__PURE__ */ h(T, {
|
|
431
423
|
className: "text-left",
|
|
432
424
|
children: /* @__PURE__ */ g("div", {
|
|
433
425
|
className: "flex items-center gap-3",
|
|
434
426
|
children: [/* @__PURE__ */ h("div", {
|
|
435
427
|
className: "p-2 rounded-full bg-action-primary-bg/10 text-primary",
|
|
436
|
-
children: /* @__PURE__ */ h(
|
|
437
|
-
}), /* @__PURE__ */ h(
|
|
428
|
+
children: /* @__PURE__ */ h(S, { className: "size-5" })
|
|
429
|
+
}), /* @__PURE__ */ h(E, {
|
|
438
430
|
className: "text-xl font-bold",
|
|
439
431
|
children: Y("security.secretDetail.rotate.title", "Rotate Secret")
|
|
440
432
|
})]
|
|
@@ -442,7 +434,7 @@ function D() {
|
|
|
442
434
|
}),
|
|
443
435
|
/* @__PURE__ */ h("p", {
|
|
444
436
|
className: "text-sm text-text-secondary",
|
|
445
|
-
children: Y("security.secretDetail.rotate.description", "Enter a new value for {name}. The current value will be moved to version history.", { name:
|
|
437
|
+
children: Y("security.secretDetail.rotate.description", "Enter a new value for {name}. The current value will be moved to version history.", { name: I.name })
|
|
446
438
|
}),
|
|
447
439
|
/* @__PURE__ */ g("div", {
|
|
448
440
|
className: "space-y-2",
|
|
@@ -466,29 +458,29 @@ function D() {
|
|
|
466
458
|
children: [/* @__PURE__ */ h(a, {
|
|
467
459
|
variant: "outline",
|
|
468
460
|
onClick: () => W(!1),
|
|
469
|
-
disabled:
|
|
461
|
+
disabled: z,
|
|
470
462
|
children: Y("security.common.actions.cancel", "Cancel")
|
|
471
463
|
}), /* @__PURE__ */ g(a, {
|
|
472
|
-
onClick:
|
|
473
|
-
disabled:
|
|
474
|
-
children: [
|
|
464
|
+
onClick: Ge,
|
|
465
|
+
disabled: z || !q.trim(),
|
|
466
|
+
children: [z ? /* @__PURE__ */ h(x, { className: "size-4 animate-spin" }) : /* @__PURE__ */ h(S, { className: "size-4" }), z ? Y("security.secretDetail.rotate.loading", "Rotating...") : Y("security.secretDetail.rotate.confirm", "Rotate Secret")]
|
|
475
467
|
})]
|
|
476
468
|
})
|
|
477
469
|
]
|
|
478
470
|
})
|
|
479
471
|
})
|
|
480
472
|
}),
|
|
481
|
-
|
|
482
|
-
isOpen:
|
|
473
|
+
k && A && /* @__PURE__ */ h(ue, {
|
|
474
|
+
isOpen: ze,
|
|
483
475
|
onClose: () => U(!1),
|
|
484
|
-
vaultId:
|
|
485
|
-
secretId:
|
|
486
|
-
name:
|
|
476
|
+
vaultId: k,
|
|
477
|
+
secretId: A,
|
|
478
|
+
name: I.name
|
|
487
479
|
})
|
|
488
480
|
]
|
|
489
481
|
});
|
|
490
482
|
}
|
|
491
483
|
//#endregion
|
|
492
|
-
export {
|
|
484
|
+
export { k as SecretDetailPage };
|
|
493
485
|
|
|
494
486
|
//# sourceMappingURL=SecretDetailPage.js.map
|