feat(manager): expose safe VPS edge health

This commit is contained in:
DCCONSTRUCTIONS
2026-08-22 13:08:04 +03:00
parent 07ffb22d38
commit 6ed4414a97
14 changed files with 464 additions and 42 deletions
+12 -2
View File
@@ -347,14 +347,23 @@ test("project query is service-authenticated and forwards only the trusted actor
test("project workspace query accepts only a canonical project path", async () => {
const projectId = "11111111-1111-4111-8111-111111111111";
let queried;
const edgeChannels = {
enabled: true,
edges: [{
edgeRegistrationId: "edge:bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
channel: "accepted",
lastErrorCode: null,
}],
};
const runtime = await startTestServer({
managementApiEnabled: true,
managementToken,
edgeChannelStatusProvider: () => edgeChannels,
repository: {
health: async () => "ready",
executeManagementCommand: async () => ({ replayed: false, result: {} }),
getProjectWorkspace: async (actor, id) => {
queried = { actor, id };
getProjectWorkspace: async (actor, id, options) => {
queried = { actor, id, options };
return { project: { projectRef: `project:${id}` }, devices: [] };
},
},
@@ -367,6 +376,7 @@ test("project workspace query accepts only a canonical project path", async () =
assert.equal(response.status, 200);
assert.equal((await response.json()).workspace.devices.length, 0);
assert.equal(queried.id, projectId);
assert.equal(queried.options.edgeChannelStatus, edgeChannels);
const invalid = await fetch(
`${runtime.baseUrl}/internal/v1/query/projects/not-a-project/workspace`,