Skip to content

Commit

Permalink
Merge r220903 - Unreviewed, rolling out r220854.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=175716

I'm not sure we really need this (Requested by KaL on

Reverted changeset:

"[GTK][WPE] Add NTLM authentication enabled API"
https://bugs.webkit.org/show_bug.cgi?id=122952
http://trac.webkit.org/changeset/220854
  • Loading branch information
webkit-commit-queue authored and carlosgcampos committed Aug 18, 2017
1 parent d41591c commit b754a98
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 114 deletions.
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
2017-08-18 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r220854.
https://bugs.webkit.org/show_bug.cgi?id=175716

I'm not sure we really need this (Requested by KaL on
#webkit).

Reverted changeset:

"[GTK][WPE] Add NTLM authentication enabled API"
https://bugs.webkit.org/show_bug.cgi?id=122952
http://trac.webkit.org/changeset/220854

2017-08-17 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK][WPE] Add NTLM authentication enabled API
Expand Down
17 changes: 0 additions & 17 deletions Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
Expand Up @@ -46,7 +46,6 @@
namespace WebCore {

static bool gIgnoreTLSErrors;
static bool gInitialNTLMAuthenticationEnabled;
static CString gInitialAcceptLanguages;
static SoupNetworkProxySettings gProxySettings;
static GType gCustomProtocolRequestType;
Expand Down Expand Up @@ -147,9 +146,6 @@ SoupNetworkSession::SoupNetworkSession(SoupCookieJar* cookieJar)
if (!gInitialAcceptLanguages.isNull())
setAcceptLanguages(gInitialAcceptLanguages);

if (gInitialNTLMAuthenticationEnabled)
soup_session_add_feature_by_type(m_soupSession.get(), SOUP_TYPE_AUTH_NTLM);

#if SOUP_CHECK_VERSION(2, 53, 92)
if (soup_auth_negotiate_supported()) {
g_object_set(m_soupSession.get(),
Expand Down Expand Up @@ -327,19 +323,6 @@ void SoupNetworkSession::allowSpecificHTTPSCertificateForHost(const CertificateI
clientCertificates().add(host, HostTLSCertificateSet()).iterator->value.add(certificateInfo.certificate());
}

void SoupNetworkSession::setInitialNTLMAuthenticationEnabled(bool enabled)
{
gInitialNTLMAuthenticationEnabled = enabled;
}

void SoupNetworkSession::setNTLMAuthenticationEnabled(bool enabled)
{
if (enabled)
soup_session_add_feature_by_type(m_soupSession.get(), SOUP_TYPE_AUTH_NTLM);
else
soup_session_remove_feature_by_type(m_soupSession.get(), SOUP_TYPE_AUTH_NTLM);
}

} // namespace WebCore

#endif
3 changes: 0 additions & 3 deletions Source/WebCore/platform/network/soup/SoupNetworkSession.h
Expand Up @@ -70,9 +70,6 @@ class SoupNetworkSession {
static void setCustomProtocolRequestType(GType);
void setupCustomProtocols();

static void setInitialNTLMAuthenticationEnabled(bool);
void setNTLMAuthenticationEnabled(bool);

private:
void setupLogger();

Expand Down
14 changes: 14 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,17 @@
2017-08-18 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r220854.
https://bugs.webkit.org/show_bug.cgi?id=175716

I'm not sure we really need this (Requested by KaL on
#webkit).

Reverted changeset:

"[GTK][WPE] Add NTLM authentication enabled API"
https://bugs.webkit.org/show_bug.cgi?id=122952
http://trac.webkit.org/changeset/220854

2017-08-17 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK][WPE] Add NTLM authentication enabled API
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/NetworkProcess/NetworkProcess.h
Expand Up @@ -210,7 +210,6 @@ class NetworkProcess : public ChildProcess, private DownloadManager::Client {
void setIgnoreTLSErrors(bool);
void userPreferredLanguagesChanged(const Vector<String>&);
void setNetworkProxySettings(const WebCore::SoupNetworkProxySettings&);
void setNTLMAuthenticationEnabled(bool);
#endif

// Platform Helpers
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/NetworkProcess/NetworkProcess.messages.in
Expand Up @@ -31,7 +31,6 @@ messages -> NetworkProcess LegacyReceiver {
SetIgnoreTLSErrors(bool ignoreTLSErrors)
UserPreferredLanguagesChanged(Vector<String> languages)
SetNetworkProxySettings(struct WebCore::SoupNetworkProxySettings settings)
SetNTLMAuthenticationEnabled(bool enabled)
#endif

ClearCachedCredentials()
Expand Down
Expand Up @@ -90,7 +90,6 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const
encoder << cookiePersistentStorageType;
encoder.encodeEnum(cookieAcceptPolicy);
encoder << ignoreTLSErrors;
encoder << ntlmAuthenticationEnabled;
encoder << languages;
encoder << proxySettings;
#endif
Expand Down Expand Up @@ -189,8 +188,6 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc
return false;
if (!decoder.decode(result.ignoreTLSErrors))
return false;
if (!decoder.decode(result.ntlmAuthenticationEnabled))
return false;
if (!decoder.decode(result.languages))
return false;
if (!decoder.decode(result.proxySettings))
Expand Down
Expand Up @@ -102,7 +102,6 @@ struct NetworkProcessCreationParameters {
uint32_t cookiePersistentStorageType { 0 };
HTTPCookieAcceptPolicy cookieAcceptPolicy { HTTPCookieAcceptPolicyAlways };
bool ignoreTLSErrors { false };
bool ntlmAuthenticationEnabled { false };
Vector<String> languages;
WebCore::SoupNetworkProxySettings proxySettings;
#endif
Expand Down
10 changes: 0 additions & 10 deletions Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
Expand Up @@ -132,7 +132,6 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati
userPreferredLanguagesChanged(parameters.languages);

setIgnoreTLSErrors(parameters.ignoreTLSErrors);
setNTLMAuthenticationEnabled(parameters.ntlmAuthenticationEnabled);
}

void NetworkProcess::platformSetURLCacheSize(unsigned, uint64_t)
Expand All @@ -149,15 +148,6 @@ void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo&
SoupNetworkSession::allowSpecificHTTPSCertificateForHost(certificateInfo, host);
}

void NetworkProcess::setNTLMAuthenticationEnabled(bool enabled)
{
SoupNetworkSession::setInitialNTLMAuthenticationEnabled(enabled);
NetworkStorageSession::forEach([enabled](const NetworkStorageSession& session) {
if (auto* soupSession = session.soupNetworkSession())
soupSession->setNTLMAuthenticationEnabled(enabled);
});
}

void NetworkProcess::clearCacheForAllOrigins(uint32_t cachesToClear)
{
if (cachesToClear == InMemoryResourceCachesOnly)
Expand Down
35 changes: 0 additions & 35 deletions Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Expand Up @@ -1546,41 +1546,6 @@ void webkit_web_context_initialize_notification_permissions(WebKitWebContext* co
context->priv->notificationProvider->setNotificationPermissions(WTFMove(map));
}

/**
* webkit_web_context_get_ntlm_authentication_enabled:
* @context: a #WebKitWebContext
*
* Get whether NTLM authentication is currently enabled. By default, the feature
* is disabled, and you need to call webkit_web_context_set_ntlm_authentication_enabled()
* to enable it.
*
* Returns: %TRUE if NTLM authentication is enabled, or %FALSE otherwise.
*
* Since: 2.18
*/
gboolean webkit_web_context_get_ntlm_authentication_enabled(WebKitWebContext* context)
{
g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), FALSE);

return context->priv->processPool->ntlmAuthenticationEnabled();
}

/**
* webkit_web_context_set_ntlm_authentication_enabled:
* @context: a #WebKitWebContext
* @enabled: Value to be set
*
* Enable or disable NTLM authentication.
*
* Since: 2.18
*/
void webkit_web_context_set_ntlm_authentication_enabled(WebKitWebContext* context, gboolean enabled)
{
g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));

return context->priv->processPool->setNTLMAuthenticationEnabled(enabled);
}

void webkitWebContextInitializeNotificationPermissions(WebKitWebContext* context)
{
g_signal_emit(context, signals[INITIALIZE_NOTIFICATION_PERMISSIONS], 0);
Expand Down
7 changes: 0 additions & 7 deletions Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h
Expand Up @@ -306,13 +306,6 @@ webkit_web_context_initialize_notification_permissions
GList *allowed_origins,
GList *disallowed_origins);

WEBKIT_API gboolean
webkit_web_context_get_ntlm_authentication_enabled (WebKitWebContext *context);

WEBKIT_API void
webkit_web_context_set_ntlm_authentication_enabled (WebKitWebContext *context,
gboolean enabled);

G_END_DECLS

#endif
Expand Up @@ -66,8 +66,6 @@ webkit_web_context_allow_tls_certificate_for_host
webkit_web_context_get_process_model
webkit_web_context_set_process_model
webkit_web_context_initialize_notification_permissions
webkit_web_context_get_ntlm_authentication_enabled
webkit_web_context_set_ntlm_authentication_enabled

<SUBSECTION URI Scheme>
WebKitURISchemeRequestCallback
Expand Down
7 changes: 0 additions & 7 deletions Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h
Expand Up @@ -306,13 +306,6 @@ webkit_web_context_initialize_notification_permissions
GList *allowed_origins,
GList *disallowed_origins);

WEBKIT_API gboolean
webkit_web_context_get_ntlm_authentication_enabled (WebKitWebContext *context);

WEBKIT_API void
webkit_web_context_set_ntlm_authentication_enabled (WebKitWebContext *context,
gboolean enabled);

G_END_DECLS

#endif
15 changes: 9 additions & 6 deletions Source/WebKit/UIProcess/WebProcessPool.h
Expand Up @@ -226,12 +226,8 @@ class WebProcessPool final : public API::ObjectImpl<API::Object::Type::ProcessPo
void stopMemorySampler();

#if USE(SOUP)
void setIgnoreTLSErrors(bool);
bool ignoreTLSErrors() const { return m_ignoreTLSErrors; }
void setInitialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) { m_initialHTTPCookieAcceptPolicy = policy; }
void setNetworkProxySettings(const WebCore::SoupNetworkProxySettings&);
void setNTLMAuthenticationEnabled(bool);
bool ntlmAuthenticationEnabled() const { return m_ntlmAuthenticationEnabled; }
#endif
void setEnhancedAccessibility(bool);

Expand Down Expand Up @@ -330,6 +326,11 @@ class WebProcessPool final : public API::ObjectImpl<API::Object::Type::ProcessPo
static void willStartUsingPrivateBrowsing();
static void willStopUsingPrivateBrowsing();

#if USE(SOUP)
void setIgnoreTLSErrors(bool);
bool ignoreTLSErrors() const { return m_ignoreTLSErrors; }
#endif

static void setInvalidMessageCallback(void (*)(WKStringRef));
static void didReceiveInvalidMessage(const IPC::StringReference& messageReceiverName, const IPC::StringReference& messageName);

Expand Down Expand Up @@ -526,8 +527,6 @@ class WebProcessPool final : public API::ObjectImpl<API::Object::Type::ProcessPo
#if USE(SOUP)
HTTPCookieAcceptPolicy m_initialHTTPCookieAcceptPolicy { HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain };
WebCore::SoupNetworkProxySettings m_networkProxySettings;
bool m_ignoreTLSErrors { true };
bool m_ntlmAuthenticationEnabled { false };
#endif
HashSet<String, ASCIICaseInsensitiveHash> m_urlSchemesRegisteredForCustomProtocols;

Expand Down Expand Up @@ -556,6 +555,10 @@ class WebProcessPool final : public API::ObjectImpl<API::Object::Type::ProcessPo
HashMap<uint64_t, RefPtr<DictionaryCallback>> m_dictionaryCallbacks;
HashMap<uint64_t, RefPtr<StatisticsRequest>> m_statisticsRequests;

#if USE(SOUP)
bool m_ignoreTLSErrors { true };
#endif

bool m_memoryCacheDisabled;
bool m_resourceLoadStatisticsEnabled { false };
bool m_javaScriptConfigurationFileEnabled { false };
Expand Down
10 changes: 0 additions & 10 deletions Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp
Expand Up @@ -61,14 +61,4 @@ void WebProcessPool::setNetworkProxySettings(const WebCore::SoupNetworkProxySett
m_networkProcess->send(Messages::NetworkProcess::SetNetworkProxySettings(m_networkProxySettings), 0);
}

void WebProcessPool::setNTLMAuthenticationEnabled(bool enabled)
{
if (m_ntlmAuthenticationEnabled == enabled)
return;

m_ntlmAuthenticationEnabled = enabled;
if (m_networkProcess)
m_networkProcess->send(Messages::NetworkProcess::SetNTLMAuthenticationEnabled(m_ntlmAuthenticationEnabled), 0);
}

}
14 changes: 14 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,17 @@
2017-08-18 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r220854.
https://bugs.webkit.org/show_bug.cgi?id=175716

I'm not sure we really need this (Requested by KaL on
#webkit).

Reverted changeset:

"[GTK][WPE] Add NTLM authentication enabled API"
https://bugs.webkit.org/show_bug.cgi?id=122952
http://trac.webkit.org/changeset/220854

2017-08-17 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK][WPE] Add NTLM authentication enabled API
Expand Down
11 changes: 0 additions & 11 deletions Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp
Expand Up @@ -252,16 +252,6 @@ static void testWebViewAuthenticationEmptyRealm(AuthenticationTest* test, gconst
g_assert_cmpstr(webkit_web_view_get_title(test->m_webView), ==, authExpectedSuccessTitle);
}

static void testWebViewAuthenticationNTLM(AuthenticationTest* test, gconstpointer)
{
// NTML is disabled by default.
g_assert(!webkit_web_context_get_ntlm_authentication_enabled(test->m_webContext.get()));
webkit_web_context_set_ntlm_authentication_enabled(test->m_webContext.get(), TRUE);
g_assert(webkit_web_context_get_ntlm_authentication_enabled(test->m_webContext.get()));

// FIXME: can we test NTLM authentication?
}

class Tunnel {
public:
Tunnel(SoupServer* server, SoupMessage* message)
Expand Down Expand Up @@ -428,7 +418,6 @@ void beforeAll()
AuthenticationTest::add("WebKitWebView", "authentication-no-credential", testWebViewAuthenticationNoCredential);
AuthenticationTest::add("WebKitWebView", "authentication-storage", testWebViewAuthenticationStorage);
AuthenticationTest::add("WebKitWebView", "authentication-empty-realm", testWebViewAuthenticationEmptyRealm);
AuthenticationTest::add("WebKitWebView", "authentication-ntlm", testWebViewAuthenticationNTLM);
ProxyAuthenticationTest::add("WebKitWebView", "authentication-proxy", testWebViewAuthenticationProxy);
ProxyAuthenticationTest::add("WebKitWebView", "authentication-proxy-https", testWebViewAuthenticationProxyHTTPS);
}
Expand Down

0 comments on commit b754a98

Please sign in to comment.