openclaw/src/browser
oneaix 216d99e585 fix(browser): derive relay auth token from gateway token in Chrome extension
The extension relay server authenticates using an HMAC-SHA256 derived
token (`openclaw-extension-relay-v1:<port>`), but the Chrome extension
was sending the raw gateway token. This caused both the WebSocket
connection and the options page validation to fail with 401 Unauthorized.

Additionally, the options page validation request triggered a CORS
preflight (due to the custom `x-openclaw-relay-token` header) which the
relay rejects because OPTIONS requests lack auth headers. The options
page now delegates the check to the background service worker which has
host_permissions and bypasses CORS preflight.

Fixes #23842

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit bbc654b9f0)
2026-02-23 18:56:14 +00:00
..
routes
bridge-auth-registry.ts
bridge-server.auth.test.ts test: dedupe repeated test fixtures and assertions 2026-02-22 18:37:25 +00:00
bridge-server.ts
browser-utils.test.ts
cdp.helpers.ts
cdp.test.ts
cdp.ts
chrome-extension-background-utils.test.ts fix(browser): derive relay auth token from gateway token in Chrome extension 2026-02-23 18:56:14 +00:00
chrome-extension-manifest.test.ts fix(browser): harden extension relay worker recovery 2026-02-22 19:08:38 +01:00
chrome-user-data-dir.test-harness.ts refactor(browser): dedupe control-server test harness 2026-02-22 17:54:51 +00:00
chrome.default-browser.test.ts test: dedupe repeated test fixtures and assertions 2026-02-22 18:37:25 +00:00
chrome.executables.ts
chrome.profile-decoration.ts
chrome.test.ts test: dedupe repeated test fixtures and assertions 2026-02-22 18:37:25 +00:00
chrome.ts
client-actions-core.ts
client-actions-observe.ts
client-actions-state.ts
client-actions-types.ts
client-actions-url.ts
client-actions.ts
client-fetch.loopback-auth.test.ts refactor(security): unify local-host and tailnet CIDR checks 2026-02-22 17:20:27 +01:00
client-fetch.ts refactor(security): unify local-host and tailnet CIDR checks 2026-02-22 17:20:27 +01:00
client.test.ts
client.ts
config.test.ts refactor(test): standardize env helpers across suites 2026-02-21 19:13:46 +00:00
config.ts
constants.ts
control-auth.auto-token.test.ts test: dedupe gateway browser discord and channel coverage 2026-02-22 17:11:54 +00:00
control-auth.test.ts
control-auth.ts
control-service.ts
csrf.ts
extension-relay-auth.test.ts Browser relay: accept raw gateway token in extension auth 2026-02-23 18:56:14 +00:00
extension-relay-auth.ts Browser relay: accept raw gateway token in extension auth 2026-02-23 18:56:14 +00:00
extension-relay.test.ts Browser relay: accept raw gateway token in extension auth 2026-02-23 18:56:14 +00:00
extension-relay.ts Browser relay: accept raw gateway token in extension auth 2026-02-23 18:56:14 +00:00
http-auth.ts
navigation-guard.test.ts
navigation-guard.ts
paths.test.ts Browser: accept canonical upload paths for symlinked roots 2026-02-21 21:54:57 -08:00
paths.ts Browser: accept canonical upload paths for symlinked roots 2026-02-21 21:54:57 -08:00
profiles-service.test.ts
profiles-service.ts
profiles.test.ts test: optimize gateway infra memory and security coverage 2026-02-21 21:44:50 +00:00
profiles.ts
proxy-files.ts
pw-ai-module.ts
pw-ai-state.ts
pw-ai.test.ts
pw-ai.ts
pw-role-snapshot.test.ts
pw-role-snapshot.ts refactor: extract shared dedupe helpers for runtime paths 2026-02-23 05:43:43 +00:00
pw-session.browserless.live.test.ts
pw-session.create-page.navigation-guard.test.ts test(core): reduce mock reset overhead in targeted suites 2026-02-22 08:40:29 +00:00
pw-session.get-page-for-targetid.extension-fallback.test.ts test(core): use lightweight clears in subagent and browser setup 2026-02-22 08:07:41 +00:00
pw-session.mock-setup.ts fix(ci): add explicit mock types in pw-session mock setup 2026-02-22 08:05:12 +00:00
pw-session.test.ts
pw-session.ts
pw-tools-core.activity.ts
pw-tools-core.clamps-timeoutms-scrollintoview.test.ts test(browser): table-drive scroll and click error rewrites 2026-02-21 23:58:33 +00:00
pw-tools-core.downloads.ts
pw-tools-core.interactions.evaluate.abort.test.ts
pw-tools-core.interactions.ts
pw-tools-core.last-file-chooser-arm-wins.test.ts
pw-tools-core.responses.ts
pw-tools-core.screenshots-element-selector.test.ts
pw-tools-core.shared.ts
pw-tools-core.snapshot.navigate-guard.test.ts
pw-tools-core.snapshot.ts
pw-tools-core.state.ts
pw-tools-core.storage.ts
pw-tools-core.test-harness.ts
pw-tools-core.trace.ts
pw-tools-core.ts
pw-tools-core.waits-next-download-saves-it.test.ts
resolved-config-refresh.ts
screenshot.test.ts test: move browser and web auto-reply local suites out of e2e 2026-02-22 11:05:26 +00:00
screenshot.ts
server-context.chrome-test-harness.ts refactor(browser): dedupe control-server test harness 2026-02-22 17:54:51 +00:00
server-context.ensure-tab-available.prefers-last-target.test.ts
server-context.hot-reload-profiles.test.ts
server-context.remote-tab-ops.test.ts test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
server-context.ts fix(browser): recover stale remote target ids 2026-02-22 19:08:38 +01:00
server-context.types.ts
server-lifecycle.test.ts test(browser): use lightweight clears in server lifecycle setup 2026-02-22 08:01:15 +00:00
server-lifecycle.ts
server-middleware.ts
server.agent-contract-form-layout-act-commands.test.ts
server.agent-contract-snapshot-endpoints.test.ts
server.agent-contract.test-harness.ts
server.auth-token-gates-http.test.ts
server.control-server.test-harness.ts refactor(browser): dedupe control-server test harness 2026-02-22 17:54:51 +00:00
server.evaluate-disabled-does-not-block-storage.test.ts
server.post-tabs-open-profile-unknown-returns-404.test.ts refactor(browser): dedupe control-server test harness 2026-02-22 17:54:51 +00:00
server.ts
target-id.ts
test-port.ts
trash.ts refactor(security): unify secure id paths and guard weak patterns 2026-02-22 10:16:19 +01:00