Closed Bug 1759994 Opened 3 years ago Closed 3 years ago

Move handling of optional hosts and origins from using preferences to command line arguments

Categories

(Testing :: geckodriver, task, P2)

Default
task
Points:
8

Tracking

(firefox100 fixed)

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

(Whiteboard: [bidi-m3-mvp])

Attachments

(3 files, 2 obsolete files)

With bug 1750689 we got opt-in support for hosts and origins other then local loopback interfaces. With the current implementation we are making use of the following preferences:

  • remote.hosts.allowed
  • remote.origins.allowed

Given that these preferences could be set by users while testing a particular feature there is the risk that they forget to actually reset the preferences afterward.

To reduce this risk and to improve the security for our users we are going to move both settings to command line arguments for Firefox. That means that they are only valid for the current Firefox instance.

By making the changes to the Remote Agent we also have to update geckodriver at the same time and that before the 0.31.0 release.

Blocks: 1753997
No longer blocks: 1606604
Assignee: nobody → hskupin
Status: NEW → ASSIGNED

Bug 1755312 comes with substantial changes to the wdspec tests which tests for this bug will need.

Depends on: 1755312
Attachment #9269620 - Attachment description: WIP: Bug 1759994 - [remote] Use private properties for Remote Agent class. → Bug 1759994 - [remote] Use private properties for Remote Agent class.
Attachment #9269621 - Attachment description: WIP: Bug 1759994 - [remote] Use command line arguments for allowed hosts and origins for Remote Agent. → Bug 1759994 - [remote] Use command line arguments for allowed hosts and origins for Remote Agent.

The Remote Agent expects the optional hosts and origins as
command line arguments now. As such geckodriver has to follow
and should no longer set the formerly used preferences.

Depends on D142188

Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3cce6dda3252 [remote] Use private properties for Remote Agent class. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/edfc642ff2f3 [remote] Use command line arguments for allowed hosts and origins for Remote Agent. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/f75298e767bb [geckodriver] Allow optional hosts and origins via command line arguments. r=webdriver-reviewers,jgraham

Backed out for causing remote failures

[task 2022-04-01T13:25:43.827Z] 13:25:43     INFO - TEST-UNEXPECTED-FAIL | remote/cdp/test/browser/browser_cdp.js | Uncaught exception in test - at chrome://mochitests/content/browser/remote/cdp/test/browser/chrome-remote-interface.js:8 - Error: WebSocket error
[task 2022-04-01T13:25:43.827Z] 13:25:43     INFO - Stack trace:
[task 2022-04-01T13:25:43.828Z] 13:25:43     INFO - CDP</e.exports</this._ws.onerror@chrome://mochitests/content/browser/remote/cdp/test/browser/chrome-remote-interface.js:8:515701
[task 2022-04-01T13:25:43.828Z] 13:25:43     INFO - Not taking screenshot here: see the one that was previously logged
[task 2022-04-01T13:25:43.829Z] 13:25:43     INFO - TEST-UNEXPECTED-FAIL | remote/cdp/test/browser/browser_cdp.js | A promise chain failed to handle a rejection: The handshake request has incorrect Origin header null - stack: processRequest@chrome://remote/content/server/WebSocketHandshake.jsm:174:11
[task 2022-04-01T13:25:43.830Z] 13:25:43     INFO - serverHandshake@chrome://remote/content/server/WebSocketHandshake.jsm:246:41
[task 2022-04-01T13:25:43.830Z] 13:25:43     INFO - upgrade@chrome://remote/content/server/WebSocketHandshake.jsm:314:9
[task 2022-04-01T13:25:43.830Z] 13:25:43     INFO - handle@chrome://remote/content/cdp/targets/Target.jsm:58:48
[task 2022-04-01T13:25:43.831Z] 13:25:43     INFO - createHandlerFunc/<@chrome://remote/content/server/HTTPD.jsm:2134:13
[task 2022-04-01T13:25:43.831Z] 13:25:43     INFO - handleResponse@chrome://remote/content/server/HTTPD.jsm:2495:36
[task 2022-04-01T13:25:43.831Z] 13:25:43     INFO - process@chrome://remote/content/server/HTTPD.jsm:1354:26
[task 2022-04-01T13:25:43.832Z] 13:25:43     INFO - _handleResponse@chrome://remote/content/server/HTTPD.jsm:1801:22
[task 2022-04-01T13:25:43.832Z] 13:25:43     INFO - _processBody@chrome://remote/content/server/HTTPD.jsm:1646:14
[task 2022-04-01T13:25:43.832Z] 13:25:43     INFO - onInputStreamReady@chrome://remote/content/server/HTTPD.jsm:1525:14
[task 2022-04-01T13:25:43.832Z] 13:25:43     INFO - Rejection date: Fri Apr 01 2022 13:25:43 GMT+0000 (Coordinated Universal Time) - false == true - JS frame :: resource://testing-common/PromiseTestUtils.jsm :: assertNoUncaughtRejections :: line 271
[task 2022-04-01T13:25:43.833Z] 13:25:43     INFO - Stack trace:
[task 2022-04-01T13:25:43.833Z] 13:25:43     INFO - resource://testing-common/PromiseTestUtils.jsm:assertNoUncaughtRejections:271
[task 2022-04-01T13:25:43.833Z] 13:25:43     INFO - chrome://mochikit/content/browser-test.js:handleTask:1017
[task 2022-04-01T13:25:43.833Z] 13:25:43     INFO - Leaving test bound testCDP
[task 2022-04-01T13:25:43.834Z] 13:25:43     INFO - GECKO(1573) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
[task 2022-04-01T13:25:43.834Z] 13:25:43     INFO - GECKO(1573) | MEMORY STAT | vsize 11356MB | residentFast 474MB | heapAllocated 233MB
[task 2022-04-01T13:25:43.834Z] 13:25:43     INFO - TEST-OK | remote/cdp/test/browser/browser_cdp.js | took 682ms
Flags: needinfo?(hskupin)

This fails the remote browser-chrome tests because these still set the remote.allow.hosts preference for the null origin. With the browser chrome mochitests limited to not being able to set custom command line arguments via the browser.ini file (see 1762647) we can only revert these changes and make use of the null origin override again.

I already pushed an update for the patches which needs to be reviewed now.

Flags: needinfo?(hskupin)
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/17c8c0ce0027 [remote] Use private properties for Remote Agent class. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/19423b8e8165 [remote] Use command line arguments for allowed hosts and origins for Remote Agent. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/2172553fa9e8 [geckodriver] Allow optional hosts and origins via command line arguments. r=webdriver-reviewers,jgraham
Regressions: 1762752
Attachment #9269501 - Attachment is obsolete: true
Attachment #9269500 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: