chore: requested changes

This commit is contained in:
Daniel Hougaard
2025-02-08 04:27:17 +04:00
parent 7286f9a9e6
commit e341bbae9d
4 changed files with 31 additions and 3 deletions
+9
View File
@@ -1739,6 +1739,15 @@ export const SecretSyncs = {
OWNER: "The name of the GitHub account owner of the repository.", OWNER: "The name of the GitHub account owner of the repository.",
REPO: "The name of the GitHub repository.", REPO: "The name of the GitHub repository.",
ENV: "The name of the GitHub environment." ENV: "The name of the GitHub environment."
},
AZURE_KEY_VAULT: {
VAULT_BASE_URL:
"The base URL of the Azure Key Vault to sync secrets to. Example: https://example.vault.azure.net/"
},
AZURE_APP_CONFIGURATION: {
CONFIGURATION_URL:
"The URL of the Azure App Configuration to sync secrets to. Example: https://example.azconfig.io/",
LABEL: "An optional label to assign to secrets created in Azure App Configuration."
} }
} }
}; };
@@ -1,5 +1,6 @@
import { z } from "zod"; import { z } from "zod";
import { SecretSyncs } from "@app/lib/api-docs";
import { AppConnection } from "@app/services/app-connection/app-connection-enums"; import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums"; import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
import { import {
@@ -10,8 +11,11 @@ import {
import { TSyncOptionsConfig } from "@app/services/secret-sync/secret-sync-types"; import { TSyncOptionsConfig } from "@app/services/secret-sync/secret-sync-types";
const AzureAppConfigurationSyncDestinationConfigSchema = z.object({ const AzureAppConfigurationSyncDestinationConfigSchema = z.object({
configurationUrl: z.string().min(1, "App Configuration URL required"), configurationUrl: z
label: z.string().optional() .string()
.min(1, "App Configuration URL required")
.describe(SecretSyncs.DESTINATION_CONFIG.AZURE_APP_CONFIGURATION.CONFIGURATION_URL),
label: z.string().optional().describe(SecretSyncs.DESTINATION_CONFIG.AZURE_APP_CONFIGURATION.LABEL)
}); });
const AzureAppConfigurationSyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: true }; const AzureAppConfigurationSyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: true };
@@ -1,5 +1,6 @@
import { z } from "zod"; import { z } from "zod";
import { SecretSyncs } from "@app/lib/api-docs";
import { AppConnection } from "@app/services/app-connection/app-connection-enums"; import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums"; import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
import { import {
@@ -10,7 +11,11 @@ import {
import { TSyncOptionsConfig } from "@app/services/secret-sync/secret-sync-types"; import { TSyncOptionsConfig } from "@app/services/secret-sync/secret-sync-types";
const AzureKeyVaultSyncDestinationConfigSchema = z.object({ const AzureKeyVaultSyncDestinationConfigSchema = z.object({
vaultBaseUrl: z.string().url("Invalid vault base URL format").min(1, "Vault base URL required") vaultBaseUrl: z
.string()
.url("Invalid vault base URL format")
.min(1, "Vault base URL required")
.describe(SecretSyncs.DESTINATION_CONFIG.AZURE_KEY_VAULT.VAULT_BASE_URL)
}); });
const AzureKeyVaultSyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: true }; const AzureKeyVaultSyncOptionsConfig: TSyncOptionsConfig = { canImportSecrets: true };
@@ -5,6 +5,8 @@ import { FormControl, Input } from "@app/components/v2";
import { SecretSync } from "@app/hooks/api/secretSyncs"; import { SecretSync } from "@app/hooks/api/secretSyncs";
import { TSecretSyncForm } from "../schemas"; import { TSecretSyncForm } from "../schemas";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faInfoCircle } from "@fortawesome/free-solid-svg-icons";
export const AzureKeyVaultSyncFields = () => { export const AzureKeyVaultSyncFields = () => {
const { control, setValue } = useFormContext< const { control, setValue } = useFormContext<
@@ -32,6 +34,14 @@ export const AzureKeyVaultSyncFields = () => {
</FormControl> </FormControl>
)} )}
/> />
<div className="mt-4 flex items-center gap-2 text-xs text-yellow-400">
<FontAwesomeIcon icon={faInfoCircle} />
<p>
Secret keys with underscores (_) will be converted to hyphens (-) when syncing to Azure
Key Vault.
</p>
</div>
</> </>
); );
}; };