cargo-credential

Crates.iocargo-credential
lib.rscargo-credential
version0.4.6
sourcesrc
created_at2020-12-16 20:17:10.306784
updated_at2024-07-25 12:10:41.943966
descriptionA library to assist writing Cargo credential helpers.
homepagehttps://github.com/rust-lang/cargo
repositoryhttps://github.com/rust-lang/cargo
max_upload_size
id323709
size66,663
release-publishers (github:rust-lang:release-publishers)

documentation

README

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/credential-provider-protocol.html

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:

# Add this to your Cargo.toml:

[dependencies]
cargo-credential = "0.4"

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:

// src/main.rs

use cargo_credential::{Credential, Error};

struct MyCredential;

impl Credential for MyCredential {
    /// implement trait methods here...
}

fn main() {
    cargo_credential::main(MyCredential);
}
Commit count: 18807

cargo fmt