feat(tenancy): harden shared cloud runtime boundaries

This commit is contained in:
Junyan Qin
2026-07-20 01:47:42 +08:00
parent 41772920ef
commit a47bfe8167
121 changed files with 18152 additions and 5588 deletions
+7
View File
@@ -46,6 +46,13 @@ def build_ap() -> SimpleNamespace:
)
ap.apikey_service = SimpleNamespace(authenticate_api_key=authenticate_api_key)
@contextlib.asynccontextmanager
async def tenant_scope(workspace_uuid: str):
assert workspace_uuid == 'workspace-1'
yield
ap.persistence_mgr = SimpleNamespace(tenant_scope=tenant_scope)
ap.bot_service = SimpleNamespace(
get_bots=AsyncMock(return_value=[{'uuid': 'bot-1', 'name': 'Demo Bot', 'adapter': 'telegram'}])
)