Add native traffic inspection to Harbor Connect and Gateway

This commit is contained in:
2026-08-31 05:19:15 +03:00
parent 116686a138
commit 4d066cb879
62 changed files with 10975 additions and 220 deletions
+10 -7
View File
@@ -26,6 +26,8 @@ test('control uses the dataplane socket protocol', async () => {
assert.equal(traffic.running, true);
const domainTraffic = await client.observeDomainTraffic();
assert.equal(domainTraffic.running, true);
const liveTraffic = await client.observeLiveTraffic();
assert.equal(liveTraffic.running, true);
await client.observeDevicePolicy();
await client.applyDevicePolicies([{ id: 'dev_0011223344556677' }]);
await client.runConnectivityDiagnostics(
@@ -47,6 +49,7 @@ test('control uses the dataplane socket protocol', async () => {
'GET /devices /run/dataplane.sock',
'GET /device-traffic /run/dataplane.sock',
'GET /domain-traffic /run/dataplane.sock',
'GET /traffic/live /run/dataplane.sock',
'GET /device-policy /run/dataplane.sock',
'PUT /device-policy /run/dataplane.sock',
'POST /diagnostics/connectivity /run/dataplane.sock',
@@ -59,16 +62,16 @@ test('control uses the dataplane socket protocol', async () => {
'POST /restart /run/dataplane.sock',
'POST /stop /run/dataplane.sock',
]);
assert.deepEqual(requests[6].body, { devices: [{ id: 'dev_0011223344556677' }] });
assert.deepEqual(requests[7].body, {
assert.deepEqual(requests[7].body, { devices: [{ id: 'dev_0011223344556677' }] });
assert.deepEqual(requests[8].body, {
services: [{ id: 'custom-test', url: 'https://example.com' }],
target: 'site:custom-test',
});
assert.equal(requests[7].timeoutMs, 25_000);
assert.deepEqual(requests[8].body, { config: { outbounds: [] } });
assert.deepEqual(requests[9].body, { role: 'primary', services: [], target: 'site:youtube', timeoutMs: 9_000 });
assert.equal(requests[9].timeoutMs, 19_000);
assert.deepEqual(requests[11].body, { role: 'reserve' });
assert.equal(requests[8].timeoutMs, 25_000);
assert.deepEqual(requests[9].body, { config: { outbounds: [] } });
assert.deepEqual(requests[10].body, { role: 'primary', services: [], target: 'site:youtube', timeoutMs: 9_000 });
assert.equal(requests[10].timeoutMs, 19_000);
assert.deepEqual(requests[12].body, { role: 'reserve' });
});
test('connectivity diagnostics expose a retryable domain error', async () => {