Add Humanitec secret sync integration

This commit is contained in:
carlosmonastyrski
2025-03-12 16:23:59 -03:00
parent 765be2d99d
commit 79d8a9debb
57 changed files with 1117 additions and 28 deletions
@@ -0,0 +1,14 @@
import { THumanitecSync } from "@app/hooks/api/secretSyncs/types/humanitec-sync";
import { getSecretSyncDestinationColValues } from "../helpers";
import { SecretSyncTableCell } from "../SecretSyncTableCell";
type Props = {
secretSync: THumanitecSync;
};
export const HumanitecSyncDestinationCol = ({ secretSync }: Props) => {
const { primaryText, secondaryText } = getSecretSyncDestinationColValues(secretSync);
return <SecretSyncTableCell primaryText={primaryText} secondaryText={secondaryText} />;
};
@@ -7,6 +7,7 @@ import { AzureKeyVaultDestinationSyncCol } from "./AzureKeyVaultDestinationSyncC
import { DatabricksSyncDestinationCol } from "./DatabricksSyncDestinationCol";
import { GcpSyncDestinationCol } from "./GcpSyncDestinationCol";
import { GitHubSyncDestinationCol } from "./GitHubSyncDestinationCol";
import { HumanitecSyncDestinationCol } from "./HumanitecSyncDestinationCol";
type Props = {
secretSync: TSecretSync;
@@ -28,6 +29,8 @@ export const SecretSyncDestinationCol = ({ secretSync }: Props) => {
return <AzureAppConfigurationDestinationSyncCol secretSync={secretSync} />;
case SecretSync.Databricks:
return <DatabricksSyncDestinationCol secretSync={secretSync} />;
case SecretSync.Humanitec:
return <HumanitecSyncDestinationCol secretSync={secretSync} />;
default:
throw new Error(
`Unhandled Secret Sync Destination Col: ${(secretSync as TSecretSync).destination}`
@@ -59,6 +59,10 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
case SecretSync.Databricks:
primaryText = destinationConfig.scope;
break;
case SecretSync.Humanitec:
primaryText = destinationConfig.app;
secondaryText = `Org - ${destinationConfig.org}`;
break;
default:
throw new Error(`Unhandled Destination Col Values ${destination}`);
}
@@ -0,0 +1,19 @@
import { SecretSyncLabel } from "@app/components/secret-syncs";
import { THumanitecSync } from "@app/hooks/api/secretSyncs/types/humanitec-sync";
type Props = {
secretSync: THumanitecSync;
};
export const HumanitecSyncDestinationSection = ({ secretSync }: Props) => {
const {
destinationConfig: { app, org }
} = secretSync;
return (
<>
<SecretSyncLabel label="App">{app}</SecretSyncLabel>
<SecretSyncLabel label="Org">{org}</SecretSyncLabel>
</>
);
};
@@ -17,6 +17,7 @@ import { GitHubSyncDestinationSection } from "@app/pages/secret-manager/SecretSy
import { AzureAppConfigurationSyncDestinationSection } from "./AzureAppConfigurationSyncDestinationSection";
import { AzureKeyVaultSyncDestinationSection } from "./AzureKeyVaultSyncDestinationSection";
import { GcpSyncDestinationSection } from "./GcpSyncDestinationSection";
import { HumanitecSyncDestinationSection } from "./HumanitecSyncDestinationSection";
type Props = {
secretSync: TSecretSync;
@@ -53,6 +54,9 @@ export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }:
case SecretSync.Databricks:
DestinationComponents = <DatabricksSyncDestinationSection secretSync={secretSync} />;
break;
case SecretSync.Humanitec:
DestinationComponents = <HumanitecSyncDestinationSection secretSync={secretSync} />;
break;
default:
throw new Error(`Unhandled Destination Section components: ${destination}`);
}
@@ -46,6 +46,7 @@ export const SecretSyncOptionsSection = ({ secretSync, onEditOptions }: Props) =
case SecretSync.AzureKeyVault:
case SecretSync.AzureAppConfiguration:
case SecretSync.Databricks:
case SecretSync.Humanitec:
AdditionalSyncOptionsComponent = null;
break;
default: