mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 15:27:46 +00:00
update distinct id for service tokens
This commit is contained in:
@@ -10,12 +10,10 @@ const getDistinctRequestActorId = (req: FastifyRequest) => {
|
|||||||
return req.auth.user.username;
|
return req.auth.user.username;
|
||||||
}
|
}
|
||||||
if (req?.auth?.actor === ActorType.IDENTITY) {
|
if (req?.auth?.actor === ActorType.IDENTITY) {
|
||||||
return `identity-${req.auth.identityId}`;
|
return `${req.auth.identityId}-machine-identity-`;
|
||||||
}
|
}
|
||||||
if (req?.auth?.actor === ActorType.SERVICE) {
|
if (req?.auth?.actor === ActorType.SERVICE) {
|
||||||
return (
|
return `${req.auth.serviceToken.id}-service-token`; // when user gets removed from system
|
||||||
`${req.auth.serviceToken.createdByEmail}-service-token` || `service-token-null-creator-${req.auth.serviceTokenId}`
|
|
||||||
); // when user gets removed from system
|
|
||||||
}
|
}
|
||||||
return req.realIp;
|
return req.realIp;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user