Repository navigation
Plugin architecture: High-Level #502
Replies: 7 comments 2 replies
|
Thanks for putting thought into this! I'm glad you wrote this document that really explains why this plugin architecture is needed and shows the underlying concern is a real one and worth discussing. Let's now talk about how it can be implemented.
"Access to the loaded page's data" is not something that exists as a stable contract today. Page data lives in RTK slices, shaped by our own websocket actions and epics, and we reshape those freely because they're internal. The moment plugins read them, our internal state shapes become a public API and we lose the ability to refactor them. That's a larger and more permanent commitment than any of the individual features this is meant to keep out of the core, and the proposal doesn't acknowledge it. I'd suggest taking a look at Since this is such a big feature, I'd suggest picking the single smallest useful capability (read-only render into one section), and answer the execution-location, data-contract, and threat-model questions for just that. Then, we can go from there. |
The original design was to run in the same process running the rest of the React app in a ShadowDOM using SecureECMAScript (ses). This allows it to works identically in the Electron renderer, the Docker web build, and the Kubernetes web build, since all three run the same Vite-built frontend in a browser context. cc: @ArgusLi |
The Compartment only governs code while it runs. A Panel's render() returns a React element tree that the host's own trusted runtime commits outside the Compartment. A JS wrapper is the only network-capable object endowed into the Compartment. A hostname check is done against a manifest allowlist before delegating to the real fetch. This covers every fetch() call the plugin's code makes directly. It does not cover browser-native resource loads ( |
We'd need to define the specifics, but the manifest would need some generics (id, name, version, hash) as well as some permission access requests. The SDK would surface would need the PanelLocation information, the module (plugin functionality that is executed), and properties. These attributes and properties should be discussed as a team and decided upon. |
The original plan was to restrict the number of queries made and reuse data already fetched. If there is a concern around the shape of the data, we could always offer the ability to query the data. |
|
I saw this and wanted to share my limited experience from another relevant product. I ran the RedisInsight team, and our Workbench plugins were a constant source of security problems, mostly from decisions that looked fine at design time. Our iframe sandbox used Our actual security model was a line in the docs saying "only install plugins from trusted authors". We got away with it because install meant copying a folder to disk. With URL install you don't get that excuse. The sandbox has to actually hold, and ours never did. The one thing that saved us was scope. Plugins only visualized one command's output and got Even with that tiny scope and a lenient trust model, plugins cost us a lot of security work. If this moves forward I'd do what Argus suggests: smallest capability, threat model first. Last thing: who will use it? At RI the plugin push came from PMs wanting to emulate VS Code, and nobody ever built an external plugin. Here it's coming from the community, so maybe it's different. I'd want to see that proven before paying the costs above, because our failure mode was the expensive one: a sandbox, a frozen API, and permanent security duty for an ecosystem that never showed up. Anyway, these are just my two cents from a very high level read through and might 've missed something ao take it with a grain of salt |
|
The cloud provider use case is interesting, because I think it changes what you'd build. Aiven, AWS, Azure are a handful of known partners who control their own On the nutrition label + signing: that solves provenance, not containment. Signing tells you who wrote the plugin and that it hasn't changed since you installed it. |
Uh oh!
There was an error while loading. Please reload this page.
Proposal: A Plugin System for Valkey Admin
There are features proposed for this product that I think would be better suited as a plugin that isn’t included in the application.
Things like specific metric panels, embedded AI assistants, machine learning components like anomaly detection over metrics and logs. Every small feature becomes a permanent problem for the main application to bear. There are also small decisions that need to be made like each feature’s placement in the application. It also increases the complexity of the code-base and the size and attack surface of the deliverable.
The proposal
Give valkey-admin a plugin system. Each plugin would be exposed in a panel with access to the loaded page’s data that can be rendered into any of the app's seven existing sections (Dashboard, Key Browser, Send Command, Cluster Topology, Hot Keys, Big Keys, Command Logs).
What a plugin looks like, in practice
A plugin is two files: a small manifest declaring what it needs — page data, network hosts, credentials, etc — and a built script. A user installs it by pointing the app at those two files. The user adds the plugin via url.
Plugins should run inside a restricted execution boundary with no access to anything it wasn't explicitly given or specified it would need access to. It only has access to the data that is rendered on that page. Network access has to be declared to an exact destination and is enforced, not just requested. And what a user reviews at install time is guaranteed to be what actually runs later plugin content is checksummed and re-verified on every load, so a plugin can't quietly change behavior after the fact.
What ships now vs. later
The immediate ship is panels have the capability reading a section's data and rendering something new alongside it.
Future Capabilities would include**:**
First Steps:
All reactions