requested changes

This commit is contained in:
Daniel Hougaard
2025-08-26 20:25:41 +02:00
parent 8f00bab61c
commit 2f375d6b65
3 changed files with 25 additions and 45 deletions
+12 -12
View File
@@ -97,7 +97,6 @@ import {
} from "./secret-types";
import { TSecretVersionDALFactory } from "./secret-version-dal";
import { TSecretVersionTagDALFactory } from "./secret-version-tag-dal";
import { validateSecretPath } from "../secret-v2-bridge/secret-v2-bridge-fns";
type TSecretServiceFactoryDep = {
secretDAL: TSecretDALFactory;
@@ -617,15 +616,6 @@ export const secretServiceFactory = ({
actionProjectType: ActionProjectType.SecretManager
});
await validateSecretPath(
{
projectId,
environment,
secretPath: path
},
folderDAL
);
let paths: { folderId: string; path: string }[] = [];
if (recursive) {
@@ -647,7 +637,12 @@ export const secretServiceFactory = ({
}
});
if (!deepPaths) return { secrets: [], imports: [] };
if (!deepPaths?.length) {
throw new NotFoundError({
message: `Folder with path '${path}' in environment '${environment}' was not found. Please ensure the environment slug and secret path is correct.`,
name: "SecretPathNotFound"
});
}
paths = deepPaths.map(({ folderId, path: p }) => ({ folderId, path: p }));
} else {
@@ -657,7 +652,12 @@ export const secretServiceFactory = ({
});
const folder = await folderDAL.findBySecretPath(projectId, environment, path);
if (!folder) return { secrets: [], imports: [] };
if (!folder) {
throw new NotFoundError({
message: `Folder with path '${path}' in environment '${environment}' was not found. Please ensure the environment slug and secret path is correct.`,
name: "SecretPathNotFound"
});
}
paths = [{ folderId: folder.id, path }];
}