mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 10:27:26 +00:00
Fix(Azure Key Vault): Ignore disabled secrets
This commit is contained in:
@@ -516,12 +516,18 @@ const syncSecretsAzureKeyVault = async ({
|
|||||||
if (!lastSlashIndex) {
|
if (!lastSlashIndex) {
|
||||||
lastSlashIndex = getAzureKeyVaultSecret.id.lastIndexOf("/");
|
lastSlashIndex = getAzureKeyVaultSecret.id.lastIndexOf("/");
|
||||||
}
|
}
|
||||||
|
if (!getAzureKeyVaultSecret.attributes.enabled) return null;
|
||||||
|
|
||||||
const azureKeyVaultSecret = await request.get(`${getAzureKeyVaultSecret.id}?api-version=7.3`, {
|
let azureKeyVaultSecret;
|
||||||
headers: {
|
try {
|
||||||
Authorization: `Bearer ${accessToken}`
|
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 {
|
return {
|
||||||
...azureKeyVaultSecret.data,
|
...azureKeyVaultSecret.data,
|
||||||
@@ -529,13 +535,15 @@ const syncSecretsAzureKeyVault = async ({
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
).reduce(
|
)
|
||||||
(obj, secret) => ({
|
.filter((secret) => secret !== null)
|
||||||
...obj,
|
.reduce(
|
||||||
[secret.key]: secret
|
(obj, secret) => ({
|
||||||
}),
|
...obj,
|
||||||
{}
|
[secret.key]: secret
|
||||||
);
|
}),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
const setSecrets: {
|
const setSecrets: {
|
||||||
key: string;
|
key: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user