cloud pull --encrypt leaves the project without its key path and encrypts referenced libraries
维护者通常 6 天内回复
评估
调研方向
Start with PullManager._pull_project and pull_projects, then compare the encryption-key handling with encrypt.py and decrypt.py; the issue also points to push_manager.py for how associated libraries are handled. Check the relevant tests for pull encryption behavior. Done means encrypt and decrypt keep the project config consistent, and pulled libraries are not encrypted; a linked pull request is already open.
由索引模型根据 Issue 内容生成。
描述
Expected Behavior
lean cloud pull --encrypt --key <key> leaves the local project in the same state as lean encrypt --key <key>: files encrypted, encrypted: true and encryption-key-path in the project config, so a later lean cloud push keeps the cloud project encrypted. --decrypt removes encryption-key-path, like lean decrypt. Referenced libraries are pulled as they are in the cloud, the same way lean cloud push --encrypt already leaves them unencrypted.
Actual Behavior
PullManager._pull_projectsetsencryptedbut never sets or removesencryption-key-path.PushManager._push_projectonly re-encrypts when that path is present, so a plain push afterpull --encryptuploads the encrypted file contents as source code withencryption_key='':
$ lean cloud pull --project "Python Project" --encrypt --key key.txt # cloud project was not encrypted
$ lean cloud push --project "Python Project"
# projects/update is called with main.py = 'iFdKTV...==' (ciphertext) and encryption_key = ''
The cloud project ends up unencrypted, with ciphertext as its code. After pull --decrypt, the stale encryption-key-path stays in the config.
PullManager.pull_projectspasses the encryption action and key to every pulled project, including the libraries it adds.pull --project P --encrypttherefore encrypts the shared libraryLibrary/Lon disk and marks itencrypted: true. The push side deliberately skips associated libraries (push_manager.py, "we don't encrypt those"), so the two commands disagree.
Potential Solution
In _pull_project, set encryption-key-path on encrypt and delete it on decrypt, as encrypt.py/decrypt.py do. In pull_projects, apply the encryption action only to the projects that were asked for, not to the libraries added afterwards. I have a PR ready with the fix and tests (fail on master, pass with the fix).
Reproducing the Problem
Run the two commands above on an unencrypted cloud project with a registered key. For the library case, use a project that references a library and check Library/<name>/main.py after the pull.
System Information
lean-cli master at 1873571, Linux.
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- 主要语言
- Python
- 星标
- 329
- 派生
- 169
- 平均合并
- 4 天 18 小时
- 30 天内合并 PR
- 9
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QuantConnect/lean-cli 的其他 Issue
-
cloud live deploy: no Interactive Brokers (FIX) brokerage, --ib-fix-account / --ib-fix-user-name do not exist可能已有人在做 @quantconnect-kronos 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
QuantConnect/lean-cli#692 · 1 条评论 ·
维护者通常 6 天内回复
-
lean live deploy skips the localhost host rewrite and symbol map mount for brokerage settings可能已有人在做 @pcbeingused333 于 2 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
QuantConnect/lean-cli#690 ·
维护者通常 6 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
QuantConnect/lean-cli#681 ·
维护者通常 6 天内回复
-
lean cloud push overwrites read-only shared library files可能已有人在做 @Amadeus-22 于 3 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
QuantConnect/lean-cli#661 · 2 条评论 ·
维护者通常 6 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
QuantConnect/lean-cli#619 ·
维护者通常 6 天内回复
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
huggingface/smolagents#3106 ·
维护者通常 2 天内回复
-
area:scripts area:tests bug priority:later
难度 2/5 1-3 小时 新手友好度 72/100
Ikalus1988/MisakaNet#4358 ·
维护者通常 1 天内回复
-
Discovered ports from service discovery are never propagated to modules in Module.load()可能已有人在做 @vishalmore90 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
OWASP/Nettacker#1828 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
aws-samples/sample-per-model-bedrock#708 ·
维护者通常 1 天内回复
-
maintenance
难度 2/5 1-3 小时 新手友好度 62/100