持久化接收记录前,对原始字节和配置的公网地址验签。使用 CloudEvent 的 source 与 id 去重,签名密钥与 OAuth 凭据独立管理。
查看对应 HTTP 契约verifyWebhook
functionexport function verifyWebhook(options: VerifyWebhookOptions): Promise<VerifiedWebhookEvent>;VerifyWebhookOptions
interfaceexport interface VerifyWebhookOptions {
body: string | Uint8Array;
headers: HeadersInit;
maxAgeSeconds?: number;
method: string;
now?: Date;
secret: string | readonly string[];
url: string;
}VerifiedWebhookEvent
interfaceexport interface VerifiedWebhookEvent {
[key: string]: unknown;
data: unknown;
id: string;
source: string;
specversion: "1.0";
type: string;
}下载方法索引 JSON ↓ · 来源摘要 5f558e57b94420ef8fc60d9a8274a2ab5b92ac85d23f370a5bac4bc7ad2baae2