Cloud push rejects an identical encryption key supplied from another path

未关闭 适合新手
#766 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@pcbeingused333 已经在做这个了。

开始于 2026年11月23日。

  • #771 来自 @pcbeingused333 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
cli, cloud

调研方向

从 lean/components/util/encryption_helper.py 中的 _validate_key_state_for_local_project 开始,然后查找云端推送的本地文件准备测试。复现不同路径下密钥内容相同的情况,并检查真正不同的密钥仍会被拒绝。回归测试通过且使用复制的密钥成功推送,即表示完成。

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

描述

priority:P2

Observed

An encrypted project configured with /keys/original.txt cannot be pushed with --encrypt --key /keys/backup.txt even when the two files have identical contents. Cloud-key validation accepts the matching hash, but local file preparation rejects the different path.

Reproduced on master at 3842533 with real push/encryption helpers and config storage, a fake filesystem, and a mocked API. Both synthetic files had the same contents and hash; the cloud project had that hash. The push returned False, made no project update, and reported:

Registered encryption key /keys/original.txt is different from the one provided /keys/backup.txt

Reproduction

  1. Encrypt a project using a synthetic key and push it successfully.
  2. Copy the key to another filesystem path without changing its contents.
  3. Run lean cloud push --project Example --encrypt --key /path/to/copied-key.txt.

Cause and required result

_validate_key_state_for_local_project in lean/components/util/encryption_helper.py compares filesystem paths rather than key identity. An explicitly supplied identical key should remain usable from another path; genuinely different keys must still be rejected. Add a regression test for identical contents at different paths.

Priority P2: a valid-key operation fails, with a workaround of using the configured path.

主要语言
Python
星标
335
派生
172
平均合并
6 小时 54 分钟
30 天内合并 PR
37

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

QuantConnect/lean-cli 的其他 Issue

查看 QuantConnect/lean-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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