:bug: harness git auth is HTTP basic only, so SSH-key source identities cannot clone

Open
#240 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
git, go

Research direction

Start at harness/internal/git/credentials.go:19 and trace how Credentials.Auth is selected for Hub source identities and passed to go-git during cloning. Reproduce the failure with the SSH remote shown in the issue, then verify that SSH-key identities no longer reach an invalid basic-auth clone, either by working through the clone or by receiving a clear resolution-time rejection.

Written by the indexing model from the issue text.

Description

The harness only builds HTTP basic auth, so a Hub source identity that holds an SSH key cannot be
used for a run. harness/internal/git/credentials.go:19:

func (c *Credentials) Auth() transport.AuthMethod {
	if c.Username == "" && c.Token == "" {
		return nil
	}
	return &http.BasicAuth{Username: c.Username, Password: c.Token}
}

There is no ssh.PublicKeys path, so an ssh:// or git@ remote gets handed basic auth and go-git
refuses it. The failure is hard to place from the outside, because the identity resolves as success
first:

[ok] app: coolstore (id=1), repo: [email protected]:<owner>/coolstore.git
[ok] git identity: coolstore-fork-deploy-key
[header] Git Setup
cloning [email protected]:<owner>/coolstore.git...
Error: clone: clone [email protected]:<owner>/coolstore.git: invalid auth method

Hub accepts the key happily, and I think other consumers of the same identity kind do use SSH keys
(I have not checked the analyzer path), so a user with an SSH-only git server gets a green identity
and a clone that cannot work. Either add an SSH auth path, or reject an SSH key at resolution time
and say so, rather than logging [ok] git identity and failing later.

Dominant language
Go
Stars
5
Forks
13
Avg merge
3d 11h
Merged PRs (30d)
41

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from konveyor/agentic-controller

All issues in konveyor/agentic-controller

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.