feat(tenancy): harden shared cloud runtime boundaries

This commit is contained in:
Junyan Qin
2026-07-20 01:47:42 +08:00
parent 3f01ffe63b
commit 627eb6b8ef
121 changed files with 18142 additions and 5615 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'}])
)