Security & Isolation | TTF Docs
Skip to main content
documentation

Security & Isolation

Multi-tenant companyId isolation, JWT verification, optional payload encryption, CORS policy, and clickjacking protection.

Multi-Tenant Isolation

Every enterprise collection in master-backend is strictly scoped by companyId. Authenticated requests resolve companyId from the verified JWT payload — never trusting a client-supplied tenant ID on protected operations.

Transport & Request Security

  • NoSQL Injection Sanitization: All incoming JSON, query, and parameter payloads pass through sanitizeMongoInput before reaching controllers.
  • Optional Payload Encryption: Sensitive client flows support X-Payload-Encrypted middleware transparently at the Express gateway.
  • Strict CORS Policy: Trusted origins are enforced via CORS_ORIGIN; only Formx public embeds (/api/forms/public/*) accept arbitrary origins with credentials: false.
  • Anti-Clickjacking Headers: Backend responses enforce X-Frame-Options: DENY and Content-Security-Policy: frame-ancestors 'none'.
  • Rate Limiting: Global API rate limiting plus stricter authRateLimiter windows protect login and SSO endpoints.

Third-Party SSO Sandboxing

Third-party Developer Console apps receive short-lived identity tokens (aud: 'ttf-identity', 1h TTL, no refresh token) restricted to GET /api/sso/userinfo. Internal authMiddleware explicitly rejects aud: 'ttf-identity' on every business route.

Last updated on