Repository navigation
fix(modules): GitHub API tarball endpoint so private repos install - #332
Merged
Merged
Conversation
…stall tarballUrl() returned the web archive URL (github.com/<org>/<repo>/archive/<ref>.tar.gz), which 404s for a PRIVATE repo even with a valid bearer token. The authenticated module-source path (the company private feed) is the first caller to fetch a private repo directly, so it hit the 404 on install while update DETECTION (which uses the API) worked. Switch to the API tarball endpoint (api.github.com/repos/<org>/<repo>/tarball/<ref>), which honours the token and 302s to a signed codeload URL; it works for public repos too, so one URL serves both. Verified live: the web path returned 404 and the API endpoint 200 for a private repo with the same fine-grained token. The licensed/authority path is unaffected — it mints its own signed URL and never calls tarballUrl(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Tiger_Module_Github::tarballUrl()returned GitHub's web archive URL(
github.com/<org>/<repo>/archive/<ref>.tar.gz), which 404s for a PRIVATE repo even with a validbearer token. Switched to the API tarball endpoint
(
api.github.com/repos/<org>/<repo>/tarball/<ref>), which honours the token and 302s to a signedcodeload URL. It works for public repos too, so one URL serves both the public directory and an
authenticated private/company source.
Why it surfaced now
The authenticated module-source feature (v1.20.0, #330) made the company private feed the first
caller to fetch a private repo directly with a token. Update detection uses the API and worked
(correctly saw TigerMarketing 0.2.0 → 0.3.0), but install fell through to
tarballUrl()and failedwith "Failed to download the release tarball."
Verification
Live, against the private
WebTigers/TigerMarketingwith a fine-grained read-only token:github.com/.../archive/v0.3.0.tar.gz→ HTTP 404api.github.com/repos/.../tarball/v0.3.0→ HTTP 200, 996 KB, via codeloadUnit: GithubTest + GithubParseTest updated; full
tests/Unit/Modulesuite green (140 tests).Scope
The licensed/authority path is unaffected — it mints its own signed URL (
Tiger_License_Authority)and never calls
tarballUrl(). (A private release ZIP asset viabrowser_download_urlhas the sameweb-host limitation and remains a separate follow-up; all current company modules are source/theme repos
that install from the tarball.)
🤖 Generated with Claude Code
https://claude.ai/code/session_01ASauLLscjqdsNqBNsx2Typ