feat(store): HTTPSource — install from the hosted registry (#275 client) - #214
Conversation
The registry client the install/update path already coded against:
- HTTPSource{BaseURL, Key} satisfies Source. Index() over /v1/index; Fetch()
downloads /v1/buttons/<@desk/name>/<ver>/download, verifies the bytes against
the registry's x-content-sha256 (and/or the index hash), then extracts into a
Bundle (Bundle.SHA256 = file-content hash, stamped as content_hash — same as
LocalSource; distinct from the tarball hash verified on the wire).
- untar hardened: size/file-count caps, traversal rejected, the wrapping folder
component flattened, macOS AppleDouble (._*) / .DS_Store junk skipped.
- cmd/install.go resolveInstallSource: LocalSource (--source/$BUTTONS_SOURCE)
else HTTPSource ($BUTTONS_REGISTRY_URL + the REGISTRY_KEY battery /
$BUTTONS_BAT_REGISTRY_KEY).
Validated live against desk.buttons.sh: `buttons install @autono/hello` fetches,
hash-verifies, installs, and stamps source/version/content_hash. Tests cover
Index/Fetch, hash-mismatch rejection, auth failure, and junk filtering.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds HTTPSource and install source resolution
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The missing registry client.
HTTPSourcesatisfies the existingSourceinterface, sobuttons installnow works against the hosted Worker (desk.buttons.sh) — not just a local--source.Index()→GET /v1/index;Fetch()→GET /v1/buttons/<@desk/name>/<ver>/download, verifies the tarball againstx-content-sha256, extracts into aBundle(file-content hash stamped ascontent_hash, consistent withLocalSource).._*/.DS_Storejunk skipped.cmd/install.go:LocalSource(--source/$BUTTONS_SOURCE) elseHTTPSource($BUTTONS_REGISTRY_URL+REGISTRY_KEYbattery).Validated live:
buttons install @autono/helloagainst desk.buttons.sh → fetch → hash-verify → install → stamp. 4 new tests; full suite green (19 pkgs).Summary by CodeRabbit
New Features
Bug Fixes