Changeset 268155 in webkit


Ignore:
Timestamp:
Oct 7, 2020 3:27:58 PM (4 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] Implement a dummy WebAuthenticationAgent
https://bugs.webkit.org/show_bug.cgi?id=217401
<rdar://problem/70012011>

Reviewed by Darin Adler.

Part 1.

This patch introduces a new dummy WebAuthenticationAgent where in the future it will take over all WebAuthn operations
from the UI Process such that we can isolate high privileged entitlements to this standalone daemon and therefore are able
offer WebAuthn to third party WKWebView clients. One of the future feautres will require this new process to listen to
LaunchEvents, which only daemons can do. That's why it is implemented as a user agent instead of a XPC service.

This is the first part of establishing such a dummy daemon. What it does is to set up a new build target for the daemon and
hook it up with WebKit's build system. One can manually load the launchd plist and load the daemon to verify this change.

Commands are:
launchctl load /to/your/path/com.apple.webkit.WebAuthenticationAgent.plist
launchctl start com.apple.webkit.WebAuthenticationAgent.Development

Covered by manual tests.

  • Configurations/WebAuthenticationAgent.xcconfig: Added.

Somehow the executable has a suffix .Development for debug/release builds. Will fix that in the later part.

  • Daemons/WebAuthenticationAgent/Info.plist: Added.
  • Daemons/WebAuthenticationAgent/WebAuthenticationAgent.entitlements: Added.
  • Daemons/WebAuthenticationAgent/com.apple.webkit.WebAuthenticationAgent.plist: Added.

The executable location is hardcoded for now. It will be fixed in Part 2 to dynamically point to the right binary.

  • Daemons/WebAuthenticationAgent/main.mm: Added.

(main):

  • WebKit.xcodeproj/project.pbxproj:

Not sure why libWTF.a is needed. Will fix that in the later part.

Location:
trunk/Source/WebKit
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r268148 r268155  
     12020-10-07  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Implement a dummy WebAuthenticationAgent
     4        https://bugs.webkit.org/show_bug.cgi?id=217401
     5        <rdar://problem/70012011>
     6
     7        Reviewed by Darin Adler.
     8
     9        Part 1.
     10
     11        This patch introduces a new dummy WebAuthenticationAgent where in the future it will take over all WebAuthn operations
     12        from the UI Process such that we can isolate high privileged entitlements to this standalone daemon and therefore are able
     13        offer WebAuthn to third party WKWebView clients. One of the future feautres will require this new process to listen to
     14        LaunchEvents, which only daemons can do. That's why it is implemented as a user agent instead of a XPC service.
     15
     16        This is the first part of establishing such a dummy daemon. What it does is to set up a new build target for the daemon and
     17        hook it up with WebKit's build system. One can manually load the launchd plist and load the daemon to verify this change.
     18
     19        Commands are:
     20        launchctl load /to/your/path/com.apple.webkit.WebAuthenticationAgent.plist
     21        launchctl start com.apple.webkit.WebAuthenticationAgent.Development
     22
     23        Covered by manual tests.
     24
     25        * Configurations/WebAuthenticationAgent.xcconfig: Added.
     26        Somehow the executable has a suffix .Development for debug/release builds. Will fix that in the later part.
     27        * Daemons/WebAuthenticationAgent/Info.plist: Added.
     28        * Daemons/WebAuthenticationAgent/WebAuthenticationAgent.entitlements: Added.
     29        * Daemons/WebAuthenticationAgent/com.apple.webkit.WebAuthenticationAgent.plist: Added.
     30        The executable location is hardcoded for now. It will be fixed in Part 2 to dynamically point to the right binary.
     31        * Daemons/WebAuthenticationAgent/main.mm: Added.
     32        (main):
     33        * WebKit.xcodeproj/project.pbxproj:
     34        Not sure why libWTF.a is needed. Will fix that in the later part.
     35
    1362020-10-07  Devin Rousso  <drousso@apple.com>
    237
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r268086 r268155  
    1515                        );
    1616                        dependencies = (
     17                                57A9FF0C252C31D6006A2040 /* PBXTargetDependency */,
    1718                                BCA8D46815BCE0D6009DC1F1 /* PBXTargetDependency */,
    1819                                372EBB492017E6CF00085064 /* PBXTargetDependency */,
     
    11131114                579F1BF923C80EC600C7D4B4 /* _WKWebAuthenticationAssertionResponseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 579F1BF823C80EC600C7D4B4 /* _WKWebAuthenticationAssertionResponseInternal.h */; };
    11141115                579F1BFC23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 579F1BFA23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.h */; };
     1116                57A9FF09252BEAF0006A2040 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 57A9FF08252BEAF0006A2040 /* main.mm */; };
     1117                57A9FF1D252C6CE6006A2040 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57A9FF15252C6AEF006A2040 /* libWTF.a */; };
    11151118                57AC8F50217FEED90055438C /* HidConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 57AC8F4E217FEED90055438C /* HidConnection.h */; };
    11161119                57B4B46020B504AC00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B4B45E20B504AB00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h */; };
     
    19661969                        remoteInfo = "Derived Sources";
    19671970                };
     1971                57A9FF0B252C31D6006A2040 /* PBXContainerItemProxy */ = {
     1972                        isa = PBXContainerItemProxy;
     1973                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
     1974                        proxyType = 1;
     1975                        remoteGlobalIDString = 57A9FEFB252BD8AA006A2040;
     1976                        remoteInfo = WebAuthenticationAgent;
     1977                };
    19681978                BC8283D416B4C01F00A278FE /* PBXContainerItemProxy */ = {
    19691979                        isa = PBXContainerItemProxy;
     
    20772087                        name = "Copy Shims";
    20782088                        runOnlyForDeploymentPostprocessing = 0;
     2089                };
     2090                57A9FEFA252BD8AA006A2040 /* CopyFiles */ = {
     2091                        isa = PBXCopyFilesBuildPhase;
     2092                        buildActionMask = 2147483647;
     2093                        dstPath = /usr/share/man/man1/;
     2094                        dstSubfolderSpec = 0;
     2095                        files = (
     2096                        );
     2097                        runOnlyForDeploymentPostprocessing = 1;
    20792098                };
    20802099                7CB16FEE1724BA05007A0A95 /* Copy Plug-in Sandbox Profiles */ = {
     
    39133932                579F1BFA23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIWebAuthenticationAssertionResponse.h; sourceTree = "<group>"; };
    39143933                579F1BFB23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = APIWebAuthenticationAssertionResponse.cpp; sourceTree = "<group>"; };
     3934                57A9FEFC252BD8AA006A2040 /* com.apple.WebKit.WebAuthenticationAgent.Development */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = com.apple.WebKit.WebAuthenticationAgent.Development; sourceTree = BUILT_PRODUCTS_DIR; };
     3935                57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebAuthenticationAgent.xcconfig; sourceTree = "<group>"; };
     3936                57A9FF08252BEAF0006A2040 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = main.mm; path = Daemons/WebAuthenticationAgent/main.mm; sourceTree = SOURCE_ROOT; };
     3937                57A9FF0A252BF5C3006A2040 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
     3938                57A9FF0D252C397A006A2040 /* com.apple.webkit.WebAuthenticationAgent.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = com.apple.webkit.WebAuthenticationAgent.plist; sourceTree = "<group>"; };
     3939                57A9FF0F252C5D9D006A2040 /* WebAuthenticationAgent.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WebAuthenticationAgent.entitlements; sourceTree = "<group>"; };
     3940                57A9FF15252C6AEF006A2040 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; };
    39153941                57AC8F4E217FEED90055438C /* HidConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HidConnection.h; sourceTree = "<group>"; };
    39163942                57AC8F4F217FEED90055438C /* HidConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HidConnection.mm; sourceTree = "<group>"; };
     
    54375463                        runOnlyForDeploymentPostprocessing = 0;
    54385464                };
     5465                57A9FEF9252BD8AA006A2040 /* Frameworks */ = {
     5466                        isa = PBXFrameworksBuildPhase;
     5467                        buildActionMask = 2147483647;
     5468                        files = (
     5469                                57A9FF1D252C6CE6006A2040 /* libWTF.a in Frameworks */,
     5470                        );
     5471                        runOnlyForDeploymentPostprocessing = 0;
     5472                };
    54395473                8DC2EF560486A6940098B216 /* Frameworks */ = {
    54405474                        isa = PBXFrameworksBuildPhase;
     
    54855519                                BC8283B116B4BF7700A278FE /* com.apple.WebKit.Networking.xpc */,
    54865520                                BC82841F16B4FDF600A278FE /* com.apple.WebKit.Plugin.64.xpc */,
     5521                                57A9FEFC252BD8AA006A2040 /* com.apple.WebKit.WebAuthenticationAgent.Development */,
    54875522                                372EBB462017E64300085064 /* com.apple.WebKit.WebContent.Development.xpc */,
    54885523                                BC3DE46615A91763008D26FC /* com.apple.WebKit.WebContent.xpc */,
     
    56295664                                1A1D2117191D996C0001619F /* MigrateHeadersFromWebKitLegacy.make */,
    56305665                                1A1D2116191D995C0001619F /* postprocess-framework-headers.sh */,
     5666                                57A9FEEF252BB70C006A2040 /* Daemons */,
    56315667                                BC2E6E74114196F000A63B1E /* Platform */,
    56325668                                1AADDF4B10D82AF000D3D63D /* Shared */,
     
    58375873                                5183B3931379F85C00E8754E /* Shim.xcconfig */,
    58385874                                1A4F976E100E7B6600637A18 /* Version.xcconfig */,
     5875                                57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */,
    58395876                                372EBB4A2017E76000085064 /* WebContentService.Development.xcconfig */,
    58405877                                BCACC40E16B0B8A800B6E092 /* WebContentService.xcconfig */,
     
    80788115                        isa = PBXGroup;
    80798116                        children = (
     8117                                57A9FF15252C6AEF006A2040 /* libWTF.a */,
    80808118                                5750F32A2032D4E500389347 /* LocalAuthentication.framework */,
    80818119                                570DAAB0230273D200E8FC04 /* NearField.framework */,
     
    81338171                        );
    81348172                        path = WebAuthentication;
     8173                        sourceTree = "<group>";
     8174                };
     8175                57A9FEEF252BB70C006A2040 /* Daemons */ = {
     8176                        isa = PBXGroup;
     8177                        children = (
     8178                                57A9FEF0252BB740006A2040 /* WebAuthenticationAgent */,
     8179                        );
     8180                        path = Daemons;
     8181                        sourceTree = "<group>";
     8182                };
     8183                57A9FEF0252BB740006A2040 /* WebAuthenticationAgent */ = {
     8184                        isa = PBXGroup;
     8185                        children = (
     8186                                57A9FF0D252C397A006A2040 /* com.apple.webkit.WebAuthenticationAgent.plist */,
     8187                                57A9FF0A252BF5C3006A2040 /* Info.plist */,
     8188                                57A9FF08252BEAF0006A2040 /* main.mm */,
     8189                                57A9FF0F252C5D9D006A2040 /* WebAuthenticationAgent.entitlements */,
     8190                        );
     8191                        path = WebAuthenticationAgent;
    81358192                        sourceTree = "<group>";
    81368193                };
     
    1192711984                        productType = "com.apple.product-type.library.dynamic";
    1192811985                };
     11986                57A9FEFB252BD8AA006A2040 /* WebAuthenticationAgent */ = {
     11987                        isa = PBXNativeTarget;
     11988                        buildConfigurationList = 57A9FF00252BD8AB006A2040 /* Build configuration list for PBXNativeTarget "WebAuthenticationAgent" */;
     11989                        buildPhases = (
     11990                                57A9FEF8252BD8AA006A2040 /* Sources */,
     11991                                57A9FEF9252BD8AA006A2040 /* Frameworks */,
     11992                                57A9FEFA252BD8AA006A2040 /* CopyFiles */,
     11993                        );
     11994                        buildRules = (
     11995                        );
     11996                        dependencies = (
     11997                        );
     11998                        name = WebAuthenticationAgent;
     11999                        productName = WebAuthenticationAgent;
     12000                        productReference = 57A9FEFC252BD8AA006A2040 /* com.apple.WebKit.WebAuthenticationAgent.Development */;
     12001                        productType = "com.apple.product-type.tool";
     12002                };
    1192912003                8DC2EF4F0486A6940098B216 /* WebKit */ = {
    1193012004                        isa = PBXNativeTarget;
     
    1205112125                                                ProvisioningStyle = Automatic;
    1205212126                                        };
     12127                                        57A9FEFB252BD8AA006A2040 = {
     12128                                                CreatedOnToolsVersion = 12.0;
     12129                                        };
    1205312130                                        E1AC2E2720F7B94C00B0897D = {
    1205412131                                                CreatedOnToolsVersion = 9.3;
     
    1208412161                                E1AC2E2720F7B94C00B0897D /* Unlock Keychain */,
    1208512162                                5325BDCD21DFF47700A0DEE1 /* Apply Configuration to XCFileLists */,
     12163                                57A9FEFB252BD8AA006A2040 /* WebAuthenticationAgent */,
    1208612164                        );
    1208712165                };
     
    1269012768                        files = (
    1269112769                                511F8A81138B485D00A95F44 /* SecItemShimLibrary.mm in Sources */,
     12770                        );
     12771                        runOnlyForDeploymentPostprocessing = 0;
     12772                };
     12773                57A9FEF8252BD8AA006A2040 /* Sources */ = {
     12774                        isa = PBXSourcesBuildPhase;
     12775                        buildActionMask = 2147483647;
     12776                        files = (
     12777                                57A9FF09252BEAF0006A2040 /* main.mm in Sources */,
    1269212778                        );
    1269312779                        runOnlyForDeploymentPostprocessing = 0;
     
    1319213278                        targetProxy = 37F7407812721F740093869B /* PBXContainerItemProxy */;
    1319313279                };
     13280                57A9FF0C252C31D6006A2040 /* PBXTargetDependency */ = {
     13281                        isa = PBXTargetDependency;
     13282                        target = 57A9FEFB252BD8AA006A2040 /* WebAuthenticationAgent */;
     13283                        targetProxy = 57A9FF0B252C31D6006A2040 /* PBXContainerItemProxy */;
     13284                };
    1319413285                BC8283D516B4C01F00A278FE /* PBXTargetDependency */ = {
    1319513286                        isa = PBXTargetDependency;
     
    1344813539                        name = Production;
    1344913540                };
     13541                57A9FF01252BD8AB006A2040 /* Debug */ = {
     13542                        isa = XCBuildConfiguration;
     13543                        baseConfigurationReference = 57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */;
     13544                        buildSettings = {
     13545                        };
     13546                        name = Debug;
     13547                };
     13548                57A9FF02252BD8AB006A2040 /* Release */ = {
     13549                        isa = XCBuildConfiguration;
     13550                        baseConfigurationReference = 57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */;
     13551                        buildSettings = {
     13552                        };
     13553                        name = Release;
     13554                };
     13555                57A9FF03252BD8AB006A2040 /* Production */ = {
     13556                        isa = XCBuildConfiguration;
     13557                        baseConfigurationReference = 57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */;
     13558                        buildSettings = {
     13559                        };
     13560                        name = Production;
     13561                };
    1345013562                5D22D69B11A7534600BF30E5 /* Production */ = {
    1345113563                        isa = XCBuildConfiguration;
     
    1370413816                        defaultConfigurationName = Production;
    1370513817                };
     13818                57A9FF00252BD8AB006A2040 /* Build configuration list for PBXNativeTarget "WebAuthenticationAgent" */ = {
     13819                        isa = XCConfigurationList;
     13820                        buildConfigurations = (
     13821                                57A9FF01252BD8AB006A2040 /* Debug */,
     13822                                57A9FF02252BD8AB006A2040 /* Release */,
     13823                                57A9FF03252BD8AB006A2040 /* Production */,
     13824                        );
     13825                        defaultConfigurationIsVisible = 0;
     13826                        defaultConfigurationName = Production;
     13827                };
    1370613828                A7AADA1419395CA9003EA1C7 /* Build configuration list for PBXAggregateTarget "Sandbox Profiles" */ = {
    1370713829                        isa = XCConfigurationList;
Note: See TracChangeset for help on using the changeset viewer.