feat(macos): add direct gateway transport
This commit is contained in:
committed by
Peter Steinberger
parent
2c5141d7df
commit
5330595a5a
33
src/config/config.gateway-remote-transport.test.ts
Normal file
33
src/config/config.gateway-remote-transport.test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
describe("gateway.remote.transport", () => {
|
||||
it("accepts direct transport", async () => {
|
||||
vi.resetModules();
|
||||
const { validateConfigObject } = await import("./config.js");
|
||||
const res = validateConfigObject({
|
||||
gateway: {
|
||||
remote: {
|
||||
transport: "direct",
|
||||
url: "wss://gateway.example.ts.net",
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects unknown transport", async () => {
|
||||
vi.resetModules();
|
||||
const { validateConfigObject } = await import("./config.js");
|
||||
const res = validateConfigObject({
|
||||
gateway: {
|
||||
remote: {
|
||||
transport: "udp",
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(false);
|
||||
if (!res.ok) {
|
||||
expect(res.issues[0]?.path).toBe("gateway.remote.transport");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -80,6 +80,8 @@ export type GatewayTailscaleConfig = {
|
||||
export type GatewayRemoteConfig = {
|
||||
/** Remote Gateway WebSocket URL (ws:// or wss://). */
|
||||
url?: string;
|
||||
/** Transport for macOS remote connections (ssh tunnel or direct WS). */
|
||||
transport?: "ssh" | "direct";
|
||||
/** Token for remote auth (when the gateway requires token auth). */
|
||||
token?: string;
|
||||
/** Password for remote auth (when the gateway requires password auth). */
|
||||
|
||||
@@ -334,6 +334,7 @@ export const ClawdbotSchema = z
|
||||
remote: z
|
||||
.object({
|
||||
url: z.string().optional(),
|
||||
transport: z.union([z.literal("ssh"), z.literal("direct")]).optional(),
|
||||
token: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
tlsFingerprint: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user