]> git.proxmox.com Git - cargo.git/commit
Implement git authentication
authorAlex Crichton <alex@alexcrichton.com>
Mon, 1 Sep 2014 06:03:45 +0000 (23:03 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 5 Sep 2014 14:25:56 +0000 (07:25 -0700)
commit219f9902c9fa8016934b2617506e66f671277534
treeed94d5c38bb235f56ea0dff7eed17cbea3d033c0
parente9a9952472507d104230b9d0140e792324ba2092
Implement git authentication

This commit updates git2-rs to get the implementation of the authentication
callback in libgit2. Additionally this specifies the callback for whenever we're
cloning into the database or updating submodules.

Currently cargo will *not* ask for user input, but rather require you to have
authentication configured in git through some other means. There are currently
two primary methods of doing so:

1. Any SSH key in the local ssh-agent will be used for authentication with SSH
   repositories.
2. The `credential.helper` interface (as specified by gitcredential(7)) has been
   implemented in git2-rs to allow for picking up of storage of passwords in the
   local git cache or keychain.

If these two methods fail, then there will likely be an authentication failure.
Interactive prompts for authentication have not been implemented as there is no
method to currently enter your password into the terminal silently.

A consequence of this commit is that cargo now depends on libssh2. A package was
created to create a static copy of libssh2, and this is now linked into cargo by
default.

It turned out that just building libssh2 was quite a beast in and of itself on
windows. The primary stickler point is that on the current release, 1.4.3,
libssh2 requires openssl on windows. At this time I don't want to pick up a
dependency on openssl for windows, and it turned out that the unreleased 1.4.4
version has a new backend for windows not based on openssl, but rather windows's
cryptography API.

The current bundled version of libssh2 is 1.4.4 with some light modifications to
actually build on windows (wow that was hard). All in all, we're now statically
linking to libssh 1.4.4 (not a runtime dependency).

Closes #493
Cargo.lock
Makefile.in
src/cargo/sources/git/utils.rs
src/etc/print-new-snapshot.py
src/snapshots.txt
tests/support/mod.rs
tests/test_cargo_build_auth.rs [new file with mode: 0644]
tests/tests.rs