Skip to content

Commit 5af8ade

Browse files
committed
fix(triggers): apply webhook audit follow-ups
Align the Greenhouse webhook matcher with provider conventions and clarify the Notion webhook secret setup text after the audit review. Made-with: Cursor
1 parent 18a7868 commit 5af8ade

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

apps/sim/lib/webhooks/providers/greenhouse.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import crypto from 'crypto'
22
import { createLogger } from '@sim/logger'
3-
import { NextResponse } from 'next/server'
43
import { safeCompare } from '@/lib/core/security/encryption'
54
import type {
65
EventMatchContext,
@@ -53,7 +52,7 @@ export const greenhouseHandler: WebhookProviderHandler = {
5352
}
5453
},
5554

56-
async matchEvent({ webhook, body, requestId, providerConfig }: EventMatchContext) {
55+
async matchEvent({ webhook, workflow, body, requestId, providerConfig }: EventMatchContext) {
5756
const triggerId = providerConfig.triggerId as string | undefined
5857
const b = body as Record<string, unknown>
5958
const action = b.action as string | undefined
@@ -64,14 +63,13 @@ export const greenhouseHandler: WebhookProviderHandler = {
6463
`[${requestId}] Greenhouse event mismatch for trigger ${triggerId}. Action: ${action}. Skipping execution.`,
6564
{
6665
webhookId: webhook.id,
66+
workflowId: workflow.id,
6767
triggerId,
6868
receivedAction: action,
6969
}
7070
)
7171

72-
return NextResponse.json({
73-
message: 'Event type does not match trigger configuration. Ignoring.',
74-
})
72+
return false
7573
}
7674
}
7775

apps/sim/triggers/notion/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function notionSetupInstructions(eventType: string): string {
2828
'Paste the <strong>Webhook URL</strong> above into the URL field.',
2929
`Select the <strong>${eventType}</strong> event type(s).`,
3030
'Notion will send a verification request. Copy the <strong>verification_token</strong> from the payload and paste it into the Notion UI to complete verification.',
31+
'Paste the same <strong>verification_token</strong> into the <strong>Webhook Secret</strong> field above to enable signature verification on incoming events.',
3132
'Ensure the integration has access to the pages/databases you want to monitor (share them with the integration).',
3233
]
3334

@@ -48,9 +49,9 @@ export function buildNotionExtraFields(triggerId: string): SubBlockConfig[] {
4849
id: 'webhookSecret',
4950
title: 'Webhook Secret',
5051
type: 'short-input',
51-
placeholder: 'Enter your Notion webhook signing secret',
52+
placeholder: 'Enter your Notion verification_token',
5253
description:
53-
'The signing secret from your Notion integration settings page, used to verify X-Notion-Signature headers. This is separate from the verification_token used during initial setup.',
54+
'The verification_token sent by Notion during webhook setup. This same token is used to verify X-Notion-Signature HMAC headers on all subsequent webhook deliveries.',
5455
password: true,
5556
required: false,
5657
mode: 'trigger',

0 commit comments

Comments
 (0)