
























@@ -65,7 +65,7 @@ async function expectSharedOperatorScopesCleared(
65656666async function expectLocalBackendGatewayClientScopesPreserved(
6767port: number,
68-auth: { token?: string; password?: string },
68+auth: { token?: string; password?: string; skipDefaultAuth?: boolean },
6969) {
7070const ws = await openWs(port);
7171try {
@@ -75,7 +75,7 @@ async function expectLocalBackendGatewayClientScopesPreserved(
7575scopes: ["operator.admin"],
7676device: null,
7777});
78-expect(res.ok).toBe(true);
78+expect(res.ok, JSON.stringify(res)).toBe(true);
79798080const helloOk = res.payload as
8181| {
@@ -334,30 +334,7 @@ describe("gateway auth compatibility baseline", () => {
334334});
335335336336test("allows auth-none local backend connects without device identity", async () => {
337-const ws = await openWs(port);
338-try {
339-const res = await connectReq(ws, {
340-skipDefaultAuth: true,
341-client: { ...BACKEND_GATEWAY_CLIENT },
342-scopes: ["operator.admin"],
343-device: null,
344-});
345-expect(res.ok, JSON.stringify(res)).toBe(true);
346-347-const helloOk = res.payload as
348-| {
349-auth?: {
350-scopes?: unknown;
351-};
352-}
353-| undefined;
354-expect(helloOk?.auth?.scopes).toEqual(["operator.admin"]);
355-356-const adminRes = await rpcReq(ws, "set-heartbeats", { enabled: false });
357-expect(adminRes.ok).toBe(true);
358-} finally {
359-ws.close();
360-}
337+await expectLocalBackendGatewayClientScopesPreserved(port, { skipDefaultAuth: true });
361338});
362339363340test("rejects auth-none browser-origin backend connects without device identity", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。