chromium/third_party/blink/renderer/modules/credentialmanagement/public_key_credential.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/credentialmanagement/public_key_credential.h"

#include <utility>

#include "base/functional/overloaded.h"
#include "third_party/blink/public/mojom/webauthn/authenticator.mojom-shared.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_all_accepted_credentials_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_authentication_response_js_on.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_current_user_details_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_public_key_credential_creation_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_registration_response_js_on.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_unknown_credential_options.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/modules/credentialmanagement/authentication_credentials_container.h"
#include "third_party/blink/renderer/modules/credentialmanagement/credential_manager_proxy.h"
#include "third_party/blink/renderer/modules/credentialmanagement/json.h"
#include "third_party/blink/renderer/modules/credentialmanagement/scoped_promise_resolver.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/base64.h"
#include "v8/include/v8-local-handle.h"
#include "v8/include/v8-value.h"

namespace blink {

namespace {

// https://www.w3.org/TR/webauthn/#dom-publickeycredential-type-slot:
constexpr char kPublicKeyCredentialType[] =;

void OnIsUserVerifyingComplete(ScriptPromiseResolver<IDLBoolean>* resolver,
                               bool available) {}

std::optional<std::string> AuthenticatorAttachmentToString(
    mojom::blink::AuthenticatorAttachment authenticator_attachment) {}

void OnGetClientCapabilitiesComplete(
    ScriptPromiseResolver<IDLRecord<IDLString, IDLBoolean>>* resolver,
    const Vector<mojom::blink::WebAuthnClientCapabilityPtr> capabilities) {}

void OnSignalReportComplete(
    std::unique_ptr<ScopedPromiseResolver> scoped_resolver,
    mojom::AuthenticatorStatus status,
    mojom::blink::WebAuthnDOMExceptionDetailsPtr dom_exception_details) {}

}  // namespace

PublicKeyCredential::PublicKeyCredential(
    const String& id,
    DOMArrayBuffer* raw_id,
    AuthenticatorResponse* response,
    mojom::blink::AuthenticatorAttachment authenticator_attachment,
    const AuthenticationExtensionsClientOutputs* extension_outputs,
    const String& type)
    :{}

// static
ScriptPromise<IDLRecord<IDLString, IDLBoolean>>
PublicKeyCredential::getClientCapabilities(ScriptState* script_state) {}

// static
ScriptPromise<IDLBoolean>
PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable(
    ScriptState* script_state) {}

AuthenticationExtensionsClientOutputs*
PublicKeyCredential::getClientExtensionResults() const {}

// static
ScriptPromise<IDLBoolean> PublicKeyCredential::isConditionalMediationAvailable(
    ScriptState* script_state) {}

v8::Local<v8::Value> PublicKeyCredential::toJSON(
    ScriptState* script_state) const {}

// static
const PublicKeyCredentialCreationOptions*
PublicKeyCredential::parseCreationOptionsFromJSON(
    ScriptState* script_state,
    const PublicKeyCredentialCreationOptionsJSON* options,
    ExceptionState& exception_state) {}

// static
const PublicKeyCredentialRequestOptions*
PublicKeyCredential::parseRequestOptionsFromJSON(
    ScriptState* script_state,
    const PublicKeyCredentialRequestOptionsJSON* options,
    ExceptionState& exception_state) {}

// static
ScriptPromise<IDLUndefined> PublicKeyCredential::signalUnknownCredential(
    ScriptState* script_state,
    const UnknownCredentialOptions* options,
    ExceptionState& exception_state) {}

// static
ScriptPromise<IDLUndefined> PublicKeyCredential::signalAllAcceptedCredentials(
    ScriptState* script_state,
    const AllAcceptedCredentialsOptions* options,
    ExceptionState& exception_state) {}

// static
ScriptPromise<IDLUndefined> PublicKeyCredential::signalCurrentUserDetails(
    ScriptState* script_state,
    const CurrentUserDetailsOptions* options,
    ExceptionState& exception_state) {}

void PublicKeyCredential::Trace(Visitor* visitor) const {}

bool PublicKeyCredential::IsPublicKeyCredential() const {}

}  // namespace blink