mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix(Azure Key Vault): Ignore disabled secrets
This commit is contained in:
@@ -516,12 +516,18 @@ const syncSecretsAzureKeyVault = async ({
|
||||
if (!lastSlashIndex) {
|
||||
lastSlashIndex = getAzureKeyVaultSecret.id.lastIndexOf("/");
|
||||
}
|
||||
if (!getAzureKeyVaultSecret.attributes.enabled) return null;
|
||||
|
||||
const azureKeyVaultSecret = await request.get(`${getAzureKeyVaultSecret.id}?api-version=7.3`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${accessToken}`
|
||||
}
|
||||
});
|
||||
let azureKeyVaultSecret;
|
||||
try {
|
||||
azureKeyVaultSecret = await request.get(`${getAzureKeyVaultSecret.id}?api-version=7.3`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${accessToken}`
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
throw new Error(`Failed to fetch Azure Key Vault secret: ${(err as Error).message}`);
|
||||
}
|
||||
|
||||
return {
|
||||
...azureKeyVaultSecret.data,
|
||||
@@ -529,13 +535,15 @@ const syncSecretsAzureKeyVault = async ({
|
||||
};
|
||||
})
|
||||
)
|
||||
).reduce(
|
||||
(obj, secret) => ({
|
||||
...obj,
|
||||
[secret.key]: secret
|
||||
}),
|
||||
{}
|
||||
);
|
||||
)
|
||||
.filter((secret) => secret !== null)
|
||||
.reduce(
|
||||
(obj, secret) => ({
|
||||
...obj,
|
||||
[secret.key]: secret
|
||||
}),
|
||||
{}
|
||||
);
|
||||
|
||||
const setSecrets: {
|
||||
key: string;
|
||||
|
||||
Reference in New Issue
Block a user