feat(plugins): create plugin sandbox with capability-based permissions (#824) - #1030
Merged
Nanle-code merged 2 commits intoSep 28, 2026
Conversation
Nanle-code#824) - Implement capability-based security model in capabilitySandbox.ts with dynamic grants and safe revocation&Nanle-code#10;- Add isolated per-plugin storage under pluginId namespace with automatic cleanup on uninstall&Nanle-code#10;- Add bidirectional postMessage RPC bridge in pluginSandbox.tsx and createSandboxClient SDK helper&Nanle-code#10;- Support capability chips and dynamic revocation controls in PluginRegistryView&Nanle-code#10;- Update scripts/create-plugin.mjs with capability flags, validation, and starter templates&Nanle-code#10;- Author comprehensive test suites covering primary flows, boundary conditions, and failure paths&Nanle-code#10;- Update docs/plugins/README.md with architecture, RPC protocols, error codes, and migration notes
|
@0dillon is attempting to deploy a commit to the nanle-code's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@ogundeleoluwaferanmi35 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Resolves #824 by introducing a capability-based permission sandbox for the plugin system and CLI scaffolding.
Objectives & Changes Implemented
Capability-Based Permissions Model (
src/plugins/capabilitySandbox.ts):CAPABILITY_SCOPES) and error codes (CAPABILITY_ERROR_CODES).PluginCapabilityControllermanaging dynamic capability tracking (grant,revoke,revokeAll,assertCapability).createSandboxedDashboardApiwith strict per-capability guards ongetState,getConfig,subscribe,actions,notifications,storage,fetch, andopenWindow.handlePluginRpcMessage) supporting requests, responses, subscriptions, and broadcast ofPLUGIN_CAPABILITY_REVOKEDevents.createSandboxClient) with request matching, timeouts, and revocation listeners.Isolated Plugin Storage (
src/plugins/pluginStorage.ts):stellar-dashboard:plugin-data:<pluginId>to prevent cross-plugin data leakage or collision.Plugin Manager Integration (
src/plugins/PluginManager.ts):PluginCapabilityControllerlifecycle intoPluginManager.getCapabilityController,grantCapability,revokeCapability, andrevokeAllCapabilities.UI Revocation Controls (
src/components/dashboard/PluginRegistryView.tsx):×).CLI Scaffolding (
scripts/create-plugin.mjs):--capabilities/--permissionsflag parsing.Documentation & Developer Guidance (
docs/plugins/README.md):Acceptance Criteria Checklist
src/plugins/__tests__/capabilitySandbox.test.ts(22 tests)src/plugins/__tests__/pluginSandbox.test.tsx(5 tests)src/plugins/__tests__/PluginManager.test.ts(3 tests)tests/create-plugin.test.mjs(8 tests)docs/plugins/README.md.master).