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
| Type | Source | Description |
|---|---|---|
Store | store.go | Interface: Create, Get, List, Update, Disable, GetByNamespace |
TenantConfig | config.go | Full tenant config: ID, namespace, quotas, rate limits, LLM provider, MCP servers |
ResourceQuotas | config.go | Resource-level quotas (runs/day, steps/run, tokens/day, cost) |
RateLimits | config.go | Rate limiting config (requests and tokens per minute/hour/day) |
CredentialRef | config.go | LLM credential reference (type: vault, env, oidc) |
MCPServerRef | config.go | MCP server reference with name, endpoint, transport |