Changeset 268248 in webkit


Ignore:
Timestamp:
Oct 8, 2020 10:16:03 PM (3 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

    r268246 r268248  
     12020-10-08  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-08  Chris Fleizach  <cfleizach@apple.com>
    237
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r268239 r268248  
    1515                        );
    1616                        dependencies = (
     17                                57A9FF0C252C31D6006A2040 /* PBXTargetDependency */,
    1718                                BCA8D46815BCE0D6009DC1F1 /* PBXTargetDependency */,
    1819                                372EBB492017E6CF00085064 /* PBXTargetDependency */,
     
    11051106                575B1BB923CE9C0B0020639A /* SimulatedInputDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 995226D5207D184600F78420 /* SimulatedInputDispatcher.cpp */; };
    11061107                575B1BBA23CE9C130020639A /* WebAutomationSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9955A6EA1C7980BB00EB6A93 /* WebAutomationSession.cpp */; };
     1108                576BCD5E252FD22D00CE9F87 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3DE46815A91763008D26FC /* Foundation.framework */; };
    11071109                576CA9D722B862180030143C /* SOAuthorizationNSURLExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 57FD317322B35148008D0E8B /* SOAuthorizationNSURLExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11081110                5772F206217DBD6A0056BF2C /* HidService.h in Headers */ = {isa = PBXBuildFile; fileRef = 5772F204217DBD6A0056BF2C /* HidService.h */; };
     
    11131115                579F1BF923C80EC600C7D4B4 /* _WKWebAuthenticationAssertionResponseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 579F1BF823C80EC600C7D4B4 /* _WKWebAuthenticationAssertionResponseInternal.h */; };
    11141116                579F1BFC23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 579F1BFA23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.h */; };
     1117                57A9FF09252BEAF0006A2040 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 57A9FF08252BEAF0006A2040 /* main.mm */; };
     1118                57A9FF1D252C6CE6006A2040 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57A9FF15252C6AEF006A2040 /* libWTF.a */; };
    11151119                57AC8F50217FEED90055438C /* HidConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 57AC8F4E217FEED90055438C /* HidConnection.h */; };
    11161120                57B4B46020B504AC00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B4B45E20B504AB00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h */; };
     
    19661970                        remoteInfo = "Derived Sources";
    19671971                };
     1972                57A9FF0B252C31D6006A2040 /* PBXContainerItemProxy */ = {
     1973                        isa = PBXContainerItemProxy;
     1974                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
     1975                        proxyType = 1;
     1976                        remoteGlobalIDString = 57A9FEFB252BD8AA006A2040;
     1977                        remoteInfo = WebAuthenticationAgent;
     1978                };
    19681979                BC8283D416B4C01F00A278FE /* PBXContainerItemProxy */ = {
    19691980                        isa = PBXContainerItemProxy;
     
    20772088                        name = "Copy Shims";
    20782089                        runOnlyForDeploymentPostprocessing = 0;
     2090                };
     2091                57A9FEFA252BD8AA006A2040 /* CopyFiles */ = {
     2092                        isa = PBXCopyFilesBuildPhase;
     2093                        buildActionMask = 2147483647;
     2094                        dstPath = /usr/share/man/man1/;
     2095                        dstSubfolderSpec = 0;
     2096                        files = (
     2097                        );
     2098                        runOnlyForDeploymentPostprocessing = 1;
    20792099                };
    20802100                7CB16FEE1724BA05007A0A95 /* Copy Plug-in Sandbox Profiles */ = {
     
    39133933                579F1BFA23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIWebAuthenticationAssertionResponse.h; sourceTree = "<group>"; };
    39143934                579F1BFB23C811CF00C7D4B4 /* APIWebAuthenticationAssertionResponse.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = APIWebAuthenticationAssertionResponse.cpp; sourceTree = "<group>"; };
     3935                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; };
     3936                57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebAuthenticationAgent.xcconfig; sourceTree = "<group>"; };
     3937                57A9FF08252BEAF0006A2040 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = main.mm; path = Daemons/WebAuthenticationAgent/main.mm; sourceTree = SOURCE_ROOT; };
     3938                57A9FF0A252BF5C3006A2040 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
     3939                57A9FF0D252C397A006A2040 /* com.apple.webkit.WebAuthenticationAgent.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = com.apple.webkit.WebAuthenticationAgent.plist; sourceTree = "<group>"; };
     3940                57A9FF0F252C5D9D006A2040 /* WebAuthenticationAgent.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WebAuthenticationAgent.entitlements; sourceTree = "<group>"; };
     3941                57A9FF15252C6AEF006A2040 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; };
    39153942                57AC8F4E217FEED90055438C /* HidConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HidConnection.h; sourceTree = "<group>"; };
    39163943                57AC8F4F217FEED90055438C /* HidConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HidConnection.mm; sourceTree = "<group>"; };
     
    54395466                        runOnlyForDeploymentPostprocessing = 0;
    54405467                };
     5468                57A9FEF9252BD8AA006A2040 /* Frameworks */ = {
     5469                        isa = PBXFrameworksBuildPhase;
     5470                        buildActionMask = 2147483647;
     5471                        files = (
     5472                                576BCD5E252FD22D00CE9F87 /* Foundation.framework in Frameworks */,
     5473                                57A9FF1D252C6CE6006A2040 /* libWTF.a in Frameworks */,
     5474                        );
     5475                        runOnlyForDeploymentPostprocessing = 0;
     5476                };
    54415477                8DC2EF560486A6940098B216 /* Frameworks */ = {
    54425478                        isa = PBXFrameworksBuildPhase;
     
    54875523                                BC8283B116B4BF7700A278FE /* com.apple.WebKit.Networking.xpc */,
    54885524                                BC82841F16B4FDF600A278FE /* com.apple.WebKit.Plugin.64.xpc */,
     5525                                57A9FEFC252BD8AA006A2040 /* com.apple.WebKit.WebAuthenticationAgent.Development */,
    54895526                                372EBB462017E64300085064 /* com.apple.WebKit.WebContent.Development.xpc */,
    54905527                                BC3DE46615A91763008D26FC /* com.apple.WebKit.WebContent.xpc */,
     
    56315668                                1A1D2117191D996C0001619F /* MigrateHeadersFromWebKitLegacy.make */,
    56325669                                1A1D2116191D995C0001619F /* postprocess-framework-headers.sh */,
     5670                                57A9FEEF252BB70C006A2040 /* Daemons */,
    56335671                                BC2E6E74114196F000A63B1E /* Platform */,
    56345672                                1AADDF4B10D82AF000D3D63D /* Shared */,
     
    58395877                                5183B3931379F85C00E8754E /* Shim.xcconfig */,
    58405878                                1A4F976E100E7B6600637A18 /* Version.xcconfig */,
     5879                                57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */,
    58415880                                372EBB4A2017E76000085064 /* WebContentService.Development.xcconfig */,
    58425881                                BCACC40E16B0B8A800B6E092 /* WebContentService.xcconfig */,
     
    80808119                        isa = PBXGroup;
    80818120                        children = (
     8121                                57A9FF15252C6AEF006A2040 /* libWTF.a */,
    80828122                                5750F32A2032D4E500389347 /* LocalAuthentication.framework */,
    80838123                                570DAAB0230273D200E8FC04 /* NearField.framework */,
     
    81358175                        );
    81368176                        path = WebAuthentication;
     8177                        sourceTree = "<group>";
     8178                };
     8179                57A9FEEF252BB70C006A2040 /* Daemons */ = {
     8180                        isa = PBXGroup;
     8181                        children = (
     8182                                57A9FEF0252BB740006A2040 /* WebAuthenticationAgent */,
     8183                        );
     8184                        path = Daemons;
     8185                        sourceTree = "<group>";
     8186                };
     8187                57A9FEF0252BB740006A2040 /* WebAuthenticationAgent */ = {
     8188                        isa = PBXGroup;
     8189                        children = (
     8190                                57A9FF0D252C397A006A2040 /* com.apple.webkit.WebAuthenticationAgent.plist */,
     8191                                57A9FF0A252BF5C3006A2040 /* Info.plist */,
     8192                                57A9FF08252BEAF0006A2040 /* main.mm */,
     8193                                57A9FF0F252C5D9D006A2040 /* WebAuthenticationAgent.entitlements */,
     8194                        );
     8195                        path = WebAuthenticationAgent;
    81378196                        sourceTree = "<group>";
    81388197                };
     
    1193111990                        productType = "com.apple.product-type.library.dynamic";
    1193211991                };
     11992                57A9FEFB252BD8AA006A2040 /* WebAuthenticationAgent */ = {
     11993                        isa = PBXNativeTarget;
     11994                        buildConfigurationList = 57A9FF00252BD8AB006A2040 /* Build configuration list for PBXNativeTarget "WebAuthenticationAgent" */;
     11995                        buildPhases = (
     11996                                57A9FEF8252BD8AA006A2040 /* Sources */,
     11997                                57A9FEF9252BD8AA006A2040 /* Frameworks */,
     11998                                57A9FEFA252BD8AA006A2040 /* CopyFiles */,
     11999                        );
     12000                        buildRules = (
     12001                        );
     12002                        dependencies = (
     12003                        );
     12004                        name = WebAuthenticationAgent;
     12005                        productName = WebAuthenticationAgent;
     12006                        productReference = 57A9FEFC252BD8AA006A2040 /* com.apple.WebKit.WebAuthenticationAgent.Development */;
     12007                        productType = "com.apple.product-type.tool";
     12008                };
    1193312009                8DC2EF4F0486A6940098B216 /* WebKit */ = {
    1193412010                        isa = PBXNativeTarget;
     
    1205512131                                                ProvisioningStyle = Automatic;
    1205612132                                        };
     12133                                        57A9FEFB252BD8AA006A2040 = {
     12134                                                CreatedOnToolsVersion = 12.0;
     12135                                        };
    1205712136                                        E1AC2E2720F7B94C00B0897D = {
    1205812137                                                CreatedOnToolsVersion = 9.3;
     
    1208812167                                E1AC2E2720F7B94C00B0897D /* Unlock Keychain */,
    1208912168                                5325BDCD21DFF47700A0DEE1 /* Apply Configuration to XCFileLists */,
     12169                                57A9FEFB252BD8AA006A2040 /* WebAuthenticationAgent */,
    1209012170                        );
    1209112171                };
     
    1269412774                        files = (
    1269512775                                511F8A81138B485D00A95F44 /* SecItemShimLibrary.mm in Sources */,
     12776                        );
     12777                        runOnlyForDeploymentPostprocessing = 0;
     12778                };
     12779                57A9FEF8252BD8AA006A2040 /* Sources */ = {
     12780                        isa = PBXSourcesBuildPhase;
     12781                        buildActionMask = 2147483647;
     12782                        files = (
     12783                                57A9FF09252BEAF0006A2040 /* main.mm in Sources */,
    1269612784                        );
    1269712785                        runOnlyForDeploymentPostprocessing = 0;
     
    1319613284                        targetProxy = 37F7407812721F740093869B /* PBXContainerItemProxy */;
    1319713285                };
     13286                57A9FF0C252C31D6006A2040 /* PBXTargetDependency */ = {
     13287                        isa = PBXTargetDependency;
     13288                        target = 57A9FEFB252BD8AA006A2040 /* WebAuthenticationAgent */;
     13289                        targetProxy = 57A9FF0B252C31D6006A2040 /* PBXContainerItemProxy */;
     13290                };
    1319813291                BC8283D516B4C01F00A278FE /* PBXTargetDependency */ = {
    1319913292                        isa = PBXTargetDependency;
     
    1345213545                        name = Production;
    1345313546                };
     13547                57A9FF01252BD8AB006A2040 /* Debug */ = {
     13548                        isa = XCBuildConfiguration;
     13549                        baseConfigurationReference = 57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */;
     13550                        buildSettings = {
     13551                        };
     13552                        name = Debug;
     13553                };
     13554                57A9FF02252BD8AB006A2040 /* Release */ = {
     13555                        isa = XCBuildConfiguration;
     13556                        baseConfigurationReference = 57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */;
     13557                        buildSettings = {
     13558                        };
     13559                        name = Release;
     13560                };
     13561                57A9FF03252BD8AB006A2040 /* Production */ = {
     13562                        isa = XCBuildConfiguration;
     13563                        baseConfigurationReference = 57A9FF07252BE6E0006A2040 /* WebAuthenticationAgent.xcconfig */;
     13564                        buildSettings = {
     13565                        };
     13566                        name = Production;
     13567                };
    1345413568                5D22D69B11A7534600BF30E5 /* Production */ = {
    1345513569                        isa = XCBuildConfiguration;
     
    1370813822                        defaultConfigurationName = Production;
    1370913823                };
     13824                57A9FF00252BD8AB006A2040 /* Build configuration list for PBXNativeTarget "WebAuthenticationAgent" */ = {
     13825                        isa = XCConfigurationList;
     13826                        buildConfigurations = (
     13827                                57A9FF01252BD8AB006A2040 /* Debug */,
     13828                                57A9FF02252BD8AB006A2040 /* Release */,
     13829                                57A9FF03252BD8AB006A2040 /* Production */,
     13830                        );
     13831                        defaultConfigurationIsVisible = 0;
     13832                        defaultConfigurationName = Production;
     13833                };
    1371013834                A7AADA1419395CA9003EA1C7 /* Build configuration list for PBXAggregateTarget "Sandbox Profiles" */ = {
    1371113835                        isa = XCConfigurationList;
Note: See TracChangeset for help on using the changeset viewer.