Skip to content

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

fix lint and security issue

Matheus Nogueiraefed0f155ae7
diff --git a/backend/src/ee/services/secret-approval-request/secret-approval-request-service.ts b/backend/src/ee/services/secret-approval-request/secret-approval-request-service.ts
index d9db0827d3..badb803f45 100644
--- a/backend/src/ee/services/secret-approval-request/secret-approval-request-service.ts
+++ b/backend/src/ee/services/secret-approval-request/secret-approval-request-service.ts
@@ -1715,7 +1715,7 @@ export const secretApprovalRequestServiceFactory = ({
type: TriggerFeature.SECRET_APPROVAL,
payload: {
userEmail: user?.email ?? undefined,
- machineIdentityId: actorId,
+ machineIdentityId: actor === ActorType.IDENTITY ? actorId : undefined,
environment: env.name,
secretPath,
projectId,
diff --git a/backend/src/services/microsoft-teams/microsoft-teams-fns.ts b/backend/src/services/microsoft-teams/microsoft-teams-fns.ts
index 280e33dd4e..1d86f08466 100644
--- a/backend/src/services/microsoft-teams/microsoft-teams-fns.ts
+++ b/backend/src/services/microsoft-teams/microsoft-teams-fns.ts
@@ -364,7 +364,9 @@ export const buildTeamsPayload = (orgId: string, notification: TNotification) =>
switch (notification.type) {
case TriggerFeature.SECRET_APPROVAL: {
const { payload } = notification;
- const author = payload.machineIdentityId ? `machine identity ${payload.machineIdentityId}` : (payload.userEmail ?? "unknown");
+ const author = payload.machineIdentityId
+ ? `machine identity ${payload.machineIdentityId}`
+ : (payload.userEmail ?? "unknown");
const adaptiveCard = {
type: "AdaptiveCard",
diff --git a/backend/src/services/slack/slack-fns.ts b/backend/src/services/slack/slack-fns.ts
index a351453a50..939d409cd4 100644
--- a/backend/src/services/slack/slack-fns.ts
+++ b/backend/src/services/slack/slack-fns.ts
@@ -53,7 +53,9 @@ const buildSlackPayload = (notification: TNotification) => {
switch (notification.type) {
case TriggerFeature.SECRET_APPROVAL: {
const { payload } = notification;
- const author = payload.machineIdentityId ? `machine identity ${payload.machineIdentityId}` : (payload.userEmail ?? "unknown");
+ const author = payload.machineIdentityId
+ ? `machine identity ${payload.machineIdentityId}`
+ : (payload.userEmail ?? "unknown");
const messageBody = `A secret approval request has been opened by ${author}.
*Project*: ${payload.projectName}
*Environment*: ${payload.environment}