-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
What feature or improvement do you think would benefit Files?
Currently, the Git integration in Files only supports authentication over the HTTPS protocol, primarily using GitHub Personal Access Tokens (PATs) obtained via an OAuth login flow.
This means that any repository that has been cloned using an SSH URL (e.g., git@github.com:user/repo.git
) cannot perform authenticated network operations like pull
, push
, or fetch
. These operations fail because the application is unable to provide the SSH key credentials required by the Git remote.
This is a significant limitation for developers who prefer using SSH for its security and convenience, effectively preventing them from using the integrated Git features for their existing projects.
Requirements
I propose to implement full authentication support for the SSH protocol. This would involve the following key changes, primarily within the GitHelpers.cs
file:
- Enhance the
CredentialsProvider
: The existingCredentialsProvider
callback will be updated to intelligently handle different credential requests fromLibGit2Sharp
. - Detect SSH Requests: The handler will now check if the required credential type is
SupportedCredentialTypes.SshKey
. - Provide SSH Key Credentials: When an SSH key is requested, the handler will locate the user's default SSH private key (e.g., ~/.ssh/id_rsa).
- Support for Passphrases: If the private key is encrypted with a passphrase, a ContentDialog will be displayed, securely prompting the user to enter it.
- Complete Authentication: The key path and the (optional) passphrase will be used to create and return an
SshUserKeyCredentials
object, allowing the SSH authentication to succeed.
This solution would seamlessly enable SSH support while retaining the existing functionality for HTTPS authentication.
Files Version
4.0.11.0
Windows Version
10.0.26100.6584
Comments
Adding SSH support would significantly enhance the Git functionality in Files.
I have already spent time investigating the codebase and have a clear implementation plan. I am willing to contribute the code for this feature and submit a Pull Request.
Before I begin development, I wanted to open this issue to discuss the plan with the project maintainers. I would greatly appreciate any feedback or guidance on this approach.
Thank you in advance!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status