UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

21 lines (20 loc) • 1.25 kB
import { type LookupFn, type SsrFPolicy } from "../infra/net/ssrf.js"; export declare function ssrfPolicyFromAllowPrivateNetwork(allowPrivateNetwork: boolean | null | undefined): SsrFPolicy | undefined; export declare function assertHttpUrlTargetsPrivateNetwork(url: string, params?: { allowPrivateNetwork?: boolean | null; lookupFn?: LookupFn; errorMessage?: string; }): Promise<void>; /** Normalize suffix-style host allowlists into lowercase canonical entries with wildcard collapse. */ export declare function normalizeHostnameSuffixAllowlist(input?: readonly string[], defaults?: readonly string[]): string[]; /** Check whether a URL is HTTPS and its hostname matches the normalized suffix allowlist. */ export declare function isHttpsUrlAllowedByHostnameSuffixAllowlist(url: string, allowlist: readonly string[]): boolean; /** * Converts suffix-style host allowlists (for example "example.com") into SSRF * hostname allowlist patterns used by the shared fetch guard. * * Suffix semantics: * - "example.com" allows "example.com" and "*.example.com" * - "*" disables hostname allowlist restrictions */ export declare function buildHostnameAllowlistPolicyFromSuffixAllowlist(allowHosts?: readonly string[]): SsrFPolicy | undefined;