mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 11:26:33 +00:00
fix: resolved recursive secret logic pulling secret from top
This commit is contained in:
@@ -334,7 +334,8 @@ export const recursivelyGetSecretPaths = async ({
|
|||||||
folderDAL,
|
folderDAL,
|
||||||
projectEnvDAL,
|
projectEnvDAL,
|
||||||
projectId,
|
projectId,
|
||||||
environment
|
environment,
|
||||||
|
currentPath
|
||||||
}: TRecursivelyFetchSecretsFromFoldersArg) => {
|
}: TRecursivelyFetchSecretsFromFoldersArg) => {
|
||||||
const env = await projectEnvDAL.findOne({
|
const env = await projectEnvDAL.findOne({
|
||||||
projectId,
|
projectId,
|
||||||
@@ -362,7 +363,11 @@ export const recursivelyGetSecretPaths = async ({
|
|||||||
folderId: p.folderId
|
folderId: p.folderId
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return paths;
|
const pathsInCurrentDirectory = paths.filter((folder) =>
|
||||||
|
folder.path.startsWith(currentPath === "/" ? "" : currentPath)
|
||||||
|
);
|
||||||
|
|
||||||
|
return pathsInCurrentDirectory;
|
||||||
};
|
};
|
||||||
// used to convert multi line ones to quotes ones with \n
|
// used to convert multi line ones to quotes ones with \n
|
||||||
const formatMultiValueEnv = (val?: string) => {
|
const formatMultiValueEnv = (val?: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user