Auto merge of #4551 - natboehm:owner-invite-messages, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 30 Sep 2017 07:37:59 +0000 (07:37 +0000)
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>
Tue, 3 Oct 2017 14:35:02 +0000 (10:35 -0400)
commit97aa28483dcb721d40b81e648deb5649333ca411
treea2fc9ae4bc16d33d0f9487ecea53ff25ea93d5f1
parent3d3f2c05d742e5f907e951aa8849b03f0bc1a895
Auto merge of #4551 - natboehm:owner-invite-messages, r=alexcrichton

Owner invite messages

This PR addresses issue #4537, the plan for `cargo owner --add` requiring invitations in Cargo and the encompassing issue [#924](https://github.com/rust-lang/crates.io/issues/924), requiring an invite to add someone as an owner in Crates.io.

Regarding the Cargo issue, we went with Option 2, changing the `add_owners` function to decode a struct sent from Crates containing a `boolean` and `String`, the `boolean` being the response status and `String` being the success message. This may sound redundant however we concluded that using both of these fields were necessary to support older versions of Cargo - if we changed Crates.io to only return the `String` message on success this would likely break systems using the older version of `add_owner` expecting a response containing a `boolean`. Matching this schema, `add_owners` on the Crates.io side will soon return a struct containing a `boolean` and `String`, and instead of adding a new crate owner to the database will add a crate owner invite. If successful, `modify_owners` now prints the message sent from Crates.io instead of the old hardcoded message.

Resolves #4537
src/cargo/ops/registry.rs
src/crates-io/lib.rs