Changeset 252248 in webkit


Ignore:
Timestamp:
Nov 8, 2019 11:44:34 AM (4 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] Return NotAllowedError immediately for UI cancellations
https://bugs.webkit.org/show_bug.cgi?id=203937
<rdar://problem/56962420>

Reviewed by Brent Fulgham.

Source/WebKit:

NotAllowedError representing UI cancellations should be returned to sites
immediately such that sites could show appropriate error page immediately.

Covered by existing tests.

  • UIProcess/WebAuthentication/AuthenticatorManager.cpp:

(WebKit::AuthenticatorManager::cancelRequest):
(WebKit::AuthenticatorManager::clearState):
(WebKit::AuthenticatorManager::resetState): Deleted.

  • UIProcess/WebAuthentication/AuthenticatorManager.h:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r252234 r252248  
     12019-11-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Return NotAllowedError immediately for UI cancellations
     4        https://bugs.webkit.org/show_bug.cgi?id=203937
     5        <rdar://problem/56962420>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        NotAllowedError representing UI cancellations should be returned to sites
     10        immediately such that sites could show appropriate error page immediately.
     11
     12        Covered by existing tests.
     13
     14        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
     15        (WebKit::AuthenticatorManager::cancelRequest):
     16        (WebKit::AuthenticatorManager::clearState):
     17        (WebKit::AuthenticatorManager::resetState): Deleted.
     18        * UIProcess/WebAuthentication/AuthenticatorManager.h:
     19
    1202019-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
    221
  • trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp

    r252035 r252248  
    199199    if (!m_pendingCompletionHandler || m_pendingRequestData.panel.get() != &panel)
    200200        return;
    201     resetState();
     201    invokePendingCompletionHandler(ExceptionData { NotAllowedError, "This request has been cancelled by the user."_s });
     202    clearState();
     203    m_requestTimeOutTimer.stop();
    202204}
    203205
     
    215217    if (m_pendingCompletionHandler)
    216218        return;
    217     resetState();
     219    m_authenticators.clear();
     220    m_services.clear();
     221    m_pendingRequestData = { };
    218222}
    219223
     
    355359}
    356360
    357 void AuthenticatorManager::resetState()
    358 {
    359     m_authenticators.clear();
    360     m_services.clear();
    361     m_pendingRequestData = { };
    362 }
    363 
    364361void AuthenticatorManager::restartDiscovery()
    365362{
  • trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h

    r251762 r252248  
    9393    void timeOutTimerFired();
    9494    void runPanel();
    95     void resetState();
    9695    void restartDiscovery();
    9796    TransportSet getTransports() const;
  • trunk/Tools/ChangeLog

    r252244 r252248  
     12019-11-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Return NotAllowedError immediately for UI cancellations
     4        https://bugs.webkit.org/show_bug.cgi?id=203937
     5        <rdar://problem/56962420>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
     10        (TestWebKitAPI::TEST):
     11
    1122019-11-08  Aakash Jain  <aakash_jain@apple.com>
    213
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm

    r252035 r252248  
    559559    Util::run(&webAuthenticationPanelRan);
    560560    [[delegate panel] cancel];
    561     [webView waitForMessage:@"Operation timed out."];
    562     EXPECT_FALSE(webAuthenticationPanelFailed);
    563     EXPECT_FALSE(webAuthenticationPanelSucceded);
     561    [webView waitForMessage:@"This request has been cancelled by the user."];
     562    EXPECT_TRUE(webAuthenticationPanelFailed);
    564563}
    565564
Note: See TracChangeset for help on using the changeset viewer.