Repository navigation
fix(notifications): WeCom webhook 字段脱敏 (ONE-43) - #137
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
WeCom Bot 的配置 key 是
webhook,此前 GET/me/notifications明文返回该 URL,PUT 时也没有「回传掩码则保留旧值」的保护。改动
worker/src/routes/me.ts/notifications的脱敏关键字列表新增"webhook":已配置时返回••••••,空值仍返回空串。/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:通过(webtsc -b+ workertsc --noEmit,无错误)pnpm test:8 个测试文件、83 个用例全部通过biome lint/biome format(两个改动文件):无问题关联 issue:ONE-43