MCPcopy Index your code
hub / github.com/simstudioai/sim / handlePreLookupWebhookVerification

Function handlePreLookupWebhookVerification

apps/sim/lib/webhooks/processor.ts:171–191  ·  view source on GitHub ↗
(
  method: string,
  body: Record<string, unknown> | undefined,
  requestId: string,
  path: string
)

Source from the content-addressed store, hash-verified

169 * before a webhook row exists and therefore before provider lookup is possible.
170 */
171export async function handlePreLookupWebhookVerification(
172 method: string,
173 body: Record<string, unknown> | undefined,
174 requestId: string,
175 path: string
176): Promise<NextResponse | null> {
177 const pendingVerification = await getPendingWebhookVerification(path)
178 if (!pendingVerification) {
179 return null
180 }
181
182 if (!matchesPendingWebhookVerificationProbe(pendingVerification, { method, body })) {
183 return null
184 }
185
186 logger.info(
187 `[${requestId}] Returning 200 for pending ${pendingVerification.provider} webhook verification on path: ${path}`
188 )
189
190 return NextResponse.json({ status: 'ok', message: 'Webhook endpoint verified' })
191}
192
193/**
194 * Handle provider-specific reachability tests that occur AFTER webhook lookup.

Callers 2

route.tsFile · 0.90
handleWebhookPostFunction · 0.90

Calls 3

infoMethod · 0.80

Tested by

no test coverage detected