import { z } from "zod"; export declare const TENANT_REGISTRY_VERSION = 1; /** The most tenants one host serves; a registry over it is refused, not truncated. */ export declare const MAX_TENANTS = 1000; declare const TenantSchema: z.ZodObject<{ id: z.ZodString; upstream: z.ZodString; tenantKeyDigests: z.ZodArray; workspace: z.ZodObject<{ tenantId: z.ZodString; apiKeyFile: z.ZodString; }, z.core.$strict>; rateLimit: z.ZodOptional>; upstreamTimeoutMs: z.ZodOptional; interception: z.ZodOptional>; mode: z.ZodOptional>; upstreamCredential: z.ZodOptional>; gatewayToken: z.ZodOptional>; presence: z.ZodOptional>; holds: z.ZodOptional>; }, z.core.$strict>; export declare const TenantRegistrySchema: z.ZodObject<{ version: z.ZodLiteral<1>; domain: z.ZodString; evidenceDir: z.ZodOptional; rateLimit: z.ZodOptional>; tenants: z.ZodArray; workspace: z.ZodObject<{ tenantId: z.ZodString; apiKeyFile: z.ZodString; }, z.core.$strict>; rateLimit: z.ZodOptional>; upstreamTimeoutMs: z.ZodOptional; interception: z.ZodOptional>; mode: z.ZodOptional>; upstreamCredential: z.ZodOptional>; gatewayToken: z.ZodOptional>; presence: z.ZodOptional>; holds: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strict>; export type TenantEntry = z.infer; export type TenantRegistry = z.infer; /** A registry that cannot be served: the code, and where it went wrong, never a value from the file. */ export declare class TenantRegistryError extends Error { readonly code: "REGISTRY_UNREADABLE" | "REGISTRY_INVALID" | "REGISTRY_DUPLICATE_TENANT"; readonly where: string | null; constructor(code: "REGISTRY_UNREADABLE" | "REGISTRY_INVALID" | "REGISTRY_DUPLICATE_TENANT", where?: string | null); } /** * The tenant registry the operator mounts, parsed and checked whole: YAML or * JSON, `version: 1`, one domain, and each tenant with its label, upstream, * key digests and workspace. What each tenant's gateway makes of its entry * (a public https upstream, well-formed digests, a valid interception * section) is checked again by the gateway's own loader when it is built. */ export declare function parseTenantRegistry(text: string): TenantRegistry; /** Whether a tenant has opted in to enforcement, which only a host of its own may serve. */ export declare function tenantEnforces(tenant: TenantEntry): boolean; /** The hostname a tenant is served at. */ export declare function tenantHostname(registry: TenantRegistry, tenant: TenantEntry): string; /** * A digest of everything that shapes a tenant's gateway: its entry and the * registry-wide settings it inherits. A reload rebuilds a tenant's gateway * only when this changes, so an edit to one tenant never interrupts another. * The tenant's key digests are not in it: a gateway takes new ones in place, * so a rotation or a revocation rebuilds nothing. */ export declare function tenantFingerprint(registry: TenantRegistry, tenant: TenantEntry): string; /** The registry's text, as read, as a digest: the revision a host reports it loaded. */ export declare function registryRevision(text: string): string; export {}; //# sourceMappingURL=TenantRegistry.d.ts.map