// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module remoting.mojom;
import "remoting/host/mojom/webauthn_proxy.mojom";
import "remoting/host/mojom/remote_security_key.mojom";
import "remoting/host/mojom/remote_url_opener.mojom";
// ChromotingHostServices defines the APIs that live in the Chromoting
// network/host process and are accessed from user-launched client applications
// (e.g. remote_open_url and the WebAuthn native messaging host). The calling
// processes run in the user context. On Linux, the network/host process also
// runs in the user context, while on Windows, the network/host process runs as
// LOCAL_SERVICE in a low-integrity sandbox.
interface ChromotingHostServices {
// Binds the ChromotingSessionServices interface which allows accessing APIs
// that are scoped to the current remote desktop session.
// The receiver will be immediately closed if the caller process' desktop
// session is not remoted.
BindSessionServices(pending_receiver<ChromotingSessionServices> receiver);
};
// ChromotingHostServices defines APIs that are scoped to an active remote
// session. The interface is brokered by ChromotingHostServices, so it has the
// same host-client pair.
interface ChromotingSessionServices {
// Binds the WebAuthnProxy interface which allows the WebAuthn native
// messaging host to send remote WebAuthn requests to the remote client.
BindWebAuthnProxy(pending_receiver<WebAuthnProxy> receiver);
// Binds the RemoteUrlOpener interface which allows applications on the host
// side to open links on the remote client's browser.
BindRemoteUrlOpener(pending_receiver<RemoteUrlOpener> receiver);
// Binds the SecurityKeyForwarder interface which allows the remote security
// key binary (used for SK forwarding) to send SK requests to the chromoting
// host via IPC. This is only used on Windows, since other platforms use
// different mechanisms for sending the SK requests.
[EnableIf=is_win]
BindSecurityKeyForwarder(pending_receiver<SecurityKeyForwarder> receiver);
};