Skip to content

fix: use Basic auth for git clone/push/fetch#261

Merged
andrewrady merged 2 commits into
ritterim:masterfrom
tgharold:20260518-1623
May 19, 2026
Merged

fix: use Basic auth for git clone/push/fetch#261
andrewrady merged 2 commits into
ritterim:masterfrom
tgharold:20260518-1623

Conversation

@tgharold

Copy link
Copy Markdown
Contributor

Summary

  • GitHub's git HTTPS server rejects Authorization: Bearer for git operations (clone, fetch, push)
  • Tested locally: Bearer → remote: invalid credentials; token → falls back to credential prompt; Basic → success
  • Adds Get-GitAuthHeader helper that encodes x-access-token:<token> as HTTP Basic, used in all four git call sites (clone, fetch, push tag, delete tag)
  • Updates Format-GitArgsForDisplay to redact Authorization: Basic in addition to Bearer/token

Root cause

PR #259 switched to Bearer which works for REST API calls but not for the git Smart HTTP protocol. The correct scheme for GitHub App installation tokens in git is Basic auth with username x-access-token.

Test plan

  • All 97 Pester tests pass locally
  • Re-run failed job in terraform-test-application after SHA bump

🤖 Generated with Claude Code

tgharold added 2 commits May 18, 2026 16:30
GitHub's git server rejects Authorization: Bearer for HTTPS
git operations; Basic auth with x-access-token as the username
is the supported scheme for GitHub App installation tokens.

Co-Authored-By: Claude Sonnet 4.6
Co-Authored-By: Claude Sonnet 4.6
@tgharold
tgharold requested a review from a team as a code owner May 18, 2026 20:31
@tgharold
tgharold requested a review from andrewrady May 19, 2026 10:36
@andrewrady
andrewrady merged commit 76245ce into ritterim:master May 19, 2026
9 checks passed
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.

3 participants