feat(host): execute granted fs.read through the capability broker (H3-A partial)

- CapabilityBroker::execute separates authorization from execution; native
  plugins requesting fs.read get real project file bytes through ProjectFs
- unsupported capabilities (fs.write/net/process/console/vendor without a
  handler) return capability.unavailable instead of empty success
- keep audit decisions for granted/denied/unavailable without logging contents
- document that worker capability bridging, live ABI session identity and OS
  isolation (H3-B) remain open; no G-C claim is made
This commit is contained in:
cflmy committed 2026-11-20 13:05:53 +08:00
1 parent b37026b79d
commit 47a2e1883f
4 files changed
+164 -11

No files matched your search

+3 -2
View File
@@ -267,7 +267,8 @@ impl StdHost {
let mut broker = CapabilityBroker::with_audit(
self.capabilities.clone(),
Arc::clone(&self.broker_audit),
);
)
.with_fs(self.fs.clone());
for capability in &self.vendor_capabilities {
broker.allow_vendor(capability.clone());
}
@@ -275,7 +276,7 @@ impl StdHost {
let options = marqdo_plugin_abi::LoadOptions {
host_target: marqdo_plugin_abi::HostTarget::current(),
capability_handler: Some(Box::new(move |capability, request| {
broker.authorize(&package, capability, request)
broker.execute(&package, capability, request)
})),
};
PluginTransport::Native(