10 releases

new 0.4.8 Jan 9, 2025
0.4.7 Nov 28, 2024
0.4.6 Jul 25, 2024
0.4.4 Mar 21, 2024
0.1.0 Dec 16, 2020

#112 in Authentication

Download history 18375/week @ 2024-09-20 21311/week @ 2024-09-27 20770/week @ 2024-10-04 23694/week @ 2024-10-11 23734/week @ 2024-10-18 22454/week @ 2024-10-25 21174/week @ 2024-11-01 20769/week @ 2024-11-08 20546/week @ 2024-11-15 20018/week @ 2024-11-22 25065/week @ 2024-11-29 22062/week @ 2024-12-06 21880/week @ 2024-12-13 18464/week @ 2024-12-20 16117/week @ 2024-12-27 22332/week @ 2025-01-03

82,930 downloads per month
Used in 62 crates (13 directly)

MIT/Apache

33KB
653 lines

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

This crate is maintained by the Cargo team for use by the wider ecosystem. This crate follows semver compatibility for its APIs.

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);
}

Dependencies

~1–11MB
~109K SLoC