mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 00:27:30 +00:00
pause project delete
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
|||||||
UsersSchema
|
UsersSchema
|
||||||
} from "@app/db/schemas";
|
} from "@app/db/schemas";
|
||||||
import { PROJECTS } from "@app/lib/api-docs";
|
import { PROJECTS } from "@app/lib/api-docs";
|
||||||
|
import { BadRequestError } from "@app/lib/errors";
|
||||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||||
import { AuthMode } from "@app/services/auth/auth-type";
|
import { AuthMode } from "@app/services/auth/auth-type";
|
||||||
@@ -192,18 +193,19 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
handler: async (req) => {
|
handler: async () => {
|
||||||
const workspace = await server.services.project.deleteProject({
|
// const workspace = await server.services.project.deleteProject({
|
||||||
filter: {
|
// filter: {
|
||||||
type: ProjectFilterType.ID,
|
// type: ProjectFilterType.ID,
|
||||||
projectId: req.params.workspaceId
|
// projectId: req.params.workspaceId
|
||||||
},
|
// },
|
||||||
actorId: req.permission.id,
|
// actorId: req.permission.id,
|
||||||
actorAuthMethod: req.permission.authMethod,
|
// actorAuthMethod: req.permission.authMethod,
|
||||||
actor: req.permission.type,
|
// actor: req.permission.type,
|
||||||
actorOrgId: req.permission.orgId
|
// actorOrgId: req.permission.orgId
|
||||||
});
|
// });
|
||||||
return { workspace };
|
// return { workspace };
|
||||||
|
throw new BadRequestError({ message: "Project delete has been paused temporarily, please try again later" });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user