question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing credentials from 'url' for SCM doesn't play well with SSH git repository hosting

See original GitHub issue
  • I’ve read the CONTRIBUTING guide.
  • I’ve specified the Conan version, operating system version and any tool that can be relevant.
  • I’ve explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

conan 1.12+, previous used version was 1.11

Once upon a time there was a pull request #4207 that changed URLs like ssh://git@a.b.c.d:port/GROUP/repo.git to ssh://a.b.c.d:port/GROUP/repo.git (i.e. without username) for SCM attribute.

Recently I updated to conan 1.18.5 and got a problem.

I’m pulling sources from a GitLab instance via SSH (I can’t change it now to HTTP) and GitLab (I think git hosting services too) doesn’t accept SSH connections without username.

So what options do I have now?

  • Every user of package have to execute git config --global url.ssh://git@a.b.c.d:port.insteadOf ssh://a.b.c.d:port, i.e. add config to rewrite URL. It doesn’t scale well.
  • Every package developer must hardcode username ‘git’ in the scm attribute i.e.
        "type": "git",
        "username": "git",
        "url": "auto",
        "revision": "auto",
    }

It doesn’t scale too and what if someone wants to use HTTPS and his name is not git?

For me as a user of conan it looks like a regression.

Could you suggest a scalable workaround or fix this issue?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
wizardsdcommented, Oct 2, 2019

Yes, exactly. That is why I’m asking for a suggestion and cannot provide my own solution.

0reactions
wizardsdcommented, Aug 5, 2020

I’ve realized, that git supports two kinds of addresses and preparing a PR to support both.

Read more comments on GitHub >

github_iconTop Results From Across the Web

windows - Remove credentials from Git - Stack Overflow
Click on Windows credentials tab and here you can see your stored github credentials, under "Generic credentials" heading. You can remove those from...
Read more >
2.5 Git Basics - Working with Remotes
Managing remote repositories includes knowing how to add remote repositories, remove remotes that are no longer valid, manage various remote branches and define ......
Read more >
Private Repositories - Declarative GitOps CD for Kubernetes
SSH Private Key Credential¶ · Navigate to Settings/Repositories. connect repo overview · Click Connect Repo using SSH button, enter the URL and paste...
Read more >
TeamForge-Git integration: General usage FAQ
If not, access the URL http(s)://<yourtfinstance>/scm integration ... The Git integration currently allows you to access a Git repository using SSH.
Read more >
Troubleshoot SSH issues | Bitbucket Cloud - Atlassian Support
When attempting to clone, push, or pull over SSH with Git, you may receive one of these messages if Bitbucket couldn't authenticate with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found