Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
refactor(secret-sync): move AKV certificate content types to module scope
Igor Correae7b8e419fe12
diff --git a/backend/src/services/secret-sync/azure-key-vault/azure-key-vault-sync-fns.ts b/backend/src/services/secret-sync/azure-key-vault/azure-key-vault-sync-fns.tsindex e96d4d5330..1fecde89c7 100644--- a/backend/src/services/secret-sync/azure-key-vault/azure-key-vault-sync-fns.ts+++ b/backend/src/services/secret-sync/azure-key-vault/azure-key-vault-sync-fns.ts@@ -16,9 +16,9 @@ type TAzureKeyVaultSyncFactoryDeps = {kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;};-export const azureKeyVaultSyncFactory = ({ kmsService, appConnectionDAL }: TAzureKeyVaultSyncFactoryDeps) => {- const AZURE_KEY_VAULT_CERTIFICATE_CONTENT_TYPES = ["application/x-pkcs12", "application/x-pem-file"];+const AZURE_KEY_VAULT_CERTIFICATE_CONTENT_TYPES = ["application/x-pkcs12", "application/x-pem-file"] as const;+export const azureKeyVaultSyncFactory = ({ kmsService, appConnectionDAL }: TAzureKeyVaultSyncFactoryDeps) => {const $getAzureKeyVaultSecrets = async (accessToken: string,vaultBaseUrl: string,@@ -49,7 +49,10 @@ export const azureKeyVaultSyncFactory = ({ kmsService, appConnectionDAL }: TAzur// filter them out at the list stage if the option is enabled (avoids fetching their values too)const visibleSecrets = disableCertificateImport? getAzureKeyVaultSecrets.filter(- (secret) => !AZURE_KEY_VAULT_CERTIFICATE_CONTENT_TYPES.includes(secret.contentType ?? "")+ (secret) =>+ !AZURE_KEY_VAULT_CERTIFICATE_CONTENT_TYPES.includes(+ secret.contentType as (typeof AZURE_KEY_VAULT_CERTIFICATE_CONTENT_TYPES)[number]+ )): getAzureKeyVaultSecrets;