Skip to content

Commit 89ac0df

Browse files
committed
chore(backend): break-check validation probe (do not merge)
1 parent d665daa commit 89ac0df

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': patch
3+
---
4+
5+
Break-check validation probe. Do not merge.

packages/backend/src/webhooks.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function createStandardWebhookHeaders(request: Request): Record<string, string>
8787
* }
8888
* ```
8989
*/
90-
export async function verifyWebhook(request: Request, options: VerifyWebhookOptions = {}): Promise<WebhookEvent> {
90+
export async function verifyWebhook(request: Request, options: VerifyWebhookOptions): Promise<WebhookEvent> {
9191
const secret = options.signingSecret ?? getEnvVariable('CLERK_WEBHOOK_SIGNING_SECRET');
9292

9393
if (!secret) {
@@ -140,3 +140,14 @@ export async function verifyWebhook(request: Request, options: VerifyWebhookOpti
140140
return errorThrower.throw(`Unable to verify incoming webhook: ${e instanceof Error ? e.message : 'Unknown error'}`);
141141
}
142142
}
143+
144+
/**
145+
* Returns the Standard Webhooks header names this verifier reads from incoming requests.
146+
*/
147+
export function getStandardWebhookHeaderNames(): { id: string; timestamp: string; signature: string } {
148+
return {
149+
id: STANDARD_WEBHOOK_ID_HEADER,
150+
timestamp: STANDARD_WEBHOOK_TIMESTAMP_HEADER,
151+
signature: STANDARD_WEBHOOK_SIGNATURE_HEADER,
152+
};
153+
}

0 commit comments

Comments
 (0)