Skip to content

Tenant

Overview

The Tenant domain is a default domain in comby, designed to represent an organization that can manage identities. These identities may be linked to existing accounts, creating a structured relationship between organizations and individual users. The domain is implemented through the Tenant aggregate, which models the organization, manages associated metadata, and reacts to domain events.

The Tenant serves as the central hub for all aggregates. While each aggregate operates independently, all comby default aggregates reference the Tenant by default to support a multi-tenancy system.

Structure

The structure of a Tenant is simple and consists of the following elements:

  • Name: The name of the tenant or organization.
  • Attributes: A map for storing additional metadata associated with the tenant.
  • Secrets: A map for storing sensitive information, such as API keys or other credentials linked to the tenant.

A Tenant does not reference other aggregates, as it serves as the central entity. All other aggregates refer to the Tenant instead. In comby, multiple Tenants can be created and managed. The framework ensures that Tenants are isolated, and no data is shared between them.