[webkit-changes] [WebKit/WebKit] c9c593: Read host app info from extension process directly...
bnham
noreply at github.com
Thu Aug 8 23:49:17 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c9c593aab62e8afdbbc714677a087029754184ed
https://github.com/WebKit/WebKit/commit/c9c593aab62e8afdbbc714677a087029754184ed
Author: Ben Nham <nham at apple.com>
Date: 2024-08-08 (Thu, 08 Aug 2024)
Changed paths:
M Source/WebKit/NetworkProcess/Notifications/Cocoa/WebPushDaemonConnectionCocoa.mm
M Source/WebKit/Platform/spi/ios/RunningBoardServicesSPI.h
M Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.webpushd.sb.in
M Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.h
M Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.serialization.in
M Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h
M Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h
M Source/WebKit/webpushd/PushClientConnection.h
M Source/WebKit/webpushd/PushClientConnection.messages.in
M Source/WebKit/webpushd/PushClientConnection.mm
M Source/WebKit/webpushd/WebPushDaemon.h
M Source/WebKit/webpushd/WebPushDaemon.mm
M Source/WebKit/webpushd/WebPushDaemonMain.mm
M Source/WebKit/webpushd/webpushtool/WebPushToolConnection.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm
Log Message:
-----------
Read host app info from extension process directly in webpushd
https://bugs.webkit.org/show_bug.cgi?id=277755
rdar://131367853
Reviewed by Brady Eidson.
Currently webpushd depends on the remote process (which is NetworkProcess) to provide the audit
token of the host app as part of a connection setup IPC message. When ExtensionKit is enabled,
instead of having to trust the remote process for that info, we can just read the audit token of the
host app directly from within webpushd.
The main refactoring here is making it so that `PushClientConnection` represents a connection to a
valid peer (i.e. one associated with a host app with the appropriate entitlements and with a
non-empty code signing identifier). As part of this, I renamed the UpdateConnectionConfiguration
message to InitializeConnection, and enforce that it is the first message sent on the
connection. Previously, `PushClientConnection` could be in an invalid state while awaiting the
UpdateConnectionConfiguration message, and we also had code that dealt with
UpdateConnectionConfiguration being sent multiple times. I deleted all of that code since you now
can't have a connection that is in an invalid state.
I also deleted the webPushDaemonUsesMockBundlesForTesting member variable since it was unused.
* Source/WebKit/NetworkProcess/Notifications/Cocoa/WebPushDaemonConnectionCocoa.mm:
(WebKit::WebPushD::Connection::newConnectionWasInitialized const):
* Source/WebKit/Platform/spi/ios/RunningBoardServicesSPI.h:
* Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.h:
(): Deleted.
* Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration webPushDaemonUsesMockBundlesForTesting]): Deleted.
(-[_WKWebsiteDataStoreConfiguration setWebPushDaemonUsesMockBundlesForTesting:]): Deleted.
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):
(WebKit::WebsiteDataStoreConfiguration::webPushDaemonConnectionConfiguration const):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::webPushDaemonUsesMockBundlesForTesting const): Deleted.
(WebKit::WebsiteDataStoreConfiguration::setWebPushDaemonUsesMockBundlesForTesting): Deleted.
* Source/WebKit/webpushd/PushClientConnection.h:
(WebPushD::PushClientConnection::hostAppCodeSigningIdentifier const):
(WebPushD::PushClientConnection::hostAppHasPushInjectEntitlement const):
(WebPushD::PushClientConnection::hasHostAppAuditToken const): Deleted.
(WebPushD::PushClientConnection::useMockBundlesForTesting const): Deleted.
* Source/WebKit/webpushd/PushClientConnection.messages.in:
* Source/WebKit/webpushd/PushClientConnection.mm:
(WebPushD::hostAppHasEntitlement):
(WebPushD::bundleIdentifierFromAuditToken):
(WebPushD::PushClientConnection::create):
(WebPushD::PushClientConnection::PushClientConnection):
(WebPushD::PushClientConnection::initializeConnection):
(WebPushD::PushClientConnection::getPushTopicsForTesting):
(WebPushD::PushClientConnection::subscriptionSetIdentifier const):
(WebPushD::PushClientConnection::connectionClosed):
(WebPushD::PushClientConnection::updateConnectionConfiguration): Deleted.
(WebPushD::PushClientConnection::setHostAppAuditTokenData): Deleted.
(WebPushD::PushClientConnection::subscriptionSetIdentifier): Deleted.
(WebPushD::PushClientConnection::hostAppCodeSigningIdentifier): Deleted.
(WebPushD::PushClientConnection::bundleIdentifierFromAuditToken): Deleted.
(WebPushD::PushClientConnection::hostAppHasPushEntitlement): Deleted.
(WebPushD::PushClientConnection::hostAppHasPushInjectEntitlement): Deleted.
(WebPushD::PushClientConnection::hostHasEntitlement): Deleted.
* Source/WebKit/webpushd/WebPushDaemon.h:
* Source/WebKit/webpushd/WebPushDaemon.mm:
(WebPushD::WebPushDaemon::connectionEventHandler):
(WebPushD::WebPushDaemon::connectionAdded):
(WebPushD::WebPushDaemon::connectionRemoved):
(WebPushD::WebPushDaemon::getPendingPushMessage):
(WebPushD::WebPushDaemon::getPendingPushMessages):
* Source/WebKit/webpushd/WebPushDaemonMain.mm:
* Source/WebKit/webpushd/webpushtool/WebPushToolConnection.mm:
(WebPushTool::Connection::sendAuditToken):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::createAndConfigureConnectionToService):
(TestWebKitAPI::TEST(WebPushD, BasicCommunication)):
(TestWebKitAPI::(WebPushD, DeclarativeParsing)):
(TestWebKitAPI::(WebPushD, DeclarativeWebPushHandling)):
Canonical link: https://commits.webkit.org/282035@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list