mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-18 18:04:17 +00:00
Token auth rewrote the clone URL with url.<user>:<token>@host.insteadOf. git hands the rewritten URL to git-remote-https as an argument, so any user on the machine could read the token with ps for as long as a clone or fetch ran. Every platform token (GitHub, GitLab, Bitbucket, Azure DevOps, Gitea, CNB) went through the same rewrite. git now gets the token from a credential helper scoped to the host, which reads it from SKILLSHARE_GIT_AUTH_PASSWORD; printf is a shell builtin, so the token never reaches an argv. An empty helper entry first clears the user's own helpers for that host, so git neither asks their keychain nor erases from it on a 401, and no longer stores the skillshare token there as the URL rewrite did. An http.extraHeader was tried first and dropped: the header goes out before any 401, so a stale token broke installs from public repos, and after a rejection git fell back to the user's helper and erased their stored credentials. Refs #565