Implement Harbor gateway device ecosystem support
Build and Deploy Gateway / build-and-push (push) Successful in 26s
Build and Deploy Gateway / deploy (push) Successful in 14s

This commit is contained in:
2026-08-31 02:06:22 +03:00
parent 7e15cc199f
commit 116686a138
21 changed files with 1924 additions and 51 deletions
+20 -2
View File
@@ -41,7 +41,7 @@ test('device controller preserves Gateway-only polling, monotonic publication an
assert.match(page, /<GatewayTrafficSummary feature=\{devicesFeature\} now=\{now\}/);
});
test('all unknown inventory results pass one identity-preserving runtime parser', () => {
test('all unknown inventory results pass one capability-aware runtime parser', () => {
const observedAt = '2026-08-08T12:34:56.000Z';
const valid = {
revision: 3,
@@ -106,7 +106,21 @@ test('all unknown inventory results pass one identity-preserving runtime parser'
},
extra: { retained: true },
};
assert.equal(parseDeviceSnapshot(valid), valid);
const oldBackend = parseDeviceSnapshot(valid);
assert.equal(oldBackend.taggingSupported, false);
assert.deepEqual(oldBackend.tags, []);
assert.deepEqual(oldBackend.devices[0].tagIds, []);
assert.deepEqual(oldBackend.extra, valid.extra);
const supported = {
...valid,
tags: [{ id: 'tag_0123456789abcdef', name: 'Умный дом' }],
devices: [{ ...valid.devices[0], tagIds: ['tag_0123456789abcdef'] }],
};
const parsedSupported = parseDeviceSnapshot(supported);
assert.equal(parsedSupported.taggingSupported, true);
assert.deepEqual(parsedSupported.tags, supported.tags);
assert.deepEqual(parsedSupported.devices[0].tagIds, ['tag_0123456789abcdef']);
for (const invalid of [
null,
{},
@@ -134,6 +148,10 @@ test('all unknown inventory results pass one identity-preserving runtime parser'
{ ...valid, devices: [{ ...valid.devices[0], outboundTraffic: { observedAt, vpnBytes: '1' } }] },
{ ...valid, devices: [{ ...valid.devices[0], outboundTraffic: { ...valid.devices[0].outboundTraffic, directIpv4ObservedAt: 'not-a-date' } }] },
{ ...valid, devices: [{ ...valid.devices[0], outboundTrafficHistory: [{ observedAt, vpnBytes: '1' }] }] },
{ ...supported, tags: [{ id: 'bad', name: 'Дом' }] },
{ ...supported, tags: [{ ...supported.tags[0], name: ' '.repeat(2) }] },
{ ...supported, devices: [{ ...valid.devices[0] }] },
{ ...supported, devices: [{ ...supported.devices[0], tagIds: ['tag_ffffffffffffffff'] }] },
{ ...valid, traffic: { ...valid.traffic, totalBytes: -4 } },
{ ...valid, traffic: { ...valid.traffic, observedAt: 'not-a-date' } },
{ ...valid, source: { ...valid.source, kind: 'arp' } },