mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 16:27:46 +00:00
improve filtering
This commit is contained in:
@@ -507,7 +507,9 @@ const syncSecretsAzureKeyVault = async ({
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAzureKeyVaultSecrets = await paginateAzureKeyVaultSecrets(`${integration.app}/secrets?api-version=7.3`);
|
const getAzureKeyVaultSecrets = (
|
||||||
|
await paginateAzureKeyVaultSecrets(`${integration.app}/secrets?api-version=7.3`)
|
||||||
|
).filter((secret) => secret.attributes.enabled);
|
||||||
|
|
||||||
let lastSlashIndex: number;
|
let lastSlashIndex: number;
|
||||||
const res = (
|
const res = (
|
||||||
@@ -516,7 +518,6 @@ const syncSecretsAzureKeyVault = async ({
|
|||||||
if (!lastSlashIndex) {
|
if (!lastSlashIndex) {
|
||||||
lastSlashIndex = getAzureKeyVaultSecret.id.lastIndexOf("/");
|
lastSlashIndex = getAzureKeyVaultSecret.id.lastIndexOf("/");
|
||||||
}
|
}
|
||||||
if (!getAzureKeyVaultSecret.attributes.enabled) return null;
|
|
||||||
|
|
||||||
let azureKeyVaultSecret;
|
let azureKeyVaultSecret;
|
||||||
try {
|
try {
|
||||||
@@ -535,15 +536,13 @@ const syncSecretsAzureKeyVault = async ({
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
)
|
).reduce(
|
||||||
.filter((secret) => secret !== null)
|
(obj, secret) => ({
|
||||||
.reduce(
|
...obj,
|
||||||
(obj, secret) => ({
|
[secret.key]: secret
|
||||||
...obj,
|
}),
|
||||||
[secret.key]: secret
|
{}
|
||||||
}),
|
);
|
||||||
{}
|
|
||||||
);
|
|
||||||
|
|
||||||
const setSecrets: {
|
const setSecrets: {
|
||||||
key: string;
|
key: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user