Add Chef PKI sync

This commit is contained in:
Carlos Monastyrski
2025-11-19 00:59:18 -03:00
parent fa44c683b0
commit 3b35b22470
45 changed files with 1374 additions and 18 deletions
@@ -13,7 +13,8 @@ import { PkiSync, TPkiSync } from "@app/hooks/api/pkiSyncs";
import {
AwsCertificateManagerPkiSyncDestinationSection,
AzureKeyVaultPkiSyncDestinationSection
AzureKeyVaultPkiSyncDestinationSection,
ChefPkiSyncDestinationSection
} from "./PkiSyncDestinationSection/index";
const GenericFieldLabel = ({ label, children }: { label: string; children: React.ReactNode }) => (
@@ -41,6 +42,9 @@ export const PkiSyncDestinationSection = ({ pkiSync, onEditDestination }: Props)
case PkiSync.AzureKeyVault:
DestinationComponents = <AzureKeyVaultPkiSyncDestinationSection pkiSync={pkiSync} />;
break;
case PkiSync.Chef:
DestinationComponents = <ChefPkiSyncDestinationSection pkiSync={pkiSync} />;
break;
default:
// For future destinations, return null (no additional fields to show)
DestinationComponents = null;
@@ -0,0 +1,25 @@
import { TPkiSync } from "@app/hooks/api/pkiSyncs";
const GenericFieldLabel = ({ label, children }: { label: string; children: React.ReactNode }) => (
<div className="mb-4">
<p className="text-sm font-medium text-mineshaft-300">{label}</p>
<div className="text-sm text-mineshaft-300">{children}</div>
</div>
);
type Props = {
pkiSync: TPkiSync;
};
export const ChefPkiSyncDestinationSection = ({ pkiSync }: Props) => {
const dataBagName =
pkiSync.destinationConfig && "dataBagName" in pkiSync.destinationConfig
? pkiSync.destinationConfig.dataBagName
: undefined;
return (
<GenericFieldLabel label="Chef Data Bag Name">
{dataBagName || "Not specified"}
</GenericFieldLabel>
);
};
@@ -1,2 +1,3 @@
export { AwsCertificateManagerPkiSyncDestinationSection } from "./AwsCertificateManagerPkiSyncDestinationSection";
export { AzureKeyVaultPkiSyncDestinationSection } from "./AzureKeyVaultPkiSyncDestinationSection";
export { ChefPkiSyncDestinationSection } from "./ChefPkiSyncDestinationSection";