Refactor VPN proxy client implementation
Build and Deploy Gateway / build-and-push (push) Failing after 2s
Build and Deploy Gateway / deploy (push) Has been skipped

This commit is contained in:
2026-08-09 00:41:52 +03:00
parent 32be4380a3
commit 34d8b681ad
190 changed files with 20064 additions and 9761 deletions
+21
View File
@@ -0,0 +1,21 @@
import type { IncomingMessage, ServerResponse } from 'node:http';
import type { RouteRulesService } from '../../features/routing/index.js';
interface RouteRulesRouteDependencies {
routeRules: RouteRulesService;
readBody(req: IncomingMessage): Promise<Record<string, unknown>>;
sendState(res: ServerResponse): Promise<void>;
}
export function createRouteRulesRoute(dependencies: RouteRulesRouteDependencies) {
return {
async handle(req: IncomingMessage, res: ServerResponse) {
if (req.method !== 'PUT' || req.url !== '/api/route-rules') return false;
const { rules, expectedRulesRevision, expectedRevision } = await dependencies.readBody(req);
await dependencies.routeRules.update(rules, expectedRulesRevision, expectedRevision);
await dependencies.sendState(res);
return true;
},
};
}