Enforces strict multi-tenant data isolation by ensuring communityId filters are applied to all MongoDB operations.
The Aegis Tenancy Enforcer is a specialized security skill designed to prevent cross-tenant data leaks within the Aegis multi-tenant community platform. It provides developers with automated guidance and strict patterns for writing MongoDB queries, repository methods, and service logic, mandating that every database interaction includes a valid communityId. By enforcing the use of communityId from authenticated JWT tokens rather than untrusted request bodies, it ensures logical data isolation and helps maintain high security standards across the backend architecture, including specific requirements for compound indexing and aggregate pipelines.
Características Principales
01Mandatory communityId filtering for all CRUD operations
02JWT-based tenant context enforcement to prevent ID spoofing
03Aggregate pipeline validation ensuring $match stages are correctly placed
040 GitHub stars
05Compound index optimization rules for efficient tenant isolation
06Standardized repository patterns for find, update, and delete methods
Casos de Uso
01Auditing repository code for potential cross-community security breaches
02Designing database schemas and indexes for logical data isolation
03Building secure multi-tenant SaaS platforms with MongoDB and NestJS