mirror of https://github.com/openclaw/openclaw.git
fix: quiet local windows gateway auth noise
This commit is contained in:
parent
394fd87c2c
commit
202765c810
|
|
@ -13,6 +13,7 @@ Docs: https://docs.openclaw.ai
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
- Windows/gateway install: bound `schtasks` calls and fall back to the Startup-folder login item when task creation hangs, so native `openclaw gateway install` fails fast instead of wedging forever on broken Scheduled Task setups.
|
- Windows/gateway install: bound `schtasks` calls and fall back to the Startup-folder login item when task creation hangs, so native `openclaw gateway install` fails fast instead of wedging forever on broken Scheduled Task setups.
|
||||||
|
- Windows/gateway auth: stop attaching device identity on local loopback shared-token and password gateway calls, so native Windows agent replies no longer log stale `device signature expired` fallback noise before succeeding.
|
||||||
- Telegram/media downloads: thread the same direct or proxy transport policy into SSRF-guarded file fetches so inbound attachments keep working when Telegram falls back between env-proxy and direct networking. (#44639) Thanks @obviyus.
|
- Telegram/media downloads: thread the same direct or proxy transport policy into SSRF-guarded file fetches so inbound attachments keep working when Telegram falls back between env-proxy and direct networking. (#44639) Thanks @obviyus.
|
||||||
- Agents/compaction: compare post-compaction token sanity checks against full-session pre-compaction totals and skip the check when token estimation fails, so sessions with large bootstrap context keep real token counts instead of falling back to unknown. (#28347) thanks @efe-arv.
|
- Agents/compaction: compare post-compaction token sanity checks against full-session pre-compaction totals and skip the check when token estimation fails, so sessions with large bootstrap context keep real token counts instead of falling back to unknown. (#28347) thanks @efe-arv.
|
||||||
- Discord/gateway startup: treat plain-text and transient `/gateway/bot` metadata fetch failures as transient startup errors so Discord gateway boot no longer crashes on unhandled rejections. (#44397) Thanks @jalehman.
|
- Discord/gateway startup: treat plain-text and transient `/gateway/bot` metadata fetch failures as transient startup errors so Discord gateway boot no longer crashes on unhandled rejections. (#44397) Thanks @jalehman.
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ let lastClientOptions: {
|
||||||
password?: string;
|
password?: string;
|
||||||
tlsFingerprint?: string;
|
tlsFingerprint?: string;
|
||||||
scopes?: string[];
|
scopes?: string[];
|
||||||
|
deviceIdentity?: unknown;
|
||||||
onHelloOk?: (hello: { features?: { methods?: string[] } }) => void | Promise<void>;
|
onHelloOk?: (hello: { features?: { methods?: string[] } }) => void | Promise<void>;
|
||||||
onClose?: (code: number, reason: string) => void;
|
onClose?: (code: number, reason: string) => void;
|
||||||
} | null = null;
|
} | null = null;
|
||||||
|
|
@ -197,6 +198,19 @@ describe("callGateway url resolution", () => {
|
||||||
expect(lastClientOptions?.token).toBe("explicit-token");
|
expect(lastClientOptions?.token).toBe("explicit-token");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not attach device identity for local loopback shared-token auth", async () => {
|
||||||
|
setLocalLoopbackGatewayConfig();
|
||||||
|
|
||||||
|
await callGateway({
|
||||||
|
method: "health",
|
||||||
|
token: "explicit-token",
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(lastClientOptions?.url).toBe("ws://127.0.0.1:18789");
|
||||||
|
expect(lastClientOptions?.token).toBe("explicit-token");
|
||||||
|
expect(lastClientOptions?.deviceIdentity).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
it("uses OPENCLAW_GATEWAY_URL env override in remote mode when remote URL is missing", async () => {
|
it("uses OPENCLAW_GATEWAY_URL env override in remote mode when remote URL is missing", async () => {
|
||||||
loadConfig.mockReturnValue({
|
loadConfig.mockReturnValue({
|
||||||
gateway: { mode: "remote", bind: "loopback", remote: {} },
|
gateway: { mode: "remote", bind: "loopback", remote: {} },
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,22 @@ export type GatewayConnectionDetails = {
|
||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function shouldAttachDeviceIdentityForGatewayCall(params: {
|
||||||
|
url: string;
|
||||||
|
token?: string;
|
||||||
|
password?: string;
|
||||||
|
}): boolean {
|
||||||
|
if (!(params.token || params.password)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const parsed = new URL(params.url);
|
||||||
|
return !["127.0.0.1", "::1", "localhost"].includes(parsed.hostname);
|
||||||
|
} catch {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export type ExplicitGatewayAuth = {
|
export type ExplicitGatewayAuth = {
|
||||||
token?: string;
|
token?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
|
|
@ -818,7 +834,9 @@ async function executeGatewayRequestWithScopes<T>(params: {
|
||||||
mode: opts.mode ?? GATEWAY_CLIENT_MODES.CLI,
|
mode: opts.mode ?? GATEWAY_CLIENT_MODES.CLI,
|
||||||
role: "operator",
|
role: "operator",
|
||||||
scopes,
|
scopes,
|
||||||
deviceIdentity: loadOrCreateDeviceIdentity(),
|
deviceIdentity: shouldAttachDeviceIdentityForGatewayCall({ url, token, password })
|
||||||
|
? loadOrCreateDeviceIdentity()
|
||||||
|
: undefined,
|
||||||
minProtocol: opts.minProtocol ?? PROTOCOL_VERSION,
|
minProtocol: opts.minProtocol ?? PROTOCOL_VERSION,
|
||||||
maxProtocol: opts.maxProtocol ?? PROTOCOL_VERSION,
|
maxProtocol: opts.maxProtocol ?? PROTOCOL_VERSION,
|
||||||
onHelloOk: async (hello) => {
|
onHelloOk: async (hello) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue