git2_codecommit

Crates.iogit2_codecommit
lib.rsgit2_codecommit
version0.1.2
sourcesrc
created_at2017-03-06 04:40:05.741248
updated_at2017-10-23 07:52:10.375667
descriptionCredential callback for using git2 with AWS CodeCommit
homepage
repositoryhttps://github.com/ilianaw/rust-git2-codecommit
max_upload_size
id8847
size7,989
iliana etaoin (iliana)

documentation

README

rust-git2-codecommit

This is a credential provider that you can give to git2::RemoteCallbacks::credentials and have it use AWS credentials from the usual locations.

It will then generate the username and password to use AWS CodeCommit via HTTPS, similar to the AWS CLI credential helper.

(You can also probably just set up the credential helper and libgit2 should do the right thing, but.)

This module uses code copied from private functions in rusoto, available under the MIT license.

Example

use git2::{FetchOptions, RemoteCallbacks};
use git2::build::RepoBuilder;
use git2_codecommit::codecommit_credentials;

let mut remote_cbs = RemoteCallbacks::new();
remote_cbs.credentials(codecommit_credentials);
let mut fetch_opts = FetchOptions::new();
fetch_opts.remote_callbacks(remote_cbs);
let repo = RepoBuilder::new().fetch_options(fetch_opts).clone(url, some_path).unwrap();
// etc.
Commit count: 9

cargo fmt