Replies: 4 comments 22 replies
-
I realize this is a complication for anti-spam actions, and ends up "wasting" potentially nice versions on spam. Possible solutions (updated):
|
Beta Was this translation helpful? Give feedback.
-
maybe there needs to be a per-name epoch (kinda like how debian does it), so when a name is totally removed, the epoch is incremented so any new crates with the same name don't conflict even if they have the same version string. that way a |
Beta Was this translation helpful? Give feedback.
-
It seems like there's some sort of data modeling mismatch here... One way to think of crate version/checksum relations is:
But another way to think of it is:
In the latter mental model, checksums are immutable: if the The point being that the checksum hasn't changed-- it's a new, appended record (because the crate is completely different). GIven this mental model, I'm not sure that crates.io needs to change anything about policies or disallowing version number reuse? What am I missing? Another thought I have is what if systems like libs.rs could consume notifications of deletes and remove entries from its systems when deletes are detected? Would that solve the issue? |
Beta Was this translation helpful? Give feedback.
-
Also note that user deletions are not allowed if there are other crates on crates.io that depend on that crate. From the page you see when attempting to delete a crate:
As admins, we only delete crates that have dependencies if there's a very good reason (such as some sort of legal action). This of course doesn't protect projects not on crates.io that depend on a crate, but the hope is these restrictions make it so that widely used crates won't get into the problematic situations being discussed here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current Behavior
Usually crates.io refuses to change existing releases. However, if a crate is deleted (by admins), then it's possible to reclaim the name, and publish the same version of the same crate with a new content.
This means that the index (apart from yanking) isn't truly immutable/append-only. It's possible that for a given
(crate_name, version)
there will be a different content at different times.This edge case creates problems:
It complicates registry caching/mirroring. I can't assume that each crate version is published only once ever. Tarballs are downloaded by name & version, but must match the checksum in the index (BTW, static.crates.io sends
cache-control: public,max-age=31536000,immutable
which isn't correct!). Properly supporting that edge case requires ability to purge caches.Similarly, it complicates data analysis. I can't assume that data derived from a release won't change, so I need to have ability to update previously processed data. I've assumed that the registry data is append-only and crate tarballs can't change, and ended up with inconsistent data on https://lib.rs for republished crates.
It prevents implementation of an extra TOFU-like security for clients. I wanted to add an extra layer of security to my crates.io mirror (and propose a similar policy in Cargo) that enforced that checksums of published crates must never change. This would ensure that existing releases couldn't be modified even if crates.io itself was hacked, and any attempts to do so could be detected and raise an alarm (I know crates.io is working on a proper security model, but this would have been an improvement without protocol changes). Unfortunately, the possibility of delete + republish legitimately changing the content of old crates is an exception that makes checksums effectively mutable.
Expected Behavior
Would it be possible for crates.io to make checksums always immutable?
Steps To Reproduce
Environment
N/A
Anything else?
The checksum changes happened quite a few times:
Beta Was this translation helpful? Give feedback.
All reactions