feat(catalog): publish what each plugin declares it binds - #72
Merged
Conversation
The catalog carried 17 keys and none of them said anything about what a plugin binds — not its capability permissions, not its network allowlist, not its ingress routes. It is the data source the in-dashboard marketplace reads, so "install only plugins you trust" had no in-product evidence to work from: an operator had to open the manifest in this repository to see any of it. Four fields are published now: permissions, net, the ingress route shapes (route, methods, whether signed) and sessionScoped. Core tolerates unknown catalog keys by design, so this needs no gateway change and older instances ignore it. The ingress shapes are the part that earns its place. A provisioned ingress route is a @public() endpoint, so which routes a plugin opens — and whether they are signed — is worth knowing before the install rather than after. They are documented as declarations of intent, not as an enforcement boundary, and the standard now carries that caveat in bold next to the field list. The sandboxing doc is explicit that a worker_thread is not an OS-level sandbox: a plugin keeps require('fs'), process and raw sockets whatever it declares, and net.allow gates the host-mediated ctx.net.fetch rather than the plugin's own traffic. An empty permissions array means no mediated capability is bound — not that the plugin can do nothing. Publishing this without that paragraph would be worse than not publishing it, because a reader would take an allowlist for a constraint. Two tests hold the published fields to the manifests they are generated from.
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 generated catalog carried 17 keys and not one of them said what a plugin binds — no capability permissions, no network allowlist, no ingress routes.
That catalog is the data source the in-dashboard marketplace reads. So the repository's own guidance — install only plugins you trust — had no in-product evidence behind it: an operator had to come here and open the manifest.
Four fields are published now:
permissionsnetnetblock, ornullingress[{ route, methods, signature }]per declared route, ornullsessionScopedCore's
CatalogEntrydeclares[key: string]: unknownwith the comment "Extra fields are tolerated", so this needs no gateway change and older instances ignore it.Why the ingress shapes earn their place most
A provisioned ingress route is a
@Public()endpoint. Which routes a plugin opens — and whether they are signed — is exactly the thing worth knowing before an install rather than after one.The caveat is the point, not a footnote
docs/30-plugin-sandboxing.mdsays it in bold: aworker_threadis a separate V8 context in the same OS process, under the same user — not an OS-level sandbox. A plugin keepsrequire('fs'),processand raw sockets whatever it declares here, andnet.allowgates the host-mediatedctx.net.fetch, not the plugin's own outbound traffic.So an empty
permissionsarray means the plugin binds no mediated capability. It does not mean the plugin can do nothing.PLUGIN-STANDARD.mdnow carries that paragraph directly beside the field list. Publishing these fields without it would be worse than not publishing them — a reader would take an allowlist for a constraint, and act on a guarantee that does not exist. That is the whole reason this change is shaped as "declarations of intent, documented as such" rather than a security panel.Tests
Two: the published fields must match the manifests they are generated from, and every plugin publishing an ingress route must say whether it is signed.
Mutation-checked — emptying one plugin's published permissions fails the first and nothing else.
Verification
550 tests passing;
node scripts/catalog.mjs --checkreports the catalog up to date.