fix(qa): strip control ui api key params · openclaw/openclaw@1cda1fc
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -384,7 +384,8 @@ describe("qa-lab server", () => {
|
384 | 384 | port: 0, |
385 | 385 | outputPath, |
386 | 386 | repoRoot, |
387 | | -controlUiUrl: "http://127.0.0.1:18789/?token=qa-token&panel=chat#token=fragment-token", |
| 387 | +controlUiUrl: |
| 388 | +"https://gateway.example.test/?token=qa-token&api_key=qa-api-key&id_token=qa-id-token&panel=chat#token=fragment-token", |
388 | 389 | embeddedGateway: "disabled", |
389 | 390 | }); |
390 | 391 | cleanups.push(async () => { |
@@ -403,8 +404,8 @@ describe("qa-lab server", () => {
|
403 | 404 | }; |
404 | 405 | expect(bootstrap.defaults.conversationId).toBe("qa-operator"); |
405 | 406 | expect(bootstrap.defaults.senderId).toBe("qa-operator"); |
406 | | -expect(bootstrap.controlUiUrl).toBe("http://127.0.0.1:18789/?panel=chat"); |
407 | | -expect(bootstrap.controlUiEmbeddedUrl).toBe("http://127.0.0.1:18789/?panel=chat"); |
| 407 | +expect(bootstrap.controlUiUrl).toBe("https://gateway.example.test/?panel=chat"); |
| 408 | +expect(bootstrap.controlUiEmbeddedUrl).toBe("https://gateway.example.test/?panel=chat"); |
408 | 409 | expect(bootstrap.kickoffTask).toContain("Lobster Invaders"); |
409 | 410 | expect(bootstrap.scenarios.length).toBeGreaterThanOrEqual(10); |
410 | 411 | expect(bootstrap.scenarios.map((scenario) => scenario.id)).toContain("dm-chat-baseline"); |
@@ -422,7 +423,7 @@ describe("qa-lab server", () => {
|
422 | 423 | ).json()) as { |
423 | 424 | status: { gateway: { url: string } }; |
424 | 425 | }; |
425 | | -expect(startupStatus.status.gateway.url).toBe("http://127.0.0.1:18789/?panel=chat"); |
| 426 | +expect(startupStatus.status.gateway.url).toBe("https://gateway.example.test/?panel=chat"); |
426 | 427 | |
427 | 428 | const messageResponse = await fetch(`${lab.baseUrl}/api/inbound/message`, { |
428 | 429 | method: "POST", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -139,8 +139,11 @@ function createBootstrapDefaults(autoKickoffTarget?: string): QaLabBootstrapDefa
|
139 | 139 | |
140 | 140 | const CONTROL_UI_CREDENTIAL_QUERY_KEYS = new Set([ |
141 | 141 | "access_token", |
| 142 | +"api_key", |
| 143 | +"apikey", |
142 | 144 | "auth", |
143 | 145 | "devicetoken", |
| 146 | +"id_token", |
144 | 147 | "password", |
145 | 148 | "refresh_token", |
146 | 149 | "token", |
@@ -158,7 +161,7 @@ function stripSensitiveQueryParams(rawUrl: string): string {
|
158 | 161 | } catch { |
159 | 162 | return rawUrl |
160 | 163 | .replace( |
161 | | -/([?&])(?:access_token|auth|deviceToken|password|refresh_token|token)=[^&#\s]*&?/gi, |
| 164 | +/([?&])(?:access_token|api_?key|auth|deviceToken|id_token|password|refresh_token|token)=[^&#\s]*&?/gi, |
162 | 165 | (match: string, separator: string) => (match.endsWith("&") ? separator : ""), |
163 | 166 | ) |
164 | 167 | .replace(/[?&]$/, "") |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。