Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: move secret validation table to secrets management settings page

Scott Wilsonf01faea72865
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
index f3c79963a9..48ab071b70 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
@@ -106,7 +106,6 @@ export const SM_SETTINGS_SUBMENU: Submenu = {
items: [
{ label: "General", icon: Cog, tab: "tab-project-general" },
{ label: "Secrets Management", icon: FileKey, tab: "tab-secret-general" },
- { label: "Secret Validation Rules", icon: ShieldCheck, tab: "tab-secret-validation-rules" },
{ label: "Encryption", icon: Lock, tab: "tab-project-encryption" },
{ label: "Workflow Integrations", icon: Plug, tab: "tab-workflow-integrations" },
{ label: "Webhooks", icon: Cable, tab: "tab-project-webhooks" }
diff --git a/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx b/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx
index 8610d1044a..59dc7dd57f 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/SettingsPage.tsx
@@ -11,7 +11,6 @@ import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/Pr
import { EncryptionTab } from "./components/EncryptionTab";
import { SecretSettingsTab } from "./components/ProjectGeneralTab";
-import { SecretValidationRulesTab } from "./components/SecretValidationRulesTab";
import { WebhooksTab } from "./components/WebhooksTab";
import { WorkflowIntegrationTab } from "./components/WorkflowIntegrationSection";
@@ -27,10 +26,6 @@ export const SettingsPage = () => {
const tabs = [
{ key: "tab-project-general", Component: ProjectGeneralTab },
{ key: "tab-secret-general", Component: SecretSettingsTab },
- {
- key: "tab-secret-validation-rules",
- Component: SecretValidationRulesTab
- },
{
key: "tab-project-encryption",
isHidden: currentProject?.version !== ProjectVersion.V3,
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/ProjectGeneralTab/ProjectGeneralTab.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/ProjectGeneralTab/ProjectGeneralTab.tsx
index 4181778a2c..3e0ee0f760 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/ProjectGeneralTab/ProjectGeneralTab.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/ProjectGeneralTab/ProjectGeneralTab.tsx
@@ -9,6 +9,7 @@ import { SecretDetectionIgnoreValuesSection } from "../SecretDetectionIgnoreValu
import { SecretSharingSection } from "../SecretSharingSection";
import { SecretSnapshotsLegacySection } from "../SecretSnapshotsLegacySection";
import { SecretTagsSection } from "../SecretTagsSection";
+import { SecretValidationRulesSection } from "../SecretValidationRulesSection";
export const SecretSettingsTab = () => {
const { config } = useServerConfig();
@@ -17,6 +18,7 @@ export const SecretSettingsTab = () => {
<div>
<EnvironmentSection />
<SecretTagsSection />
+ <SecretValidationRulesSection />
<AutoCapitalizationSection />
<EnforceEncryptedMetadataSection />
<SecretSharingSection />
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
index 0d45244fa0..9c29371576 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/SecretValidationRulesSection/SecretValidationRulesSection.tsx
@@ -450,9 +450,7 @@ export const SecretValidationRulesSection = () => {
<Card className="mb-6">
<CardHeader>
<CardTitle>Secret Validation Rules</CardTitle>
- <CardDescription>
- Define validation constraints for secret keys and values
- </CardDescription>
+ <CardDescription>Define validation constraints for secret keys and values</CardDescription>
<CardAction>
<ProjectPermissionCan I={ProjectPermissionActions.Edit} a={ProjectPermissionSub.Settings}>
{(isAllowed) => (
@@ -485,136 +483,134 @@ export const SecretValidationRulesSection = () => {
</div>
)}
{!isLoading && rules.length === 0 ? (
- <Empty className="border">
- <EmptyHeader>
- <EmptyTitle>No validation rules configured</EmptyTitle>
- <EmptyDescription>
- Create a rule to enforce validation constraints on secret keys and values
- </EmptyDescription>
- </EmptyHeader>
- <EmptyContent>
- <ProjectPermissionCan
- I={ProjectPermissionActions.Edit}
- a={ProjectPermissionSub.Settings}
- >
- {(isAllowed) => (
- <Tooltip>
- <TooltipTrigger asChild>
- <span>
- <Button
- variant="outline"
- size="xs"
- isDisabled={!isAllowed}
- onClick={() => setSheetState({ open: true, mode: "create" })}
- >
- <PlusIcon className="size-4" />
- Create Rule
- </Button>
- </span>
- </TooltipTrigger>
- <TooltipContent side="top" hidden={isAllowed}>
- <p>Access restricted</p>
- </TooltipContent>
- </Tooltip>
- )}
- </ProjectPermissionCan>
- </EmptyContent>
- </Empty>
- ) : (
- !isLoading && (
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead>Name</TableHead>
- <TableHead>Type</TableHead>
- <TableHead>Scope</TableHead>
- <TableHead>Status</TableHead>
- <TableHead className="w-12" />
- </TableRow>
- </TableHeader>
- <TableBody>
- {rules.map((rule) => (
- <TableRow key={rule.id}>
- <TableCell className="py-3">
- <div className="flex items-center">
- <span className="text-sm font-medium text-foreground">{rule.name}</span>
- {rule.description && (
- <Tooltip>
- <TooltipTrigger asChild>
- <InfoIcon className="ml-1.5 size-3.5 text-muted" />
- </TooltipTrigger>
- <TooltipContent>{rule.description}</TooltipContent>
- </Tooltip>
- )}
- </div>
- </TableCell>
- <TableCell className="py-3">
- <Badge variant="neutral">
- {RULE_TYPE_LABELS[rule.type as string as RuleType] ?? rule.type}
- </Badge>
- </TableCell>
- <TableCell className="py-3">
- <div className="flex items-center gap-1.5">
- <Badge variant="neutral">{resolveEnvName(rule.envId)}</Badge>
- <Badge variant="neutral">{rule.secretPath}</Badge>
- </div>
- </TableCell>
- <TableCell className="py-3">
- <Badge variant={rule.isActive ? "success" : "neutral"}>
- {rule.isActive ? "Active" : "Inactive"}
- </Badge>
- </TableCell>
- <TableCell className="py-3">
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton aria-label="Actions" variant="ghost" size="xs">
- <EllipsisVerticalIcon className="size-4" />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <ProjectPermissionCan
- I={ProjectPermissionActions.Edit}
- a={ProjectPermissionSub.Settings}
+ <Empty className="border">
+ <EmptyHeader>
+ <EmptyTitle>No validation rules configured</EmptyTitle>
+ <EmptyDescription>
+ Create a rule to enforce validation constraints on secret keys and values
+ </EmptyDescription>
+ </EmptyHeader>
+ <EmptyContent>
+ <ProjectPermissionCan
+ I={ProjectPermissionActions.Edit}
+ a={ProjectPermissionSub.Settings}
+ >
+ {(isAllowed) => (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span>
+ <Button
+ variant="outline"
+ size="xs"
+ isDisabled={!isAllowed}
+ onClick={() => setSheetState({ open: true, mode: "create" })}
+ >
+ <PlusIcon className="size-4" />
+ Create Rule
+ </Button>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent side="top" hidden={isAllowed}>
+ <p>Access restricted</p>
+ </TooltipContent>
+ </Tooltip>
+ )}
+ </ProjectPermissionCan>
+ </EmptyContent>
+ </Empty>
+ ) : (
+ !isLoading && (
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>Name</TableHead>
+ <TableHead>Type</TableHead>
+ <TableHead>Scope</TableHead>
+ <TableHead>Status</TableHead>
+ <TableHead className="w-12" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {rules.map((rule) => (
+ <TableRow key={rule.id}>
+ <TableCell className="py-3">
+ <div className="flex items-center">
+ <span className="text-sm font-medium text-foreground">{rule.name}</span>
+ {rule.description && (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <InfoIcon className="ml-1.5 size-3.5 text-muted" />
+ </TooltipTrigger>
+ <TooltipContent>{rule.description}</TooltipContent>
+ </Tooltip>
+ )}
+ </div>
+ </TableCell>
+ <TableCell className="py-3">
+ <Badge variant="neutral">
+ {RULE_TYPE_LABELS[rule.type as string as RuleType] ?? rule.type}
+ </Badge>
+ </TableCell>
+ <TableCell className="py-3">
+ <div className="flex items-center gap-1.5">
+ <Badge variant="neutral">{resolveEnvName(rule.envId)}</Badge>
+ <Badge variant="neutral">{rule.secretPath}</Badge>
+ </div>
+ </TableCell>
+ <TableCell className="py-3">
+ <Badge variant={rule.isActive ? "success" : "neutral"}>
+ {rule.isActive ? "Active" : "Inactive"}
+ </Badge>
+ </TableCell>
+ <TableCell className="py-3">
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton aria-label="Actions" variant="ghost" size="xs">
+ <EllipsisVerticalIcon className="size-4" />
+ </IconButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <ProjectPermissionCan
+ I={ProjectPermissionActions.Edit}
+ a={ProjectPermissionSub.Settings}
+ >
+ {(isAllowed) => (
+ <DropdownMenuItem
+ isDisabled={!isAllowed}
+ onClick={() =>
+ setSheetState({ open: true, mode: "edit", ruleId: rule.id })
+ }
>
- {(isAllowed) => (
- <DropdownMenuItem
- isDisabled={!isAllowed}
- onClick={() =>
- setSheetState({ open: true, mode: "edit", ruleId: rule.id })
- }
- >
- <PencilIcon className="mr-2 size-4" />
- Edit
- </DropdownMenuItem>
- )}
- </ProjectPermissionCan>
- <ProjectPermissionCan
- I={ProjectPermissionActions.Edit}
- a={ProjectPermissionSub.Settings}
+ <PencilIcon className="mr-2 size-4" />
+ Edit
+ </DropdownMenuItem>
+ )}
+ </ProjectPermissionCan>
+ <ProjectPermissionCan
+ I={ProjectPermissionActions.Edit}
+ a={ProjectPermissionSub.Settings}
+ >
+ {(isAllowed) => (
+ <DropdownMenuItem
+ variant="danger"
+ isDisabled={!isAllowed}
+ onClick={() => setDeleteRuleId(rule.id)}
>
- {(isAllowed) => (
- <DropdownMenuItem
- variant="danger"
- isDisabled={!isAllowed}
- onClick={() => setDeleteRuleId(rule.id)}
- >
- <TrashIcon className="mr-2 size-4" />
- Delete
- </DropdownMenuItem>
- )}
- </ProjectPermissionCan>
- </DropdownMenuContent>
- </DropdownMenu>
- </TableCell>
- </TableRow>
- ))}
- </TableBody>
- </Table>
- )
- )}
- </div>
- </div>
- </div>
+ <TrashIcon className="mr-2 size-4" />
+ Delete
+ </DropdownMenuItem>
+ )}
+ </ProjectPermissionCan>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ )
+ )}
+ </CardContent>
<AlertDialog
open={deleteRuleId !== null}
@@ -680,6 +676,6 @@ export const SecretValidationRulesSection = () => {
)}
</SheetContent>
</Sheet>
- </div>
+ </Card>
);
};
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/index.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/index.tsx
index 7b58012626..067aba19d0 100644
--- a/frontend/src/pages/secret-manager/SettingsPage/components/index.tsx
+++ b/frontend/src/pages/secret-manager/SettingsPage/components/index.tsx
@@ -3,4 +3,4 @@ export { BackfillSecretReferenceSecretion } from "./BackfillSecretReferenceSecti
export { EnforceEncryptedMetadataSection } from "./EnforceEncryptedMetadataSection";
export { EnvironmentSection } from "./EnvironmentSection";
export { SecretTagsSection } from "./SecretTagsSection";
-export { SecretValidationRulesTab } from "./SecretValidationRulesTab";
+export { SecretValidationRulesSection } from "./SecretValidationRulesSection";