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 摘要。