diff options
Diffstat (limited to 'src/tools/cargo/credential/cargo-credential-1password')
3 files changed, 17 insertions, 6 deletions
diff --git a/src/tools/cargo/credential/cargo-credential-1password/Cargo.toml b/src/tools/cargo/credential/cargo-credential-1password/Cargo.toml index a607e6da1..d7bd949d1 100644 --- a/src/tools/cargo/credential/cargo-credential-1password/Cargo.toml +++ b/src/tools/cargo/credential/cargo-credential-1password/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-credential-1password" -version = "0.3.0" +version = "0.4.0" edition.workspace = true license.workspace = true repository = "https://github.com/rust-lang/cargo" diff --git a/src/tools/cargo/credential/cargo-credential-1password/README.md b/src/tools/cargo/credential/cargo-credential-1password/README.md index 7cc15e05b..3648efe4b 100644 --- a/src/tools/cargo/credential/cargo-credential-1password/README.md +++ b/src/tools/cargo/credential/cargo-credential-1password/README.md @@ -1,7 +1,18 @@ # cargo-credential-1password -This is the implementation for the Cargo credential helper for [1password]. -See the [credential-process] documentation for how to use this. +A Cargo [credential provider] for [1password]. + +`cargo-credential-1password` uses the 1password `op` CLI to store the token. You must +install the `op` CLI from the [1password +website](https://1password.com/downloads/command-line/). You must run `op signin` +at least once with the appropriate arguments (such as `op signin my.1password.com user@example.com`), +unless you provide the sign-in-address and email arguments. The master password will be required on each request +unless the appropriate `OP_SESSION` environment variable is set. It supports +the following command-line arguments: +* `--account`: The account shorthand name to use. +* `--vault`: The vault name to use. +* `--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. [1password]: https://1password.com/ -[credential-process]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#credential-process +[credential provider]: https://doc.rust-lang.org/nightly/cargo/reference/registry-authentication.html diff --git a/src/tools/cargo/credential/cargo-credential-1password/src/main.rs b/src/tools/cargo/credential/cargo-credential-1password/src/main.rs index a2607fd2f..921b52145 100644 --- a/src/tools/cargo/credential/cargo-credential-1password/src/main.rs +++ b/src/tools/cargo/credential/cargo-credential-1password/src/main.rs @@ -255,8 +255,8 @@ pub struct OnePasswordCredential {} impl Credential for OnePasswordCredential { fn perform( &self, - registry: &RegistryInfo, - action: &Action, + registry: &RegistryInfo<'_>, + action: &Action<'_>, args: &[&str], ) -> Result<CredentialResponse, Error> { let op = OnePasswordKeychain::new(args)?; |