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
cap the project names listed when deletion is blocked by imports
DimitrisStaratzis906b7ac1cf64
diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.tsindex 817dcf7ea8..ac99caa5d2 100644--- a/backend/src/services/project/project-service.ts+++ b/backend/src/services/project/project-service.ts@@ -888,8 +888,13 @@ export const projectServiceFactory = ({? await projectDAL.findProjectsImportingFrom(project.id): [];if (importingProjects.length) {+ const preview = importingProjects+ .slice(0, 5)+ .map(({ name }) => `'${name}'`)+ .join(", ");+ const remaining = importingProjects.length - 5;throw new BadRequestError({- message: `Project '${project.name}' can't be deleted while other projects import secrets from it: ${importingProjects.map(({ name }) => `'${name}'`).join(", ")}. Remove those secret imports first, then retry.`+ message: `Project '${project.name}' can't be deleted while other projects import secrets from it: ${remaining > 0 ? `${preview}, and ${remaining} more` : preview}. Remove those secret imports first, then retry.`});}