mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 10:29:17 +00:00
Fix: Restructured recursive path functions as suggested by Akhil
This commit is contained in:
@@ -74,12 +74,6 @@ type TGetPathsDTO = {
|
||||
interface FolderMap {
|
||||
[parentId: string]: TSecretFolders[];
|
||||
}
|
||||
|
||||
export const recursivelyGetSecretPaths = ({
|
||||
folderDAL,
|
||||
projectEnvDAL,
|
||||
permissionService
|
||||
}: TRecursivelyFetchSecretsFromFoldersArg) => {
|
||||
const buildHierarchy = (folders: TSecretFolders[]): FolderMap => {
|
||||
const map: FolderMap = {};
|
||||
map.null = []; // Initialize mapping for root directory
|
||||
@@ -129,7 +123,12 @@ export const recursivelyGetSecretPaths = ({
|
||||
return paths;
|
||||
};
|
||||
|
||||
return async ({ projectId, environment, currentPath, auth }: TGetPathsDTO) => {
|
||||
export const recursivelyGetSecretPaths = ({
|
||||
folderDAL,
|
||||
projectEnvDAL,
|
||||
permissionService
|
||||
}: TRecursivelyFetchSecretsFromFoldersArg) => {
|
||||
const getPaths = async ({ projectId, environment, currentPath, auth }: TGetPathsDTO) => {
|
||||
const env = await projectEnvDAL.findOne({
|
||||
projectId,
|
||||
slug: environment
|
||||
@@ -175,6 +174,8 @@ export const recursivelyGetSecretPaths = ({
|
||||
|
||||
return allowedPaths;
|
||||
};
|
||||
|
||||
return getPaths;
|
||||
};
|
||||
|
||||
type TInterpolateSecretArg = {
|
||||
|
||||
Reference in New Issue
Block a user