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

RFE: Support Crate Ownership

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

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
python

调研方向

Start with the proposed CrateOwnership model and CargoPublishApiView.put(), then review the three Cargo owner endpoints and the yank authorization path. Done means ownership is scoped per distribution, first publishers are assigned automatically, owners can manage owners, and publish/yank permissions follow the stated rules while unauthenticated ownership mode remains supported.

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

描述

Feature Triage-Needed

Consider supporting Crate ownership like crates.io -- users would be able to publish or modify only crates which they have maintainership over.

This is more of a long-term plan and should probably be optional. The "if you can auth, you can push" mode ought to continue being supported.


Crate Ownership

Goal: Track who owns which crate names, and only allow owners to publish new versions or yank. Deferred — any authenticated user with distribution-level permission can publish any crate name for now.

a. CrateOwnership model
class CrateOwnership(BaseModel):
    distribution = models.ForeignKey(RustDistribution, on_delete=models.CASCADE)
    crate_name = models.CharField(max_length=255)
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)

    class Meta:
        unique_together = ("distribution", "crate_name", "user")
  • Scoped per-distribution (different registries can have different owners for the same crate name)
  • First publisher of a crate name automatically becomes owner
  • Owners can add/remove other owners
b. Ownership endpoints

Implement the Cargo owner API:

  • GET /api/v1/crates/{name}/owners — list owners
  • PUT /api/v1/crates/{name}/owners — add owner (body: {"users": ["username"]})
  • DELETE /api/v1/crates/{name}/owners — remove owner
c. Publish authorization check

In CargoPublishApiView.put():

  1. If the crate name has no owners yet → allow (auto-assign publisher as owner)
  2. If the crate name has owners → only allow if request.user is an owner
d. Yank authorization check

Only crate owners (or distribution admins) can yank/unyank.

主要语言
Python
星标
1
派生
5
平均合并
5 天 4 小时
30 天内合并 PR
3

环境准备

从这里开始

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

pulp/pulp_rust 的其他 Issue

查看 pulp/pulp_rust 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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