lean cloud push overwrites read-only shared library files
还没有人认领这个 Issue。
评估
调研方向
从 lean cloud push 流程开始,跟踪链接的库文件如何到达 /files/update 或 /files/create。检查 /projects/read 如何暴露协作者访问权限,然后复现只读库场景。完成的标准是:只读库文件会被跳过或拒绝,且不会覆盖云端更改,同时相关的 push 行为由测试覆盖。
由索引模型根据 Issue 内容生成。
描述
lean cloud push overwrites read-only shared library files
Summary
When a project references a shared library for which the pushing user has read-only (collaborator) access, lean cloud push still uploads the locally cached library files via /files/update, effectively overwriting whatever the library owner has since changed on the cloud. The access control on the library project is not consulted before the push.
Reproduction steps
- Create a library project and share it across an organisation as read-only (i.e. other members are added as read-only collaborators, not owners).
- A read-only collaborator runs
lean cloud pullon a project that references this library → library files are downloaded locally. - The library owner pushes new changes to the library in the cloud.
- The read-only collaborator runs
lean cloud pushon the project (not on the library directly). - Observed: the cloud library files are reverted to the version the read-only collaborator had locally from step 2.
- Expected:
lean cloud pushshould skip pushing files for libraries where the current user has read-only access (or the cloud API should reject the write with an appropriate error).
Root cause (hypothesis)
lean cloud push iterates over all local project files, including the contents of every linked library directory, and calls /files/update or /files/create for each. It does not check the authenticated user's role on the library project before pushing library files. The result is that a collaborator who cannot directly write to a library via the web IDE or via lean cloud push <library> can inadvertently overwrite it by pushing the parent project.
Suggested fix
Before pushing library files, retrieve the calling user's access level on each library project (e.g. via /projects/read for the library's project id and checking the collaborator role / access flag). Skip — or error — on any library where the user is not an owner or write collaborator.
A complementary server-side guard on /files/update to enforce the library project's collaborator permissions would provide defence-in-depth regardless of the client.
References
- Intercom conversation id: 215475353035232
- Related lean-cli open issue: #579 (Improve semantics of library organisation — may overlap)
- LEAN CLI docs: https://www.quantconnect.com/docs/v2/lean-cli/projects/libraries/project-libraries
- 主要语言
- Python
- 星标
- 326
- 派生
- 168
- 平均合并
- 3 天 50 分钟
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QuantConnect/lean-cli 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
QuantConnect/lean-cli#619 ·
-
feature
QuantConnect/lean-cli#602 · 6 条评论 · 3 个 reaction · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 45/100
QuantConnect/lean-cli#588 ·
-
难度 4/5 3-5 天 新手友好度 35/100
QuantConnect/lean-cli#579 ·
-
bug feature
难度 3/5 1-2 天 新手友好度 35/100
QuantConnect/lean-cli#574 · 1 条评论 · 1 个 reaction ·
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
speaches-ai/speaches#678 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
conda-forge/spacy-feedstock#177 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
UKGovernmentBEIS/inspect_evals#2523 ·