ADR-013 Phase 2: meta_path import guard (re-review fix)

This commit is contained in:
2026-07-18 21:47:40 -04:00
parent 77ca2e0d2d
commit 83a5ce79d9
4 changed files with 368 additions and 19 deletions

View File

@@ -80,6 +80,16 @@ class PluginManager:
self.loader.verifier = verifier
self.migration_manager.verifier = verifier
# Install (or clear) the import guard that verifies every `plugins.*`
# import against a trusted signature. This is what covers the core
# request handlers that do `from plugins.<name>.models import ...`, which
# never pass through the loader (findings #1, #2).
from . import importguard
if verifier.require_signed:
importguard.install(plugins_dir, verifier)
else:
importguard.uninstall()
# Load enabled plugins
self._load_enabled_plugins()