Skip to content

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

remove dead code.

adilsonf0f73436704c
diff --git a/backend/src/services/webhook/webhook-fns.ts b/backend/src/services/webhook/webhook-fns.ts
index 74af7a6f96..215335605a 100644
--- a/backend/src/services/webhook/webhook-fns.ts
+++ b/backend/src/services/webhook/webhook-fns.ts
@@ -248,91 +248,8 @@ export const getWebhookPayload = (event: TWebhookPayloads) => {
}
}
- const { projectName, projectId, environment, secretPath, type, reminderNote, secretName } = event.payload;
-
- switch (type) {
- case WebhookType.SLACK:
- return {
- text: "You have a secret reminder",
- attachments: [
- {
- color: "#E7F256",
- fields: [
- {
- title: "Project",
- value: projectName,
- short: false
- },
- {
- title: "Environment",
- value: environment,
- short: false
- },
- {
- title: "Secret Path",
- value: secretPath,
- short: false
- },
- {
- title: "Secret Name",
- value: secretName,
- short: false
- },
- {
- title: "Reminder Note",
- value: reminderNote,
- short: false
- }
- ]
- }
- ]
- };
- case WebhookType.MICROSOFT_TEAMS:
- return {
- type: "message",
- attachments: [
- {
- contentType: "application/vnd.microsoft.card.adaptive",
- contentUrl: null,
- content: {
- type: "AdaptiveCard",
- version: "1.2",
- body: [
- {
- type: "TextBlock",
- size: "Medium",
- weight: "Bolder",
- text: "You have a secret reminder"
- },
- {
- type: "FactSet",
- facts: [
- { title: "Project", value: projectName || "" },
- { title: "Environment", value: environment },
- { title: "Secret Path", value: secretPath || "" },
- { title: "Reminder Note", value: reminderNote || "" }
- ]
- }
- ]
- }
- }
- ]
- };
- case WebhookType.GENERAL:
- default:
- return {
- event: event.type,
- project: {
- workspaceId: projectId,
- projectId,
- projectName,
- environment,
- secretPath,
- secretName,
- reminderNote
- }
- };
- }
+ const exhaustiveCheck: never = event;
+ throw new Error(`Unhandled webhook event: ${JSON.stringify(exhaustiveCheck)}`);
};
export type TFnTriggerWebhookDTO = {