Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Fixed path return
x032205272336092d48
diff --git a/backend/src/db/schemas/secret-folders.ts b/backend/src/db/schemas/secret-folders.tsindex 799f2f24fa..09e2fe8c14 100644--- a/backend/src/db/schemas/secret-folders.ts+++ b/backend/src/db/schemas/secret-folders.ts@@ -17,8 +17,7 @@ export const SecretFoldersSchema = z.object({parentId: z.string().uuid().nullable().optional(),isReserved: z.boolean().default(false).nullable().optional(),description: z.string().nullable().optional(),- lastSecretModified: z.date().nullable().optional(),- path: z.string()+ lastSecretModified: z.date().nullable().optional()});export type TSecretFolders = z.infer<typeof SecretFoldersSchema>;diff --git a/backend/src/server/routes/v1/secret-folder-router.ts b/backend/src/server/routes/v1/secret-folder-router.tsindex cfc46ed996..8712591479 100644--- a/backend/src/server/routes/v1/secret-folder-router.ts+++ b/backend/src/server/routes/v1/secret-folder-router.ts@@ -58,7 +58,9 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>}),response: {200: z.object({- folder: SecretFoldersSchema+ folder: SecretFoldersSchema.extend({+ path: z.string()+ })})}},@@ -143,7 +145,9 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>}),response: {200: z.object({- folder: SecretFoldersSchema+ folder: SecretFoldersSchema.extend({+ path: z.string()+ })})}},diff --git a/backend/src/services/secret-folder/secret-folder-service.ts b/backend/src/services/secret-folder/secret-folder-service.tsindex a60d293483..90cc25710b 100644--- a/backend/src/services/secret-folder/secret-folder-service.ts+++ b/backend/src/services/secret-folder/secret-folder-service.ts@@ -238,8 +238,16 @@ export const secretFolderServiceFactory = ({return doc;});+ const [folderWithFullPath] = await folderDAL.findSecretPathByFolderIds(projectId, [folder.id]);++ if (!folderWithFullPath) {+ throw new NotFoundError({+ message: `Failed to retrieve path for folder with ID '${folder.id}'`+ });+ }+await snapshotService.performSnapshot(folder.parentId as string);- return folder;+ return { ...folder, path: folderWithFullPath.path };};const updateManyFolders = async ({@@ -496,8 +504,27 @@ export const secretFolderServiceFactory = ({return doc;});+ const foldersWithFullPaths = await folderDAL.findSecretPathByFolderIds(projectId, [newFolder.id, folder.id]);++ const newFolderWithFullPath = foldersWithFullPaths.find((f) => f?.id === newFolder.id);+ if (!newFolderWithFullPath) {+ throw new NotFoundError({+ message: `Failed to retrieve path for folder with ID '${newFolder.id}'`+ });+ }++ const folderWithFullPath = foldersWithFullPaths.find((f) => f?.id === folder.id);+ if (!folderWithFullPath) {+ throw new NotFoundError({+ message: `Failed to retrieve path for folder with ID '${folder.id}'`+ });+ }+await snapshotService.performSnapshot(newFolder.parentId as string);- return { folder: newFolder, old: folder };+ return {+ folder: { ...newFolder, path: newFolderWithFullPath.path },+ old: { ...folder, path: folderWithFullPath.path }+ };};const $checkFolderPolicy = async ({