app.core.tenant

Tenant API router - tenant info, usage, and auth bootstrap.

Functions

bootstrap([client])

Return public tenant configuration for frontend bootstrapping.

get_tenant_usage([client])

Get the current tenant's usage statistics and limits.

whoami([project_name, client, token])

Return information about the authenticated user.

Classes

BootstrapResponse(**data)

Session bootstrap response for frontend initialization.

TenantUsageResponse(**data)

Tenant usage and limits.

UserInfo(**data)

User information response.

class app.core.tenant.UserInfo(**data)[source]

Bases: BaseModel

User information response.

Parameters:
  • email (str)

  • id (str)

email: str
id: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class app.core.tenant.BootstrapResponse(**data)[source]

Bases: BaseModel

Session bootstrap response for frontend initialization.

Parameters:
  • tenant_id (str)

  • project_names (List[str])

  • anonymous_allowed (bool)

tenant_id: str
project_names: List[str]
anonymous_allowed: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class app.core.tenant.TenantUsageResponse(**data)[source]

Bases: BaseModel

Tenant usage and limits.

Parameters:
  • tenant_id (str)

  • node_count (int)

  • node_limit (int)

tenant_id: str
node_count: int
node_limit: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

async app.core.tenant.bootstrap(client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]

Return public tenant configuration for frontend bootstrapping.

This replaces the need for NEXT_PUBLIC_TENANT_ID and other build-time secrets. The frontend can call this endpoint to discover tenant configuration dynamically.

Parameters:

client (Any)

async app.core.tenant.whoami(project_name=Query(None), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None), token=Depends(dependency=<function get_user_token>, use_cache=True, scope=None))[source]

Return information about the authenticated user.

Optionally validates membership in a specific project.

Parameters:
  • project_name (str | None)

  • client (Any)

  • token (str | None)

async app.core.tenant.get_tenant_usage(client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]

Get the current tenant’s usage statistics and limits.

Parameters:

client (Any)