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

Support manager plugins loaded at runtime #113

Open
chipsenkbeil opened this issue Jul 24, 2022 · 2 comments
Open

Support manager plugins loaded at runtime #113

chipsenkbeil opened this issue Jul 24, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@chipsenkbeil
Copy link
Owner

The manager is our main entrypoint into connecting and translating protocols into the distant protocol that the client understands. Today, we expose talking to a distant server via distant-core and over ssh via distant-ssh2. As more protocols get implemented, it may not make sense to have all of them live in this repository. This is especially the case if a protocol is private (such as my workplace) and cannot be included directly in this repo.

To that end, we can use libloading to dynamically load DLL and so files from a well-known location (e.g. a plugins directory), but ONLY if a feature flag is enabled on the CLI. That way, the CLI can be built to not support runtime plugins since there is a security concern about enabling new plugins to be loaded.

The idea is that the plugin will have a trait it implements that can trigger functions like on_load and on_unload along with the core initial reason for the plugin register where new launch and connect handlers can be registered, which enables things like google drive or other extensions that may not make sense to include directly.

E.g. we load a plugin distant-gdrive.so which registers gdrive://... as a connect handler. Underneath, the plugin would implement the DistantApi and handle challenges needed to properly connect.

@chipsenkbeil chipsenkbeil added the enhancement New feature or request label Jul 24, 2022
@chipsenkbeil chipsenkbeil added this to the 1.0 milestone Jul 24, 2022
@chipsenkbeil
Copy link
Owner Author

Check out https://michael-f-bryan.github.io/rust-ffi-guide/dynamic_loading.html for a guide to doing this.

@chipsenkbeil
Copy link
Owner Author

Alternatively, check out abi_stable and this guide towards using it.

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

No branches or pull requests

1 participant