Repository navigation
http backend: headers option (Bearer auth) to install binaries from ghcr.io / private registries
#14014
CyrilDesch
started this conversation in
Ideas
Replies: 2 comments
|
Thanks for the detailed write-up. Option 1 is in #14022: a templated [tools."http:polaris"]
version = "0.9.2"
headers = { Authorization = "Bearer {{ env.GITHUB_TOKEN | b64_encode }}" }Headers go to the AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.288. |
0 replies
|
Implemented in #14022: feat(http): add headers option for bearer and API-key auth |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add a
headersoption to thehttp:backend, with env templating, so a tool can be installed from a URL that needs a token other than Basic auth. The main case is a binary stored as an OCI blob onghcr.io, the way Homebrew stores its bottles.Why
GITHUB_TOKEN. A cross-repo secret is the only way.GITHUB_TOKEN+permissions: packages: readis enough, and no secret is needed.So for internal CLIs, GHCR is the natural place to host binaries. The only part that is missing is in mise.
What I tested (mise 2026.10.3, macos-arm64)
curlGHCR blob (homebrew/core/jq), no authcurlsame blob,Authorization: Bearer QQ==bin/jq)curlprivate package,Bearer base64(PAT)curlprivate package, Basicuser:PATmise installhttp:tool on the same blob URLmise installwithheaders = {…}in the tool optionsnetrcsupport (#6842 / #7164) does not help here.netrcgives Basic auth, and GHCR rejects Basic auth on/v2/blob and manifest requests.Note: GHCR redirects blob downloads to a signed
pkg-containers.githubusercontent.comURL. The existing rule that strips auth headers on cross-origin redirects is correct here, because the signed URL needs no auth.Proposal
Any one of these solves it, in order of preference:
headerstool option onhttp:(and maybe onversion_list_url), with{{ env.* }}templating. Generic, and it also covers Artifactory/Nexus API-key headers.ghcr.ioURLs, sendAuthorization: Bearer base64(<github token>). Use the token that mise already resolves for thegithub:backend, andQQ==when there is no token.netrcbut for tokens.Related
orasonPATHand a custom artifact format, so it does not help with a plain tarball pushed withoras push.All reactions