Skip to content

Fix #387: Fix git clone auth by honoring configured git account username#1448

Open
lukababu wants to merge 1 commit into
moghtech:mainfrom
lukababu:fix/git-account-username-in-clone-url
Open

Fix #387: Fix git clone auth by honoring configured git account username#1448
lukababu wants to merge 1 commit into
moghtech:mainfrom
lukababu:fix/git-account-username-in-clone-url

Conversation

@lukababu
Copy link
Copy Markdown

@lukababu lukababu commented May 27, 2026

Closes #387

Why

Private repo clones can fail on providers that validate HTTP basic-auth usernames (for example GitLab deploy tokens, Bitbucket, and GitHub fine-grained PATs).
Komodo currently resolves a token but loses the configured account username before URL construction, so clone URLs fall back to token:<token>@.... That causes HTTP Basic: Access denied for providers that require a specific username.

What changed

  • Updated Core git credential resolution to return credentials in username:token form (while preserving existing token values that already contain : for backward compatibility).
  • Updated Periphery fallback credential resolution to do the same when Core does not provide a token.
  • Added comments documenting the auth flow and compatibility behavior.

Behavior

Before:

  • Clone URL often became https://token:<token>@<provider>/<repo>
    After:
  • Clone URL uses configured account username:
    • https://<configured-username>:<token>@<provider>/<repo>

Backward compatibility

  • Existing setups that already use the v1.19.2 workaround (token field manually set to username:token) continue to work unchanged.

Validation

  • cargo check -p komodo_core passes
  • cargo check -p komodo_periphery passes
  • cargo clippy -p komodo_core -p komodo_periphery --no-deps passes
  • Reproduced failing GitLab deploy-token clone case before patch
  • NEEDS TO BE DONE - Verify clone succeeds after patch with same provider/account config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant