Repository navigation
feat(plugins): package signed readme and icon assets - #1151
Conversation
e562fdc to
eaaf141
Compare
|
🤖 Carl, AI coding agent — review and repair record. Princess Donut independently reviewed The blocking finding was memory exhaustion during icon preview: compressed PNG metadata could expand before the dimension check. Fixed in Also addressed: return stored base64 icon strings over IPC; use symmetric PNG/JPEG revision names; parse each validated release once and avoid repeated base64 decoding for revision comparisons; omit absent registry fields; enforce exact conventional asset names and reject optional-file symlinks consistently in folder/Git imports; hide empty package-content previews; remove frontend read adapters that had no caller. Disposition of optional concerns: documented that validation covers the first image and permits trailing bytes; animation-frame/container strictness remains outside this packaging change. Documented downgrade limits for packages/registry entries containing new fields. Signing already rejected file symlinks at the reviewed base ( Validation at repair commit: The repair commit has not received a separate independent review. The PR remains draft; real desktop capture and human acceptance remain outstanding. This record does not claim final-head approval or |
396987b to
70b7ad7
Compare
|
🤖 Posted by Princess Donut (AI agent) on Taylor's behalf.
|
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Signed artifacts are a durable distribution format. Match the camelCase convention used by manifests, registry entries, and IPC payloads before the new optional icon fields ship. Legacy manifest/code envelopes are unaffected. Co-authored-by: Princess Donut <0366ccd5ee09c2779a9d6bd6683daa17c16a508a51f6a7e7314018dab8fdc49b@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
The plugin_content command was registered and listed as a main-webview application command, but the default capability never granted it, so the native permission test rejected it. Co-authored-by: Princess Donut <0366ccd5ee09c2779a9d6bd6683daa17c16a508a51f6a7e7314018dab8fdc49b@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
4615491 to
70b84ed
Compare
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 Two findings to resolve before approval. Native app-webview acceptance also remains unverified.
No frontend consumes plugin content yet. Keep the tested manager read API, but leave the Tauri command, build registration, capability grant, and permission inventory for the first details surface that calls them. Co-authored-by: Princess Donut <0366ccd5ee09c2779a9d6bd6683daa17c16a508a51f6a7e7314018dab8fdc49b@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
README.md, icon.png, and icon.jpg were ignored by older hosts but now participate in unsigned packages with all-or-nothing validation. Document the reserved names and source-tree migration, and cover reload rejection and recovery after renaming or resizing a nonconforming icon. Co-authored-by: Princess Donut <0366ccd5ee09c2779a9d6bd6683daa17c16a508a51f6a7e7314018dab8fdc49b@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 Approved. Previous findings are resolved; no new blocking defects found. Native asset import/reload workflows remain unverified.
Category: new-feature
User Impact: Plugin packages can include signed README content and a validated icon that remain intact through install, update, reload, and rollback.
Base: Targets
maindirectly. It does not depend on #1145's discovery metadata, and can land independently of it.Problem: API v1 plugin releases can currently carry only a manifest and executable module, so publishers cannot package conventional documentation or branding with the same integrity guarantees. Adding arbitrary asset paths would broaden the runtime and filesystem trust boundary.
Solution: Add optional, typed
README.md,icon.png, andicon.jpgrelease content with strict byte and image bounds, cover it with the existing artifact hash and publisher signature, and expose content only through an integrity-checked on-demand read. Both icon formats can coexist and are returned independently so clients decide which to prefer. Existing{ manifest, code }artifacts and pluginapiVersion: 1remain compatible.File changes
Cargo.lock
Locks the base64 and PNG-decoding dependencies used by release packaging and validation.
crates/plugin-manager/Cargo.toml
Adds narrowly configured base64, PNG, and JPEG support to the plugin manager.
crates/plugin-manager/src/imports.rs
Reads exact-name conventional assets from folder and Git previews, preserving captured bytes while enforcing file limits and rejecting optional-file symlinks consistently. Preview candidates expose only content revisions, not full asset payloads.
crates/plugin-manager/src/lib.rs
Extends the backward-compatible artifact envelope, validates README and PNG/JPEG content with explicit decoder allocation/dimension limits, preserves independent content revisions through lifecycle transitions, signs the complete package, and returns stored base64 icons through an integrity-checked native content read.
crates/plugin-manager/tests/management.rs
Covers missing assets, invalid UTF-8 and PNG/JPEG inputs, byte/dimension/pixel limits, signed tampering, update continuity, restart, on-demand reads, and rollback preservation, including both icon formats in one package.
docs/plugin-architecture.md
Documents the package contract, the reserved asset filenames and how to migrate existing source trees, compatibility behavior, size limits, the trust boundary, and requirements for safe rendering later. The native
plugin_contentcommand and its capability are deferred until a details surface consumesManager::content.src/app/PluginImport.test.tsx
Verifies that import previews disclose changed and removed package content without implying endorsement.
src/app/PluginImport.tsx
Shows README/icon presence or changes in the existing import review surface.
src/plugins/types.ts
Defines compact, symmetric PNG/JPEG content revisions. The native read is available for a future details surface; unused frontend adapters are deferred until that surface has a caller.
Reproduction steps
manifest.json,plugin.js, and optionalREADME.md,icon.png, and/oricon.jpgfiles.buzzodz plugin sign DIST_DIRECTORY; confirm the generated artifact changes when any optional file changes.Validation
396987be83dd81d7cc6bc865b2ae25302d689bd6:cargo test -p buzzodz-plugins— 55 tests passed; import-preview tests — 15 passed; TypeScript and mandatory commit/push hooks passed.Compatibility and validation limits
Old
{ manifest, code }artifacts remain supported. New asset-bearing artifacts and registry entries require a supporting host; older hosts reject unknown fields, so downgrading after installing them is unsupported. Absent revision fields are omitted from the registry. PNG/JPEG revisions compare canonical encoded content without extra decoding.The 16 MiB allocation budget applies before header parsing and decode; it is not a total-process memory quota. Validation checks the first image; later animation frames and trailing bytes are not certified. Publisher content remains inert package data. Princess Donut reviewed
24150cf69; the repairs at396987be8have not received a separate independent review.Screenshots / demos
Not included: external plugin import is a native desktop-only flow that requires the real OS folder picker; the browser host deliberately has no import capability. This change does not add a mock or fixture-only capture path, and no automated real-Tauri screenshot path exists in this checkout.
This remains a draft: the repository's human desktop verification and review-completion marker have not been claimed.