You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("blocks install token resolution for tailscale serve with explicit no-auth",async()=>{
276
+
constresolved=awaitresolveGatewayInstallToken({
277
+
config: {
278
+
gateway: {
279
+
auth: {mode: "none"},
280
+
tailscale: {mode: "serve"},
281
+
},
282
+
}asOpenClawConfig,
283
+
env: {}asNodeJS.ProcessEnv,
284
+
});
285
+
286
+
expect(resolved.token).toBeUndefined();
287
+
expect(resolved.unavailableReason).toBe(
288
+
"gateway.auth.mode=none cannot be used with gateway.tailscale.mode=serve; configure token, password, or trusted-proxy auth before exposing the gateway through Tailscale",
it("rejects explicit no-auth when tailscale serve or funnel exposes the gateway",()=>{
24
+
constserveRes=validateConfigObject({
25
+
gateway: {
26
+
bind: "loopback",
27
+
auth: {mode: "none"},
28
+
tailscale: {mode: "serve"},
29
+
},
30
+
});
31
+
expect(serveRes.ok).toBe(false);
32
+
if(!serveRes.ok){
33
+
expect(serveRes.issues).toEqual([
34
+
{
35
+
path: "gateway.auth.mode",
36
+
message:
37
+
"gateway.auth.mode=none cannot be used with gateway.tailscale.mode=serve; configure token, password, or trusted-proxy auth before exposing the gateway through Tailscale",
38
+
},
39
+
]);
40
+
}
41
+
42
+
constfunnelRes=validateConfigObject({
43
+
gateway: {
44
+
bind: "loopback",
45
+
auth: {mode: "none"},
46
+
tailscale: {mode: "funnel"},
47
+
},
48
+
});
49
+
expect(funnelRes.ok).toBe(false);
50
+
if(!funnelRes.ok){
51
+
expect(funnelRes.issues).toEqual([
52
+
{
53
+
path: "gateway.auth.mode",
54
+
message:
55
+
"gateway.tailscale.mode=funnel requires gateway.auth.mode=password; auth.mode=none cannot be used when exposing the gateway through Tailscale Funnel",
56
+
},
57
+
]);
58
+
}
59
+
});
60
+
61
+
it("allows explicit no-auth for loopback-only gateway config",()=>{
62
+
constres=validateConfigObject({
63
+
gateway: {
64
+
bind: "loopback",
65
+
auth: {mode: "none"},
66
+
tailscale: {mode: "off"},
67
+
},
68
+
});
69
+
expect(res.ok).toBe(true);
70
+
});
71
+
23
72
it("accepts custom loopback bind host with tailscale serve/funnel",()=>{
return"gateway.tailscale.mode=funnel requires gateway.auth.mode=password; auth.mode=none cannot be used when exposing the gateway through Tailscale Funnel";
18
+
}
19
+
return`gateway.auth.mode=none cannot be used with gateway.tailscale.mode=${tailscaleMode}; configure token, password, or trusted-proxy auth before exposing the gateway through Tailscale`;
0 commit comments