Update Harbor client and gateway functionality
Build and Deploy Gateway / build-and-push (push) Successful in 35s
Build and Deploy Gateway / deploy (push) Successful in 14s

This commit is contained in:
2026-08-17 15:23:16 +03:00
parent 0b39211fbd
commit 7c255192b0
41 changed files with 1443 additions and 218 deletions
+15 -1
View File
@@ -136,10 +136,17 @@ test('verified Gateway stays active through transient discovery failures', () =>
});
test('canonical route distinguishes fresh, stale, lost, disabled and local states', () => {
const desiredRules = [
{ type: 'domain', value: 'api.example.com', enabled: true, outbound: 'vpn' },
{ type: 'domain_suffix', value: 'example.com', enabled: true, outbound: 'direct' },
];
const appliedRules = [...desiredRules].reverse();
const storedState = {
revision: 1,
subscriptionUrl,
gatewayAutoEnabled: true,
routeRules: desiredRules,
appliedRouteRules: appliedRules,
};
const snapshot = (gatewayAuto, stored = storedState) => createStateSnapshot({
storedState: stored,
@@ -167,10 +174,17 @@ test('canonical route distinguishes fresh, stale, lost, disabled and local state
assert.equal(found.lastVerifiedAt, '2026-07-13T11:59:59.000Z');
assert.equal(found.autoEnabled, true);
assert.equal(found.fallbackPreference, 'local-vpn');
assert.equal(found.rulesContractVersion, 2);
assert.deepEqual(found.localRules, desiredRules);
assert.deepEqual(found.activeLocalRules, []);
assert.equal(found.localRulesPendingRestart, false);
assert.equal(snapshot({ ...fresh, failures: 1 }).reason, 'gateway-stale');
assert.equal(snapshot({ ...fresh, mode: 'local-vpn', gatewayId: '', lastError: 'lost' }).reason, 'gateway-lost');
assert.equal(snapshot(fresh, { ...storedState, gatewayAutoEnabled: false }).reason, 'disabled');
assert.equal(snapshot(createGatewayAutoState()).reason, 'local');
const local = snapshot(createGatewayAutoState());
assert.equal(local.reason, 'local');
assert.deepEqual(local.activeLocalRules, appliedRules);
assert.equal(local.localRulesPendingRestart, true);
});
test('client can ignore and restore a verified Gateway without losing discovery', () => {