Skip to content

Point private extension installs at gh auth setup-git - #388

Merged
charlie-ps merged 2 commits into
mainfrom
private-extension-auth-hint
Oct 27, 2026
Merged

charlie-ps merged 2 commits into
mainfrom
private-extension-auth-hint

Conversation

@charlie-ps

Copy link
Copy Markdown
Contributor

Git runs without a prompt when it installs or updates an extension. So a private GitHub repository with no credential helper failed with a long "Command failed: git -c …" message that did not say what to do.

  • install.js recognises git auth failures on github.com URLs: "could not read Username", "Authentication failed", "Repository not found", "Permission denied (publickey)" and "Invalid username or token". It replaces the message with git's own last line and a hint: "It may be a private repository: run gh auth login, then gh auth setup-git, and try again." An SSH URL is pointed at its https:// form instead.
  • The hint covers clone, the early-adopter branch lookup, ls-remote and the update-count fetch. So it shows in the Extensions panel's install line, the error toast, and an installed extension's "Could not reach the origin" line.
  • How cloning runs is unchanged. Other hosts and other failures are rethrown untouched.
  • docs/extensions.md and the README's gh requirement line mention gh auth setup-git.

Validation:

  • New unit tests in server/extensions/install.test.js; full npm test: 4,620 passed.
  • npm run docs:check: passed.
  • An isolated dev board with git's credential helper turned off, installing a real private GitHub repository, showed the hint in the panel and the toast.

Made with Agent Wrangler and the PortSwigger/wrangler-squared extension

Git runs without a prompt when it installs or updates an extension. So a private GitHub repository with no credential helper failed with a long "Command failed: git -c …" message that did not say what to do.

- `install.js` recognises git auth failures on `github.com` URLs: "could not read Username", "Authentication failed", "Repository not found", "Permission denied (publickey)" and "Invalid username or token". It replaces the message with git's own last line and a hint: "It may be a private repository: run gh auth login, then gh auth setup-git, and try again." An SSH URL is pointed at its `https://` form instead.
- The hint covers clone, the early-adopter branch lookup, `ls-remote` and the update-count fetch. So it shows in the Extensions panel's install line, the error toast, and an installed extension's "Could not reach the origin" line.
- How cloning runs is unchanged. Other hosts and other failures are rethrown untouched.
- `docs/extensions.md` and the README's `gh` requirement line mention `gh auth setup-git`.

Validation:
- New unit tests in `server/extensions/install.test.js`; full `npm test`: 4,620 passed.
- `npm run docs:check`: passed.
- An isolated dev board with git's credential helper turned off, installing a real private GitHub repository, showed the hint in the panel and the toast.

Made with Agent Wrangler and the PortSwigger/wrangler-squared extension
@charlie-ps
charlie-ps merged commit c752e2e into main Oct 27, 2026
2 checks passed
@charlie-ps
charlie-ps deleted the private-extension-auth-hint branch October 27, 2026 13:23
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