Changeset 285864 in webkit
- Timestamp:
- Nov 16, 2021, 8:47:40 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm (modified) (1 diff)
-
UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp (modified) (4 diffs)
-
UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r285856 r285864 1 2021-11-16 J Pascoe <j_pascoe@apple.com> 2 3 [WebAuthn] WebKitTestRunner/TWAPI lacks an entitlement and bundle identifier to use required [ASCAgent performAuthorizationRequestsForContext] 4 https://bugs.webkit.org/show_bug.cgi?id=232846 5 rdar://problem/85170633 6 7 Reviewed by Brent Fulgham. 8 9 Covered by existing tests. 10 11 Calling to ASC requires converting WebAuthenticationRequestData to ASCCredentialRequestContext and then making 12 a call to _WKAuthenticatorAssertionResponse, while also requiring entitlements currently unavailable in OpenSource. 13 This change avoids calling out to ASC in tests using mock / virtual authenticators to avoid this problem, the 14 serialization to and from ASCAgent can be tested seperately. 15 16 * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: 17 Refactor creation of ASCCredentialRequestContext. 18 (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable): 19 * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: 20 (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): 21 Refactor use of ASC and add clarifying comment about flow. 22 1 23 2021-11-16 Kimmo Kinnunen <kkinnunen@apple.com> 2 24 -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm
r285736 r285864 239 239 } 240 240 241 void WebAuthenticatorCoordinatorProxy::makeCredential(FrameIdentifier frameId, FrameInfoData&& frameInfo, Vector<uint8_t>&& hash, PublicKeyCredentialCreationOptions&& options, bool processingUserGesture, RequestCompletionHandler&& handler) 242 { 243 auto requestContext = configureRegistrationRequestContext(options); 244 performRequest(requestContext, WTFMove(handler)); 245 } 246 247 void WebAuthenticatorCoordinatorProxy::getAssertion(FrameIdentifier frameId, FrameInfoData&& frameInfo, Vector<uint8_t>&& hash, PublicKeyCredentialRequestOptions&& options, bool processingUserGesture, RequestCompletionHandler&& handler) 248 { 249 auto requestContext = configurationAssertionRequestContext(options); 250 performRequest(requestContext, WTFMove(handler)); 241 RetainPtr<ASCCredentialRequestContext> WebAuthenticatorCoordinatorProxy::contextForRequest(WebAuthenticationRequestData&& requestData) 242 { 243 RetainPtr<ASCCredentialRequestContext> result; 244 WTF::switchOn(requestData.options, [&](const PublicKeyCredentialCreationOptions& options) { 245 result = configureRegistrationRequestContext(options); 246 }, [&](const PublicKeyCredentialRequestOptions& options) { 247 result = configurationAssertionRequestContext(options); 248 }); 249 return result; 251 250 } 252 251 -
trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp
r284142 r285864 56 56 } 57 57 58 #if !HAVE(UNIFIED_ASC_AUTH_UI)59 58 void WebAuthenticatorCoordinatorProxy::makeCredential(FrameIdentifier frameId, FrameInfoData&& frameInfo, Vector<uint8_t>&& hash, PublicKeyCredentialCreationOptions&& options, bool processingUserGesture, RequestCompletionHandler&& handler) 60 59 { … … 66 65 handleRequest({ WTFMove(hash), WTFMove(options), m_webPageProxy, WebAuthenticationPanelResult::Unavailable, nullptr, GlobalFrameIdentifier { m_webPageProxy.webPageID(), frameId }, WTFMove(frameInfo), processingUserGesture, String(), nullptr }, WTFMove(handler)); 67 66 } 68 #endif69 67 70 68 void WebAuthenticatorCoordinatorProxy::handleRequest(WebAuthenticationRequestData&& data, RequestCompletionHandler&& handler) 71 69 { 70 auto& authenticatorManager = m_webPageProxy.websiteDataStore().authenticatorManager(); 71 72 #if HAVE(UNIFIED_ASC_AUTH_UI) 73 if (!authenticatorManager.isMock() && !authenticatorManager.isVirtual()) { 74 auto context = contextForRequest(WTFMove(data)); 75 // performRequest calls out to ASCAgent which will then call [_WKWebAuthenticationPanel makeCredential/getAssertionWithChallenge] 76 // which calls authenticatorManager.handleRequest(..) 77 performRequest(context, WTFMove(handler)); 78 return; 79 } 80 #endif // HAVE(UNIFIED_ASC_AUTH_UI) 81 72 82 auto callback = [handler = WTFMove(handler)] (std::variant<Ref<AuthenticatorResponse>, ExceptionData>&& result) mutable { 73 83 ASSERT(RunLoop::isMain()); … … 78 88 }); 79 89 }; 80 m_webPageProxy.websiteDataStore().authenticatorManager().handleRequest(WTFMove(data), WTFMove(callback));90 authenticatorManager.handleRequest(WTFMove(data), WTFMove(callback)); 81 91 } 82 92 … … 86 96 handler(LocalService::isAvailable()); 87 97 } 88 #endif 98 #endif // !HAVE(UNIFIED_ASC_AUTH_UI) 89 99 90 100 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h
r284071 r285864 78 78 79 79 #if HAVE(UNIFIED_ASC_AUTH_UI) 80 RetainPtr<ASCCredentialRequestContext> contextForRequest(WebAuthenticationRequestData&&); 80 81 void performRequest(RetainPtr<ASCCredentialRequestContext>, RequestCompletionHandler&&); 81 82 RetainPtr<ASCAuthorizationRemotePresenter> m_presenter;
Note:
See TracChangeset
for help on using the changeset viewer.