feat(lookup): enhance lookup functionality to support CIDR queries
CI / changes (push) Successful in 6s
CI / commitlint (push) Skipped
CI / openapi (push) Failing after 40s
CI / web (push) Successful in 56s
CI / go (push) Successful in 1m9s
CI / bird2 (push) Successful in 14s
CI / release (push) Skipped

Updated the lookup system to allow for CIDR queries in addition to IP and domain searches. This includes modifications to the API, frontend components, and documentation to reflect the new capabilities. The LookupSearchForm and LookupComponent were adjusted to accommodate CIDR input, and relevant tests were added to ensure functionality.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-31 13:20:18 +07:00
co-authored by Cursor
parent b13c233679
commit f45b2bed90
12 changed files with 1240 additions and 69 deletions
+6 -4
View File
@@ -789,7 +789,7 @@ components:
LookupQueryKind:
type: string
enum: [ip, domain]
enum: [ip, domain, cidr]
description: Определённый тип запроса после нормализации.
LookupLayer:
@@ -864,7 +864,7 @@ components:
$ref: "#/components/schemas/LookupQueryKind"
normalized:
type: string
description: Нормализованный IP или FQDN.
description: Нормализованный IP, masked CIDR или FQDN.
matched:
type: boolean
description: true, если есть хотя бы одно совпадение.
@@ -2028,12 +2028,14 @@ paths:
/v1/lookup:
get:
tags: [Lookup]
summary: Проверка IP или домена в списках
summary: Проверка IP, CIDR или домена в списках
description: |
Быстрая membership-проверка по tenant:
- **IP** — слой `entry` (`IP_RANGES`, `CIDR.Contains`) и слой `snapshot`
(все module prefix snapshots, `Prefix.Contains`);
- **CIDR** — слой `entry` (`IP_RANGES`, равенство masked-префикса или покрытие
запрошенной сети) и слой `snapshot` (то же правило);
- **Domain** — слой `entry` (нормализованный FQDN в `DOMAINS`) и слой `snapshot`
(префиксы `source=domain` у matched DOMAINS-модулей, если snapshot есть);
затем **live DNS resolve** (A/AAAA через системный резолвер) и проверка
@@ -2054,7 +2056,7 @@ paths:
type: string
minLength: 1
maxLength: 253
description: IP-адрес или FQDN для проверки.
description: IP-адрес, CIDR или FQDN для проверки.
responses:
"200":
description: Результат проверки (в т.ч. matched=false при отсутствии совпадений).