Skip to content

fix(notifications): WeCom webhook 字段脱敏 (ONE-43) - #137

Merged
mapxn merged 1 commit into
mainfrom
agent/daniel/4fbeb4b98441
Oct 22, 2026
Merged

mapxn merged 1 commit into
mainfrom
agent/daniel/4fbeb4b98441

Conversation

@mapxn

@mapxn mapxn commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

背景

WeCom Bot 的配置 key 是 webhook,此前 GET /me/notifications 明文返回该 URL,PUT 时也没有「回传掩码则保留旧值」的保护。

改动

  • worker/src/routes/me.ts
    • GET /notifications 的脱敏关键字列表新增 "webhook":已配置时返回 ••••••,空值仍返回空串。
    • PUT /notifications 的 secretFields 列表新增 "webhook":传入 •••••• 或空值时保留库里的旧 webhook。
  • worker/test/me-notifications.test.ts:新增 5 个用例覆盖上述行为,并回归校验 webhook_url / secret / device_key 等其它渠道脱敏不变。

未改存储 key、未改 services/notify/wechatbot.ts、未改 VALID_CHANNELS、无数据迁移、不动前端。

自测

  • pnpm typecheck:通过(web tsc -b + worker tsc --noEmit,无错误)
  • pnpm test:8 个测试文件、83 个用例全部通过
  • biome lint / biome format(两个改动文件):无问题

关联 issue:ONE-43

@mapxn
mapxn merged commit 591c960 into main Oct 22, 2026
1 check passed
@mapxn
mapxn deleted the agent/daniel/4fbeb4b98441 branch October 22, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant