RFE: Support Crate Ownership
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 4
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 6
Description
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 ownersPUT /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():
- If the crate name has no owners yet → allow (auto-assign publisher as owner)
- If the crate name has owners → only allow if
request.useris an owner
d. Yank authorization check
Only crate owners (or distribution admins) can yank/unyank.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, authorization, backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100