Add DNS diagnostics across dataplane and client
Build and Deploy Gateway / build-and-push (push) Successful in 31s
Build and Deploy Gateway / deploy (push) Successful in 13s

This commit is contained in:
2026-09-01 04:16:15 +03:00
parent e0bdafd25e
commit 76a99f098a
23 changed files with 1888 additions and 35 deletions
@@ -4,7 +4,7 @@ import type { ConnectivityDiagnosticsUseCase } from '../../features/diagnostics/
import { sendJson } from '../response.js';
interface ConnectivityDiagnosticsRouteDependencies {
diagnostics: Pick<ConnectivityDiagnosticsUseCase, 'run' | 'updateSettings'>;
diagnostics: Pick<ConnectivityDiagnosticsUseCase, 'run' | 'dnsCatalog' | 'runDns' | 'updateSettings'>;
readBody(req: IncomingMessage): Promise<Record<string, unknown>>;
sendState(res: ServerResponse): Promise<void>;
}
@@ -14,6 +14,15 @@ export function createConnectivityDiagnosticsRoute(
) {
return {
async handle(req: IncomingMessage, res: ServerResponse) {
if (req.url === '/api/diagnostics/dns' && req.method === 'GET') {
sendJson(res, 200, await dependencies.diagnostics.dnsCatalog());
return true;
}
if (req.url === '/api/diagnostics/dns' && req.method === 'POST') {
const { domainId, resolverId = null } = await dependencies.readBody(req);
sendJson(res, 200, await dependencies.diagnostics.runDns(domainId, resolverId));
return true;
}
if (req.url === '/api/diagnostics/connectivity' && req.method === 'POST') {
const { target = null } = await dependencies.readBody(req);
const result = await dependencies.diagnostics.run(target);