/** * IP Allowlist Matching * * Utilities for matching a source IP against an allowlist entry that may be an * exact IPv4/IPv6 address or an IPv4 CIDR range. Used to enforce per-API-key IP * restrictions. * * @remarks * IPv4 CIDR ranges (e.g. `10.0.0.0/8`) and exact IPv4/IPv6 addresses are supported. * IPv6 CIDR ranges are not expanded; provide exact IPv6 addresses instead. */ /** * Validate whether a string is a valid IP address or IPv4 CIDR range. * * @param entry - Candidate allowlist entry * @returns true if the entry is a usable IP or IPv4 CIDR * * @example * ```typescript * isValidIpOrCidr('203.0.113.4'); // true * isValidIpOrCidr('10.0.0.0/8'); // true * isValidIpOrCidr('not-an-ip'); // false * ``` */ export declare function isValidIpOrCidr(entry: string): boolean; /** * Determine whether a source IP matches a single allowlist entry. * * Supports: * - Exact IPv4/IPv6 match (case-insensitive for IPv6) * - IPv4 CIDR range match (e.g. `10.0.0.0/8`) * * @param ip - Source IP of the request * @param entry - Allowlist entry (IP or IPv4 CIDR) * @returns true if the IP is covered by the entry * * @example * ```typescript * ipMatchesEntry('10.1.2.3', '10.0.0.0/8'); // true * ipMatchesEntry('203.0.113.4', '203.0.113.4'); // true * ``` */ export declare function ipMatchesEntry(ip: string, entry: string): boolean; //# sourceMappingURL=ip-match.d.ts.map