Let a scroll expand an uncompressed tarball - #14
Merged
Merged
Conversation
`assetArchives` accepted `zip` or `tar.gz`, so a publisher who ships a plain `.tar` could not be consumed at all — and that is the usual choice when every member inside is already compressed, where a second pass costs minutes to save nothing. The archive goes through the same listing, validation and extraction as `tar.gz`; the only thing missing was permission to say so. Compression is now left to the library on read, which is what it was doing anyway: node-tar reads the header and decompresses or not, and its `gzip` option applies to writing. Passing `gzip: true` on a read looked like a guarantee and was not one. The `tar` / `tar.gz` distinction records what the author pinned, and the asset's SHA-256 is what holds them to it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying scrollcase with
|
| Latest commit: |
64cb078
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e40a0391.scrollcase.pages.dev |
| Branch Preview URL: | https://plain-tar-assets.scrollcase.pages.dev |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
assetArchivesacceptedziportar.gzonly. A publisher who ships a plain.tarcould not be consumed at all — and that is the usual choice when every member inside is already compressed, where a second gzip pass costs minutes to save nothing.tarnow joins the enum and goes through the same listing, validation and extraction astar.gz. Nothing about the safety rules changes: entries are listed and checked before anything is written, and links and special entries are still refused outright.One thing that turned out not to be true
The read paths passed
gzip: trueto node-tar, which reads like a guarantee that the archive really is gzipped. It is not one — node-tar reads the header and decompresses or not on its own, and itsgzipoption applies to writing. Probed directly on all four combinations before deciding:So the option is dropped rather than threaded through, and the white paper now says what actually holds the author to their claim: the scroll's
tar/tar.gzdistinction records what they pinned, and the asset's SHA-256 is what makes it binding.Tests
Two added to
archive-security.test.mjs: a plain tarball expands withstripComponents, and the entry rules apply to it exactly as to a compressed one.Full suite on Linux: 566 passed, 36 files. On a Windows host 43 tests fail with
EPERM: operation not permitted, symlink— pre-existing, unrelated, and true onmaintoo.Where it came from
A project whose model bundles 1.86 GB of pickled molecule definitions as a plain
mols.tar. Third gap this line of work has found by real use, after PyPI licences (1.1.0) and download-then-expand (1.1.1).🤖 Generated with Claude Code