mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00

This is a short-term option until we can have a better solution for
globbing. This does not update `benches/` to support which has a README
in there preventing globbing; this seems low-churn enough not to find a
solution for it.
On the next sync-up with rust-lang/rust, we'll need to update 4e46301258/src/bootstrap/tool.rs (L588-L603)
Fixes #11988
42 lines
976 B
Markdown
42 lines
976 B
Markdown
# cargo-credential
|
|
|
|
This package is a library to assist writing a Cargo credential helper, which
|
|
provides an interface to store tokens for authorizing access to a registry
|
|
such as https://crates.io/.
|
|
|
|
Documentation about credential processes may be found at
|
|
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#credential-process
|
|
|
|
Example implementations may be found at
|
|
https://github.com/rust-lang/cargo/tree/master/credential
|
|
|
|
## Usage
|
|
|
|
Create a Cargo project with this as a dependency:
|
|
|
|
```toml
|
|
# Add this to your Cargo.toml:
|
|
|
|
[dependencies]
|
|
cargo-credential = "0.1"
|
|
```
|
|
|
|
And then include a `main.rs` binary which implements the `Credential` trait, and calls
|
|
the `main` function which will call the appropriate method of the trait:
|
|
|
|
```rust
|
|
// src/main.rs
|
|
|
|
use cargo_credential::{Credential, Error};
|
|
|
|
struct MyCredential;
|
|
|
|
impl Credential for MyCredential {
|
|
/// implement trait methods here...
|
|
}
|
|
|
|
fn main() {
|
|
cargo_credential::main(MyCredential);
|
|
}
|
|
```
|