This release introduces a significant architectural overhaul to implement multi-tenancy via Organizations. This was a foundational effort that refactored the entire backend stack—from the API down to the data access layer—to be organization-aware, setting the stage for advanced enterprise features.
High-Level Summary
The primary change is the shift from a single-user-centric model to a multi-tenant, organization-centric one. Nearly every part of the backend has been touched to enforce strict data isolation and access control between different organizations.
Key Architectural Changes
-
Introduction of
AuthContext: We've replaced thecurrent_userdependency with a newAuthContextobject across the application. This context object is now the single source of truth for authentication and authorization, carrying both user and organization identity, ensuring all operations are correctly scoped to a tenant. -
New Data Access (CRUD) Paradigm: The CRUD layer was redesigned to enforce multi-tenancy at the database level.
- A new
CRUDBaseOrganizationclass now serves as the foundation for all resources that belong to an organization (e.g.,Collections,SourceConnections,APIKeys). It automatically handles organization scoping and access validation. - A
CRUDPublicbase class is used for system-wide resources that are not tenant-specific (e.g.,EmbeddingModels,Sources). - This change makes our data access patterns cleaner, more secure, and less prone to cross-tenant data leaks.
- A new
-
Auth0 Organizations Integration: A new
Auth0Servicehas been implemented to integrate directly with the Auth0 Management API. This provides seamless, two-way synchronization of organizations and user memberships between Airweave and Auth0, automating user onboarding into their respective orgs.
Feature and Endpoint Changes
- New Organization Management API: A full suite of
POST,GET,PUT, andDELETEendpoints under/api/v1/organizationshas been added. This allows for programmatic management of organizations, user roles, and invitations. - Endpoint Refactoring: All existing endpoints have been refactored to be organization-aware. All resources are now created, listed, and managed strictly within the organization provided by the
AuthContext. - Removal of Chat Functionality: The
/chatAPI endpoints and the underlyingChatServicehave been removed. This decision was made to sharpen our focus.