Changeset 220854 in webkit
- Timestamp:
- Aug 17, 2017, 6:13:32 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220829 r220854 1 2017-08-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK][WPE] Add NTLM authentication enabled API 4 https://bugs.webkit.org/show_bug.cgi?id=122952 5 6 Reviewed by Michael Catanzaro. 7 8 Add/remove NTLM feature to/from soup session depending on whether the feature is enabled or disabled. 9 10 * platform/network/soup/SoupNetworkSession.cpp: 11 (WebCore::SoupNetworkSession::SoupNetworkSession): 12 (WebCore::SoupNetworkSession::setInitialNTLMAuthenticationEnabled): 13 (WebCore::SoupNetworkSession::setNTLMAuthenticationEnabled): 14 * platform/network/soup/SoupNetworkSession.h: 15 1 16 2017-08-16 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
r219954 r220854 47 47 48 48 static bool gIgnoreTLSErrors; 49 static bool gInitialNTLMAuthenticationEnabled; 49 50 static CString gInitialAcceptLanguages; 50 51 static SoupNetworkProxySettings gProxySettings; … … 146 147 if (!gInitialAcceptLanguages.isNull()) 147 148 setAcceptLanguages(gInitialAcceptLanguages); 149 150 if (gInitialNTLMAuthenticationEnabled) 151 soup_session_add_feature_by_type(m_soupSession.get(), SOUP_TYPE_AUTH_NTLM); 148 152 149 153 #if SOUP_CHECK_VERSION(2, 53, 92) … … 324 328 } 325 329 330 void SoupNetworkSession::setInitialNTLMAuthenticationEnabled(bool enabled) 331 { 332 gInitialNTLMAuthenticationEnabled = enabled; 333 } 334 335 void SoupNetworkSession::setNTLMAuthenticationEnabled(bool enabled) 336 { 337 if (enabled) 338 soup_session_add_feature_by_type(m_soupSession.get(), SOUP_TYPE_AUTH_NTLM); 339 else 340 soup_session_remove_feature_by_type(m_soupSession.get(), SOUP_TYPE_AUTH_NTLM); 341 } 342 326 343 } // namespace WebCore 327 344 -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h
r218799 r220854 71 71 void setupCustomProtocols(); 72 72 73 static void setInitialNTLMAuthenticationEnabled(bool); 74 void setNTLMAuthenticationEnabled(bool); 75 73 76 private: 74 77 void setupLogger(); -
trunk/Source/WebKit/ChangeLog
r220821 r220854 1 2017-08-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK][WPE] Add NTLM authentication enabled API 4 https://bugs.webkit.org/show_bug.cgi?id=122952 5 6 Reviewed by Michael Catanzaro. 7 8 Add API to WebKitWebContext to enable/disable NTLM authentication. 9 10 * NetworkProcess/NetworkProcess.h: 11 * NetworkProcess/NetworkProcess.messages.in: 12 * NetworkProcess/NetworkProcessCreationParameters.cpp: 13 (WebKit::NetworkProcessCreationParameters::encode const): 14 (WebKit::NetworkProcessCreationParameters::decode): 15 * NetworkProcess/NetworkProcessCreationParameters.h: 16 * NetworkProcess/soup/NetworkProcessSoup.cpp: 17 (WebKit::NetworkProcess::platformInitializeNetworkProcess): 18 (WebKit::NetworkProcess::setNTLMAuthenticationEnabled): 19 * UIProcess/API/glib/WebKitWebContext.cpp: 20 (webkit_web_context_get_ntlm_authentication_enabled): 21 (webkit_web_context_set_ntlm_authentication_enabled): 22 * UIProcess/API/gtk/WebKitWebContext.h: 23 * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 24 * UIProcess/API/wpe/WebKitWebContext.h: 25 * UIProcess/WebProcessPool.h: 26 * UIProcess/soup/WebProcessPoolSoup.cpp: 27 (WebKit::WebProcessPool::setNTLMAuthenticationEnabled): 28 1 29 2017-08-16 Andy Estes <aestes@apple.com> 2 30 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r220267 r220854 211 211 void userPreferredLanguagesChanged(const Vector<String>&); 212 212 void setNetworkProxySettings(const WebCore::SoupNetworkProxySettings&); 213 void setNTLMAuthenticationEnabled(bool); 213 214 #endif 214 215 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r220105 r220854 32 32 UserPreferredLanguagesChanged(Vector<String> languages) 33 33 SetNetworkProxySettings(struct WebCore::SoupNetworkProxySettings settings) 34 SetNTLMAuthenticationEnabled(bool enabled) 34 35 #endif 35 36 -
trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp
r219050 r220854 91 91 encoder.encodeEnum(cookieAcceptPolicy); 92 92 encoder << ignoreTLSErrors; 93 encoder << ntlmAuthenticationEnabled; 93 94 encoder << languages; 94 95 encoder << proxySettings; … … 189 190 if (!decoder.decode(result.ignoreTLSErrors)) 190 191 return false; 192 if (!decoder.decode(result.ntlmAuthenticationEnabled)) 193 return false; 191 194 if (!decoder.decode(result.languages)) 192 195 return false; -
trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
r219050 r220854 103 103 HTTPCookieAcceptPolicy cookieAcceptPolicy { HTTPCookieAcceptPolicyAlways }; 104 104 bool ignoreTLSErrors { false }; 105 bool ntlmAuthenticationEnabled { false }; 105 106 Vector<String> languages; 106 107 WebCore::SoupNetworkProxySettings proxySettings; -
trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
r220267 r220854 133 133 134 134 setIgnoreTLSErrors(parameters.ignoreTLSErrors); 135 setNTLMAuthenticationEnabled(parameters.ntlmAuthenticationEnabled); 135 136 } 136 137 … … 147 148 { 148 149 SoupNetworkSession::allowSpecificHTTPSCertificateForHost(certificateInfo, host); 150 } 151 152 void NetworkProcess::setNTLMAuthenticationEnabled(bool enabled) 153 { 154 SoupNetworkSession::setInitialNTLMAuthenticationEnabled(enabled); 155 NetworkStorageSession::forEach([enabled](const NetworkStorageSession& session) { 156 if (auto* soupSession = session.soupNetworkSession()) 157 soupSession->setNTLMAuthenticationEnabled(enabled); 158 }); 149 159 } 150 160 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
r220387 r220854 1547 1547 } 1548 1548 1549 /** 1550 * webkit_web_context_get_ntlm_authentication_enabled: 1551 * @context: a #WebKitWebContext 1552 * 1553 * Get whether NTLM authentication is currently enabled. By default, the feature 1554 * is disabled, and you need to call webkit_web_context_set_ntlm_authentication_enabled() 1555 * to enable it. 1556 * 1557 * Returns: %TRUE if NTLM authentication is enabled, or %FALSE otherwise. 1558 * 1559 * Since: 2.18 1560 */ 1561 gboolean webkit_web_context_get_ntlm_authentication_enabled(WebKitWebContext* context) 1562 { 1563 g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), FALSE); 1564 1565 return context->priv->processPool->ntlmAuthenticationEnabled(); 1566 } 1567 1568 /** 1569 * webkit_web_context_set_ntlm_authentication_enabled: 1570 * @context: a #WebKitWebContext 1571 * @enabled: Value to be set 1572 * 1573 * Enable or disable NTLM authentication. 1574 * 1575 * Since: 2.18 1576 */ 1577 void webkit_web_context_set_ntlm_authentication_enabled(WebKitWebContext* context, gboolean enabled) 1578 { 1579 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 1580 1581 return context->priv->processPool->setNTLMAuthenticationEnabled(enabled); 1582 } 1583 1549 1584 void webkitWebContextInitializeNotificationPermissions(WebKitWebContext* context) 1550 1585 { -
trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h
r216006 r220854 307 307 GList *disallowed_origins); 308 308 309 WEBKIT_API gboolean 310 webkit_web_context_get_ntlm_authentication_enabled (WebKitWebContext *context); 311 312 WEBKIT_API void 313 webkit_web_context_set_ntlm_authentication_enabled (WebKitWebContext *context, 314 gboolean enabled); 315 309 316 G_END_DECLS 310 317 -
trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt
r220329 r220854 67 67 webkit_web_context_set_process_model 68 68 webkit_web_context_initialize_notification_permissions 69 webkit_web_context_get_ntlm_authentication_enabled 70 webkit_web_context_set_ntlm_authentication_enabled 69 71 70 72 <SUBSECTION URI Scheme> -
trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h
r218553 r220854 307 307 GList *disallowed_origins); 308 308 309 WEBKIT_API gboolean 310 webkit_web_context_get_ntlm_authentication_enabled (WebKitWebContext *context); 311 312 WEBKIT_API void 313 webkit_web_context_set_ntlm_authentication_enabled (WebKitWebContext *context, 314 gboolean enabled); 315 309 316 G_END_DECLS 310 317 -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r220412 r220854 227 227 228 228 #if USE(SOUP) 229 void setIgnoreTLSErrors(bool); 230 bool ignoreTLSErrors() const { return m_ignoreTLSErrors; } 229 231 void setInitialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) { m_initialHTTPCookieAcceptPolicy = policy; } 230 232 void setNetworkProxySettings(const WebCore::SoupNetworkProxySettings&); 233 void setNTLMAuthenticationEnabled(bool); 234 bool ntlmAuthenticationEnabled() const { return m_ntlmAuthenticationEnabled; } 231 235 #endif 232 236 void setEnhancedAccessibility(bool); … … 326 330 static void willStartUsingPrivateBrowsing(); 327 331 static void willStopUsingPrivateBrowsing(); 328 329 #if USE(SOUP)330 void setIgnoreTLSErrors(bool);331 bool ignoreTLSErrors() const { return m_ignoreTLSErrors; }332 #endif333 332 334 333 static void setInvalidMessageCallback(void (*)(WKStringRef)); … … 528 527 HTTPCookieAcceptPolicy m_initialHTTPCookieAcceptPolicy { HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain }; 529 528 WebCore::SoupNetworkProxySettings m_networkProxySettings; 529 bool m_ignoreTLSErrors { true }; 530 bool m_ntlmAuthenticationEnabled { false }; 530 531 #endif 531 532 HashSet<String, ASCIICaseInsensitiveHash> m_urlSchemesRegisteredForCustomProtocols; … … 555 556 HashMap<uint64_t, RefPtr<DictionaryCallback>> m_dictionaryCallbacks; 556 557 HashMap<uint64_t, RefPtr<StatisticsRequest>> m_statisticsRequests; 557 558 #if USE(SOUP)559 bool m_ignoreTLSErrors { true };560 #endif561 558 562 559 bool m_memoryCacheDisabled; -
trunk/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp
r213927 r220854 62 62 } 63 63 64 void WebProcessPool::setNTLMAuthenticationEnabled(bool enabled) 65 { 66 if (m_ntlmAuthenticationEnabled == enabled) 67 return; 68 69 m_ntlmAuthenticationEnabled = enabled; 70 if (m_networkProcess) 71 m_networkProcess->send(Messages::NetworkProcess::SetNTLMAuthenticationEnabled(m_ntlmAuthenticationEnabled), 0); 64 72 } 73 74 } -
trunk/Tools/ChangeLog
r220809 r220854 1 2017-08-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK][WPE] Add NTLM authentication enabled API 4 https://bugs.webkit.org/show_bug.cgi?id=122952 5 6 Reviewed by Michael Catanzaro. 7 8 Add a test case to check we can enable/disable NTLM. 9 10 * TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp: 11 (testWebViewAuthenticationNTLM): 12 (beforeAll): 13 1 14 2017-08-16 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp
r220583 r220854 251 251 g_assert_cmpint(test->m_loadEvents[2], ==, LoadTrackingTest::LoadFinished); 252 252 g_assert_cmpstr(webkit_web_view_get_title(test->m_webView), ==, authExpectedSuccessTitle); 253 } 254 255 static void testWebViewAuthenticationNTLM(AuthenticationTest* test, gconstpointer) 256 { 257 // NTML is disabled by default. 258 g_assert(!webkit_web_context_get_ntlm_authentication_enabled(test->m_webContext.get())); 259 webkit_web_context_set_ntlm_authentication_enabled(test->m_webContext.get(), TRUE); 260 g_assert(webkit_web_context_get_ntlm_authentication_enabled(test->m_webContext.get())); 261 262 // FIXME: can we test NTLM authentication? 253 263 } 254 264 … … 419 429 AuthenticationTest::add("WebKitWebView", "authentication-storage", testWebViewAuthenticationStorage); 420 430 AuthenticationTest::add("WebKitWebView", "authentication-empty-realm", testWebViewAuthenticationEmptyRealm); 431 AuthenticationTest::add("WebKitWebView", "authentication-ntlm", testWebViewAuthenticationNTLM); 421 432 ProxyAuthenticationTest::add("WebKitWebView", "authentication-proxy", testWebViewAuthenticationProxy); 422 433 ProxyAuthenticationTest::add("WebKitWebView", "authentication-proxy-https", testWebViewAuthenticationProxyHTTPS);
Note:
See TracChangeset
for help on using the changeset viewer.