]> git.proxmox.com Git - cargo.git/commit
Make .cargo/credentials a subset of .cargo/config
authorSteven Fackler <sfackler@gmail.com>
Wed, 20 Dec 2017 03:37:14 +0000 (19:37 -0800)
committerSteven Fackler <sfackler@palantir.com>
Mon, 8 Jan 2018 23:14:55 +0000 (15:14 -0800)
commit5cb5e7d8f0496a3e765f6e05b95e8c3b1665036a
treead2a715d2d92384533dc1ae8deea04cfe9e7de31
parentf60ece98c10aa3716d037524da4ee989e212fe19
Make .cargo/credentials a subset of .cargo/config

Previously, .cargo/credentials looked like

```toml
token = "..."

[my-registry]
token = "..."
```

And was simply merged into the `registry` block of .cargo/config. This
meant that custom registry tokens were under
`registry.my-registry.token` rather than `registries.my-registry.token`
which is where the index was located, and that you couldn't have a
custom registry named `token` or it'd conflict with the token for the
default registry.

This commit changes things such that .cargo/credentials has the same
layout as .cargo/config, but only contains token values. For backwards
compatibility, we move `token` to `registry.token` when parsing.
src/cargo/ops/registry.rs
src/cargo/util/config.rs
tests/cargotest/support/publish.rs
tests/login.rs
tests/publish.rs