fix(validation): avoid token false positives in pre-publish check#253
Merged
fix(validation): avoid token false positives in pre-publish check#253
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.
概述
修复预发布校验器将函数调用/普通标识符赋值误判为泄露 token 的问题。
变更内容
后端实现
BasicPrePublishValidator的敏感赋值检测逻辑,先识别敏感键赋值,再只对真实字面量进行告警。token = extract_group_token_value(...)这类代码被误判。前端实现
测试覆盖
BasicPrePublishValidatorTest,覆盖函数调用赋值、普通标识符赋值、带尾注释的真实 secret。质量门禁
make test-backend-app通过make typecheck-web通过(未执行,本次无前端改动)make lint-web通过(未执行,本次无前端改动)make test-frontend通过(未执行,本次无前端改动)web/e2e)关键路径通过(未执行,本次无 UI 变更)make generate-api已执行且schema.d.ts已提交(不适用,本次无 Controller 变更)安全考虑
相关 Issue
Closes #234
测试说明
本地验证步骤
token = extract_group_token_value(response, group_choice.group_id)。BasicPrePublishValidatorTest。回归测试范围
截图/录屏(如有 UI 变更)
无