feat: replace openapi hashing system with /version

Apparently I didn't use my brain cells and rely on the /version
endpoint that Headscale has exposed since 0.26 (our lowest supported
version). Switching to that significantly simplifies the API surface.
This commit is contained in:
Aarnav Tale
2026-05-23 19:59:03 -04:00
parent d4eee702e9
commit 0512565f8e
59 changed files with 1123 additions and 1573 deletions
+10 -10
View File
@@ -43,7 +43,7 @@ describe("Login action validation", () => {
const request = mockRequest(formData);
const mockContext = {
hsApi: { getRuntimeClient: vi.fn() },
headscale: { client: vi.fn() },
sessions: { createSession: vi.fn() },
};
@@ -63,7 +63,7 @@ describe("Login action validation", () => {
const request = mockRequest(formData);
const mockContext = {
hsApi: { getRuntimeClient: vi.fn() },
headscale: { client: vi.fn() },
sessions: { createSession: vi.fn() },
};
@@ -87,8 +87,8 @@ describe("Login action validation", () => {
.mockResolvedValue([{ prefix: "other-prefix", expiration: "2030-01-01T00:00:00Z" }]);
const mockContext = {
hsApi: {
getRuntimeClient: () => ({ getApiKeys: mockGetApiKeys }),
headscale: {
client: () => ({ apiKeys: { list: mockGetApiKeys } }),
},
sessions: { createSession: vi.fn() },
};
@@ -114,8 +114,8 @@ describe("Login action validation", () => {
.mockResolvedValue([{ prefix: "expired-key-prefix", expiration: "2020-01-01T00:00:00Z" }]);
const mockContext = {
hsApi: {
getRuntimeClient: () => ({ getApiKeys: mockGetApiKeys }),
headscale: {
client: () => ({ apiKeys: { list: mockGetApiKeys } }),
},
sessions: { createSession: vi.fn() },
};
@@ -141,8 +141,8 @@ describe("Login action validation", () => {
.mockResolvedValue([{ prefix: "malformed-key", expiration: null } as MockApiKey]);
const mockContext = {
hsApi: {
getRuntimeClient: () => ({ getApiKeys: mockGetApiKeys }),
headscale: {
client: () => ({ apiKeys: { list: mockGetApiKeys } }),
},
sessions: { createSession: vi.fn() },
};
@@ -173,8 +173,8 @@ describe("Login action validation", () => {
const mockCreateSession = vi.fn().mockResolvedValue("session-cookie");
const mockContext = {
hsApi: {
getRuntimeClient: () => ({ getApiKeys: mockGetApiKeys }),
headscale: {
client: () => ({ apiKeys: { list: mockGetApiKeys } }),
},
sessions: { createSession: mockCreateSession },
};