python / python/release-tools

Bug: release tooling should quote remote command arguments

未关闭
#397 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
61
派生
48
平均合并
1 小时 22 分钟
30 天内合并 PR
4

描述

run_release.py builds remote shell command strings for release publication.
Several values are interpolated directly into those command strings, including
release credential environment values, the release tag, and remote staging paths
derived from release-manager state.

Those values are normally trusted release-process inputs, but quoting them
consistently makes the generated commands safer and more predictable when a
value contains whitespace or shell metacharacters.

Reproducer

Using mocked Paramiko clients:

  1. Set the python.org API credential value to contain shell metacharacters, such
    as user:key; echo unexpected.
  2. Make the fake Sigstore issuer return a token containing shell metacharacters,
    such as token; touch /tmp/unexpected.
  3. Run the python.org upload step and capture the command sent to
    exec_command().
  4. The captured command includes those values unquoted in AUTH_INFO=... and
    SIGSTORE_IDENTITY_TOKEN=... assignments.

Similar mocked tests can set the release-manager SSH username to a value with a
metacharacter and observe that derived staging paths are inserted into cleanup,
copy, unzip, move, group, and permission commands without quoting.

Expected behavior

Release-tool commands should quote environment values, release arguments, and
remote filesystem paths before sending command strings to the remote shell,
while preserving intentional glob expansion for staged artifact copies.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 run_release.py 开始,检查用于上传到 python.org 以及 release-manager SSH 路径的命令构造。使用模拟的 Paramiko 客户端,在凭据、令牌、用户名和暂存路径中包含元字符的情况下捕获 exec_command() 的输出;完成标准是这些值都经过安全引用,同时为暂存构件复制而有意进行的 glob 展开仍保持不变。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
release
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
描述清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。