[GTK][WPE] Add API to allow applications to handle the HTTP authentication credential...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jun 2020 07:55:19 +0000 (07:55 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jun 2020 07:55:19 +0000 (07:55 +0000)
commitc81925b2820475c58933f456a176efd1f2e443a9
tree06bf41603479827e6d05d6ee2f667df780eb15eb
parentd0f8bbc5b3d3850fbf3c309cda8bc17e27c1841e
[GTK][WPE] Add API to allow applications to handle the HTTP authentication credential storage
https://bugs.webkit.org/show_bug.cgi?id=213177

Reviewed by Michael Catanzaro.

Source/WebKit:

Add API to disable the internal credential storage support when building with libsecret. And add new API to
WebKitAuthenticationRequest to allow applications to use their own credentials storage:

* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::persistentCredentialStorageEnabled const):
(WebKit::NetworkDataTaskSoup::authenticate):
(WebKit::NetworkDataTaskSoup::continueAuthenticate):
(WebKit::NetworkDataTaskSoup::didGetHeaders):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::setPersistentCredentialStorageEnabled):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
* NetworkProcess/soup/NetworkSessionSoup.h:
* UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
(webkitAuthenticationRequestDispose):
(webkit_authentication_request_class_init):
(webkitAuthenticationRequestCreate):
(webkitAuthenticationRequestDidAuthenticate):
(webkitAuthenticationRequestGetProposedCredential):
(webkit_authentication_request_can_save_credentials):
(webkit_authentication_request_set_can_save_credentials):
(webkit_authentication_request_get_proposed_credential):
(webkit_authentication_request_set_proposed_credential):
(webkit_authentication_request_authenticate):
(webkit_authentication_request_cancel):
* UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewCompleteAuthenticationRequest):
(webkitWebViewLoadChanged):
(webkitWebViewLoadFailed):
(webkitWebViewLoadFailedWithTLSErrors):
(webkitWebViewHandleAuthenticationChallenge):
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(webkit_website_data_manager_set_persistent_credential_storage_enabled):
(webkit_website_data_manager_get_persistent_credential_storage_enabled):
* UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
(webkitAuthenticationDialogInitialize):
* UIProcess/API/gtk/WebKitAuthenticationRequest.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitAuthenticationRequest.h:
* UIProcess/API/wpe/WebKitWebsiteDataManager.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::persistentCredentialStorageEnabled const):
* UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
(WebKit::WebsiteDataStore::setPersistentCredentialStorageEnabled):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

Tools:

Update the authentication tests to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp:
(testWebViewAuthenticationCancel):
(testWebViewAuthenticationLoadCancelled):
(testWebViewAuthenticationFailure):
(testWebViewAuthenticationNoCredential):
(testWebViewAuthenticationEphemeral):
(testWebViewAuthenticationStorage):
(testWebViewAuthenticationSuccess):
(testWebViewAuthenticationEmptyRealm):
(serverCallback):
(beforeAll):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/NetworkProcess.messages.in
Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp
Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h
Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.h
Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp
Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.h
Source/WebKit/UIProcess/API/glib/WebKitAuthenticationRequest.cpp
Source/WebKit/UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h
Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataManager.cpp
Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationRequest.h
Source/WebKit/UIProcess/API/gtk/WebKitWebsiteDataManager.h
Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt
Source/WebKit/UIProcess/API/wpe/WebKitAuthenticationRequest.h
Source/WebKit/UIProcess/API/wpe/WebKitWebsiteDataManager.h
Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
Source/WebKit/UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp
Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp