Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: update rate limit for grant admin access

Scott Wilsonb3fa59f9a498
diff --git a/backend/src/server/routes/v1/org-admin-router.ts b/backend/src/server/routes/v1/org-admin-router.ts
index a4b469016d..fce867b4e5 100644
--- a/backend/src/server/routes/v1/org-admin-router.ts
+++ b/backend/src/server/routes/v1/org-admin-router.ts
@@ -2,7 +2,7 @@ import { z } from "zod";
import { ProjectMembershipsSchema } from "@app/db/schemas";
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
-import { readLimit, smtpRateLimit } from "@app/server/config/rateLimiter";
+import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { ActorType, AuthMode } from "@app/services/auth/auth-type";
@@ -48,9 +48,7 @@ export const registerOrgAdminRouter = async (server: FastifyZodProvider) => {
method: "POST",
url: "/projects/:projectId/grant-admin-access",
config: {
- rateLimit: smtpRateLimit({
- keyGenerator: (req) => (req.auth.actor === ActorType.USER ? req.auth.userId : req.realIp)
- })
+ rateLimit: writeLimit
},
schema: {
operationId: "grantOrganizationAdminProjectAccess",