Repository navigation
fix: retain SQL table extraction when skipping whitelist checks - #1464
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.
Summary
修正 #1463 中启动参数的作用范围:
SQLBOT_SKIP_TABLE_CHECK=true仅跳过白名单外表的拒绝,始终提取真实表名,无法提取表名时仍拒绝。参数名、默认值和启动生效方式保持不变,同步修正配置与安全说明。Evidence
6cb69d00上运行新的局部回归用例,结果为 4 failed, 2 passed:跳过参数会放过无表名/解析失败的 SQL,也不会调用表名提取。After: 修正后相关回归 64 passed,覆盖默认白名单拒绝、CTE、开关两种状态下的表名提取失败、显式跳过白名单后继续执行,以及写操作/危险函数/元数据查询拒绝。
backend/执行:LOG_FORMAT='%(levelname)s %(message)s' uv run --no-sync pytest -q tests/test_table_check.py tests/test_postgres_denylist.py tests/test_cwe89_escape_fix.py --tb=shortfd3d3342(文件树2c648c3d);复用开发阶段结果,提交和 PR 阶段未重复测试。使用已有 Python 3.11.18 / pytest 7.4.4 / sqlglot 30.14.0 环境,未同步依赖。Merge Danger
Door: two-way
单提交,无迁移或依赖变更,可 Rebase and merge。
Blast Radius: deployment
默认行为不变。已设置跳过参数的部署将恢复对表名提取失败的拒绝(包括
SELECT 1这类无表名查询),仍允许白名单外但可提取表名的 SQL 进入后续流程。