Skip to main content

tenant

Multi-tenant isolation with Postgres RLS. Manages tenant configuration including resource quotas, rate limits, allowed models/tools, LLM credentials, and MCP server assignments. Each tenant maps to a Temporal namespace.

Used by cmd/worker, cmd/ui, cmd/run, cmd/seed-registry.

Usage

import "cruvero/internal/tenant"

Key Types / Interfaces

TypeSourceDescription
Storestore.goInterface: Create, Get, List, Update, Disable, GetByNamespace
TenantConfigconfig.goFull tenant config: ID, namespace, quotas, rate limits, LLM provider, MCP servers
ResourceQuotasconfig.goResource-level quotas (runs/day, steps/run, tokens/day, cost)
RateLimitsconfig.goRate limiting config (requests and tokens per minute/hour/day)
CredentialRefconfig.goLLM credential reference (type: vault, env, oidc)
MCPServerRefconfig.goMCP server reference with name, endpoint, transport