Skip to content

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

update distinct id for service tokens

Maidul Islam44e37fd531e3
diff --git a/backend/src/server/config/rateLimiter.ts b/backend/src/server/config/rateLimiter.ts
index 997ed9daf7..20a6313956 100644
--- a/backend/src/server/config/rateLimiter.ts
+++ b/backend/src/server/config/rateLimiter.ts
@@ -10,12 +10,10 @@ const getDistinctRequestActorId = (req: FastifyRequest) => {
return req.auth.user.username;
}
if (req?.auth?.actor === ActorType.IDENTITY) {
- return `identity-${req.auth.identityId}`;
+ return `${req.auth.identityId}-machine-identity-`;
}
if (req?.auth?.actor === ActorType.SERVICE) {
- return (
- `${req.auth.serviceToken.createdByEmail}-service-token` || `service-token-null-creator-${req.auth.serviceTokenId}`
- ); // when user gets removed from system
+ return `${req.auth.serviceToken.id}-service-token`; // when user gets removed from system
}
return req.realIp;
};