mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 01:05:40 +00:00
secret sync + tweaks
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
import { TOCIVaultSync } from "@app/hooks/api/secretSyncs/types/oci-vault-sync";
|
||||
|
||||
import { getSecretSyncDestinationColValues } from "../helpers";
|
||||
import { SecretSyncTableCell } from "../SecretSyncTableCell";
|
||||
|
||||
type Props = {
|
||||
secretSync: TOCIVaultSync;
|
||||
};
|
||||
|
||||
export const OCIVaultSyncDestinationCol = ({ secretSync }: Props) => {
|
||||
const { primaryText, secondaryText } = getSecretSyncDestinationColValues(secretSync);
|
||||
|
||||
return <SecretSyncTableCell primaryText={primaryText} secondaryText={secondaryText} />;
|
||||
};
|
||||
+3
@@ -10,6 +10,7 @@ import { GcpSyncDestinationCol } from "./GcpSyncDestinationCol";
|
||||
import { GitHubSyncDestinationCol } from "./GitHubSyncDestinationCol";
|
||||
import { HCVaultSyncDestinationCol } from "./HCVaultSyncDestinationCol";
|
||||
import { HumanitecSyncDestinationCol } from "./HumanitecSyncDestinationCol";
|
||||
import { OCIVaultSyncDestinationCol } from "./OCIVaultSyncDestinationCol";
|
||||
import { TeamCitySyncDestinationCol } from "./TeamCitySyncDestinationCol";
|
||||
import { TerraformCloudSyncDestinationCol } from "./TerraformCloudSyncDestinationCol";
|
||||
import { VercelSyncDestinationCol } from "./VercelSyncDestinationCol";
|
||||
@@ -49,6 +50,8 @@ export const SecretSyncDestinationCol = ({ secretSync }: Props) => {
|
||||
return <HCVaultSyncDestinationCol secretSync={secretSync} />;
|
||||
case SecretSync.TeamCity:
|
||||
return <TeamCitySyncDestinationCol secretSync={secretSync} />;
|
||||
case SecretSync.OCIVault:
|
||||
return <OCIVaultSyncDestinationCol secretSync={secretSync} />;
|
||||
default:
|
||||
throw new Error(
|
||||
`Unhandled Secret Sync Destination Col: ${(secretSync as TSecretSync).destination}`
|
||||
|
||||
+5
@@ -102,6 +102,11 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
|
||||
primaryText = destinationConfig.project;
|
||||
secondaryText = destinationConfig.buildConfig;
|
||||
break;
|
||||
case SecretSync.OCIVault:
|
||||
// TODO(andrey): Truncating these may make them look better
|
||||
primaryText = destinationConfig.compartmentOcid;
|
||||
secondaryText = destinationConfig.vaultOcid;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unhandled Destination Col Values ${destination}`);
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { TOCIVaultSync } from "@app/hooks/api/secretSyncs/types/oci-vault-sync";
|
||||
|
||||
type Props = {
|
||||
secretSync: TOCIVaultSync;
|
||||
};
|
||||
|
||||
export const OCIVaultSyncDestinationSection = ({ secretSync }: Props) => {
|
||||
const {
|
||||
destinationConfig: { compartmentOcid, keyOcid, vaultOcid }
|
||||
} = secretSync;
|
||||
|
||||
return (
|
||||
<>
|
||||
<GenericFieldLabel label="Compartment OCID">{compartmentOcid}</GenericFieldLabel>
|
||||
<GenericFieldLabel label="Vault OCID">{vaultOcid}</GenericFieldLabel>
|
||||
<GenericFieldLabel label="Key OCID">{keyOcid}</GenericFieldLabel>
|
||||
</>
|
||||
);
|
||||
};
|
||||
+4
@@ -20,6 +20,7 @@ import { GcpSyncDestinationSection } from "./GcpSyncDestinationSection";
|
||||
import { GitHubSyncDestinationSection } from "./GitHubSyncDestinationSection";
|
||||
import { HCVaultSyncDestinationSection } from "./HCVaultSyncDestinationSection";
|
||||
import { HumanitecSyncDestinationSection } from "./HumanitecSyncDestinationSection";
|
||||
import { OCIVaultSyncDestinationSection } from "./OCIVaultSyncDestinationSection";
|
||||
import { TeamCitySyncDestinationSection } from "./TeamCitySyncDestinationSection";
|
||||
import { TerraformCloudSyncDestinationSection } from "./TerraformCloudSyncDestinationSection";
|
||||
import { VercelSyncDestinationSection } from "./VercelSyncDestinationSection";
|
||||
@@ -81,6 +82,9 @@ export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }:
|
||||
case SecretSync.TeamCity:
|
||||
DestinationComponents = <TeamCitySyncDestinationSection secretSync={secretSync} />;
|
||||
break;
|
||||
case SecretSync.OCIVault:
|
||||
DestinationComponents = <OCIVaultSyncDestinationSection secretSync={secretSync} />;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unhandled Destination Section components: ${destination}`);
|
||||
}
|
||||
|
||||
+1
@@ -54,6 +54,7 @@ export const SecretSyncOptionsSection = ({ secretSync, onEditOptions }: Props) =
|
||||
case SecretSync.Windmill:
|
||||
case SecretSync.HCVault:
|
||||
case SecretSync.TeamCity:
|
||||
case SecretSync.OCIVault:
|
||||
AdditionalSyncOptionsComponent = null;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user