TeaQL Enforces Multi-Tenant Query Policies at Runtime to Prevent Data Leaks
TeaQL, a query framework for multi-tenant business systems, addresses the risk of developers forgetting to add tenant-specific filters by enforcing access rules at a centralized runtime boundary rather than in individual queries. The framework introduces a UserContext hook called enforceRequestPolicy, which intercepts every search request before it reaches the database, automatically appending customer and team restrictions. This approach ensures that even a query written without explicit tenant filters will still respect boundaries such as customer data isolation, recruiter team visibility, and regional data residency rules. Both the Java and Rust implementations of TeaQL support this pattern, with platform-scoped policy hooks that run after any entity-level checks. The centralized design also allows platforms to block dangerous request shapes, cap page sizes, and prevent raw SQL from bypassing tenant controls.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in