mirror of https://github.com/rust-lang/cargo
Auto merge of #12986 - Turbo87:1password-readme, r=ehuss
cargo-credential-1password: Fix README ### What does this PR try to resolve? The README.md file of the cargo-credential-1password package does not match the implemented reality (anymore?). - `--sign-in-address` and `--email` are not actually supported by the implementation - manually calling `op signin` appears to be unnecessary This PR also adds configuration instructions directly to the README.md so that they show up on crates.io.
This commit is contained in:
parent
3aa3b0c9b5
commit
8862fd33a0
|
@ -314,7 +314,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cargo-credential-1password"
|
name = "cargo-credential-1password"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cargo-credential",
|
"cargo-credential",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "cargo-credential-1password"
|
name = "cargo-credential-1password"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
rust-version = "1.70.0" # MSRV:3
|
rust-version = "1.70.0" # MSRV:3
|
||||||
|
|
|
@ -2,17 +2,31 @@
|
||||||
|
|
||||||
A Cargo [credential provider] for [1password].
|
A Cargo [credential provider] for [1password].
|
||||||
|
|
||||||
`cargo-credential-1password` uses the 1password `op` CLI to store the token. You must
|
## Usage
|
||||||
install the `op` CLI from the [1password
|
|
||||||
website](https://1password.com/downloads/command-line/). You must run `op signin`
|
`cargo-credential-1password` uses the 1password `op` CLI to store the token. You
|
||||||
at least once with the appropriate arguments (such as `op signin my.1password.com user@example.com`),
|
must install the `op` CLI from the [1password
|
||||||
unless you provide the sign-in-address and email arguments. The master password will be required on each request
|
website](https://1password.com/downloads/command-line/).
|
||||||
unless the appropriate `OP_SESSION` environment variable is set. It supports
|
|
||||||
the following command-line arguments:
|
Afterward you need to configure `cargo` to use `cargo-credential-1password` as
|
||||||
* `--account`: The account shorthand name to use.
|
the credential provider. You can do this by adding something like the following
|
||||||
* `--vault`: The vault name to use.
|
to your [cargo config file][credential provider]:
|
||||||
* `--sign-in-address`: The sign-in-address, which is a web address such as `my.1password.com`.
|
|
||||||
* `--email`: The email address to sign in with.
|
```toml
|
||||||
|
[registry]
|
||||||
|
global-credential-providers = ["cargo-credential-1password --account my.1password.com"]
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, run `cargo login` to save your registry token in 1password.
|
||||||
|
|
||||||
|
## CLI Arguments
|
||||||
|
|
||||||
|
`cargo-credential-1password` supports the following command-line arguments:
|
||||||
|
|
||||||
|
* `--account`: The account name to use. For a list of available accounts,
|
||||||
|
run `op account list`.
|
||||||
|
* `--vault`: The vault name to use. For a list of available vaults,
|
||||||
|
run `op vault list`.
|
||||||
|
|
||||||
[1password]: https://1password.com/
|
[1password]: https://1password.com/
|
||||||
[credential provider]: https://doc.rust-lang.org/nightly/cargo/reference/registry-authentication.html
|
[credential provider]: https://doc.rust-lang.org/stable/cargo/reference/registry-authentication.html
|
||||||
|
|
|
@ -103,7 +103,7 @@ Install the provider with `cargo install cargo-credential-1password`
|
||||||
In the config, add to (or create) `registry.global-credential-providers`:
|
In the config, add to (or create) `registry.global-credential-providers`:
|
||||||
```toml
|
```toml
|
||||||
[registry]
|
[registry]
|
||||||
global-credential-providers = ["cargo:token", "cargo-credential-1password --email you@example.com"]
|
global-credential-providers = ["cargo:token", "cargo-credential-1password --account my.1password.com"]
|
||||||
```
|
```
|
||||||
|
|
||||||
The values in `global-credential-providers` are split on spaces into path and command-line arguments. To
|
The values in `global-credential-providers` are split on spaces into path and command-line arguments. To
|
||||||
|
|
Loading…
Reference in New Issue