cargo login
should allow for multiple tokens, one per registry, to be saved in ~/.cargo/credentials
#3365
Labels
A-registries
Area: registries
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-login
S-needs-mentor
Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
T-cargo
Team: Cargo
Because I'm working on crates.io locally and testing out publish, and because I'm interested in being able to publish to a private registry in the future, it's annoying that I have to
cargo login
again when I want to publish to crates.io again instead.cargo login --help
shows a--host
option likecargo publish
has, but specifying my local crates.io index tocargo login --host
still overwrites all the content in~/.cargo/config
.It looks like the only thing
--host
is used for right now is if you callcargo login
without a token:println!("please visit {}me and paste the API Token below", host);
Related to rust-lang/rfcs#2141, namely, I think this is similar to, but not dependent on, #4498 so that we can say
cargo login --registry myregistry
and cargo will put this in.cargo/credentials
, which will match up with the registry configuration in.cargo/config
specified in rust-lang/rfcs#2141:I think it could literally just append this to the file (replacing any existing token for
registries.myregistry
; nicer would be if it complained ifregistries.myregistry
didn't appear in any.cargo/config
.Although I guess it does depend on #4498 to actually be useful, since otherwise cargo wouldn't know when it should use this token :)
The text was updated successfully, but these errors were encountered: