-
Notifications
You must be signed in to change notification settings - Fork 64
SSH credential host matching fails for git@host format #175
Copy link
Copy link
Open
Description
Bug Description
When adding an SSH credential with the host format git@bitbucket.org, the credential is not matched when trying to clone a repository. The clone fails with "Permission denied (publickey)".
Steps to Reproduce
- Go to Settings > Git Credentials
- Add an SSH credential with host git@bitbucket.org (the pre-filled format when selecting SSH type)
- Save the credential
- Try to clone a repo from that host, e.g., git@bitbucket.org:user/repo.git
- Clone fails with authentication error
Expected Behavior
SSH credential should match and authentication should succeed.
Root Cause
- Frontend pre-fills git@github.com when selecting SSH type (frontend/src/components/settings/GitCredentialDialog.tsx:180), suggesting this format is valid
- Backend's getSSHCredentialsForHost (backend/src/utils/git-auth.ts:130) doesn't normalize the git@ prefix
- When cloning, extractHostFromSSHUrl extracts just bitbucket.org from the repo URL
- Comparison: git@bitbucket.org ≠ bitbucket.org → no match found
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels