Add delivery metadata support, preferred channels, and enhanced agent validation

This commit introduces delivery metadata tracking for gateway commands, updates, and shells. Adds preferred delivery channel handling, refined validation for edge agents, improved relay management logic, and broker presence reporting. Includes schema changes, enhanced shell handling, and test coverage.
This commit is contained in:
Jeppe Bundgaard
2026-04-16 13:44:28 +02:00
parent d4d162d38a
commit d30a006457
16 changed files with 2188 additions and 160 deletions
@@ -10,12 +10,14 @@ it('registers the edge gateway management REST endpoints', function (): void {
expect($route)->toContain("'/edge-gateways/{id}/discovery'");
expect($route)->toContain("'/edge-gateways/{id}/bindings'");
expect($route)->toContain("'/edge-gateways/{id}/update-jobs'");
expect($route)->toContain("'/edge-gateways/{id}/uninstall'");
expect($route)->toContain("'/edge-gateways/{id}/shell-sessions'");
expect($route)->toContain("'/edge-gateways/{id}/shell-sessions/{sessionId}/events'");
expect($route)->toContain("'/edge-gateways/{id}/shell-sessions/{sessionId}/input'");
expect($route)->toContain("'/edge-gateways/{id}/shell-sessions/{sessionId}/resize'");
expect($route)->toContain("'/edge-gateways/{id}/shell-sessions/{sessionId}/close'");
expect($route)->toContain("'/edge-gateways/{id}/rotate-credentials'");
expect($route)->toContain("'/edge-gateways/{id}'");
expect($route)->toContain("'/departments/{id}/gateway-cutover'");
});
@@ -34,3 +36,15 @@ it('registers public installer, claim, heartbeat, command polling, and shell pol
expect($route)->toContain("'/edge-agent/gateways/{id}/shell-actions/{actionId}/result'");
expect($route)->toContain("'/edge-agent/gateways/{id}/shell-sessions/{sessionId}/events'");
});
it('registers authenticated internal broker validation and presence endpoints', function (): void {
$route = file_get_contents(app_path('routes/edgeGatewaysRoute.php'));
expect($route)->not->toBeFalse();
expect($route)->toContain("'/edge-agent/internal/gateways/{id}/validate'");
expect($route)->toContain("'/edge-agent/internal/shell-sessions/validate'");
expect($route)->toContain("'/edge-agent/internal/gateways/{id}/presence'");
expect($route)->toContain("'/edge-agent/internal/shell-sessions/close'");
expect($route)->toContain('HTTP_X_EDGE_BROKER_SECRET');
expect($route)->toContain('EDGE_BROKER_SHARED_SECRET');
});