Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(multitenancy): cite symbols for the session-scope primitives
Yudhi Armyndharis7bdf99bc1197
diff --git a/docs/28-multitenancy.md b/docs/28-multitenancy.mdindex 8b79c8117..457a42cb1 100644--- a/docs/28-multitenancy.md+++ b/docs/28-multitenancy.md@@ -25,13 +25,13 @@OpenWA today is **multi-session, not multi-tenant**. What already exists and is reused by this design:-| Primitive | Where | Reuse |-| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |-| Many WhatsApp sessions per deployment, engine-isolated | `session.service.ts` | Sessions become tenant-owned resources |-| API keys with roles (`ADMIN/OPERATOR/VIEWER`) and an `allowedSessions` scope; list + stats already scope-filtered | `api-key.entity.ts:37`, `api-key.guard.ts:64-77`, `session.controller.ts:68-70` | Evolves into tenant-scoped keys; the enforcement pattern (guard-level session resolution) is exactly where tenant checks plug in |-| Per-session plugin activation and per-session config overrides | `sessionConfig` in the plugin loader | Per-tenant plugin policy on top |-| All business data keyed by `sessionId` | messages, audit_log, webhooks, templates | Adding `tenantId` alongside is mechanical |-| Per-request ALS actor stamping (audit attribution) | `request-context.ts` | Audit gains `tenantId` at the same point |+| Primitive | Where | Reuse |+| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |+| Many WhatsApp sessions per deployment, engine-isolated | `session.service.ts` | Sessions become tenant-owned resources |+| API keys with roles (`ADMIN/OPERATOR/VIEWER`) and an `allowedSessions` scope; list + stats already scope-filtered | `api-key.entity.ts:37`, `ApiKeyGuard.authorize` (session resolution), `SessionService.findAll` / `getStats` | Evolves into tenant-scoped keys; the enforcement pattern (guard-level session resolution) is exactly where tenant checks plug in |+| Per-session plugin activation and per-session config overrides | `sessionConfig` in the plugin loader | Per-tenant plugin policy on top |+| All business data keyed by `sessionId` | messages, audit_log, webhooks, templates | Adding `tenantId` alongside is mechanical |+| Per-request ALS actor stamping (audit attribution) | `request-context.ts` | Audit gains `tenantId` at the same point |**The gaps** (what makes it not multi-tenant today): no tenant entity, no named users ormemberships, dashboard identity is the API key itself, all branding is global (engine device name,