SuperAPI AI 工具集

enode-webhooks

智能体与模型

查看项目

更新于 10-15 22:14

技能介绍

用途:设置 Enode Webhook 处理器、调试 Enode 签名校验失败、理解 Enode 事件类型与载荷,并处理 user:vehicle:updated、user:charger:updated、user:battery:updated 等事件。

主要能力:Enode 使用 HMAC-SHA1,以创建 Webhook 时提供的每 Webhook 密钥(至少 128 位)对原始请求体签名,摘要放在 x-enode-signature 头,格式为 sha1=<小写十六进制>。Enode 不遵循 Standard Webhooks 规范,校验须使用原始请求体并进行时间安全比较。资料提供 Node(crypto.createHmac('sha1', secret)、crypto.timingSafeEqual)和 Python(hmac.new(..., hashlib.sha1) 与 hmac.compare_digest)的核心校验示例。

用法:请求体是 JSON 数组,单次投递可包含多个事件,需遍历数组;每个元素含 event 名称、createdAt 时间戳和 version。常见事件包括 user:vehicle:updated、user:charger:updated、user:battery:updated、user:vehicle:discovered、user:credentials:invalidated、system:heartbeat 和 enode:webhook:test。重要请求头有 x-enode-signature 与 x-enode-delivery。环境变量 ENODE_WEBHOOK_SECRET 由你生成,Enode 不返回密钥,需在 POST /webhooks 的 secret 字段传入。本地开发可运行:npx hookdeck-cli listen 3000 enode --path /webhooks/enode。完整处理器(含路由、事件分发和测试)见 examples/express/、examples/nextjs/、examples/fastapi/;更多资料见 references/overview.md、references/setup.md、references/verification.md。

限制:资料未提供具体价格、平台覆盖范围或性能效果,暂未提供相关信息。