feat(sandbox): 支持注入规则匹配条件#454
Conversation
升级 go-sdk 到 v7.26.14,补齐 sandbox 注入规则的 if-headers、if-queries 与 GitHub base-url 支持,并增加远端集成测试覆盖。
There was a problem hiding this comment.
Code Review
This pull request introduces request matching conditions (--if-headers and --if-queries) for sandbox injection rules and inline injections, and adds support for limiting GitHub injections to specific repository paths via --base-url. It also upgrades the Qiniu Go SDK to v7.26.14 and adds corresponding integration and unit tests. Feedback is provided regarding a high-severity issue in the inline injection parser (parseInlineInjectionFields), where segments without an equals sign can incorrectly pollute scalar fields like type or base-url if currentKey is not verified to be a map field.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
No issues found in this review. I reviewed the injection rule condition/base-url changes, inline parsing paths, docs, and tests.
Verification run:
go test ./iqshell/sandbox/...go test ./cmd/...go test ./iqshell/sandbox/sandbox/operations ./iqshell/sandbox/injection_rule/operations
限制 inline injection 解析中的续写逻辑,只允许 headers、if-headers 和 if-queries 吸收非键值片段,并补充尾部逗号回归测试。
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: miclle The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
变更内容
github.com/qiniu/go-sdk/v7到v7.26.14sandbox injection-rule create/update新增--if-headers与--if-queriessandbox create --inline-injection支持if-headers=/if-queries=github注入类型支持通过--base-url/base-url=限制匹配范围injection-rule list/get展示匹配条件验证
gofmt -s -l .go test ./iqshell/sandbox/... ./cmd_test/...set -a; source .env.prod; set +a; make test-sandbox-integration说明:
make lint仍受仓库既有 staticcheck 问题影响,失败项不在本次变更文件中。Release 建议
建议合并后发布
v2.19.9,这是对 go-sdkv7.26.14新 sandbox 能力的 CLI 跟进,包含用户可见的新参数与文档更新。