mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 11:12:25 +00:00
8d7ec64354
cargo-credential-1password: Add missing `--account` argument to `op signin` command ### What does this PR try to resolve? Without this the account chooser is shown by the `op signin` command, even though the user has already specified an account via the `--account` command line argument to the `cargo-credential-1password` CLI. Note that the `--vault` in this case does not need to be forwarded to `op`, since it is irrelevant for the `op signin` command. ### How should we test and review this PR? - Have a 1password installation with multiple accounts - Use `global-credential-providers = ["cargo-credential-1password --account my.1password.com"]` in the cargo config file - Run e.g. `cargo publish` - Notice how you are seeing an account switcher even though `--account` was used - Apply this patch and notice that the account switcher is no longer there and the correct account is selected automatically ### Additional information see https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/1password.20credentials.20provider |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md |
cargo-credential-1password
A Cargo credential provider for 1password.
Usage
cargo-credential-1password
uses the 1password op
CLI to store the token. You
must install the op
CLI from the 1password
website.
Afterward you need to configure cargo
to use cargo-credential-1password
as
the credential provider. You can do this by adding something like the following
to your cargo config file:
[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, runop account list
.--vault
: The vault name to use. For a list of available vaults, runop vault list
.