// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module gcpw_hid.mojom;
import "mojo/public/mojom/base/string16.mojom";
// This interface exposes a method to return the FIDO2 HID device
// handle. This IPC is hosted by GaiaCredentialProvider
// (aka GCPW) process and invoked via Chrome browser process.
// The APIs for getting a FIDO2 HID device handle is only accessible
// from privileged processes (GCPW runs with SYSTEM privilege).
// Since Chrome shouldn't run with administrator privileges, this
// interface is required to enable 2FA in GCPW login workflow.
// For more details, look at go/gcpw-security-key-design.
interface GaiaCredentialProviderHidBroker {
// Returns the device handle back to the caller for the
// corresponding input device path. Note: These devices
// are currently restricted to only FIDO2 devices. For
// any other device path, this method would return null.
// Note: This definition is exported to external clients and must
// remain backward incompatible indefinitely.
OpenDevice(mojo_base.mojom.String16 device_path)
=> (handle<platform>? out_handle);
};