Title: [290758] trunk/Source/WebKit
- Revision
- 290758
- Author
- [email protected]
- Date
- 2022-03-02 15:25:10 -0800 (Wed, 02 Mar 2022)
Log Message
[AppSSO] Correct logging messages to avoid confusing screeners that an error has occurred
https://bugs.webkit.org/show_bug.cgi?id=237390
<rdar://problem/89710486>
Reviewed by Simon Fraser.
The phrasing of the message in 'SOAuthorizationCoordinator::tryAuthorize' when a URL is not relevant for
AppSSO flows is:
AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize: Cannot authorize the requested URL.");
This leads people spelunking logs to believe that the URL can't be authorized (perhaps due to an error).
Instead, we should more accurately report that the URL is not one that is mediated through an AppSSO flow,
and so no AppSSO processing is needed.
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm:
(WebKit::SOAuthorizationCoordinator::tryAuthorize):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (290757 => 290758)
--- trunk/Source/WebKit/ChangeLog 2022-03-02 23:09:20 UTC (rev 290757)
+++ trunk/Source/WebKit/ChangeLog 2022-03-02 23:25:10 UTC (rev 290758)
@@ -1,5 +1,26 @@
2022-03-02 Brent Fulgham <[email protected]>
+ [AppSSO] Correct logging messages to avoid confusing screeners that an error has occurred
+ https://bugs.webkit.org/show_bug.cgi?id=237390
+ <rdar://problem/89710486>
+
+ Reviewed by Simon Fraser.
+
+ The phrasing of the message in 'SOAuthorizationCoordinator::tryAuthorize' when a URL is not relevant for
+ AppSSO flows is:
+
+ AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize: Cannot authorize the requested URL.");
+
+ This leads people spelunking logs to believe that the URL can't be authorized (perhaps due to an error).
+
+ Instead, we should more accurately report that the URL is not one that is mediated through an AppSSO flow,
+ and so no AppSSO processing is needed.
+
+ * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm:
+ (WebKit::SOAuthorizationCoordinator::tryAuthorize):
+
+2022-03-02 Brent Fulgham <[email protected]>
+
[WebAuthn] Completion handler is not called when WebAuthn invoked without proper entitlements
https://bugs.webkit.org/show_bug.cgi?id=237380
<rdar://problem/89700242>
Modified: trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm (290757 => 290758)
--- trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm 2022-03-02 23:09:20 UTC (rev 290757)
+++ trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm 2022-03-02 23:25:10 UTC (rev 290758)
@@ -42,6 +42,7 @@
#import <wtf/Function.h>
#define AUTHORIZATIONCOORDINATOR_RELEASE_LOG(fmt, ...) RELEASE_LOG(AppSSO, "%p - SOAuthorizationCoordinator::" fmt, this, ##__VA_ARGS__)
+#define AUTHORIZATIONCOORDINATOR_RELEASE_LOG_ERROR(fmt, ...) RELEASE_LOG_ERROR(AppSSO, "%p - SOAuthorizationCoordinator::" fmt, this, ##__VA_ARGS__)
namespace WebKit {
@@ -67,7 +68,7 @@
{
AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize");
if (!canAuthorize(navigationAction->request().url())) {
- AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize: Cannot authorize the requested URL.");
+ AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize: The requested URL is not registered for AppSSO handling. No further action needed.");
completionHandler(false);
return;
}
@@ -76,7 +77,7 @@
auto* targetFrame = navigationAction->targetFrame();
bool subframeNavigation = targetFrame && !targetFrame->isMainFrame();
if (subframeNavigation && (!page.mainFrame() || ![AKAuthorizationController isURLFromAppleOwnedDomain:page.mainFrame()->url()])) {
- AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize: Attempting to perform subframe navigation for non-Apple authorization URL.");
+ AUTHORIZATIONCOORDINATOR_RELEASE_LOG_ERROR("tryAuthorize: Attempting to perform subframe navigation for non-Apple authorization URL.");
completionHandler(false);
return;
}
@@ -88,13 +89,25 @@
void SOAuthorizationCoordinator::tryAuthorize(Ref<API::NavigationAction>&& navigationAction, WebPageProxy& page, NewPageCallback&& newPageCallback, UIClientCallback&& uiClientCallback)
{
AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize (2)");
+ if (!canAuthorize(navigationAction->request().url())) {
+ AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize (2): The requested URL is not registered for AppSSO handling. No further action needed.");
+ uiClientCallback(WTFMove(navigationAction), WTFMove(newPageCallback));
+ return;
+ }
+
bool subframeNavigation = navigationAction->sourceFrame() && !navigationAction->sourceFrame()->isMainFrame();
- if (subframeNavigation || !navigationAction->isProcessingUserGesture() || !canAuthorize(navigationAction->request().url())) {
- AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize (2): Attempting to perform invalid auth.");
+ if (subframeNavigation) {
+ AUTHORIZATIONCOORDINATOR_RELEASE_LOG_ERROR("tryAuthorize (2): Attempting to perform subframe navigation.");
uiClientCallback(WTFMove(navigationAction), WTFMove(newPageCallback));
return;
}
+ if (!navigationAction->isProcessingUserGesture()) {
+ AUTHORIZATIONCOORDINATOR_RELEASE_LOG_ERROR("tryAuthorize (2): Attempting to perform auth without a user gesture.");
+ uiClientCallback(WTFMove(navigationAction), WTFMove(newPageCallback));
+ return;
+ }
+
auto session = PopUpSOAuthorizationSession::create(m_soAuthorization.get(), page, WTFMove(navigationAction), WTFMove(newPageCallback), WTFMove(uiClientCallback));
[m_soAuthorizationDelegate setSession:WTFMove(session)];
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes