-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drawback: typosquatting #3
Comments
Ok I haven't thought through the complete implications of this yet; will think some more later. But what if we introduce a new syntax in Cargo.toml that will map to "foo/bar" (and old Cargos can use "foo/bar" to depend on crates like this, I feel like supporting old cargos is probably where this idea is going to fall down but stick with me for a second) either something like:
or:
to make it more obvious and explicit and different when your intention is to use a sub-crate? |
@carols10cents I don't see how this proposal fixes typosquatting, in essence the crate will still be
We can't do this because this locks us out of ever adding more keys to the dependency spec format |
My personal take on this is that typosquatting is not that big a deal and we mostly should decide on whether registering |
To be clear, this means the following: If I have This is okay if we support the The only issue is that the wording seemed quite confusing at first until I really sat down to think on this. We might want to expand the section and add examples of the behaviour. I don't think this will be an issue but I am worried about other tools which might get affected because of two crates resolving to |
It is already possible to make a crate resolve to an arbitrary library name, fwiw. It's only a problem if you are trying to use the two crates in cargo.toml. Crates.io, docs.rs, etc are unaffected. Tooling should be fine, the only issue is cargo.toml, and that's handled by renaming. |
I agree.
What I meant is the behaviour of other non-official tools that use crates.io. |
We were discussing aspects of this in the Cargo meeting today, and in general, I would expect a dependency on That would reduce the ambiguity between |
@joshtriplett idk, in some cases it makes sense for that to be the crate name, but in most cases for me i think that disambiguator is good -- looking at the lot of the Also yeah this makes the typosquatting situation worse since it's no longer typosquatting it's just squatting. I think the fact that, by default, looking at a piece of rust code tells you what crates you need is good -- losing this property opens us up to confusion and potential malice when someone looks at rust code using |
With talk in #1 pivoting towards using |
No, but most of these issues should be ignored at this stage of the RFC |
The current proposal allows for dash typosquatting
The text was updated successfully, but these errors were encountered: