export interface HostCheckResult { ok: boolean; /** Human-readable reason when ok=false — stable for incident replay + error responses. */ reason?: string; /** The value inspected, for diagnostics. */ host?: string; } /** * Parse the `RELAY_HTTP_ALLOWED_HOSTS` / `RELAY_DASHBOARD_HOSTS` env var * pair into a Set. Caller passes the result to `checkHostHeader`; parse * at startup and cache, not per-request. * * Entries can be either full `host:port` (exact match) or hostname-only * (match regardless of port — common for random-bind dev setups). */ export declare function parseHostAllowlist(env?: NodeJS.ProcessEnv): Set | null; /** * Pure Host-header check. Returns `{ ok: true }` when the Host header * matches the allowlist (or is a loopback literal when no override set). * * Mismatch → `{ ok: false, reason }` — the caller is responsible for * mapping that to a 421 Misdirected Request response on HTTP or a socket * destroy on WebSocket upgrade. */ export declare function checkHostHeader(hostHeaderRaw: string | undefined, override: Set | null): HostCheckResult; export interface OriginCheckResult { ok: boolean; /** Set to the incoming Origin when ok=true; callers echo back in Access-Control-Allow-Origin. */ origin?: string; reason?: string; } /** * Match an Origin header against an allowlist pattern. * Supported forms (same as the pre-v2.2.0 `matchesOrigin` in http.ts): * - exact: "http://localhost" matches only that exact origin * - port glob: "http://localhost:*" matches any port * - host glob (future): "https://*.example.com" — NOT supported yet */ export declare function matchesOrigin(origin: string, pattern: string): boolean; /** * Pure Origin check. Requests with no Origin header (curl, server-to- * server, etc.) pass through unchanged — browsers always send Origin on * cross-origin fetches, so this is the distinguishing signal. Caller is * responsible for echoing `origin` in `Access-Control-Allow-Origin` when * ok=true (the HTTP middleware does that; WS upgrade doesn't need it). */ export declare function checkOrigin(originRaw: string | undefined, allowedPatterns: string[]): OriginCheckResult; //# sourceMappingURL=boundary-checks.d.ts.map