/** Strict same-machine network trust classification. Hosts supply their authorization policy. */ import type http from "node:http"; export interface LocalRequestTrustPolicy { localAuthRequired: boolean; cloudProvisioned: boolean; } /** * True when any proxy-style client-IP header carries a non-loopback (or * unparseable) address. A request that reaches a same-machine listener but * advertises a remote client behind a proxy must NOT be granted local trust. */ export declare function proxyClientHeaderBlocksLocalTrust(headers: http.IncomingHttpHeaders): boolean; /** * True when the TCP peer address is a loopback address. Note this is stricter * than {@link isLoopbackBindHost}: it matches only fully-normalised loopback * addresses (no host:port or URL forms), since `socket.remoteAddress` is always * a bare IP. */ export declare function isLoopbackRemoteAddress(remoteAddress: string | null | undefined): boolean; export declare function isRemoteAddressInCidrList(remoteAddress: string | null | undefined, cidrList: string | null | undefined): boolean; /** * Same-machine dashboard access. Intentionally stricter than a bare * `remoteAddress` check: the browser must also target a loopback Host and must * not present cross-site browser metadata or proxy client-IP headers. * * Each consumer supplies {@link LocalRequestTrustPolicy} matching its historical * policy gates; the host/origin/proxy classification is identical for all. */ export declare function isTrustedLocalRequest(req: Pick & { socket?: Pick | null; }, options: LocalRequestTrustPolicy): boolean;