Repository navigation
feat: fetch display files pinned by hash, with limits - #64
Merged
Merged
Conversation
Registry entries gain the optional theme, about and terms paths; each must be pinned in digests. DisplayFiles fetches a pinned file only, tries the mirrors in order, and uses it only if the bytes hash to the pinned SHA-256 and fit the file's limit. A verified file may be kept under its digest and is hashed again on every read. Pictures are judged from their header before anything decodes them: format, pixel size and, for a PNG, that it is not animated. ThemeLoader loads a theme with its pictures and replaces what fails a check with the default, keeping the rest of the theme. Closes #26 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.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
The fetch-and-verify layer for everything a profile shows, in
Launcher.Core, with no UI yet:RegistryEntrygainsTheme,AboutandTerms(language to path), and the index reader requires each path to be a safe relative path that is also pinned indigests.Changelogis the conventionalchangelog.mdwhen pinned.DisplayFilesrequests a path only if the entry pins it, tries the mirrors in order, and uses the bytes only if they hash to the pinned SHA-256 and fit the file's limit (enforced while reading, and again on the result). A failure is returned as a problem, not thrown.DisplayFileCachekeeps verified files under their digest; a stored file is hashed again on every read.ImageInspectorreads format and pixel size from the header, so an oversized or animated picture is turned away before anything decodes it. Rules: logo PNG 256 KiB and 512 x 512; art PNG or JPEG 1 MiB and 1920 x 1080.ThemeLoaderloadstheme.jsonand its pictures; a picture that fails becomes the default and the rest of the theme stays. A picture both schemes name is fetched once.HttpRegistryFetchertakes a limit per call (IDisplayFileFetcher); the registry index still uses its 1 MiB.Docs: a "Display files" section in
registry-format.md; the changelog limit (64 KiB) is new and is added toserver-page.md.Notes
The decoded size is still checked by the UI when it builds the bitmap (#24); this layer makes sure nothing oversized or unpinned gets that far.
Tests
46 new tests (Launcher.Tests is now 402).
Closes #26
🤖 Generated with Claude Code