mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 09:19:04 +00:00
Plug-ins: only an approval records a grant, and installs need one
registry::grant takes a GrantToken, which the engine makes after a person's approval and when it loads grants.json. registry::install, install_bytes and folder loads refuse a module that lists permissions no recorded grant gives this very module (Error::NeedsApproval), and leave the plug-in under its id and the revision as they were. A folder load's approve callback only narrows what installs. A module without permissions, or with an empty list, installs as before. A folder load in a session with a plug-in store records the store's grant for each module it approves, so those modules still load. docs/plugins.md says what the approval does not protect against: native code linked into the app, and another program running as the same user, which can edit the Plug-ins folder and its unsigned grants.json.
This commit is contained in:
@@ -326,7 +326,7 @@ fn an_importer_past_its_budget_opens_nothing() {
|
||||
];
|
||||
for (id, limits, _) in &cases {
|
||||
let wasm = wat::parse_str(tpl::module(&tpl::importer(id, r#"["tbg"]"#, "{}"), SPINS, "", 1)).unwrap();
|
||||
vectorcraft_plugins::registry::install(Plugin::load(&wasm, limits.clone()).unwrap());
|
||||
vectorcraft_plugins::registry::install(Plugin::load(&wasm, limits.clone()).unwrap()).unwrap();
|
||||
}
|
||||
let mut s = Session::new();
|
||||
for (id, _, why) in &cases {
|
||||
|
||||
Reference in New Issue
Block a user