


























@@ -132,7 +132,7 @@ describe("handshake auth helpers", () => {
132132).toBe(false);
133133});
134134135-it("requires explicit pairing for browser-origin clients even when locality resolves local", () => {
135+it("allows Control UI or WebChat browser-origin pairing but keeps other browser-origin clients explicit", () => {
136136expect(
137137shouldAllowSilentLocalPairing({
138138locality: "browser_container_local",
@@ -141,7 +141,7 @@ describe("handshake auth helpers", () => {
141141isWebchat: true,
142142reason: "not-paired",
143143}),
144-).toBe(false);
144+).toBe(true);
145145expect(
146146shouldAllowSilentLocalPairing({
147147locality: "shared_secret_loopback_local",
@@ -150,6 +150,15 @@ describe("handshake auth helpers", () => {
150150isWebchat: true,
151151reason: "scope-upgrade",
152152}),
153+).toBe(true);
154+expect(
155+shouldAllowSilentLocalPairing({
156+locality: "shared_secret_loopback_local",
157+hasBrowserOriginHeader: true,
158+isControlUi: false,
159+isWebchat: false,
160+reason: "scope-upgrade",
161+}),
153162).toBe(false);
154163});
155164@@ -165,7 +174,7 @@ describe("handshake auth helpers", () => {
165174).toBe(false);
166175});
167176168-it("requires explicit pairing for browser-origin clients even when locality resolves local", () => {
177+it("allows Control UI browser-origin local pairing for fresh pairing and upgrades", () => {
169178for (const locality of ["direct_local", "browser_container_local"] as const) {
170179expect(
171180shouldAllowSilentLocalPairing({
@@ -175,7 +184,7 @@ describe("handshake auth helpers", () => {
175184isWebchat: true,
176185reason: "not-paired",
177186}),
178-).toBe(false);
187+).toBe(true);
179188expect(
180189shouldAllowSilentLocalPairing({
181190 locality,
@@ -184,7 +193,7 @@ describe("handshake auth helpers", () => {
184193isWebchat: true,
185194reason: "role-upgrade",
186195}),
187-).toBe(false);
196+).toBe(true);
188197}
189198});
190199此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。