[GTK] WebDriver: allow applying host-specific TLS certificates for automated sessions
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2018 11:03:58 +0000 (11:03 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2018 11:03:58 +0000 (11:03 +0000)
commit0dccdd0684a2ade2c3f3bc85b9b3006519a3e0d2
tree04d106cb669f77c0f84be1c182ee5932c28cdb23
parent225f556a22a6b14e21f22dde5bd7430ed34eac15
[GTK] WebDriver: allow applying host-specific TLS certificates for automated sessions
https://bugs.webkit.org/show_bug.cgi?id=186884

Reviewed by Carlos Garcia Campos.

Source/JavaScriptCore:

Add a tuple array input parameter to the StartAutomationSession DBus
message, representing a list of host-and-certificate pairs that have to
be allowed for a given session. This array is then unpacked and used to
fill out the certificates Vector object in the SessionCapabilities
struct.

* inspector/remote/RemoteInspector.h: Add a GLib-specific Vector of
String pairs representing hosts and the certificate file paths.
* inspector/remote/glib/RemoteInspectorServer.cpp:

Source/WebDriver:

Start handling the 'certificates' capability for the GTK+ port. This is
a list of host-certificate pairs that should be marked as allowed for a
given automation session. This object should be positioned inside the
'webkitgtk:browserOptions' dictionary in the capabilities JSON.

* Capabilities.h:
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::startAutomationSession): Include any
host-certificate pairs in the StartAutomationSession DBus message.
* gtk/WebDriverServiceGtk.cpp:
(WebDriver::WebDriverService::platformValidateCapability const):
Properly validate the 'certificates' value, if present.
(WebDriver::WebDriverService::platformParseCapabilities const):
Properly parse the 'certificates' value, if present, and extract the
host-certificate pairs.

Source/WebKit:

* UIProcess/API/glib/WebKitAutomationSession.cpp:
(webkitAutomationSessionCreate): Handle any host-certificate pair that's
been set for this session, creating a GTlsCertificate object through
loading from the specified certificate path and marking that certificate
as allowed for the specified host through the
webkit_web_context_allow_tls_certificate_for_host() API.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/remote/RemoteInspector.h
Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorServer.cpp
Source/WebDriver/Capabilities.h
Source/WebDriver/ChangeLog
Source/WebDriver/glib/SessionHostGlib.cpp
Source/WebDriver/gtk/WebDriverServiceGtk.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp