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
avoid syncing disabled azure keys
McPizza033411335edec
diff --git a/backend/src/services/integration-auth/integration-sync-secret.ts b/backend/src/services/integration-auth/integration-sync-secret.tsindex f69b3fefcb..c147150f08 100644--- a/backend/src/services/integration-auth/integration-sync-secret.ts+++ b/backend/src/services/integration-auth/integration-sync-secret.ts@@ -473,7 +473,7 @@ const syncSecretsAzureKeyVault = async ({id: string; // secret URIvalue: string;attributes: {- enabled: true;+ enabled: boolean;created: number;updated: number;recoveryLevel: string;@@ -507,14 +507,21 @@ const syncSecretsAzureKeyVault = async ({return result;};- const getAzureKeyVaultSecrets = (- await paginateAzureKeyVaultSecrets(`${integration.app}/secrets?api-version=7.3`)- ).filter((secret) => secret.attributes.enabled);+ const getAzureKeyVaultSecrets = await paginateAzureKeyVaultSecrets(`${integration.app}/secrets?api-version=7.3`);++ const enabledAzureKeyVaultSecrets = getAzureKeyVaultSecrets.filter((secret) => secret.attributes.enabled);++ // disabled keys to skip sending updates to+ const disabledAzureKeyVaultSecretKeys = getAzureKeyVaultSecrets+ .filter(({ attributes }) => !attributes.enabled)+ .map((getAzureKeyVaultSecret) => {+ return getAzureKeyVaultSecret.id.substring(getAzureKeyVaultSecret.id.lastIndexOf("/") + 1);+ });let lastSlashIndex: number;const res = (await Promise.all(- getAzureKeyVaultSecrets.map(async (getAzureKeyVaultSecret) => {+ enabledAzureKeyVaultSecrets.map(async (getAzureKeyVaultSecret) => {if (!lastSlashIndex) {lastSlashIndex = getAzureKeyVaultSecret.id.lastIndexOf("/");}@@ -660,6 +667,7 @@ const syncSecretsAzureKeyVault = async ({}) => {let isSecretSet = false;let maxTries = 6;+ if (disabledAzureKeyVaultSecretKeys.includes(key)) return;while (!isSecretSet && maxTries > 0) {// try to set secret