Repository navigation
check-secrets:真实身份脱敏检查(纠正即约束第三批) - #137
Merged
Merged
Conversation
- test/check-secrets.mjs:扫源码里的真实 QQ 号 / 抖音 uid,新增命中即报错退出。 黑名单**只存 sha256 前 16 位,不存真值**(存真值等于这个脚本自己就是泄漏源)。 判据是精确数字 token 哈希比对,零误报(已用占位符 12345678 / 1234567890123456789 / 时间戳 / 端口 / MAX_SAFE_INTEGER 边界验过)。 - test/check-secrets.baseline.txt:现有 32 行(64 处)存量记账,让存量可见、新增被拦。 存量清理改动面大(部分在 history/),单独立项。 - scripts/gen-secrets-baseline.mjs:生成 baseline 用,只在确认存量时跑一次。 - 红验证:造一个含真值的新文件 → 报错拦下;删掉 → 绿。 - 加进 package.json 测试链 + CI 快速闸。
Merged
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.
问题
AGENTS.md 把「真实群名 / 昵称 / uid 不进仓库」标成
[仅文字],靠提交前记得逐个看。这个防线已经漏过:扫出来仓库里有 32 行(64 处) 真实身份标识符(主人 QQ 号、主人抖音 uid、机器人自己抖音 uid 及其截断值),分布在 15 个文件里(含lib/gateway.js的注释、多个测试夹具)。修法
test/check-secrets.mjs(静态拦截)扫源码文件里的真实身份标识符,新增命中即报错退出。
关键设计:
12345678/1234567890123456789/ 时间戳1794735596871/ 端口47890/ 大数7300000000000000032/MAX_SAFE_INTEGER边界9007199254740992全部放行。check-secrets.baseline.txt记存量(文件 + 哈希),让存量可见、新增被拦,不用一次性改一堆测试夹具。scripts/gen-secrets-baseline.mjs:生成 baseline 用,只在确认存量时跑一次。验证(红绿都亲验过)
test/_redtest_temp.md:1 出现主人 QQ 号);删掉 → 绿。check-test-chain/client-lint全绿。64 处存量分布在 15 个文件,其中
history/2026-11.md/CHANGELOG.md是已发布的历史记录,改动要慎重;测试夹具(test/douyin-*.mjs)可以批量换成占位符。建议单开一个 PR 专项清理,先清测试夹具和lib/注释,历史文档由你决定要不要动。注:真实值已在公开仓库历史里,改文件不能撤回历史 —— 如果要彻底处理,得考虑历史重写(force push 会打乱所有 fork 与 tag,需要你明确授权)。