refactor(b1): contacts domain fully plugin-owned - routes moved from core to contacts plugin with require_active_plugin guard
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -318,6 +318,21 @@ async def app(engine: AsyncEngine, redis_client: aioredis.Redis):
|
||||
"""FastAPI app with test engine injected (session-scoped for speed)."""
|
||||
reset_engine_for_testing(engine)
|
||||
app = create_app()
|
||||
# Block B1: contacts routes are plugin-owned and guarded by
|
||||
# require_active_plugin("contacts"). The test DB is empty, so create_app()
|
||||
# leaves active plugins empty — activate the core contacts plugin for the
|
||||
# generic app/client fixtures (same pattern as the specialized ai_app).
|
||||
from app.core.permission_registry import (
|
||||
init_permission_registry,
|
||||
register_plugin_permissions,
|
||||
)
|
||||
|
||||
init_permission_registry(active_plugin_names={"contacts"})
|
||||
from app.plugins.builtins.contacts.plugin import ContactsPlugin
|
||||
|
||||
contacts_manifest = ContactsPlugin().manifest
|
||||
if contacts_manifest.permissions:
|
||||
register_plugin_permissions("contacts", contacts_manifest.permissions)
|
||||
yield app
|
||||
await close_engine()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user