Skip to content

Commit 5aa953d

Browse files
committed
feat: add git SSH authentication support
1 parent 2e1d2ad commit 5aa953d

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ crossterm = "0.22.1"
3434
dirs = "3.0.1"
3535
env_logger = "0.8.1"
3636
fs-err = "2.5.0"
37-
git2 = "0.16.1"
37+
git2 = "0.18.1"
3838
hex = "0.4.2"
3939
indoc = "1.0.3"
4040
log = "0.4.11"

src/git_util.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ fn make_credentials_callback(
2727
let mut token_tried = false;
2828

2929
move |url, username, allowed_types| {
30+
if allowed_types.contains(CredentialType::SSH_KEY) {
31+
let username = username.unwrap();
32+
return Cred::ssh_key_from_agent(username);
33+
}
34+
3035
if allowed_types.contains(CredentialType::USER_PASS_PLAINTEXT) {
3136
if let Some(token) = &access_token {
3237
if !token_tried {

wally-registry-backend/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ constant_time_eq = "0.1.5"
2323
figment = "0.10.9"
2424
fs-err = "2.5.0"
2525
futures = "0.3.13"
26-
git2 = "0.16.1"
26+
git2 = "0.18.1"
2727
reqwest = { version = "0.11.0", features = ["blocking", "json"] }
2828
rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "91f6288ea4aeb3d5a502b2f18b2b9677a85463ea", features = ["json"] }
2929
rusoto_core = { version = "0.48.0", optional = true }

0 commit comments

Comments
 (0)