Changeset 263645 in webkit
- Timestamp:
- Jun 29, 2020 12:39:36 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r263644 r263645 1 2020-06-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK][WPE] Add webkit_authentication_request_get_security_origin 4 https://bugs.webkit.org/show_bug.cgi?id=213596 5 6 Reviewed by Michael Catanzaro. 7 8 Returns the security origin for the authentication protection space. 9 10 * UIProcess/API/glib/WebKitAuthenticationRequest.cpp: 11 (webkit_authentication_request_get_security_origin): 12 * UIProcess/API/gtk/WebKitAuthenticationRequest.h: 13 * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 14 * UIProcess/API/wpe/WebKitAuthenticationRequest.h: 15 * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: 16 1 17 2020-06-29 Alexander Mikhaylenko <alexm@gnome.org> 2 18 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitAuthenticationRequest.cpp
r263444 r263645 26 26 #include "WebKitAuthenticationRequestPrivate.h" 27 27 #include "WebKitCredentialPrivate.h" 28 #include "WebKitSecurityOriginPrivate.h" 28 29 #include "WebProtectionSpace.h" 29 30 #include <WebCore/AuthenticationChallenge.h> … … 330 331 331 332 /** 333 * webkit_authentication_request_get_security_origin: 334 * @request: a #WebKitAuthenticationRequest 335 * 336 * Get the #WebKitSecurityOrigin that this authentication challenge is applicable to. 337 * 338 * Returns: (transfer full): a newly created #WebKitSecurityOrigin. 339 * 340 * Since: 2.30 341 */ 342 WebKitSecurityOrigin* webkit_authentication_request_get_security_origin(WebKitAuthenticationRequest* request) 343 { 344 g_return_val_if_fail(WEBKIT_IS_AUTHENTICATION_REQUEST(request), nullptr); 345 346 const auto& protectionSpace = request->priv->authenticationChallenge->core().protectionSpace(); 347 String protocol; 348 switch (protectionSpace.serverType()) { 349 case ProtectionSpaceServerHTTP: 350 case ProtectionSpaceProxyHTTP: 351 protocol = "http"_s; 352 break; 353 case ProtectionSpaceServerHTTPS: 354 case ProtectionSpaceProxyHTTPS: 355 protocol = "https"_s; 356 break; 357 case ProtectionSpaceServerFTP: 358 case ProtectionSpaceProxyFTP: 359 protocol = "ftp"_s; 360 break; 361 case ProtectionSpaceServerFTPS: 362 protocol = "ftps"_s; 363 break; 364 case ProtectionSpaceProxySOCKS: 365 protocol = "socks"_s; 366 break; 367 } 368 return webkitSecurityOriginCreate(SecurityOrigin::create(protocol, protectionSpace.host(), protectionSpace.port())); 369 } 370 371 /** 332 372 * webkit_authentication_request_get_realm: 333 373 * @request: a #WebKitAuthenticationRequest -
trunk/Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationRequest.h
r263444 r263645 28 28 #include <webkit2/WebKitCredential.h> 29 29 #include <webkit2/WebKitDefines.h> 30 #include <webkit2/WebKitSecurityOrigin.h> 30 31 31 32 G_BEGIN_DECLS … … 110 111 webkit_authentication_request_get_port (WebKitAuthenticationRequest *request); 111 112 113 WEBKIT_API WebKitSecurityOrigin * 114 webkit_authentication_request_get_security_origin (WebKitAuthenticationRequest *request); 115 112 116 WEBKIT_API const gchar * 113 117 webkit_authentication_request_get_realm (WebKitAuthenticationRequest *request); -
trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt
r263444 r263645 349 349 webkit_authentication_request_get_host 350 350 webkit_authentication_request_get_port 351 webkit_authentication_request_get_security_origin 351 352 webkit_authentication_request_is_retry 352 353 webkit_authentication_request_get_proposed_credential -
trunk/Source/WebKit/UIProcess/API/wpe/WebKitAuthenticationRequest.h
r263444 r263645 27 27 #include <wpe/WebKitCredential.h> 28 28 #include <wpe/WebKitDefines.h> 29 #include <wpe/WebKitSecurityOrigin.h> 29 30 30 31 G_BEGIN_DECLS … … 109 110 webkit_authentication_request_get_port (WebKitAuthenticationRequest *request); 110 111 112 WEBKIT_API WebKitSecurityOrigin * 113 webkit_authentication_request_get_security_origin (WebKitAuthenticationRequest *request); 114 111 115 WEBKIT_API const gchar * 112 116 webkit_authentication_request_get_realm (WebKitAuthenticationRequest *request); -
trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt
r263444 r263645 352 352 webkit_authentication_request_get_host 353 353 webkit_authentication_request_get_port 354 webkit_authentication_request_get_security_origin 354 355 webkit_authentication_request_is_retry 355 356 webkit_authentication_request_get_proposed_credential -
trunk/Tools/ChangeLog
r263635 r263645 1 2020-06-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK][WPE] Add webkit_authentication_request_get_security_origin 4 https://bugs.webkit.org/show_bug.cgi?id=213596 5 6 Reviewed by Michael Catanzaro. 7 8 Update the unit tests to check the new API. 9 10 * TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp: 11 (testWebViewAuthenticationRequest): 12 (testWebViewAuthenticationProxy): 13 (testWebViewAuthenticationProxyHTTPS): 14 1 15 2020-06-28 Geoffrey Garen <ggaren@apple.com> 2 16 -
trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp
r263444 r263645 135 135 g_assert_false(webkit_authentication_request_is_for_proxy(request)); 136 136 g_assert_false(webkit_authentication_request_is_retry(request)); 137 auto* origin = webkit_authentication_request_get_security_origin(request); 138 g_assert_nonnull(origin); 139 g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, soup_uri_get_scheme(kServer->baseURI())); 140 g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, soup_uri_get_host(kServer->baseURI())); 141 g_assert_cmpuint(webkit_security_origin_get_port(origin), ==, soup_uri_get_port(kServer->baseURI())); 142 webkit_security_origin_unref(origin); 137 143 } 138 144 … … 463 469 g_assert_true(webkit_authentication_request_is_for_proxy(request)); 464 470 g_assert_false(webkit_authentication_request_is_retry(request)); 471 auto* origin = webkit_authentication_request_get_security_origin(request); 472 g_assert_nonnull(origin); 473 g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, soup_uri_get_scheme(kServer->baseURI())); 474 g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, soup_uri_get_host(kServer->baseURI())); 475 g_assert_cmpuint(webkit_security_origin_get_port(origin), ==, soup_uri_get_port(kServer->baseURI())); 476 webkit_security_origin_unref(origin); 465 477 } 466 478 … … 479 491 g_assert_true(webkit_authentication_request_is_for_proxy(request)); 480 492 g_assert_false(webkit_authentication_request_is_retry(request)); 493 auto* origin = webkit_authentication_request_get_security_origin(request); 494 g_assert_nonnull(origin); 495 g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, soup_uri_get_scheme(httpsServer->baseURI())); 496 g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, soup_uri_get_host(httpsServer->baseURI())); 497 g_assert_cmpuint(webkit_security_origin_get_port(origin), ==, soup_uri_get_port(httpsServer->baseURI())); 498 webkit_security_origin_unref(origin); 481 499 } 482 500
Note: See TracChangeset
for help on using the changeset viewer.