diff --git a/src/gateway/probe.test.ts b/src/gateway/probe.test.ts index 4a2374e17cb..92af905a302 100644 --- a/src/gateway/probe.test.ts +++ b/src/gateway/probe.test.ts @@ -61,7 +61,7 @@ describe("probeGateway", () => { expect(result.ok).toBe(true); }); - it("keeps device identity enabled for remote probes", async () => { + it("enables device identity for remote probes", async () => { await probeGateway({ url: "wss://gateway.example/ws", auth: { token: "secret" }, @@ -71,13 +71,13 @@ describe("probeGateway", () => { expect(gatewayClientState.options?.deviceIdentity).toBeUndefined(); }); - it("keeps device identity disabled for unauthenticated loopback probes", async () => { + it("enables device identity for loopback probes", async () => { await probeGateway({ url: "ws://127.0.0.1:18789", timeoutMs: 1_000, }); - expect(gatewayClientState.options?.deviceIdentity).toBeNull(); + expect(gatewayClientState.options?.deviceIdentity).toBeUndefined(); }); it("skips detail RPCs for lightweight reachability probes", async () => { diff --git a/src/gateway/probe.ts b/src/gateway/probe.ts index bbd36639b78..fa391cffd7c 100644 --- a/src/gateway/probe.ts +++ b/src/gateway/probe.ts @@ -4,7 +4,6 @@ import type { SystemPresence } from "../infra/system-presence.js"; import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js"; import { GatewayClient } from "./client.js"; import { READ_SCOPE } from "./method-scopes.js"; -import { isLoopbackHost } from "./net.js"; export type GatewayProbeAuth = { token?: string; @@ -42,16 +41,7 @@ export async function probeGateway(opts: { let connectError: string | null = null; let close: GatewayProbeClose | null = null; - const disableDeviceIdentity = (() => { - try { - const hostname = new URL(opts.url).hostname; - // Local authenticated probes should stay device-bound so read/detail RPCs - // are not scope-limited by the shared-auth scope stripping hardening. - return isLoopbackHost(hostname) && !(opts.auth?.token || opts.auth?.password); - } catch { - return false; - } - })(); + const disableDeviceIdentity = false; const detailLevel = opts.includeDetails === false ? "none" : (opts.detailLevel ?? "full");