feat: add tenant isolation middleware#9
Conversation
- Add comprehensive multi-tenancy documentation covering: - Header-based tenancy (current implementation) - Subdomain-based tenancy (new option) - Path-based tenancy - Row-level security (PostgreSQL) - Separate schemas/databases - Add SubdomainTenantMiddleware for subdomain-based tenant resolution - Add TenantConfig types and configuration utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add subdomain-tenant.middleware.spec.ts with 16 tests covering: - Subdomain extraction from various hostname formats - Skip subdomains (www, api, localhost) - Case-insensitive subdomain matching - Custom resolveAccountBySubdomain implementation - CLS context setting - 404 error for unknown tenants - Add tenant.config.spec.ts with 24 tests covering: - TenantStrategy enum values - defaultTenantConfig defaults - getTenantConfig environment parsing - TENANT_STRATEGY, TENANT_HEADER_NAME, APP_DOMAIN - SKIP_SUBDOMAINS parsing with whitespace trimming - ALLOW_NO_TENANT boolean parsing - Add Jest moduleNameMapper for src/* path resolution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Rate limit exceeded@aabrius has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 29 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (6)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Test plan
npm test -- --testPathPattern="subdomain-tenant.middleware|tenant.config"to verify all tests pass🤖 Generated with Claude Code