mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-11-29 02:39:13 +00:00
#1286 taught the credential files to carry the GitHub host their token came from, but the environment and `gh auth token` rungs carried none, so they were always addressed to api.github.com. A user whose only Copilot credential is a GitHub Enterprise Cloud login — GH_TOKEN exported alongside GH_HOST, or `gh auth login --hostname <tenant>.ghe.com` — got a 401 and a terminal failure with nothing to act on. The environment rung now reads GH_HOST out of the same environment as the token. The gh rung resolves the host from gh's own hosts.yml, found via GH_CONFIG_DIR, then XDG_CONFIG_HOME/gh, then ~/.config/gh, and picked the way gh picks the host for `gh auth token`: GH_HOST, else the single configured host, else dotcom. That is a file read rather than a second `gh auth status` spawn, because gh writes hosts.yml for every login, keyring-backed ones included. Both are new untrusted inputs, so they stay raw all the way to `apiHost(for:)`, where #1286's character validation refuses a crafted value such as `evil.com?.ghe.com` before any URL exists — that host passes the `.ghe.com` suffix check but builds a URL whose host is api.evil.com, which would then receive the Authorization header. |
||
|---|---|---|
| .. | ||
| CodeBurnMenubar | ||