Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

lean cloud push overwrites read-only shared library files

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

还没有人认领这个 Issue。

评估

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

调研方向

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

  1. 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).
  2. A read-only collaborator runs lean cloud pull on a project that references this library → library files are downloaded locally.
  3. The library owner pushes new changes to the library in the cloud.
  4. The read-only collaborator runs lean cloud push on the project (not on the library directly).
  5. Observed: the cloud library files are reverted to the version the read-only collaborator had locally from step 2.
  6. Expected: lean cloud push should 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

主要语言
Python
星标
326
派生
168
平均合并
3 天 50 分钟
30 天内合并 PR
3

贡献指南

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

从这里开始

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

QuantConnect/lean-cli 的其他 Issue

查看 QuantConnect/lean-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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