Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Plugin System #5

Closed
HalidOdat opened this issue Sep 26, 2024 · 0 comments · Fixed by #45
Closed

Implement Plugin System #5

HalidOdat opened this issue Sep 26, 2024 · 0 comments · Fixed by #45
Assignees
Labels
enhancement New feature or request

Comments

@HalidOdat
Copy link
Contributor

HalidOdat commented Sep 26, 2024

This issue describes some of the requirements that the plugin system needs support, the plugins themself will be WASM modules and a manifest describing the plugin.

Plugins

The plugins would have two main components: WASM module (compiled code) and manifest (json, yaml, ...) (zipped an archive):

  • Defaults: no permissions, no events, no file system access, no internet access, it can only crunch numbers (that is also limited).
  • A manifest: Describes the plugin and the permissions it wants and the events it wants to listen to and generate, etc
  • Language Agnostic: Allow Multi-Language source C, C++, Rust to be compiled to WebAssembly
  • Stateful: modules can request to be stateful in the manifest and the max size of the state (on disk).
  • Sandboxed: It should not know about other plugins, only through events emitted by the plugin manager.

Plugin Manager

  • Event Driven: Plugins are invoked by an event that the app specifies (e.g. Task Create, Task Modified, Task Delete, Task Sync, Interval Timer, etc).
  • Smart loading and unloading of modules: modules that are not used often get unloaded to reduce memory usage.
  • Plugin Isolation: Must verify WebAssembly module do not escape the sandbox.
  • Must kill modules that are malicious (while (true) {}, out of memory, trying to access internet without specifying, etc) and unload module and mark as malicious, report to user.

The main goal for the safety measures is to allow a user to load a plugin that is not necessarily created by @stride-tasks and be sure that it will not maliciously crash the application or try to delete all the tasks (unless you give it permission).

Templates

An official template for plugins should be created maybe stride-tasks/plugin-template-rust that allows users to quickly get started with plugin development for stride.

@HalidOdat HalidOdat added the enhancement New feature or request label Sep 26, 2024
@HalidOdat HalidOdat self-assigned this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant