Repository navigation
Authenticate over SSH with the default key files - #20
Merged
Merged
Conversation
When no ssh-agent is available, try ~/.ssh/id_ed25519, id_ecdsa and id_rsa in order, and name the keys tried when none is accepted. Document the credential order and the ~/.ssh/config limits in ARCHITECTURE.md.
libgit2 aborts the connection when handed an encrypted key without its passphrase, so detect OpenSSH and PEM encryption and skip those keys, naming them in the error. A failed agent attempt is an ordinary auth failure that libgit2 retries, so the SSH_AUTH_SOCK gate is dropped. Fix the ARCHITECTURE.md section order and move the task back to doing until the release ships.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.ssh/id_ed25519,id_ecdsaandid_rsathat exist. Each credential is handed out once so libgit2 cannot retry forever.docs/ARCHITECTURE.mddocuments the credential order and that libgit2 ignores~/.ssh/config(non-standard ports need anssh://URL).doing/until the release ships.Testing
127.0.0.1:2299), with noSSH_AUTH_SOCK: a key file clones andsync_writepushes; a rejected key and a passphrase-protected key each fail with an error naming the key; a staleSSH_AUTH_SOCKfalls through to the key file; no key at all gives the setup hint. CI cannot run an sshd, so these are not automated.cargo test,cargo clippy --all-targets -W clippy::pedanticandcargo fmt --checkpass for this change.