-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Track which commands a registry supports in its config.json #4747
Conversation
The registry config.json contains an extra field, "commands", an object. The fields of this object each is a command, which records which versions (if any) of this command that registry supports. A complete registry, as of today, would have these commands: ```json { "login": ["v1"], "publish": ["v1"], "owner": ["v1"], "search": ["v1"], "yank": ["v1"] } ```
Prior to this commit, the login flow for registries other than the default does not support the token pasting flow. Now, if the host flag is specified, or the registry claims to support the "v1" flow, we enter the token pasting flow.
(rust_highfive has picked a reviewer for you, use r? to override) |
This seems reasonable to me! (although I haven't really spent much time thinking through ramifications. I think merging of this would need to be preceded with a change to the actual index, right? |
Correct |
Can't replicate the test failure locally :-\ |
Hm using the latest stable locally on a fresh checkout if I do
@matklad mind helping take a look at this failure (it's on master, not just with this PR) |
☔ The latest upstream changes (presumably #4836) made this pull request unmergeable. Please resolve the merge conflicts. |
This has been inactive for some time now so I'm going to close this, but it can of course be resubmitted! |
This arose out of #4574. The idea is for cargo to only perform an action if the registry supports that command.
The 5 existing commands that interact with registries are:
This proposes to track each command as an array of supported versions:
(On the issue it was discussed having an "api" string for each command, but the actual APIs of the commands are not conducive to this because parts of the query are in the path.)
Before merging, this commands object would need to be added to the config.json of the crates.io index.
@cswindle @carols10cents @rust-lang/cargo