feat: add lookup functionality for IP/domain verification and enhance dashboard links
Introduced a new lookup feature allowing users to quickly verify IP addresses or domains against community lists. Updated the DashboardQuickLinks component to include a new action for IP/domain checks, enhancing user navigation. Expanded API documentation to include the new lookup endpoint and its response structure, ensuring comprehensive coverage of the feature. Updated UI design documentation to reflect the integration of the lookup functionality.
This commit is contained in:
@@ -27,6 +27,8 @@ tags:
|
||||
description: Liveness, readiness и метаданные сборки. Обычно без чувствительных данных; доступ может быть шире.
|
||||
- name: Modules
|
||||
description: Экземпляры модулей префиксов (AS, CDN, домены, статические IP-диапазоны) и вложенные записи. Чтение - viewer+; изменение - editor+.
|
||||
- name: Lookup
|
||||
description: Быстрая проверка membership IP/FQDN в списках (entries + module prefix snapshots) и community. Чтение - viewer+.
|
||||
- name: DoH profiles
|
||||
description: Профили DNS-over-HTTPS для модулей типа домены. Секрет в ответах не возвращается.
|
||||
- name: Communities
|
||||
@@ -221,6 +223,12 @@ components:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Problem"
|
||||
BadRequest:
|
||||
description: Некорректный запрос (пустой или невалидный параметр).
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Problem"
|
||||
Forbidden:
|
||||
description: Недостаточно прав для операции.
|
||||
content:
|
||||
@@ -751,6 +759,90 @@ components:
|
||||
description: Человекочитаемое название для UI и фильтров.
|
||||
additionalProperties: true
|
||||
|
||||
LookupQueryKind:
|
||||
type: string
|
||||
enum: [ip, domain]
|
||||
description: Определённый тип запроса после нормализации.
|
||||
|
||||
LookupLayer:
|
||||
type: string
|
||||
enum: [entry, snapshot]
|
||||
description: |
|
||||
`entry` — сырые IP_RANGES / DOMAINS entries;
|
||||
`snapshot` — материализованные префиксы `module_prefix_snapshot`.
|
||||
|
||||
LookupMatchKind:
|
||||
type: string
|
||||
enum: [ip_range, domain, prefix]
|
||||
description: Вид совпадения (entry CIDR, entry FQDN или snapshot prefix).
|
||||
|
||||
LookupMatch:
|
||||
type: object
|
||||
required:
|
||||
- layer
|
||||
- module_id
|
||||
- module_name
|
||||
- module_type
|
||||
- match_kind
|
||||
- matched_value
|
||||
properties:
|
||||
layer:
|
||||
$ref: "#/components/schemas/LookupLayer"
|
||||
module_id:
|
||||
$ref: "#/components/schemas/ResourceId"
|
||||
module_name:
|
||||
type: string
|
||||
module_type:
|
||||
$ref: "#/components/schemas/ModuleType"
|
||||
match_kind:
|
||||
$ref: "#/components/schemas/LookupMatchKind"
|
||||
matched_value:
|
||||
type: string
|
||||
description: CIDR, FQDN или prefix, с которым совпал запрос.
|
||||
entry_id:
|
||||
type: string
|
||||
description: ID entry (только для layer=entry).
|
||||
source:
|
||||
type: string
|
||||
description: Источник строки snapshot (ip_range, domain, as, cdn, …).
|
||||
community_id:
|
||||
type: ["string", "null"]
|
||||
community:
|
||||
type: string
|
||||
description: Техническое значение BGP community.
|
||||
community_title:
|
||||
type: string
|
||||
description: Человекочитаемое название community.
|
||||
|
||||
LookupResponse:
|
||||
type: object
|
||||
required:
|
||||
- query
|
||||
- query_kind
|
||||
- normalized
|
||||
- matched
|
||||
- match_count
|
||||
- matches
|
||||
properties:
|
||||
query:
|
||||
type: string
|
||||
description: Исходная строка запроса.
|
||||
query_kind:
|
||||
$ref: "#/components/schemas/LookupQueryKind"
|
||||
normalized:
|
||||
type: string
|
||||
description: Нормализованный IP или FQDN.
|
||||
matched:
|
||||
type: boolean
|
||||
description: true, если есть хотя бы одно совпадение.
|
||||
match_count:
|
||||
type: integer
|
||||
minimum: 0
|
||||
matches:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/LookupMatch"
|
||||
|
||||
BgpPeer:
|
||||
type: object
|
||||
required:
|
||||
@@ -1780,6 +1872,47 @@ paths:
|
||||
default:
|
||||
$ref: "#/components/responses/DefaultProblem"
|
||||
|
||||
/v1/lookup:
|
||||
get:
|
||||
tags: [Lookup]
|
||||
summary: Проверка IP или домена в списках
|
||||
description: |
|
||||
Быстрая membership-проверка по tenant:
|
||||
|
||||
- **IP** — слой `entry` (`IP_RANGES`, `CIDR.Contains`) и слой `snapshot`
|
||||
(все module prefix snapshots, `Prefix.Contains`);
|
||||
- **Domain** — слой `entry` (нормализованный FQDN в `DOMAINS`) и слой `snapshot`
|
||||
(префиксы `source=domain` у matched DOMAINS-модулей, если snapshot есть).
|
||||
|
||||
Community на матче: `entry.community_id || module.default_community_id` (entry)
|
||||
или `PrefixRow.community_id` (snapshot), с join к справочнику communities.
|
||||
|
||||
Live DoH resolve не выполняется — только уже материализованный snapshot.
|
||||
operationId: lookupMembership
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/TenantId"
|
||||
- name: q
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 253
|
||||
description: IP-адрес или FQDN для проверки.
|
||||
responses:
|
||||
"200":
|
||||
description: Результат проверки (в т.ч. matched=false при отсутствии совпадений).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/LookupResponse"
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
"401":
|
||||
$ref: "#/components/responses/Unauthorized"
|
||||
default:
|
||||
$ref: "#/components/responses/DefaultProblem"
|
||||
|
||||
/v1/router-lists/catalog:
|
||||
get:
|
||||
tags: [Modules]
|
||||
|
||||
Reference in New Issue
Block a user