* feat: add prek pre-commit hooks and dependabot Pre-commit hooks (via prek): - Basic hygiene: trailing-whitespace, end-of-file-fixer, check-yaml, check-added-large-files, check-merge-conflict - Security: detect-secrets, zizmor (GitHub Actions audit) - Linting: shellcheck, actionlint, oxlint, swiftlint - Formatting: oxfmt, swiftformat Dependabot: - npm and GitHub Actions ecosystems - Grouped updates (production/development/actions) - 7-day cooldown for supply chain protection Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add prek install instruction to AGENTS.md --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
939 B
TypeScript
30 lines
939 B
TypeScript
import type { WebhookContext, WebhookVerificationResult } from "../../types.js";
|
|
import { verifyTwilioWebhook } from "../../webhook-security.js";
|
|
|
|
import type { TwilioProviderOptions } from "../twilio.js";
|
|
|
|
export function verifyTwilioProviderWebhook(params: {
|
|
ctx: WebhookContext;
|
|
authToken: string;
|
|
currentPublicUrl?: string | null;
|
|
options: TwilioProviderOptions;
|
|
}): WebhookVerificationResult {
|
|
const result = verifyTwilioWebhook(params.ctx, params.authToken, {
|
|
publicUrl: params.currentPublicUrl || undefined,
|
|
allowNgrokFreeTier: params.options.allowNgrokFreeTier ?? true,
|
|
skipVerification: params.options.skipVerification,
|
|
});
|
|
|
|
if (!result.ok) {
|
|
console.warn(`[twilio] Webhook verification failed: ${result.reason}`);
|
|
if (result.verificationUrl) {
|
|
console.warn(`[twilio] Verification URL: ${result.verificationUrl}`);
|
|
}
|
|
}
|
|
|
|
return {
|
|
ok: result.ok,
|
|
reason: result.reason,
|
|
};
|
|
}
|