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
Direct disk/filesystem access #678
Comments
@Simonl9l you can give the plugins access to the file system, you just have to specify it in the manifest explicitly. Docs: https://extism.github.io/dotnet-sdk/api/Extism.Sdk.Manifest.html#Extism_Sdk_Manifest_AllowedPaths Example: https://github.com/extism/dotnet-sdk/blob/main/test/Extism.Sdk/BasicTests.cs#L87 |
thanks for the link to the docs, for some reason they are not obviously visible from elsewhere! |
Ah - please can you help interpret the difference betwen source and destination for Allowed Paths - https://extism.github.io/dotnet-sdk/api/Extism.Sdk.Manifest.html#Extism_Sdk_Manifest_AllowedPaths if relative is that relative to the manifest file, or the host process? |
@Simonl9l So the plugin thinks all of the files in
The source path is relative to the host process (but you can provide an absolute path too) |
I am struggling to get If I inline the path in the I am using Rust (v1.78) both as host language and plugin language. I tried both absolute path and relative (still unclear what it is relative to). Any help appreciated, thanks. hostfn!(read(path: String) {
fs::read_dir(path);
});
Manifest {
wasm: vec![url],
allowed_paths: Some(BTreeMap::from([
(
// PathBufs
"/home/NAME/Target",
"/Target"
)
])),
}
// ---- Plugin ----
#[host_fn]
extern "ExtismHost" {
fn read(path: String);
}
#[plugin_fn]
fn get(path: String) {
unsafe { read(path) }
} Edit: added code |
@henriklundgren - since you’re using your own host function Using the Manifest, you can map the paths like you have, but compile using |
@nilslice Thanks, works now! |
@henriklundgren, glad to hear it! we could improve the docs on this, sorry for the confusion. |
per the GA announcement https://extism.org/blog/announcing-extism/#how-we-built-it
Do you have anything to share yet on the experimenting?
Our solution uses plugins to allows customer to develop adapters that will allow them to get data (from files or other API's etc.) in and out of our system. For input adapters they can access their file and use host functions to pass in the specific value for each its they want to pass in.
When would we be able to access these experimental approaches? Thanks!
The text was updated successfully, but these errors were encountered: