mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 09:33:06 +00:00
test(config): cover bind alias legacy detection and log escaping
This commit is contained in:
@@ -402,6 +402,25 @@ describe("legacy config detection", () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
it("flags gateway.bind host aliases as legacy to trigger auto-migration paths", async () => {
|
||||
const cases = ["0.0.0.0", "::", "127.0.0.1", "localhost", "::1"] as const;
|
||||
for (const bind of cases) {
|
||||
const validated = validateConfigObject({ gateway: { bind } });
|
||||
expect(validated.ok, bind).toBe(false);
|
||||
if (!validated.ok) {
|
||||
expect(
|
||||
validated.issues.some((issue) => issue.path === "gateway.bind"),
|
||||
bind,
|
||||
).toBe(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
it("escapes control characters in gateway.bind migration change text", async () => {
|
||||
const res = migrateLegacyConfig({
|
||||
gateway: { bind: "\r\n0.0.0.0\r\n" },
|
||||
});
|
||||
expect(res.changes).toContain('Normalized gateway.bind "\\r\\n0.0.0.0\\r\\n" → "lan".');
|
||||
});
|
||||
it('enforces dmPolicy="open" allowFrom wildcard for supported providers', async () => {
|
||||
const cases = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user