Changeset 270142 in webkit


Ignore:
Timestamp:
Nov 21, 2020 12:11:34 AM (3 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] Implement SPI for AuthenticationServices.Framework
https://bugs.webkit.org/show_bug.cgi?id=218893
<rdar://problem/71364731>

Reviewed by Alex Christensen.

Source/WebCore:

Covered by API tests.

  • Modules/webauthn/PublicKeyCredentialCreationOptions.h:
  • Modules/webauthn/PublicKeyCredentialRequestOptions.h:

Tweaks some macros to expose an empty struct for ports that have WebAuthn disabled.

Source/WebKit:

This patch implements the SPI for AuthenticationServices.Framework, which is more or less a direct
translation of the WebAuthn Web IDLs and a thin wrapper on top of functionalities of the WebAuthn
process.

It deprecates the existing _WKWebAuthenticationPanel SPI which is for Safari to show UI only. This
patch does not just repurpose the SPI but also modifies some of the implementations. The most noticeable one
is the change of ownerships. Prior to this change, AuthenticatorManager owns the APIWebAuthenticationPanel.
Now, it's the opposite way.

Since there will be a period of time that the deprecated implementation will coexist with the new implementation,
this path also marks things that are meant to deprecate in the future to reduce confusions.

  • UIProcess/API/APIWebAuthenticationPanel.cpp:

(API::WebAuthenticationPanel::WebAuthenticationPanel):
(API::WebAuthenticationPanel::handleRequest):
(API::WebAuthenticationPanel::cancel const):

  • UIProcess/API/APIWebAuthenticationPanel.h:

Implements the plumbing for the new SPI and owns the AuthenticatorManager now.

  • UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
  • UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:

(-[_WKAuthenticationExtensionsClientOutputs initWithAppid:]):
(-[_WKAuthenticatorResponse initWithRawId:extensions:]):
(-[_WKAuthenticatorAssertionResponse initWithRawId:extensions:authenticatorData:signature:userHandle:]):
(-[_WKAuthenticatorAttestationResponse initWithRawId:extensions:attestationObject:]):
(-[_WKAuthenticatorSelectionCriteria init]):
(-[_WKPublicKeyCredentialCreationOptions initWithRp:user:pubKeyCredParams:]):
(-[_WKPublicKeyCredentialDescriptor initWithType:identifier:]):
(-[_WKPublicKeyCredentialEntity initWithName:]):
(-[_WKPublicKeyCredentialParameters initWithType:alg:]):
(-[_WKPublicKeyCredentialRequestOptions init]):
(-[_WKPublicKeyCredentialRpEntity initWithName:]):
(-[_WKPublicKeyCredentialUserEntity initWithName:identifier:displayName:]):
(-[_WKWebAuthenticationPanel init]):
(vectorFromNSData):
(encodeEntity):
(publicKeyCredentialRpEntity):
(publicKeyCredentialUserEntity):
(publicKeyCredentialParameters):
(authenticatorTransport):
(authenticatorTransports):
(publicKeyCredentialDescriptors):
(authenticatorAttachment):
(userVerification):
(authenticatorSelectionCriteria):
(attestationConveyancePreference):
(authenticationExtensionsClientInputs):
(+[_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:]):
(wkAuthenticatorAttestationResponse):
(-[_WKWebAuthenticationPanel makeCredentialWithHash:options:completionHandler:]):
(+[_WKWebAuthenticationPanel convertToCoreRequestOptionsWithOptions:]):
(wkAuthenticatorAssertionResponse):
(-[_WKWebAuthenticationPanel getAssertionWithHash:options:completionHandler:]):
(+[_WKWebAuthenticationPanel isUserVerifyingPlatformAuthenticatorAvailable]):
Implements the SPI.

  • UIProcess/WebAuthentication/WebAuthenticationRequestData.h:

Marks things as to deprecate.

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:

(TestWebKitAPI::TEST):
(): Deleted.

Location:
trunk
Files:
1 added
12 edited
31 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r270141 r270142  
     12020-11-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Implement SPI for AuthenticationServices.Framework
     4        https://bugs.webkit.org/show_bug.cgi?id=218893
     5        <rdar://problem/71364731>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Covered by API tests.
     10
     11        * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
     12        * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
     13        Tweaks some macros to expose an empty struct for ports that have WebAuthn disabled.
     14
    1152020-11-20  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h

    r262994 r270142  
    2727
    2828#if ENABLE(WEB_AUTHN)
    29 
    3029#include "AttestationConveyancePreference.h"
    3130#include "AuthenticationExtensionsClientInputs.h"
     
    3534#include "UserVerificationRequirement.h"
    3635#include <wtf/Forward.h>
     36#endif // ENABLE(WEB_AUTHN)
    3737
    3838namespace WebCore {
    3939
    4040struct PublicKeyCredentialCreationOptions {
     41#if ENABLE(WEB_AUTHN)
    4142    enum class AuthenticatorAttachment {
    4243        Platform,
     
    9091    template<class Encoder> void encode(Encoder&) const;
    9192    template<class Decoder> static Optional<PublicKeyCredentialCreationOptions> decode(Decoder&);
     93#endif // ENABLE(WEB_AUTHN)
    9294};
    9395
     96#if ENABLE(WEB_AUTHN)
    9497template<class Encoder>
    9598void PublicKeyCredentialCreationOptions::Parameters::encode(Encoder& encoder) const
     
    197200    return result;
    198201}
     202#endif // ENABLE(WEB_AUTHN)
    199203
    200204} // namespace WebCore
    201205
     206#if ENABLE(WEB_AUTHN)
    202207namespace WTF {
    203208
     
    211216
    212217} // namespace WTF
    213 
    214 #endif // ENABLE(WEB_AUTHN)
     218#endif // ENABLE(WEB_AUTHN)
  • trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.h

    r243193 r270142  
    2727
    2828#if ENABLE(WEB_AUTHN)
    29 
    3029#include "AuthenticationExtensionsClientInputs.h"
    3130#include "BufferSource.h"
     
    3332#include "UserVerificationRequirement.h"
    3433#include <wtf/Forward.h>
     34#endif // ENABLE(WEB_AUTHN)
    3535
    3636namespace WebCore {
    3737
    3838struct PublicKeyCredentialRequestOptions {
     39#if ENABLE(WEB_AUTHN)
    3940    BufferSource challenge;
    4041    Optional<unsigned> timeout;
     
    4647    template<class Encoder> void encode(Encoder&) const;
    4748    template<class Decoder> static Optional<PublicKeyCredentialRequestOptions> decode(Decoder&);
     49#endif // ENABLE(WEB_AUTHN)
    4850};
    4951
     52#if ENABLE(WEB_AUTHN)
    5053// Not every member is encoded.
    5154template<class Encoder>
     
    8588    return result;
    8689}
     90#endif // ENABLE(WEB_AUTHN)
    8791
    8892} // namespace WebCore
    89 
    90 #endif // ENABLE(WEB_AUTHN)
  • trunk/Source/WebKit/ChangeLog

    r270136 r270142  
     12020-11-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Implement SPI for AuthenticationServices.Framework
     4        https://bugs.webkit.org/show_bug.cgi?id=218893
     5        <rdar://problem/71364731>
     6
     7        Reviewed by Alex Christensen.
     8
     9        This patch implements the SPI for AuthenticationServices.Framework, which is more or less a direct
     10        translation of the WebAuthn Web IDLs and a thin wrapper on top of functionalities of the WebAuthn
     11        process.
     12
     13        It deprecates the existing _WKWebAuthenticationPanel SPI which is for Safari to show UI only. This
     14        patch does not just repurpose the SPI but also modifies some of the implementations. The most noticeable one
     15        is the change of ownerships. Prior to this change, AuthenticatorManager owns the APIWebAuthenticationPanel.
     16        Now, it's the opposite way.
     17
     18        Since there will be a period of time that the deprecated implementation will coexist with the new implementation,
     19        this path also marks things that are meant to deprecate in the future to reduce confusions.
     20
     21        * UIProcess/API/APIWebAuthenticationPanel.cpp:
     22        (API::WebAuthenticationPanel::WebAuthenticationPanel):
     23        (API::WebAuthenticationPanel::handleRequest):
     24        (API::WebAuthenticationPanel::cancel const):
     25        * UIProcess/API/APIWebAuthenticationPanel.h:
     26        Implements the plumbing for the new SPI and owns the AuthenticatorManager now.
     27
     28        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
     29        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
     30        (-[_WKAuthenticationExtensionsClientOutputs initWithAppid:]):
     31        (-[_WKAuthenticatorResponse initWithRawId:extensions:]):
     32        (-[_WKAuthenticatorAssertionResponse initWithRawId:extensions:authenticatorData:signature:userHandle:]):
     33        (-[_WKAuthenticatorAttestationResponse initWithRawId:extensions:attestationObject:]):
     34        (-[_WKAuthenticatorSelectionCriteria init]):
     35        (-[_WKPublicKeyCredentialCreationOptions initWithRp:user:pubKeyCredParams:]):
     36        (-[_WKPublicKeyCredentialDescriptor initWithType:identifier:]):
     37        (-[_WKPublicKeyCredentialEntity initWithName:]):
     38        (-[_WKPublicKeyCredentialParameters initWithType:alg:]):
     39        (-[_WKPublicKeyCredentialRequestOptions init]):
     40        (-[_WKPublicKeyCredentialRpEntity initWithName:]):
     41        (-[_WKPublicKeyCredentialUserEntity initWithName:identifier:displayName:]):
     42        (-[_WKWebAuthenticationPanel init]):
     43        (vectorFromNSData):
     44        (encodeEntity):
     45        (publicKeyCredentialRpEntity):
     46        (publicKeyCredentialUserEntity):
     47        (publicKeyCredentialParameters):
     48        (authenticatorTransport):
     49        (authenticatorTransports):
     50        (publicKeyCredentialDescriptors):
     51        (authenticatorAttachment):
     52        (userVerification):
     53        (authenticatorSelectionCriteria):
     54        (attestationConveyancePreference):
     55        (authenticationExtensionsClientInputs):
     56        (+[_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:]):
     57        (wkAuthenticatorAttestationResponse):
     58        (-[_WKWebAuthenticationPanel makeCredentialWithHash:options:completionHandler:]):
     59        (+[_WKWebAuthenticationPanel convertToCoreRequestOptionsWithOptions:]):
     60        (wkAuthenticatorAssertionResponse):
     61        (-[_WKWebAuthenticationPanel getAssertionWithHash:options:completionHandler:]):
     62        (+[_WKWebAuthenticationPanel isUserVerifyingPlatformAuthenticatorAvailable]):
     63        Implements the SPI.
     64
     65        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
     66        Marks things as to deprecate.
     67
    1682020-11-20  Kate Cheney  <katherine_cheney@apple.com>
    269
  • trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp

    r257269 r270142  
    4242}
    4343
     44WebAuthenticationPanel::WebAuthenticationPanel()
     45    : m_manager(makeUnique<AuthenticatorManager>())
     46    , m_client(makeUniqueRef<WebAuthenticationPanelClient>())
     47{
     48}
     49
    4450WebAuthenticationPanel::WebAuthenticationPanel(const AuthenticatorManager& manager, const WTF::String& rpId, const TransportSet& transports, ClientDataType type)
    45     : m_manager(makeWeakPtr(manager))
     51    : m_client(makeUniqueRef<WebAuthenticationPanelClient>())
     52    , m_weakManager(makeWeakPtr(manager))
    4653    , m_rpId(rpId)
    47     , m_client(WTF::makeUniqueRef<WebAuthenticationPanelClient>())
    4854    , m_clientDataType(type)
    4955{
     
    6066WebAuthenticationPanel::~WebAuthenticationPanel() = default;
    6167
     68void WebAuthenticationPanel::handleRequest(WebAuthenticationRequestData&& request, Callback&& callback)
     69{
     70    ASSERT(m_manager);
     71    m_manager->handleRequest(WTFMove(request), WTFMove(callback));
     72}
     73
    6274void WebAuthenticationPanel::cancel() const
    6375{
    64     if (m_manager)
    65         m_manager->cancelRequest(*this);
     76    if (m_weakManager)
     77        m_weakManager->cancelRequest(*this);
    6678}
    6779
  • trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.h

    r251762 r270142  
    3636namespace WebCore {
    3737enum class ClientDataType : bool;
     38
     39class AuthenticatorResponse;
     40
     41struct ExceptionData;
    3842}
    3943
    4044namespace WebKit {
    4145class AuthenticatorManager;
     46
     47struct WebAuthenticationRequestData;
    4248}
    4349
     
    4854class WebAuthenticationPanel final : public ObjectImpl<Object::Type::WebAuthenticationPanel>, public CanMakeWeakPtr<WebAuthenticationPanel> {
    4955public:
    50     using TransportSet = HashSet<WebCore::AuthenticatorTransport, WTF::IntHash<WebCore::AuthenticatorTransport>, WTF::StrongEnumHashTraits<WebCore::AuthenticatorTransport>>;
     56    using Response = Variant<Ref<WebCore::AuthenticatorResponse>, WebCore::ExceptionData>;
     57    using Callback = CompletionHandler<void(Response&&)>;
    5158
    52     static Ref<WebAuthenticationPanel> create(const WebKit::AuthenticatorManager&, const WTF::String& rpId, const TransportSet&, WebCore::ClientDataType);
     59    WebAuthenticationPanel();
    5360    ~WebAuthenticationPanel();
    5461
    55     WTF::String rpId() const { return m_rpId; }
    56     const Vector<WebCore::AuthenticatorTransport>& transports() const { return m_transports; }
    57     WebCore::ClientDataType clientDataType() const { return m_clientDataType; }
     62    void handleRequest(WebKit::WebAuthenticationRequestData&&, Callback&&);
    5863    void cancel() const;
    5964
     
    6166    void setClient(UniqueRef<WebAuthenticationPanelClient>&&);
    6267
     68    // FIXME: <rdar://problem/71509848> Remove the following deprecated methods.
     69    using TransportSet = HashSet<WebCore::AuthenticatorTransport, WTF::IntHash<WebCore::AuthenticatorTransport>, WTF::StrongEnumHashTraits<WebCore::AuthenticatorTransport>>;
     70    static Ref<WebAuthenticationPanel> create(const WebKit::AuthenticatorManager&, const WTF::String& rpId, const TransportSet&, WebCore::ClientDataType);
     71    WTF::String rpId() const { return m_rpId; }
     72    const Vector<WebCore::AuthenticatorTransport>& transports() const { return m_transports; }
     73    WebCore::ClientDataType clientDataType() const { return m_clientDataType; }
     74
    6375private:
     76    // FIXME: <rdar://problem/71509848> Remove the following deprecated method.
    6477    WebAuthenticationPanel(const WebKit::AuthenticatorManager&, const WTF::String& rpId, const TransportSet&, WebCore::ClientDataType);
    6578
    66     WeakPtr<WebKit::AuthenticatorManager> m_manager;
     79    std::unique_ptr<WebKit::AuthenticatorManager> m_manager; // FIXME: <rdar://problem/71509848> Change to UniqueRef.
     80    UniqueRef<WebAuthenticationPanelClient> m_client;
     81
     82    // FIXME: <rdar://problem/71509848> Remove the following deprecated fields.
     83    WeakPtr<WebKit::AuthenticatorManager> m_weakManager;
    6784    WTF::String m_rpId;
    68     UniqueRef<WebAuthenticationPanelClient> m_client;
    6985    Vector<WebCore::AuthenticatorTransport> m_transports;
    7086    WebCore::ClientDataType m_clientDataType;
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientInputs.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
    4031
    41 namespace WebKit {
     32NS_ASSUME_NONNULL_BEGIN
    4233
    43 class WebPageProxy;
     34WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     35@interface _WKAuthenticationExtensionsClientInputs : NSObject
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37@property (nullable, nonatomic, copy) NSString *appid;
    5638
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     39@end
    5840
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     41NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientInputs.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKAuthenticationExtensionsClientInputs.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
    29 
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
    40 
    41 namespace WebKit {
    42 
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     29@implementation _WKAuthenticationExtensionsClientInputs
     30@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientOutputs.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
    4031
    41 namespace WebKit {
     32NS_ASSUME_NONNULL_BEGIN
    4233
    43 class WebPageProxy;
     34WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     35@interface _WKAuthenticationExtensionsClientOutputs : NSObject
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37@property (nonatomic, readonly) BOOL appid;
    5638
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     39@end
    5840
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     41NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientOutputs.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKAuthenticationExtensionsClientOutputs.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKAuthenticationExtensionsClientOutputs
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)initWithAppid:(BOOL)appid
     32{
     33    if (!(self = [super init]))
     34        return nil;
    4035
    41 namespace WebKit {
     36    _appid = appid;
     37    return self;
     38}
    4239
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     40@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientOutputsInternal.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import "_WKAuthenticationExtensionsClientOutputs.h"
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30NS_ASSUME_NONNULL_BEGIN
    4031
    41 namespace WebKit {
     32@interface _WKAuthenticationExtensionsClientOutputs ()
    4233
    43 class WebPageProxy;
     34- (instancetype)initWithAppid:(BOOL)appid;
    4435
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     36@end
    5637
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     38NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorAssertionResponse.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/_WKAuthenticatorResponse.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30NS_ASSUME_NONNULL_BEGIN
    4031
    41 namespace WebKit {
     32WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     33@interface _WKAuthenticatorAssertionResponse : _WKAuthenticatorResponse
    4234
    43 class WebPageProxy;
     35@property (nonatomic, readonly) NSData *authenticatorData;
     36@property (nonatomic, readonly) NSData *signature;
     37@property (nullable, nonatomic, readonly) NSData *userHandle;
    4438
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     39@end
    5640
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     41NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorAssertionResponse.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKAuthenticatorAssertionResponse.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29#import "_WKAuthenticationExtensionsClientOutputs.h"
     30#import "_WKAuthenticatorResponseInternal.h"
     31#import <wtf/RetainPtr.h>
    2932
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     33@implementation _WKAuthenticatorAssertionResponse
    4034
    41 namespace WebKit {
     35- (instancetype)initWithRawId:(NSData *)rawId extensions:(RetainPtr<_WKAuthenticationExtensionsClientOutputs>&&)extensions authenticatorData:(NSData *)authenticatorData signature:(NSData *)signature userHandle:(NSData *)userHandle
     36{
     37    if (!(self = [super initWithRawId:rawId extensions:WTFMove(extensions)]))
     38        return nil;
    4239
    43 class WebPageProxy;
     40    _authenticatorData = authenticatorData;
     41    _signature = signature;
     42    _userHandle = userHandle;
     43    return self;
     44}
    4445
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     46@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorAssertionResponseInternal.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import "_WKAuthenticatorAssertionResponse.h"
     29#import <wtf/RetainPtr.h>
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31NS_ASSUME_NONNULL_BEGIN
    4032
    41 namespace WebKit {
     33@class _WKAuthenticationExtensionsClientOutputs;
    4234
    43 class WebPageProxy;
     35@interface _WKAuthenticatorAssertionResponse ()
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37- (instancetype)initWithRawId:(NSData *)rawId extensions:(RetainPtr<_WKAuthenticationExtensionsClientOutputs>&&)extensions authenticatorData:(NSData *)authenticatorData signature:(NSData *)signature userHandle:(NSData *)userHandle;
    5638
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     39@end
    5840
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     41NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorAttestationResponse.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/_WKAuthenticatorResponse.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30NS_ASSUME_NONNULL_BEGIN
    4031
    41 namespace WebKit {
     32WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     33@interface _WKAuthenticatorAttestationResponse : _WKAuthenticatorResponse
    4234
    43 class WebPageProxy;
     35@property (nonatomic, readonly) NSData *attestationObject;
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37@end
    5638
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     39NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorAttestationResponse.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKAuthenticatorAttestationResponse.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29#import "_WKAuthenticationExtensionsClientOutputs.h"
     30#import "_WKAuthenticatorResponseInternal.h"
     31#import <wtf/RetainPtr.h>
    2932
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     33@implementation _WKAuthenticatorAttestationResponse
    4034
    41 namespace WebKit {
     35- (instancetype)initWithRawId:(NSData *)rawId extensions:(RetainPtr<_WKAuthenticationExtensionsClientOutputs>&&)extensions attestationObject:(NSData *)attestationObject
     36{
     37    if (!(self = [super initWithRawId:rawId extensions:WTFMove(extensions)]))
     38        return nil;
    4239
    43 class WebPageProxy;
     40    _attestationObject = attestationObject;
     41    return self;
     42}
    4443
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     44@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorAttestationResponseInternal.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import "_WKAuthenticatorAttestationResponse.h"
     29#import <wtf/RetainPtr.h>
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31NS_ASSUME_NONNULL_BEGIN
    4032
    41 namespace WebKit {
     33@class _WKAuthenticationExtensionsClientOutputs;
    4234
    43 class WebPageProxy;
     35@interface _WKAuthenticatorAttestationResponse ()
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37- (instancetype)initWithRawId:(NSData *)rawId extensions:(RetainPtr<_WKAuthenticationExtensionsClientOutputs>&&)extensions attestationObject:(NSData *)attestationObject;
    5638
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     39@end
    5840
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     41NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorResponse.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
    4031
    41 namespace WebKit {
     32NS_ASSUME_NONNULL_BEGIN
    4233
    43 class WebPageProxy;
     34@class _WKAuthenticationExtensionsClientOutputs;
    4435
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     36WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     37@interface _WKAuthenticatorResponse : NSObject
    5638
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     39@property (nonatomic, readonly) NSData *rawId;
     40@property (nullable, nonatomic, readonly, strong) _WKAuthenticationExtensionsClientOutputs *extensions;
    5841
    59 } // namespace WebKit
     42@end
    6043
    61 #endif // ENABLE(WEB_AUTHN)
     44NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorResponse.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKAuthenticatorResponseInternal.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29#import "_WKAuthenticationExtensionsClientOutputs.h"
     30#import <wtf/RetainPtr.h>
    2931
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     32@implementation _WKAuthenticatorResponse {
     33    RetainPtr<_WKAuthenticationExtensionsClientOutputs> _extensions;
     34}
    4035
    41 namespace WebKit {
     36- (instancetype)initWithRawId:(NSData *)rawId extensions:(RetainPtr<_WKAuthenticationExtensionsClientOutputs>&&)extensions
     37{
     38    if (!(self = [super init]))
     39        return nil;
    4240
    43 class WebPageProxy;
     41    _rawId = rawId;
     42    _extensions = extensions;
     43    return self;
     44}
    4445
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     46- (_WKAuthenticationExtensionsClientOutputs *)extensions
     47{
     48    return _extensions.get();
     49}
    5650
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     51@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorResponseInternal.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import "_WKAuthenticatorResponse.h"
     29#import <wtf/RetainPtr.h>
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31NS_ASSUME_NONNULL_BEGIN
    4032
    41 namespace WebKit {
     33@class _WKAuthenticationExtensionsClientOutputs;
    4234
    43 class WebPageProxy;
     35@interface _WKAuthenticatorResponse ()
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37- (instancetype)initWithRawId:(NSData *)rawId extensions:(RetainPtr<_WKAuthenticationExtensionsClientOutputs>&&)extensions;
    5638
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     39@end
    5840
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     41NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorSelectionCriteria.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
     31#import <WebKit/_WKUserVerificationRequirement.h>
    4032
    41 namespace WebKit {
     33NS_ASSUME_NONNULL_BEGIN
    4234
    43 class WebPageProxy;
     35typedef NS_ENUM(NSInteger, _WKAuthenticatorAttachment) {
     36    _WKAuthenticatorAttachmentAll,
     37    _WKAuthenticatorAttachmentPlatform,
     38    _WKAuthenticatorAttachmentCrossPlatform,
     39} WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    4440
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     41WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     42@interface _WKAuthenticatorSelectionCriteria : NSObject
    5643
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     44/*!@discussion The default value is _WKAuthenticatorAttachmentAll.*/
     45@property (nonatomic) _WKAuthenticatorAttachment authenticatorAttachment;
    5846
    59 } // namespace WebKit
     47/*!@discussion The default value is NO.*/
     48@property (nonatomic) BOOL requireResidentKey;
    6049
    61 #endif // ENABLE(WEB_AUTHN)
     50/*!@discussion The default value is _WKUserVerificationRequirementPreferred.*/
     51@property (nonatomic) _WKUserVerificationRequirement userVerification;
     52
     53@end
     54
     55NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorSelectionCriteria.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKAuthenticatorSelectionCriteria.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKAuthenticatorSelectionCriteria
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)init
     32{
     33    if (!(self = [super init]))
     34        return nil;
    4035
    41 namespace WebKit {
     36    self.authenticatorAttachment = _WKAuthenticatorAttachmentAll;
     37    self.requireResidentKey = NO;
     38    self.userVerification = _WKUserVerificationRequirementPreferred;
     39    return self;
     40}
    4241
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     42@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialCreationOptions.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKPublicKeyCredentialCreationOptions.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29#import "_WKPublicKeyCredentialRelyingPartyEntity.h"
     30#import "_WKPublicKeyCredentialUserEntity.h"
    2931
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     32@implementation _WKPublicKeyCredentialCreationOptions
    4033
    41 namespace WebKit {
     34- (instancetype)initWithRelyingParty:(_WKPublicKeyCredentialRelyingPartyEntity *)relyingParty user:(_WKPublicKeyCredentialUserEntity *)user publicKeyCredentialParamaters:(NSArray<_WKPublicKeyCredentialParameters *> *)publicKeyCredentialParamaters
     35{
     36    if (!(self = [super init]))
     37        return nil;
    4238
    43 class WebPageProxy;
     39    self.relyingParty = relyingParty;
     40    self.user = user;
     41    self.publicKeyCredentialParamaters = publicKeyCredentialParamaters;
     42    return self;
     43}
    4444
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     45@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialDescriptor.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
    4031
    41 namespace WebKit {
     32NS_ASSUME_NONNULL_BEGIN
    4233
    43 class WebPageProxy;
     34WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     35@interface _WKPublicKeyCredentialDescriptor : NSObject
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37+ (instancetype)new NS_UNAVAILABLE;
     38- (instancetype)init NS_UNAVAILABLE;
     39- (instancetype)initWithIdentifier:(NSData *)identifier;
    5640
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     41@property (nonatomic, copy) NSData *identifier;
     42@property (nullable, nonatomic, copy) NSArray<NSNumber *> *transports;
    5843
    59 } // namespace WebKit
     44@end
    6045
    61 #endif // ENABLE(WEB_AUTHN)
     46NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialDescriptor.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKPublicKeyCredentialDescriptor.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKPublicKeyCredentialDescriptor
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)initWithIdentifier:(NSData *)identifier
     32{
     33    if (!(self = [super init]))
     34        return nil;
    4035
    41 namespace WebKit {
     36    self.identifier = identifier;
     37    return self;
     38}
    4239
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     40@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialEntity.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
    4031
    41 namespace WebKit {
     32NS_ASSUME_NONNULL_BEGIN
    4233
    43 class WebPageProxy;
     34WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     35@interface _WKPublicKeyCredentialEntity : NSObject
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37+ (instancetype)new NS_UNAVAILABLE;
     38- (instancetype)init NS_UNAVAILABLE;
     39- (instancetype)initWithName:(NSString *)name;
    5640
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     41@property (nonatomic, copy) NSString *name;
     42@property (nullable, nonatomic, copy) NSString *icon;
    5843
    59 } // namespace WebKit
     44@end
    6045
    61 #endif // ENABLE(WEB_AUTHN)
     46NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialEntity.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKPublicKeyCredentialEntity.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKPublicKeyCredentialEntity
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)initWithName:(NSString *)name
     32{
     33    if (!(self = [super init]))
     34        return nil;
    4035
    41 namespace WebKit {
     36    self.name = name;
     37    return self;
     38}
    4239
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     40@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialParameters.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
    4031
    41 namespace WebKit {
     32NS_ASSUME_NONNULL_BEGIN
    4233
    43 class WebPageProxy;
     34WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     35@interface _WKPublicKeyCredentialParameters : NSObject
    4436
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     37+ (instancetype)new NS_UNAVAILABLE;
     38- (instancetype)init NS_UNAVAILABLE;
     39- (instancetype)initWithAlgorithm:(NSNumber *)algorithm;
    5640
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     41@property (nonatomic, copy) NSNumber *algorithm;
    5842
    59 } // namespace WebKit
     43@end
    6044
    61 #endif // ENABLE(WEB_AUTHN)
     45NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialParameters.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKPublicKeyCredentialParameters.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKPublicKeyCredentialParameters
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)initWithAlgorithm:(NSNumber *)algorithm
     32{
     33    if (!(self = [super init]))
     34        return nil;
    4035
    41 namespace WebKit {
     36    self.algorithm = algorithm;
     37    return self;
     38}
    4239
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     40@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialRelyingPartyEntity.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/_WKPublicKeyCredentialEntity.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30NS_ASSUME_NONNULL_BEGIN
    4031
    41 namespace WebKit {
     32WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     33@interface _WKPublicKeyCredentialRelyingPartyEntity : _WKPublicKeyCredentialEntity
    4234
    43 class WebPageProxy;
     35+ (instancetype)new NS_UNAVAILABLE;
     36- (instancetype)init NS_UNAVAILABLE;
     37- (instancetype)initWithName:(NSString *)name;
    4438
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     39@property (nullable, nonatomic, copy) NSString *identifier;
    5640
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     41@end
    5842
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     43NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialRelyingPartyEntity.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKPublicKeyCredentialRelyingPartyEntity.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKPublicKeyCredentialRelyingPartyEntity
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)initWithName:(NSString *)name
     32{
     33    if (!(self = [super initWithName:name]))
     34        return nil;
     35    return self;
     36}
    4037
    41 namespace WebKit {
    42 
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     38@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialRequestOptions.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30#import <Foundation/Foundation.h>
     31#import <WebKit/_WKUserVerificationRequirement.h>
    4032
    41 namespace WebKit {
     33NS_ASSUME_NONNULL_BEGIN
    4234
    43 class WebPageProxy;
     35@class _WKAuthenticationExtensionsClientInputs;
     36@class _WKPublicKeyCredentialDescriptor;
    4437
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     38WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     39@interface _WKPublicKeyCredentialRequestOptions : NSObject
    5640
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     41@property (nullable, nonatomic, copy) NSNumber *timeout;
     42@property (nullable, nonatomic, copy) NSString *relyingPartyIdentifier;
     43@property (nullable, nonatomic, copy) NSArray<_WKPublicKeyCredentialDescriptor *> *allowCredentials;
     44/*!@discussion The default value is _WKUserVerificationRequirementPreferred.*/
     45@property (nonatomic) _WKUserVerificationRequirement userVerification;
     46@property (nullable, nonatomic, strong) _WKAuthenticationExtensionsClientInputs *extensions;
    5847
    59 } // namespace WebKit
     48@end
    6049
    61 #endif // ENABLE(WEB_AUTHN)
     50NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialRequestOptions.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKPublicKeyCredentialRequestOptions.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKPublicKeyCredentialRequestOptions
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)init
     32{
     33    if (!(self = [super init]))
     34        return nil;
    4035
    41 namespace WebKit {
     36    self.userVerification = _WKUserVerificationRequirementPreferred;
     37    return self;
     38}
    4239
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     40@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialUserEntity.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/_WKPublicKeyCredentialEntity.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30NS_ASSUME_NONNULL_BEGIN
    4031
    41 namespace WebKit {
     32WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     33@interface _WKPublicKeyCredentialUserEntity : _WKPublicKeyCredentialEntity
    4234
    43 class WebPageProxy;
     35+ (instancetype)new NS_UNAVAILABLE;
     36- (instancetype)init NS_UNAVAILABLE;
     37- (instancetype)initWithName:(NSString *)name NS_UNAVAILABLE;
     38- (instancetype)initWithName:(NSString *)name identifier:(NSData *)identifier displayName:(NSString *)displayName;
    4439
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
     40@property (nonatomic, copy) NSData *identifier;
     41@property (nonatomic, copy) NSString *displayName;
    5642
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
     43@end
    5844
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     45NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKPublicKeyCredentialUserEntity.mm

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #pragma once
     26#import "config.h"
     27#import "_WKPublicKeyCredentialUserEntity.h"
    2728
    28 #if ENABLE(WEB_AUTHN)
     29@implementation _WKPublicKeyCredentialUserEntity
    2930
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     31- (instancetype)initWithName:(NSString *)name identifier:(NSData *)identifier displayName:(NSString *)displayName
     32{
     33    if (!(self = [super initWithName:name]))
     34        return nil;
    4035
    41 namespace WebKit {
     36    self.identifier = identifier;
     37    self.displayName = displayName;
     38    return self;
     39}
    4240
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     41@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKUserVerificationRequirement.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
    40 
    41 namespace WebKit {
    42 
    43 class WebPageProxy;
    44 
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     30typedef NS_ENUM(NSInteger, _WKUserVerificationRequirement) {
     31    _WKUserVerificationRequirementRequired,
     32    _WKUserVerificationRequirementPreferred,
     33    _WKUserVerificationRequirementDiscouraged,
     34} WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h

    r261118 r270142  
    2929NS_ASSUME_NONNULL_BEGIN
    3030
    31 @class LAContext;
     31@class _WKAuthenticatorAttestationResponse;
     32@class _WKAuthenticatorAssertionResponse;
     33@class _WKPublicKeyCredentialCreationOptions;
     34@class _WKPublicKeyCredentialRequestOptions;
    3235@class _WKWebAuthenticationAssertionResponse;
    3336@class _WKWebAuthenticationPanel;
     
    7679} WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    7780
     81// FIXME: <rdar://problem/71509141> Optimize the delegate for the AuthenticationService.framework.
    7882@protocol _WKWebAuthenticationPanelDelegate <NSObject>
    7983
     
    9296
    9397@property (nullable, nonatomic, weak) id <_WKWebAuthenticationPanelDelegate> delegate;
     98
     99+ (void)clearAllLocalAuthenticatorCredentials;
     100+ (BOOL)isUserVerifyingPlatformAuthenticatorAvailable;
     101
     102- (instancetype)init;
     103
     104// FIXME: <rdar://problem/71509394> Adds ClientDataJSON.
     105// FIXME: <rdar://problem/71509485> Adds detailed NSError.
     106- (void)makeCredentialWithHash:(NSData *)hash options:(_WKPublicKeyCredentialCreationOptions *)options completionHandler:(void (^)(_WKAuthenticatorAttestationResponse *, NSError *))handler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     107- (void)getAssertionWithHash:(NSData *)hash options:(_WKPublicKeyCredentialRequestOptions *)options completionHandler:(void (^)(_WKAuthenticatorAssertionResponse *, NSError *))handler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     108- (void)cancel;
     109
     110// FIXME: <rdar://problem/71509848> Deprecate the following properties.
    94111@property (nonatomic, readonly, copy) NSString *relyingPartyID;
    95112@property (nonatomic, readonly, copy) NSSet *transports;
    96113@property (nonatomic, readonly) _WKWebAuthenticationType type;
    97114
    98 + (void)clearAllLocalAuthenticatorCredentials;
    99 
    100 - (void)cancel;
    101 
    102115@end
    103116
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm

    r261118 r270142  
    2727#import "_WKWebAuthenticationPanelInternal.h"
    2828
     29
    2930#import "LocalAuthenticator.h"
     31#import "LocalService.h"
     32#import "WKError.h"
    3033#import "WebAuthenticationPanelClient.h"
     34#import "_WKAuthenticationExtensionsClientInputs.h"
     35#import "_WKAuthenticationExtensionsClientOutputsInternal.h"
     36#import "_WKAuthenticatorAssertionResponseInternal.h"
     37#import "_WKAuthenticatorAttestationResponseInternal.h"
     38#import "_WKAuthenticatorSelectionCriteria.h"
     39#import "_WKPublicKeyCredentialCreationOptions.h"
     40#import "_WKPublicKeyCredentialDescriptor.h"
     41#import "_WKPublicKeyCredentialParameters.h"
     42#import "_WKPublicKeyCredentialRequestOptions.h"
     43#import "_WKPublicKeyCredentialRelyingPartyEntity.h"
     44#import "_WKPublicKeyCredentialUserEntity.h"
     45#import <WebCore/AuthenticatorResponse.h>
     46#import <WebCore/AuthenticatorResponseData.h>
     47#import <WebCore/PublicKeyCredentialCreationOptions.h>
     48#import <WebCore/PublicKeyCredentialRequestOptions.h>
    3149#import <WebCore/WebAuthenticationConstants.h>
     50#import <wtf/BlockPtr.h>
    3251#import <wtf/RetainPtr.h>
    3352
     
    3756    RetainPtr<NSMutableSet> _transports;
    3857#endif
     58}
     59
     60- (instancetype)init
     61{
     62    if (!(self = [super init]))
     63        return nil;
     64
     65#if ENABLE(WEB_AUTHN)
     66    API::Object::constructInWrapper<API::WebAuthenticationPanel>(self);
     67#endif
     68    return self;
    3969}
    4070
     
    137167
    138168#if ENABLE(WEB_AUTHN)
     169static Vector<uint8_t> vectorFromNSData(NSData* data)
     170{
     171    Vector<uint8_t> result;
     172    result.append((const uint8_t*)data.bytes, data.length);
     173    return result;
     174}
     175
     176static WebCore::PublicKeyCredentialCreationOptions::RpEntity publicKeyCredentialRpEntity(_WKPublicKeyCredentialRelyingPartyEntity *rpEntity)
     177{
     178    WebCore::PublicKeyCredentialCreationOptions::RpEntity result;
     179    result.name = rpEntity.name;
     180    result.icon = rpEntity.icon;
     181    result.id = rpEntity.identifier;
     182
     183    return result;
     184}
     185
     186static WebCore::PublicKeyCredentialCreationOptions::UserEntity publicKeyCredentialUserEntity(_WKPublicKeyCredentialUserEntity *userEntity)
     187{
     188    WebCore::PublicKeyCredentialCreationOptions::UserEntity result;
     189    result.name = userEntity.name;
     190    result.icon = userEntity.icon;
     191    result.idVector = vectorFromNSData(userEntity.identifier);
     192    result.displayName = userEntity.displayName;
     193
     194    return result;
     195}
     196
     197static Vector<WebCore::PublicKeyCredentialCreationOptions::Parameters> publicKeyCredentialParameters(NSArray<_WKPublicKeyCredentialParameters *> *publicKeyCredentialParamaters)
     198{
     199    Vector<WebCore::PublicKeyCredentialCreationOptions::Parameters> result;
     200    result.reserveInitialCapacity(publicKeyCredentialParamaters.count);
     201
     202    for (_WKPublicKeyCredentialParameters *param : publicKeyCredentialParamaters)
     203        result.uncheckedAppend({ WebCore::PublicKeyCredentialType::PublicKey, param.algorithm.longLongValue });
     204
     205    return result;
     206}
     207
     208static WebCore::AuthenticatorTransport authenticatorTransport(_WKWebAuthenticationTransport transport)
     209{
     210    switch (transport) {
     211    case _WKWebAuthenticationTransportUSB:
     212        return WebCore::AuthenticatorTransport::Usb;
     213    case _WKWebAuthenticationTransportNFC:
     214        return WebCore::AuthenticatorTransport::Nfc;
     215    case _WKWebAuthenticationTransportInternal:
     216        return WebCore::AuthenticatorTransport::Internal;
     217    default:
     218        ASSERT_NOT_REACHED();
     219        return WebCore::AuthenticatorTransport::Usb;
     220    }
     221}
     222
     223static Vector<WebCore::AuthenticatorTransport> authenticatorTransports(NSArray<NSNumber *> *transports)
     224{
     225    Vector<WebCore::AuthenticatorTransport> result;
     226    result.reserveInitialCapacity(transports.count);
     227
     228    for (NSNumber *transport : transports)
     229        result.uncheckedAppend(authenticatorTransport((_WKWebAuthenticationTransport)transport.intValue));
     230
     231    return result;
     232}
     233
     234static Vector<WebCore::PublicKeyCredentialDescriptor> publicKeyCredentialDescriptors(NSArray<_WKPublicKeyCredentialDescriptor *> *credentials)
     235{
     236    Vector<WebCore::PublicKeyCredentialDescriptor> result;
     237    result.reserveInitialCapacity(credentials.count);
     238
     239    for (_WKPublicKeyCredentialDescriptor *credential : credentials)
     240        result.uncheckedAppend({ WebCore::PublicKeyCredentialType::PublicKey, { }, vectorFromNSData(credential.identifier), authenticatorTransports(credential.transports) });
     241
     242    return result;
     243}
     244
     245static Optional<WebCore::PublicKeyCredentialCreationOptions::AuthenticatorAttachment> authenticatorAttachment(_WKAuthenticatorAttachment attachment)
     246{
     247    switch (attachment) {
     248    case _WKAuthenticatorAttachmentAll:
     249        return WTF::nullopt;
     250    case _WKAuthenticatorAttachmentPlatform:
     251        return WebCore::PublicKeyCredentialCreationOptions::AuthenticatorAttachment::Platform;
     252    case _WKAuthenticatorAttachmentCrossPlatform:
     253        return WebCore::PublicKeyCredentialCreationOptions::AuthenticatorAttachment::CrossPlatform;
     254    default:
     255        ASSERT_NOT_REACHED();
     256        return WTF::nullopt;
     257    }
     258}
     259
     260static WebCore::UserVerificationRequirement userVerification(_WKUserVerificationRequirement uv)
     261{
     262    switch (uv) {
     263    case _WKUserVerificationRequirementRequired:
     264        return WebCore::UserVerificationRequirement::Required;
     265    case _WKUserVerificationRequirementPreferred:
     266        return WebCore::UserVerificationRequirement::Preferred;
     267    case _WKUserVerificationRequirementDiscouraged:
     268        return WebCore::UserVerificationRequirement::Discouraged;
     269    default:
     270        ASSERT_NOT_REACHED();
     271        return WebCore::UserVerificationRequirement::Preferred;
     272    }
     273}
     274
     275static WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria authenticatorSelectionCriteria(_WKAuthenticatorSelectionCriteria *authenticatorSelection)
     276{
     277    WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria result;
     278    result.authenticatorAttachment = authenticatorAttachment(authenticatorSelection.authenticatorAttachment);
     279    result.requireResidentKey = authenticatorSelection.requireResidentKey;
     280    result.userVerification = userVerification(authenticatorSelection.userVerification);
     281
     282    return result;
     283}
     284
     285static WebCore::AttestationConveyancePreference attestationConveyancePreference(_WKAttestationConveyancePreference attestation)
     286{
     287    switch (attestation) {
     288    case _WKAttestationConveyancePreferenceNone:
     289        return WebCore::AttestationConveyancePreference::None;
     290    case _WKAttestationConveyancePreferenceIndirect:
     291        return WebCore::AttestationConveyancePreference::Indirect;
     292    case _WKAttestationConveyancePreferenceDirect:
     293        return WebCore::AttestationConveyancePreference::Direct;
     294    default:
     295        ASSERT_NOT_REACHED();
     296        return WebCore::AttestationConveyancePreference::None;
     297    }
     298}
     299
     300static WebCore::AuthenticationExtensionsClientInputs authenticationExtensionsClientInputs(_WKAuthenticationExtensionsClientInputs *extensions)
     301{
     302    WebCore::AuthenticationExtensionsClientInputs result;
     303    result.appid = extensions.appid;
     304    result.googleLegacyAppidSupport = false;
     305
     306    return result;
     307}
     308#endif
     309
     310+ (WebCore::PublicKeyCredentialCreationOptions)convertToCoreCreationOptionsWithOptions:(_WKPublicKeyCredentialCreationOptions *)options
     311{
     312    WebCore::PublicKeyCredentialCreationOptions result;
     313
     314#if ENABLE(WEB_AUTHN)
     315    result.rp = publicKeyCredentialRpEntity(options.relyingParty);
     316    result.user = publicKeyCredentialUserEntity(options.user);
     317
     318    result.pubKeyCredParams = publicKeyCredentialParameters(options.publicKeyCredentialParamaters);
     319
     320    if (options.timeout)
     321        result.timeout = options.timeout.unsignedIntValue;
     322    if (options.excludeCredentials)
     323        result.excludeCredentials = publicKeyCredentialDescriptors(options.excludeCredentials);
     324    if (options.authenticatorSelection)
     325        result.authenticatorSelection = authenticatorSelectionCriteria(options.authenticatorSelection);
     326    result.attestation = attestationConveyancePreference(options.attestation);
     327    result.extensions = authenticationExtensionsClientInputs(options.extensions);
     328#endif
     329
     330    return result;
     331}
     332
     333#if ENABLE(WEB_AUTHN)
     334static RetainPtr<_WKAuthenticatorAttestationResponse> wkAuthenticatorAttestationResponse(const WebCore::AuthenticatorResponseData& data)
     335{
     336    return adoptNS([[_WKAuthenticatorAttestationResponse alloc] initWithRawId:[NSData dataWithBytes:data.rawId->data() length:data.rawId->byteLength()] extensions:nil attestationObject:[NSData dataWithBytes:data.attestationObject->data() length:data.attestationObject->byteLength()]]);
     337}
     338#endif
     339
     340- (void)makeCredentialWithHash:(NSData *)hash options:(_WKPublicKeyCredentialCreationOptions *)options completionHandler:(void (^)(_WKAuthenticatorAttestationResponse *, NSError *))handler
     341{
     342#if ENABLE(WEB_AUTHN)
     343    auto callback = [handler = makeBlockPtr(handler)] (Variant<Ref<WebCore::AuthenticatorResponse>, WebCore::ExceptionData>&& result) mutable {
     344        WTF::switchOn(result, [&](const Ref<WebCore::AuthenticatorResponse>& response) {
     345            handler(wkAuthenticatorAttestationResponse(response->data()).get(), nil);
     346        }, [&](const WebCore::ExceptionData& exception) {
     347            handler(nil, [NSError errorWithDomain:WKErrorDomain code:WKErrorUnknown userInfo:nil]);
     348        });
     349    };
     350    _panel->handleRequest({ vectorFromNSData(hash), [_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:options], nullptr, WebKit::WebAuthenticationPanelResult::Unavailable, nullptr, WTF::nullopt, { }, true, String() }, WTFMove(callback));
     351#endif
     352}
     353
     354+ (WebCore::PublicKeyCredentialRequestOptions)convertToCoreRequestOptionsWithOptions:(_WKPublicKeyCredentialRequestOptions *)options
     355{
     356    WebCore::PublicKeyCredentialRequestOptions result;
     357
     358#if ENABLE(WEB_AUTHN)
     359    if (options.timeout)
     360        result.timeout = options.timeout.unsignedIntValue;
     361    if (options.relyingPartyIdentifier)
     362        result.rpId = options.relyingPartyIdentifier;
     363    if (options.allowCredentials)
     364        result.allowCredentials = publicKeyCredentialDescriptors(options.allowCredentials);
     365    result.userVerification = userVerification(options.userVerification);
     366    result.extensions = authenticationExtensionsClientInputs(options.extensions);
     367#endif
     368
     369    return result;
     370}
     371
     372#if ENABLE(WEB_AUTHN)
     373static RetainPtr<_WKAuthenticatorAssertionResponse> wkAuthenticatorAssertionResponse(const WebCore::AuthenticatorResponseData& data)
     374{
     375    RetainPtr<_WKAuthenticationExtensionsClientOutputs> extensions;
     376    if (data.appid)
     377        extensions = adoptNS([[_WKAuthenticationExtensionsClientOutputs alloc] initWithAppid:data.appid.value()]);
     378
     379    NSData *userHandle = nil;
     380    if (data.userHandle)
     381        userHandle = [NSData dataWithBytes:data.userHandle->data() length:data.userHandle->byteLength()];
     382
     383    return adoptNS([[_WKAuthenticatorAssertionResponse alloc] initWithRawId:[NSData dataWithBytes:data.rawId->data() length:data.rawId->byteLength()] extensions:WTFMove(extensions) authenticatorData:[NSData dataWithBytes:data.authenticatorData->data() length:data.authenticatorData->byteLength()] signature:[NSData dataWithBytes:data.signature->data() length:data.signature->byteLength()] userHandle:userHandle]);
     384}
     385#endif
     386
     387- (void)getAssertionWithHash:(NSData *)hash options:(_WKPublicKeyCredentialRequestOptions *)options completionHandler:(void (^)(_WKAuthenticatorAssertionResponse *, NSError *))handler
     388{
     389#if ENABLE(WEB_AUTHN)
     390    auto callback = [handler = makeBlockPtr(handler)] (Variant<Ref<WebCore::AuthenticatorResponse>, WebCore::ExceptionData>&& result) mutable {
     391        WTF::switchOn(result, [&](const Ref<WebCore::AuthenticatorResponse>& response) {
     392            handler(wkAuthenticatorAssertionResponse(response->data()).get(), nil);
     393        }, [&](const WebCore::ExceptionData& exception) {
     394            handler(nil, [NSError errorWithDomain:WKErrorDomain code:WKErrorUnknown userInfo:nil]);
     395        });
     396    };
     397    _panel->handleRequest({ vectorFromNSData(hash), [_WKWebAuthenticationPanel convertToCoreRequestOptionsWithOptions:options], nullptr, WebKit::WebAuthenticationPanelResult::Unavailable, nullptr, WTF::nullopt, { }, true, String() }, WTFMove(callback));
     398#endif
     399}
     400
     401+ (BOOL)isUserVerifyingPlatformAuthenticatorAvailable
     402{
     403#if ENABLE(WEB_AUTHN)
     404    return WebKit::LocalService::isAvailable();
     405#else
     406    return NO;
     407#endif
     408}
     409
     410#if ENABLE(WEB_AUTHN)
    139411#pragma mark WKObject protocol implementation
    140412
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelForTesting.h

    r270141 r270142  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
    28 #if ENABLE(WEB_AUTHN)
     28#import "_WKWebAuthenticationPanel.h"
    2929
    30 #include "APIWebAuthenticationPanel.h"
    31 #include "FrameInfoData.h"
    32 #include "WebAuthenticationFlags.h"
    33 #include <WebCore/GlobalFrameIdentifier.h>
    34 #include <WebCore/PublicKeyCredentialCreationOptions.h>
    35 #include <WebCore/PublicKeyCredentialRequestOptions.h>
    36 #include <WebCore/WebAuthenticationConstants.h>
    37 #include <wtf/Variant.h>
    38 #include <wtf/Vector.h>
    39 #include <wtf/WeakPtr.h>
     30namespace WebCore {
     31struct PublicKeyCredentialCreationOptions;
     32struct PublicKeyCredentialRequestOptions;
     33}
    4034
    41 namespace WebKit {
     35WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
     36@interface _WKWebAuthenticationPanel (WKTesting)
    4237
    43 class WebPageProxy;
     38// FIXME: <rdar://problem/71509714> Introduces mock testing.
     39+ (WebCore::PublicKeyCredentialCreationOptions)convertToCoreCreationOptionsWithOptions:(_WKPublicKeyCredentialCreationOptions *)options WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     40+ (WebCore::PublicKeyCredentialRequestOptions)convertToCoreRequestOptionsWithOptions:(_WKPublicKeyCredentialRequestOptions *)options WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    4441
    45 struct WebAuthenticationRequestData {
    46     Vector<uint8_t> hash;
    47     Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
    48     WeakPtr<WebPageProxy> page;
    49     WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
    50     RefPtr<API::WebAuthenticationPanel> panel;
    51     WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    52     WebKit::FrameInfoData frameInfo;
    53     bool processingUserGesture;
    54     String cachedPin; // Only used to improve NFC Client PIN experience.
    55 };
    56 
    57 WebCore::ClientDataType getClientDataType(const Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions>&);
    58 
    59 } // namespace WebKit
    60 
    61 #endif // ENABLE(WEB_AUTHN)
     42@end
  • trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h

    r264543 r270142  
    4646    Vector<uint8_t> hash;
    4747    Variant<WebCore::PublicKeyCredentialCreationOptions, WebCore::PublicKeyCredentialRequestOptions> options;
     48
     49    // FIXME<rdar://problem/71509848>: Remove the following deprecated fields.
    4850    WeakPtr<WebPageProxy> page;
    4951    WebAuthenticationPanelResult panelResult { WebAuthenticationPanelResult::Unavailable };
     
    5153    WTF::Optional<WebCore::GlobalFrameIdentifier> frameID;
    5254    WebKit::FrameInfoData frameInfo;
     55
    5356    bool processingUserGesture;
    5457    String cachedPin; // Only used to improve NFC Client PIN experience.
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r270035 r270142  
    11341134                577FF7852346ECAA004EDFB9 /* WebAuthenticationPanelClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 577FF7832346ECAA004EDFB9 /* WebAuthenticationPanelClient.h */; };
    11351135                578DC2982155A0020074E815 /* LocalAuthenticationSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 578DC2972155A0010074E815 /* LocalAuthenticationSoftLink.h */; };
     1136                5790A6532565DED30077C5A7 /* _WKWebAuthenticationPanelForTesting.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A6512565DE6A0077C5A7 /* _WKWebAuthenticationPanelForTesting.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1137                5790A656256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A654256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1138                5790A657256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A655256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.mm */; };
     1139                5790A65A25679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A65825679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1140                5790A65B25679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A65925679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.mm */; };
     1141                5790A65E25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A65C25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1142                5790A65F25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A65D25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.mm */; };
     1143                5790A66225679C860077C5A7 /* _WKPublicKeyCredentialParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A66025679C860077C5A7 /* _WKPublicKeyCredentialParameters.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1144                5790A66325679C860077C5A7 /* _WKPublicKeyCredentialParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A66125679C860077C5A7 /* _WKPublicKeyCredentialParameters.mm */; };
     1145                5790A66625679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A66425679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1146                5790A66725679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A66525679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.mm */; };
     1147                5790A66925679E000077C5A7 /* _WKUserVerificationRequirement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A66825679E000077C5A7 /* _WKUserVerificationRequirement.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1148                5790A66C25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A66A25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1149                5790A66D25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A66B25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.mm */; };
     1150                5790A67025679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A66E25679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1151                5790A67125679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A66F25679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.mm */; };
     1152                5790A67425679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A67225679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1153                5790A67525679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A67325679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.mm */; };
     1154                5790A6782567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A6762567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1155                5790A6792567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A6772567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.mm */; };
     1156                5790A67C2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A67A2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1157                5790A67D2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A67B2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.mm */; };
     1158                5790A6802567A1AC0077C5A7 /* _WKAuthenticatorResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A67E2567A1AC0077C5A7 /* _WKAuthenticatorResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1159                5790A6812567A1AC0077C5A7 /* _WKAuthenticatorResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A67F2567A1AC0077C5A7 /* _WKAuthenticatorResponse.mm */; };
     1160                5790A6842567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A6822567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1161                5790A6852567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A6832567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.mm */; };
     1162                5790A6882567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A6862567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1163                5790A6892567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5790A6872567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.mm */; };
     1164                5790A68B2567A4CC0077C5A7 /* _WKAuthenticatorResponseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A68A2567A4CC0077C5A7 /* _WKAuthenticatorResponseInternal.h */; };
     1165                5790A68D2567B4490077C5A7 /* _WKAuthenticatorAttestationResponseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A68C2567B4490077C5A7 /* _WKAuthenticatorAttestationResponseInternal.h */; };
     1166                5790A68F2567B4CF0077C5A7 /* _WKAuthenticatorAssertionResponseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A68E2567B4CF0077C5A7 /* _WKAuthenticatorAssertionResponseInternal.h */; };
     1167                5790A6912567B5E00077C5A7 /* _WKAuthenticationExtensionsClientOutputsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5790A6902567B5E00077C5A7 /* _WKAuthenticationExtensionsClientOutputsInternal.h */; };
    11361168                579F1BF623C80DB600C7D4B4 /* _WKWebAuthenticationAssertionResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 579F1BF423C80DB600C7D4B4 /* _WKWebAuthenticationAssertionResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11371169                579F1BF923C80EC600C7D4B4 /* _WKWebAuthenticationAssertionResponseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 579F1BF823C80EC600C7D4B4 /* _WKWebAuthenticationAssertionResponseInternal.h */; };
     
    40144046                577FF7842346ECAA004EDFB9 /* WebAuthenticationPanelClient.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebAuthenticationPanelClient.mm; sourceTree = "<group>"; };
    40154047                578DC2972155A0010074E815 /* LocalAuthenticationSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalAuthenticationSoftLink.h; sourceTree = "<group>"; };
     4048                5790A6512565DE6A0077C5A7 /* _WKWebAuthenticationPanelForTesting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKWebAuthenticationPanelForTesting.h; sourceTree = "<group>"; };
     4049                5790A654256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKPublicKeyCredentialEntity.h; sourceTree = "<group>"; };
     4050                5790A655256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKPublicKeyCredentialEntity.mm; sourceTree = "<group>"; };
     4051                5790A65825679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKPublicKeyCredentialRelyingPartyEntity.h; sourceTree = "<group>"; };
     4052                5790A65925679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKPublicKeyCredentialRelyingPartyEntity.mm; sourceTree = "<group>"; };
     4053                5790A65C25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKPublicKeyCredentialUserEntity.h; sourceTree = "<group>"; };
     4054                5790A65D25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKPublicKeyCredentialUserEntity.mm; sourceTree = "<group>"; };
     4055                5790A66025679C860077C5A7 /* _WKPublicKeyCredentialParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKPublicKeyCredentialParameters.h; sourceTree = "<group>"; };
     4056                5790A66125679C860077C5A7 /* _WKPublicKeyCredentialParameters.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKPublicKeyCredentialParameters.mm; sourceTree = "<group>"; };
     4057                5790A66425679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticatorSelectionCriteria.h; sourceTree = "<group>"; };
     4058                5790A66525679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKAuthenticatorSelectionCriteria.mm; sourceTree = "<group>"; };
     4059                5790A66825679E000077C5A7 /* _WKUserVerificationRequirement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKUserVerificationRequirement.h; sourceTree = "<group>"; };
     4060                5790A66A25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKPublicKeyCredentialDescriptor.h; sourceTree = "<group>"; };
     4061                5790A66B25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKPublicKeyCredentialDescriptor.mm; sourceTree = "<group>"; };
     4062                5790A66E25679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticationExtensionsClientInputs.h; sourceTree = "<group>"; };
     4063                5790A66F25679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKAuthenticationExtensionsClientInputs.mm; sourceTree = "<group>"; };
     4064                5790A67225679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKPublicKeyCredentialCreationOptions.h; sourceTree = "<group>"; };
     4065                5790A67325679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKPublicKeyCredentialCreationOptions.mm; sourceTree = "<group>"; };
     4066                5790A6762567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKPublicKeyCredentialRequestOptions.h; sourceTree = "<group>"; };
     4067                5790A6772567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKPublicKeyCredentialRequestOptions.mm; sourceTree = "<group>"; };
     4068                5790A67A2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticationExtensionsClientOutputs.h; sourceTree = "<group>"; };
     4069                5790A67B2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKAuthenticationExtensionsClientOutputs.mm; sourceTree = "<group>"; };
     4070                5790A67E2567A1AC0077C5A7 /* _WKAuthenticatorResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticatorResponse.h; sourceTree = "<group>"; };
     4071                5790A67F2567A1AC0077C5A7 /* _WKAuthenticatorResponse.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKAuthenticatorResponse.mm; sourceTree = "<group>"; };
     4072                5790A6822567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticatorAttestationResponse.h; sourceTree = "<group>"; };
     4073                5790A6832567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKAuthenticatorAttestationResponse.mm; sourceTree = "<group>"; };
     4074                5790A6862567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticatorAssertionResponse.h; sourceTree = "<group>"; };
     4075                5790A6872567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKAuthenticatorAssertionResponse.mm; sourceTree = "<group>"; };
     4076                5790A68A2567A4CC0077C5A7 /* _WKAuthenticatorResponseInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticatorResponseInternal.h; sourceTree = "<group>"; };
     4077                5790A68C2567B4490077C5A7 /* _WKAuthenticatorAttestationResponseInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticatorAttestationResponseInternal.h; sourceTree = "<group>"; };
     4078                5790A68E2567B4CF0077C5A7 /* _WKAuthenticatorAssertionResponseInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticatorAssertionResponseInternal.h; sourceTree = "<group>"; };
     4079                5790A6902567B5E00077C5A7 /* _WKAuthenticationExtensionsClientOutputsInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKAuthenticationExtensionsClientOutputsInternal.h; sourceTree = "<group>"; };
    40164080                579F1BF423C80DB600C7D4B4 /* _WKWebAuthenticationAssertionResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKWebAuthenticationAssertionResponse.h; sourceTree = "<group>"; };
    40174081                579F1BF523C80DB600C7D4B4 /* _WKWebAuthenticationAssertionResponse.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKWebAuthenticationAssertionResponse.mm; sourceTree = "<group>"; };
     
    73747438                                F44291931FA59311002CC93E /* _WKAttachment.mm */,
    73757439                                F44291951FA5942A002CC93E /* _WKAttachmentInternal.h */,
     7440                                5790A66E25679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.h */,
     7441                                5790A66F25679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.mm */,
     7442                                5790A67A2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.h */,
     7443                                5790A67B2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.mm */,
     7444                                5790A6902567B5E00077C5A7 /* _WKAuthenticationExtensionsClientOutputsInternal.h */,
     7445                                5790A6862567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.h */,
     7446                                5790A6872567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.mm */,
     7447                                5790A68E2567B4CF0077C5A7 /* _WKAuthenticatorAssertionResponseInternal.h */,
     7448                                5790A6822567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.h */,
     7449                                5790A6832567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.mm */,
     7450                                5790A68C2567B4490077C5A7 /* _WKAuthenticatorAttestationResponseInternal.h */,
     7451                                5790A67E2567A1AC0077C5A7 /* _WKAuthenticatorResponse.h */,
     7452                                5790A67F2567A1AC0077C5A7 /* _WKAuthenticatorResponse.mm */,
     7453                                5790A68A2567A4CC0077C5A7 /* _WKAuthenticatorResponseInternal.h */,
     7454                                5790A66425679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.h */,
     7455                                5790A66525679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.mm */,
    73767456                                99E714C11C1249E600665B3A /* _WKAutomationDelegate.h */,
    73777457                                990D28A71C6404B000986977 /* _WKAutomationSession.h */,
     
    74467526                                1A43E827188F3CDC009E4D30 /* _WKProcessPoolConfiguration.mm */,
    74477527                                7C89D2D61A6C6BE6003A5FDE /* _WKProcessPoolConfigurationInternal.h */,
     7528                                5790A67225679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.h */,
     7529                                5790A67325679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.mm */,
     7530                                5790A66A25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.h */,
     7531                                5790A66B25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.mm */,
     7532                                5790A654256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.h */,
     7533                                5790A655256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.mm */,
     7534                                5790A66025679C860077C5A7 /* _WKPublicKeyCredentialParameters.h */,
     7535                                5790A66125679C860077C5A7 /* _WKPublicKeyCredentialParameters.mm */,
     7536                                5790A65825679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.h */,
     7537                                5790A65925679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.mm */,
     7538                                5790A6762567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.h */,
     7539                                5790A6772567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.mm */,
     7540                                5790A65C25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.h */,
     7541                                5790A65D25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.mm */,
    74487542                                A55BA80C1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.h */,
    74497543                                A55BA80D1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.mm */,
     
    74947588                                2D87861C1BDB54BF00D02ABB /* _WKUserStyleSheet.mm */,
    74957589                                2D87861F1BDB57F500D02ABB /* _WKUserStyleSheetInternal.h */,
     7590                                5790A66825679E000077C5A7 /* _WKUserVerificationRequirement.h */,
    74967591                                1A81B37F18BD66AD0007FDAC /* _WKVisitedLinkStore.h */,
    74977592                                1A81B37E18BD66AD0007FDAC /* _WKVisitedLinkStore.mm */,
     
    75027597                                574728CF23456E98001700AF /* _WKWebAuthenticationPanel.h */,
    75037598                                574728D023456E98001700AF /* _WKWebAuthenticationPanel.mm */,
     7599                                5790A6512565DE6A0077C5A7 /* _WKWebAuthenticationPanelForTesting.h */,
    75047600                                574728D3234570AE001700AF /* _WKWebAuthenticationPanelInternal.h */,
    75057601                                1AE286761C7E76510069AC4F /* _WKWebsiteDataSize.h */,
     
    1084810944                                F44291921FA591C9002CC93E /* _WKAttachment.h in Headers */,
    1084910945                                F44291961FA5942A002CC93E /* _WKAttachmentInternal.h in Headers */,
     10946                                5790A67025679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.h in Headers */,
     10947                                5790A67C2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.h in Headers */,
     10948                                5790A6912567B5E00077C5A7 /* _WKAuthenticationExtensionsClientOutputsInternal.h in Headers */,
     10949                                5790A6882567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.h in Headers */,
     10950                                5790A68F2567B4CF0077C5A7 /* _WKAuthenticatorAssertionResponseInternal.h in Headers */,
     10951                                5790A6842567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.h in Headers */,
     10952                                5790A68D2567B4490077C5A7 /* _WKAuthenticatorAttestationResponseInternal.h in Headers */,
     10953                                5790A6802567A1AC0077C5A7 /* _WKAuthenticatorResponse.h in Headers */,
     10954                                5790A68B2567A4CC0077C5A7 /* _WKAuthenticatorResponseInternal.h in Headers */,
     10955                                5790A66625679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.h in Headers */,
    1085010956                                99E714C51C124A0400665B3A /* _WKAutomationDelegate.h in Headers */,
    1085110957                                990D28AB1C6420C600986977 /* _WKAutomationSession.h in Headers */,
     
    1090411010                                1A43E82A188F3CDC009E4D30 /* _WKProcessPoolConfiguration.h in Headers */,
    1090511011                                7C89D2D71A6C6BE6003A5FDE /* _WKProcessPoolConfigurationInternal.h in Headers */,
     11012                                5790A67425679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.h in Headers */,
     11013                                5790A66C25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.h in Headers */,
     11014                                5790A656256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.h in Headers */,
     11015                                5790A66225679C860077C5A7 /* _WKPublicKeyCredentialParameters.h in Headers */,
     11016                                5790A6782567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.h in Headers */,
     11017                                5790A65A25679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.h in Headers */,
     11018                                5790A65E25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.h in Headers */,
    1090611019                                1A9E328D182165A900F5D04C /* _WKRemoteObjectInterface.h in Headers */,
    1090711020                                1AABFE3A1829C1ED005B070E /* _WKRemoteObjectInterfaceInternal.h in Headers */,
     
    1094411057                                2D87861D1BDB54BF00D02ABB /* _WKUserStyleSheet.h in Headers */,
    1094511058                                2D8786201BDB57F500D02ABB /* _WKUserStyleSheetInternal.h in Headers */,
     11059                                5790A66925679E000077C5A7 /* _WKUserVerificationRequirement.h in Headers */,
    1094611060                                1A81B38118BD66AD0007FDAC /* _WKVisitedLinkStore.h in Headers */,
    1094711061                                1A81B38518BD673A0007FDAC /* _WKVisitedLinkStoreInternal.h in Headers */,
     
    1094911063                                579F1BF923C80EC600C7D4B4 /* _WKWebAuthenticationAssertionResponseInternal.h in Headers */,
    1095011064                                574728D123456E98001700AF /* _WKWebAuthenticationPanel.h in Headers */,
     11065                                5790A6532565DED30077C5A7 /* _WKWebAuthenticationPanelForTesting.h in Headers */,
    1095111066                                574728D4234570AE001700AF /* _WKWebAuthenticationPanelInternal.h in Headers */,
    1095211067                                1AE286781C7E76510069AC4F /* _WKWebsiteDataSize.h in Headers */,
     
    1308113196                        buildActionMask = 2147483647;
    1308213197                        files = (
     13198                                5790A67125679F1A0077C5A7 /* _WKAuthenticationExtensionsClientInputs.mm in Sources */,
     13199                                5790A67D2567A13E0077C5A7 /* _WKAuthenticationExtensionsClientOutputs.mm in Sources */,
     13200                                5790A6892567A28A0077C5A7 /* _WKAuthenticatorAssertionResponse.mm in Sources */,
     13201                                5790A6852567A21E0077C5A7 /* _WKAuthenticatorAttestationResponse.mm in Sources */,
     13202                                5790A6812567A1AC0077C5A7 /* _WKAuthenticatorResponse.mm in Sources */,
     13203                                5790A66725679CEA0077C5A7 /* _WKAuthenticatorSelectionCriteria.mm in Sources */,
    1308313204                                5CBD595C2280EDF4002B22AA /* _WKCustomHeaderFields.mm in Sources */,
     13205                                5790A67525679F740077C5A7 /* _WKPublicKeyCredentialCreationOptions.mm in Sources */,
     13206                                5790A66D25679EB70077C5A7 /* _WKPublicKeyCredentialDescriptor.mm in Sources */,
     13207                                5790A657256799DA0077C5A7 /* _WKPublicKeyCredentialEntity.mm in Sources */,
     13208                                5790A66325679C860077C5A7 /* _WKPublicKeyCredentialParameters.mm in Sources */,
     13209                                5790A6792567A0CD0077C5A7 /* _WKPublicKeyCredentialRequestOptions.mm in Sources */,
     13210                                5790A65B25679B260077C5A7 /* _WKPublicKeyCredentialRelyingPartyEntity.mm in Sources */,
     13211                                5790A65F25679C110077C5A7 /* _WKPublicKeyCredentialUserEntity.mm in Sources */,
    1308413212                                49FBEFFD239B011D00BD032F /* _WKResourceLoadStatisticsFirstParty.mm in Sources */,
    1308513213                                49FBEFFF239B012F00BD032F /* _WKResourceLoadStatisticsThirdParty.mm in Sources */,
  • trunk/Tools/ChangeLog

    r270136 r270142  
     12020-11-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Implement SPI for AuthenticationServices.Framework
     4        https://bugs.webkit.org/show_bug.cgi?id=218893
     5        <rdar://problem/71364731>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
     10        (TestWebKitAPI::TEST):
     11        (): Deleted.
     12
    1132020-11-20  Kate Cheney  <katherine_cheney@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm

    r268613 r270142  
    3434#import "WKWebViewConfigurationExtras.h"
    3535#import <LocalAuthentication/LocalAuthentication.h>
     36#import <WebCore/PublicKeyCredentialCreationOptions.h>
     37#import <WebCore/PublicKeyCredentialRequestOptions.h>
    3638#import <WebKit/WKPreferencesPrivate.h>
    3739#import <WebKit/WKUIDelegatePrivate.h>
     40#import <WebKit/_WKAuthenticationExtensionsClientInputs.h>
     41#import <WebKit/_WKAuthenticationExtensionsClientOutputs.h>
     42#import <WebKit/_WKAuthenticatorAssertionResponse.h>
     43#import <WebKit/_WKAuthenticatorAttestationResponse.h>
     44#import <WebKit/_WKAuthenticatorSelectionCriteria.h>
    3845#import <WebKit/_WKExperimentalFeature.h>
     46#import <WebKit/_WKPublicKeyCredentialCreationOptions.h>
     47#import <WebKit/_WKPublicKeyCredentialDescriptor.h>
     48#import <WebKit/_WKPublicKeyCredentialParameters.h>
     49#import <WebKit/_WKPublicKeyCredentialRequestOptions.h>
     50#import <WebKit/_WKPublicKeyCredentialRelyingPartyEntity.h>
     51#import <WebKit/_WKPublicKeyCredentialUserEntity.h>
    3952#import <WebKit/_WKWebAuthenticationAssertionResponse.h>
    4053#import <WebKit/_WKWebAuthenticationPanel.h>
     54#import <WebKit/_WKWebAuthenticationPanelForTesting.h>
    4155#import <wtf/BlockPtr.h>
    4256#import <wtf/RandomNumber.h>
     
    238252
    239253namespace TestWebKitAPI {
     254using namespace WebCore;
    240255
    241256namespace {
     
    14331448#endif // USE(APPLE_INTERNAL_SDK) || PLATFORM(IOS)
    14341449
     1450TEST(WebAuthenticationPanel, PublicKeyCredentialCreationOptionsMinimun)
     1451{
     1452    uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 };
     1453    NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)];
     1454    auto parameters = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-7]);
     1455
     1456    auto rp = adoptNS([[_WKPublicKeyCredentialRelyingPartyEntity alloc] initWithName:@"example.com"]);
     1457    auto user = adoptNS([[_WKPublicKeyCredentialUserEntity alloc] initWithName:@"jappleseed@example.com" identifier:nsIdentifier displayName:@"J Appleseed"]);
     1458    NSArray<_WKPublicKeyCredentialParameters *> *publicKeyCredentialParamaters = @[ parameters.get() ];
     1459
     1460    auto options = adoptNS([[_WKPublicKeyCredentialCreationOptions alloc] initWithRelyingParty:rp.get() user:user.get() publicKeyCredentialParamaters:publicKeyCredentialParamaters]);
     1461    auto result = [_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:options.get()];
     1462
     1463    EXPECT_WK_STREQ(result.rp.name, "example.com");
     1464    EXPECT_TRUE(result.rp.icon.isNull());
     1465    EXPECT_TRUE(result.rp.id.isNull());
     1466
     1467    EXPECT_WK_STREQ(result.user.name, "jappleseed@example.com");
     1468    EXPECT_TRUE(result.user.icon.isNull());
     1469    EXPECT_EQ(result.user.idVector.size(), sizeof(identifier));
     1470    EXPECT_EQ(memcmp(result.user.idVector.data(), identifier, sizeof(identifier)), 0);
     1471    EXPECT_WK_STREQ(result.user.displayName, "J Appleseed");
     1472
     1473    EXPECT_EQ(result.pubKeyCredParams.size(), 1lu);
     1474    EXPECT_EQ(result.pubKeyCredParams[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1475    EXPECT_EQ(result.pubKeyCredParams[0].alg, -7);
     1476
     1477    EXPECT_EQ(result.timeout, WTF::nullopt);
     1478    EXPECT_EQ(result.excludeCredentials.size(), 0lu);
     1479    EXPECT_EQ(result.authenticatorSelection, WTF::nullopt);
     1480    EXPECT_EQ(result.attestation, AttestationConveyancePreference::None);
     1481    EXPECT_TRUE(result.extensions->appid.isNull());
     1482    EXPECT_EQ(result.extensions->googleLegacyAppidSupport, false);
     1483}
     1484
     1485TEST(WebAuthenticationPanel, PublicKeyCredentialCreationOptionsMaximumDefault)
     1486{
     1487    uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 };
     1488    NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)];
     1489    auto parameters1 = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-7]);
     1490    auto parameters2 = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-257]);
     1491    auto descriptor = adoptNS([[_WKPublicKeyCredentialDescriptor alloc] initWithIdentifier:nsIdentifier]);
     1492
     1493    auto rp = adoptNS([[_WKPublicKeyCredentialRelyingPartyEntity alloc] initWithName:@"example.com"]);
     1494    auto user = adoptNS([[_WKPublicKeyCredentialUserEntity alloc] initWithName:@"jappleseed@example.com" identifier:nsIdentifier displayName:@"J Appleseed"]);
     1495    NSArray<_WKPublicKeyCredentialParameters *> *publicKeyCredentialParamaters = @[ parameters1.get(), parameters2.get() ];
     1496    auto authenticatorSelection = adoptNS([[_WKAuthenticatorSelectionCriteria alloc] init]);
     1497    auto extensions = adoptNS([[_WKAuthenticationExtensionsClientInputs alloc] init]);
     1498
     1499    auto options = adoptNS([[_WKPublicKeyCredentialCreationOptions alloc] initWithRelyingParty:rp.get() user:user.get() publicKeyCredentialParamaters:publicKeyCredentialParamaters]);
     1500    [options setTimeout:@120];
     1501    [options setExcludeCredentials:@[ descriptor.get() ]];
     1502    [options setAuthenticatorSelection:authenticatorSelection.get()];
     1503    [options setExtensions:extensions.get()];
     1504
     1505    auto result = [_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:options.get()];
     1506
     1507    EXPECT_WK_STREQ(result.rp.name, "example.com");
     1508    EXPECT_TRUE(result.rp.icon.isNull());
     1509    EXPECT_TRUE(result.rp.id.isNull());
     1510
     1511    EXPECT_WK_STREQ(result.user.name, "jappleseed@example.com");
     1512    EXPECT_TRUE(result.user.icon.isNull());
     1513    EXPECT_EQ(result.user.idVector.size(), sizeof(identifier));
     1514    EXPECT_EQ(memcmp(result.user.idVector.data(), identifier, sizeof(identifier)), 0);
     1515    EXPECT_WK_STREQ(result.user.displayName, "J Appleseed");
     1516
     1517    EXPECT_EQ(result.pubKeyCredParams.size(), 2lu);
     1518    EXPECT_EQ(result.pubKeyCredParams[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1519    EXPECT_EQ(result.pubKeyCredParams[0].alg, -7);
     1520    EXPECT_EQ(result.pubKeyCredParams[1].type, WebCore::PublicKeyCredentialType::PublicKey);
     1521    EXPECT_EQ(result.pubKeyCredParams[1].alg, -257);
     1522
     1523    EXPECT_EQ(result.timeout, 120u);
     1524
     1525    EXPECT_EQ(result.excludeCredentials.size(), 1lu);
     1526    EXPECT_EQ(result.excludeCredentials[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1527    EXPECT_EQ(result.excludeCredentials[0].idVector.size(), sizeof(identifier));
     1528    EXPECT_EQ(memcmp(result.excludeCredentials[0].idVector.data(), identifier, sizeof(identifier)), 0);
     1529
     1530    EXPECT_EQ(result.authenticatorSelection->authenticatorAttachment, WTF::nullopt);
     1531    EXPECT_EQ(result.authenticatorSelection->requireResidentKey, false);
     1532    EXPECT_EQ(result.authenticatorSelection->userVerification, UserVerificationRequirement::Preferred);
     1533
     1534    EXPECT_EQ(result.attestation, AttestationConveyancePreference::None);
     1535    EXPECT_TRUE(result.extensions->appid.isNull());
     1536}
     1537
     1538TEST(WebAuthenticationPanel, PublicKeyCredentialCreationOptionsMaximum1)
     1539{
     1540    uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 };
     1541    NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)];
     1542    auto parameters1 = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-7]);
     1543    auto parameters2 = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-257]);
     1544
     1545    auto rp = adoptNS([[_WKPublicKeyCredentialRelyingPartyEntity alloc] initWithName:@"example.com"]);
     1546    [rp setIcon:@"https//www.example.com/icon.jpg"];
     1547    [rp setIdentifier:@"example.com"];
     1548
     1549    auto user = adoptNS([[_WKPublicKeyCredentialUserEntity alloc] initWithName:@"jappleseed@example.com" identifier:nsIdentifier displayName:@"J Appleseed"]);
     1550    [user setIcon:@"https//www.example.com/icon.jpg"];
     1551
     1552    NSArray<_WKPublicKeyCredentialParameters *> *publicKeyCredentialParamaters = @[ parameters1.get(), parameters2.get() ];
     1553
     1554    auto options = adoptNS([[_WKPublicKeyCredentialCreationOptions alloc] initWithRelyingParty:rp.get() user:user.get() publicKeyCredentialParamaters:publicKeyCredentialParamaters]);
     1555    [options setTimeout:@120];
     1556
     1557    auto usb = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportUSB]);
     1558    auto nfc = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportNFC]);
     1559    auto internal = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportInternal]);
     1560    auto credential = adoptNS([[_WKPublicKeyCredentialDescriptor alloc] initWithIdentifier:nsIdentifier]);
     1561    [credential setTransports:@[ usb.get(), nfc.get(), internal.get() ]];
     1562    [options setExcludeCredentials:@[ credential.get(), credential.get() ]];
     1563
     1564    auto authenticatorSelection = adoptNS([[_WKAuthenticatorSelectionCriteria alloc] init]);
     1565    [authenticatorSelection setAuthenticatorAttachment:_WKAuthenticatorAttachmentPlatform];
     1566    [authenticatorSelection setRequireResidentKey:YES];
     1567    [authenticatorSelection setUserVerification:_WKUserVerificationRequirementRequired];
     1568    [options setAuthenticatorSelection:authenticatorSelection.get()];
     1569
     1570    [options setAttestation:_WKAttestationConveyancePreferenceDirect];
     1571
     1572    auto result = [_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:options.get()];
     1573
     1574    EXPECT_WK_STREQ(result.rp.name, "example.com");
     1575    EXPECT_WK_STREQ(result.rp.icon, @"https//www.example.com/icon.jpg");
     1576    EXPECT_WK_STREQ(result.rp.id, "example.com");
     1577
     1578    EXPECT_WK_STREQ(result.user.name, "jappleseed@example.com");
     1579    EXPECT_WK_STREQ(result.user.icon, @"https//www.example.com/icon.jpg");
     1580    EXPECT_EQ(result.user.idVector.size(), sizeof(identifier));
     1581    EXPECT_EQ(memcmp(result.user.idVector.data(), identifier, sizeof(identifier)), 0);
     1582    EXPECT_WK_STREQ(result.user.displayName, "J Appleseed");
     1583
     1584    EXPECT_EQ(result.pubKeyCredParams.size(), 2lu);
     1585    EXPECT_EQ(result.pubKeyCredParams[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1586    EXPECT_EQ(result.pubKeyCredParams[0].alg, -7);
     1587    EXPECT_EQ(result.pubKeyCredParams[1].type, WebCore::PublicKeyCredentialType::PublicKey);
     1588    EXPECT_EQ(result.pubKeyCredParams[1].alg, -257);
     1589
     1590    EXPECT_EQ(result.timeout, 120u);
     1591
     1592    EXPECT_EQ(result.excludeCredentials.size(), 2lu);
     1593    EXPECT_EQ(result.excludeCredentials[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1594    EXPECT_EQ(result.excludeCredentials[0].idVector.size(), sizeof(identifier));
     1595    EXPECT_EQ(memcmp(result.excludeCredentials[0].idVector.data(), identifier, sizeof(identifier)), 0);
     1596    EXPECT_EQ(result.excludeCredentials[0].transports.size(), 3lu);
     1597    EXPECT_EQ(result.excludeCredentials[0].transports[0], AuthenticatorTransport::Usb);
     1598    EXPECT_EQ(result.excludeCredentials[0].transports[1], AuthenticatorTransport::Nfc);
     1599    EXPECT_EQ(result.excludeCredentials[0].transports[2], AuthenticatorTransport::Internal);
     1600
     1601    EXPECT_EQ(result.authenticatorSelection->authenticatorAttachment, PublicKeyCredentialCreationOptions::AuthenticatorAttachment::Platform);
     1602    EXPECT_EQ(result.authenticatorSelection->requireResidentKey, true);
     1603    EXPECT_EQ(result.authenticatorSelection->userVerification, UserVerificationRequirement::Required);
     1604
     1605    EXPECT_EQ(result.attestation, AttestationConveyancePreference::Direct);
     1606}
     1607
     1608TEST(WebAuthenticationPanel, PublicKeyCredentialCreationOptionsMaximum2)
     1609{
     1610    uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 };
     1611    NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)];
     1612    auto parameters1 = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-7]);
     1613    auto parameters2 = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-257]);
     1614
     1615    auto rp = adoptNS([[_WKPublicKeyCredentialRelyingPartyEntity alloc] initWithName:@"example.com"]);
     1616    [rp setIcon:@"https//www.example.com/icon.jpg"];
     1617    [rp setIdentifier:@"example.com"];
     1618
     1619    auto user = adoptNS([[_WKPublicKeyCredentialUserEntity alloc] initWithName:@"jappleseed@example.com" identifier:nsIdentifier displayName:@"J Appleseed"]);
     1620    [user setIcon:@"https//www.example.com/icon.jpg"];
     1621
     1622    NSArray<_WKPublicKeyCredentialParameters *> *publicKeyCredentialParamaters = @[ parameters1.get(), parameters2.get() ];
     1623
     1624    auto options = adoptNS([[_WKPublicKeyCredentialCreationOptions alloc] initWithRelyingParty:rp.get() user:user.get() publicKeyCredentialParamaters:publicKeyCredentialParamaters]);
     1625    [options setTimeout:@120];
     1626
     1627    auto usb = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportUSB]);
     1628    auto nfc = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportNFC]);
     1629    auto internal = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportInternal]);
     1630    auto credential = adoptNS([[_WKPublicKeyCredentialDescriptor alloc] initWithIdentifier:nsIdentifier]);
     1631    [credential setTransports:@[ usb.get(), nfc.get(), internal.get() ]];
     1632    [options setExcludeCredentials:@[ credential.get(), credential.get() ]];
     1633
     1634    auto authenticatorSelection = adoptNS([[_WKAuthenticatorSelectionCriteria alloc] init]);
     1635    [authenticatorSelection setAuthenticatorAttachment:_WKAuthenticatorAttachmentCrossPlatform]; //
     1636    [authenticatorSelection setRequireResidentKey:YES];
     1637    [authenticatorSelection setUserVerification:_WKUserVerificationRequirementDiscouraged]; //
     1638    [options setAuthenticatorSelection:authenticatorSelection.get()];
     1639
     1640    [options setAttestation:_WKAttestationConveyancePreferenceIndirect]; //
     1641
     1642    auto result = [_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:options.get()];
     1643
     1644    EXPECT_WK_STREQ(result.rp.name, "example.com");
     1645    EXPECT_WK_STREQ(result.rp.icon, @"https//www.example.com/icon.jpg");
     1646    EXPECT_WK_STREQ(result.rp.id, "example.com");
     1647
     1648    EXPECT_WK_STREQ(result.user.name, "jappleseed@example.com");
     1649    EXPECT_WK_STREQ(result.user.icon, @"https//www.example.com/icon.jpg");
     1650    EXPECT_EQ(result.user.idVector.size(), sizeof(identifier));
     1651    EXPECT_EQ(memcmp(result.user.idVector.data(), identifier, sizeof(identifier)), 0);
     1652    EXPECT_WK_STREQ(result.user.displayName, "J Appleseed");
     1653
     1654    EXPECT_EQ(result.pubKeyCredParams.size(), 2lu);
     1655    EXPECT_EQ(result.pubKeyCredParams[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1656    EXPECT_EQ(result.pubKeyCredParams[0].alg, -7);
     1657    EXPECT_EQ(result.pubKeyCredParams[1].type, WebCore::PublicKeyCredentialType::PublicKey);
     1658    EXPECT_EQ(result.pubKeyCredParams[1].alg, -257);
     1659
     1660    EXPECT_EQ(result.timeout, 120u);
     1661
     1662    EXPECT_EQ(result.excludeCredentials.size(), 2lu);
     1663    EXPECT_EQ(result.excludeCredentials[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1664    EXPECT_EQ(result.excludeCredentials[0].idVector.size(), sizeof(identifier));
     1665    EXPECT_EQ(memcmp(result.excludeCredentials[0].idVector.data(), identifier, sizeof(identifier)), 0);
     1666    EXPECT_EQ(result.excludeCredentials[0].transports.size(), 3lu);
     1667    EXPECT_EQ(result.excludeCredentials[0].transports[0], AuthenticatorTransport::Usb);
     1668    EXPECT_EQ(result.excludeCredentials[0].transports[1], AuthenticatorTransport::Nfc);
     1669    EXPECT_EQ(result.excludeCredentials[0].transports[2], AuthenticatorTransport::Internal);
     1670
     1671    EXPECT_EQ(result.authenticatorSelection->authenticatorAttachment, PublicKeyCredentialCreationOptions::AuthenticatorAttachment::CrossPlatform);
     1672    EXPECT_EQ(result.authenticatorSelection->requireResidentKey, true);
     1673    EXPECT_EQ(result.authenticatorSelection->userVerification, UserVerificationRequirement::Discouraged);
     1674
     1675    EXPECT_EQ(result.attestation, AttestationConveyancePreference::Indirect);
     1676}
     1677
     1678TEST(WebAuthenticationPanel, MakeCredentialSPITimeout)
     1679{
     1680    reset();
     1681
     1682    uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 };
     1683    uint8_t hash[] = { 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04 };
     1684    NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)];
     1685    NSData *nsHash = [NSData dataWithBytes:hash length:sizeof(hash)];
     1686    auto parameters = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-7]);
     1687
     1688    auto rp = adoptNS([[_WKPublicKeyCredentialRelyingPartyEntity alloc] initWithName:@"example.com"]);
     1689    auto user = adoptNS([[_WKPublicKeyCredentialUserEntity alloc] initWithName:@"jappleseed@example.com" identifier:nsIdentifier displayName:@"J Appleseed"]);
     1690    NSArray<_WKPublicKeyCredentialParameters *> *publicKeyCredentialParamaters = @[ parameters.get() ];
     1691    auto options = adoptNS([[_WKPublicKeyCredentialCreationOptions alloc] initWithRelyingParty:rp.get() user:user.get() publicKeyCredentialParamaters:publicKeyCredentialParamaters]);
     1692    [options setTimeout:@120];
     1693
     1694    auto panel = adoptNS([[_WKWebAuthenticationPanel alloc] init]);
     1695    [panel makeCredentialWithHash:nsHash options:options.get() completionHandler:^(_WKAuthenticatorAttestationResponse *response, NSError *error) {
     1696        webAuthenticationPanelRan = true;
     1697
     1698        EXPECT_NULL(response);
     1699        EXPECT_EQ(error.domain, WKErrorDomain);
     1700        EXPECT_EQ(error.code, WKErrorUnknown);
     1701    }];
     1702    Util::run(&webAuthenticationPanelRan);
     1703}
     1704
     1705TEST(WebAuthenticationPanel, PublicKeyCredentialRequestOptionsMinimun)
     1706{
     1707    auto options = adoptNS([[_WKPublicKeyCredentialRequestOptions alloc] init]);
     1708    auto result = [_WKWebAuthenticationPanel convertToCoreRequestOptionsWithOptions:options.get()];
     1709
     1710    EXPECT_EQ(result.timeout, WTF::nullopt);
     1711    EXPECT_TRUE(result.rpId.isNull());
     1712    EXPECT_EQ(result.allowCredentials.size(), 0lu);
     1713    EXPECT_EQ(result.userVerification, UserVerificationRequirement::Preferred);
     1714    EXPECT_TRUE(result.extensions->appid.isNull());
     1715    EXPECT_EQ(result.extensions->googleLegacyAppidSupport, false);
     1716}
     1717
     1718TEST(WebAuthenticationPanel, PublicKeyCredentialRequestOptionsMaximumDefault)
     1719{
     1720    uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 };
     1721    NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)];
     1722    auto descriptor = adoptNS([[_WKPublicKeyCredentialDescriptor alloc] initWithIdentifier:nsIdentifier]);
     1723    auto extensions = adoptNS([[_WKAuthenticationExtensionsClientInputs alloc] init]);
     1724
     1725    auto options = adoptNS([[_WKPublicKeyCredentialRequestOptions alloc] init]);
     1726    [options setTimeout:@120];
     1727    [options setAllowCredentials:@[ descriptor.get() ]];
     1728    [options setExtensions:extensions.get()];
     1729
     1730    auto result = [_WKWebAuthenticationPanel convertToCoreRequestOptionsWithOptions:options.get()];
     1731
     1732    EXPECT_EQ(result.timeout, 120u);
     1733
     1734    EXPECT_EQ(result.allowCredentials.size(), 1lu);
     1735    EXPECT_EQ(result.allowCredentials[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1736    EXPECT_EQ(result.allowCredentials[0].idVector.size(), sizeof(identifier));
     1737    EXPECT_EQ(memcmp(result.allowCredentials[0].idVector.data(), identifier, sizeof(identifier)), 0);
     1738
     1739    EXPECT_EQ(result.userVerification, UserVerificationRequirement::Preferred);
     1740    EXPECT_TRUE(result.extensions->appid.isNull());
     1741}
     1742
     1743TEST(WebAuthenticationPanel, PublicKeyCredentialRequestOptionsMaximum)
     1744{
     1745    uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 };
     1746    NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)];
     1747
     1748    auto options = adoptNS([[_WKPublicKeyCredentialRequestOptions alloc] init]);
     1749    [options setTimeout:@120];
     1750
     1751    auto usb = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportUSB]);
     1752    auto nfc = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportNFC]);
     1753    auto internal = adoptNS([NSNumber numberWithInt:_WKWebAuthenticationTransportInternal]);
     1754    auto credential = adoptNS([[_WKPublicKeyCredentialDescriptor alloc] initWithIdentifier:nsIdentifier]);
     1755    [credential setTransports:@[ usb.get(), nfc.get(), internal.get() ]];
     1756    [options setAllowCredentials:@[ credential.get(), credential.get() ]];
     1757
     1758    [options setUserVerification:_WKUserVerificationRequirementRequired];
     1759
     1760    auto extensions = adoptNS([[_WKAuthenticationExtensionsClientInputs alloc] init]);
     1761    [extensions setAppid:@"https//www.example.com/fido"];
     1762    [options setExtensions:extensions.get()];
     1763
     1764    auto result = [_WKWebAuthenticationPanel convertToCoreRequestOptionsWithOptions:options.get()];
     1765
     1766    EXPECT_EQ(result.timeout, 120u);
     1767
     1768    EXPECT_EQ(result.allowCredentials.size(), 2lu);
     1769    EXPECT_EQ(result.allowCredentials[0].type, WebCore::PublicKeyCredentialType::PublicKey);
     1770    EXPECT_EQ(result.allowCredentials[0].idVector.size(), sizeof(identifier));
     1771    EXPECT_EQ(memcmp(result.allowCredentials[0].idVector.data(), identifier, sizeof(identifier)), 0);
     1772    EXPECT_EQ(result.allowCredentials[0].transports.size(), 3lu);
     1773    EXPECT_EQ(result.allowCredentials[0].transports[0], AuthenticatorTransport::Usb);
     1774    EXPECT_EQ(result.allowCredentials[0].transports[1], AuthenticatorTransport::Nfc);
     1775    EXPECT_EQ(result.allowCredentials[0].transports[2], AuthenticatorTransport::Internal);
     1776
     1777    EXPECT_EQ(result.userVerification, UserVerificationRequirement::Required);
     1778    EXPECT_WK_STREQ(result.extensions->appid, "https//www.example.com/fido");
     1779}
     1780
     1781TEST(WebAuthenticationPanel, GetAssertionSPITimeout)
     1782{
     1783    reset();
     1784
     1785    uint8_t hash[] = { 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04 };
     1786    NSData *nsHash = [NSData dataWithBytes:hash length:sizeof(hash)];
     1787
     1788    auto options = adoptNS([[_WKPublicKeyCredentialRequestOptions alloc] init]);
     1789    [options setTimeout:@120];
     1790
     1791    auto panel = adoptNS([[_WKWebAuthenticationPanel alloc] init]);
     1792    [panel getAssertionWithHash:nsHash options:options.get() completionHandler:^(_WKAuthenticatorAssertionResponse *response, NSError *error) {
     1793        webAuthenticationPanelRan = true;
     1794
     1795        EXPECT_NULL(response);
     1796        EXPECT_EQ(error.domain, WKErrorDomain);
     1797        EXPECT_EQ(error.code, WKErrorUnknown);
     1798    }];
     1799    Util::run(&webAuthenticationPanelRan);
     1800}
     1801
    14351802} // namespace TestWebKitAPI
    14361803
Note: See TracChangeset for help on using the changeset viewer.