forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remoting: Add gRPC protos for directory service.
These protos describe the new directory service API, and are needed to query it via gRPC. Change-Id: I86989f1d09a2d7fc03d0868bce75db66fd2830cc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1580860 Commit-Queue: Yuwei Huang <yuweih@chromium.org> Reviewed-by: Joe Downing <joedow@chromium.org> Reviewed-by: Yuwei Huang <yuweih@chromium.org> Cr-Commit-Position: refs/heads/master@{#655474}
- Loading branch information
Erik Jensen
authored and
Commit Bot
committed
May 1, 2019
1 parent
fdd65d3
commit 1b00aa7
Showing
5 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2019 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//third_party/grpc/grpc_library.gni") | ||
|
||
cc_grpc_library("directory_grpc_library") { | ||
sources = [ | ||
"directory_messages.proto", | ||
"directory_service.proto", | ||
"host_info.proto", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
syntax = "proto2"; | ||
|
||
option optimize_for = LITE_RUNTIME; | ||
|
||
package remoting.apis.v1; | ||
|
||
import "host_info.proto"; | ||
|
||
// Requests the deletion of a specific host from the Directory. | ||
message DeleteHostRequest { | ||
// The ID of the host to delete. | ||
optional string host_id = 1; | ||
} | ||
|
||
// The response to a DeleteHostRequest. | ||
message DeleteHostResponse {} | ||
|
||
// Request host info for a single Me2Me host. This is typically used when the | ||
// client already has the host list and wants updated host info or if a deeplink | ||
// is used to connect to a specific host. | ||
message GetHostRequest { | ||
// The ID of the host to request info for. | ||
optional string host_id = 1; | ||
} | ||
|
||
// The response to a GetHostRequest. | ||
message GetHostResponse { | ||
// The info for the host_id in the request. | ||
optional HostInfo host_info = 1; | ||
} | ||
|
||
// Requests a list of hosts owned by the user making the request. | ||
message GetHostListRequest {} | ||
|
||
// Response to a GetHostListRequest. | ||
message GetHostListResponse { | ||
// The list of users owned by the user. | ||
repeated remoting.apis.v1.HostInfo hosts = 1; | ||
} | ||
|
||
// Sent from a Me2Me host to update it's info and online presence. | ||
message HeartbeatRequest { | ||
// An encypted token used to validate the request's origin. | ||
optional string signature = 1; | ||
// Host identity. Normally a UUID. | ||
optional string host_id = 2; | ||
// Current ID for the GoogleTalk service, if applicable. | ||
optional string jabber_id = 3; | ||
// Current ID for the Tachyon service, if applicable. | ||
optional string tachyon_id = 4; | ||
// Monotonically increasing value which is used to prevent replay attacks. | ||
optional int32 sequence_id = 5; | ||
// Version of the Me2Me host software installed. | ||
optional string host_version = 6; | ||
// A reason for the host reporting itself as offline. | ||
optional string host_offline_reason = 7; | ||
// Operating system type the host is running on. | ||
optional string host_os_name = 8; | ||
// Operating system version the host is running on. | ||
optional string host_os_version = 9; | ||
} | ||
|
||
// Sent in response to a HeartbeatRequest. | ||
message HeartbeatResponse { | ||
// The result of the request. | ||
optional HeartbeatResult result = 1; | ||
// The amount of time to wait before the host should send its next update. | ||
optional int32 set_interval_seconds = 2; | ||
} | ||
|
||
// TODO(joedow): Translate XMPP stanza errors into proto format. | ||
// The result of a HeartBeatRequest. | ||
enum HeartbeatResult { | ||
// Field was not set. | ||
HEARTBEATRESULT_UNSET = 0; | ||
// The heartbeat was handled successfully. | ||
SUCCESS = 1; | ||
// There was an error processing the heartbeat request. | ||
ERROR = 2; | ||
} | ||
|
||
// Requests an auth_code with updated OAuth scopes. Should only be called by | ||
// robot accounts assigned to a Me2me host. | ||
message UpdateRobotTokenRequest {} | ||
|
||
// Response to a UpdateRobotTokenRequest. | ||
message UpdateRobotTokenResponse { | ||
// An auth code nonce which can be exchanged for a new token from Gaia. | ||
optional string auth_code = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
syntax = "proto2"; | ||
|
||
option optimize_for = LITE_RUNTIME; | ||
|
||
// Note that the package name is used to build the service URL. | ||
package remoting.apis.v1; | ||
|
||
import "directory_messages.proto"; | ||
|
||
// A set of RPC services which provide functionality for remote access hosts | ||
// and clients. | ||
service RemotingDirectoryService { | ||
// RPC service which returns the info for a specific host. | ||
rpc GetHost(GetHostRequest) returns (GetHostResponse) {} | ||
|
||
// RPC service which returns a list of remote hosts. | ||
rpc GetHostList(GetHostListRequest) returns (GetHostListResponse) {} | ||
|
||
// RPC service called by the remote access host to indicate online presence | ||
// and update Directory info such as the signaling ID and OS info. | ||
rpc Heartbeat(HeartbeatRequest) returns (HeartbeatResponse) {} | ||
|
||
// RPC service which provides an update token for a robot account. | ||
rpc UpdateRobotToken(UpdateRobotTokenRequest) | ||
returns (UpdateRobotTokenResponse) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
syntax = "proto2"; | ||
|
||
option optimize_for = LITE_RUNTIME; | ||
|
||
package remoting.apis.v1; | ||
|
||
// Represents a Chrome Remote Desktop host instance. It includes static data | ||
// from when the host was first registered as well as transient data such as | ||
// the signaling ID and the last heartbeat time. | ||
message HostInfo { | ||
// Host identity. Normally a UUID. | ||
optional string host_id = 1; | ||
|
||
// Public key for the host. Must be a 2048-bit RSA key encoded with BASE64. | ||
optional string public_key = 2; | ||
|
||
// A readable name shown to the user. | ||
optional string host_name = 3; | ||
|
||
// Time when the host was created (milliseconds since 01/01/1970 GMT). | ||
optional int64 created_time = 4; | ||
|
||
// Most recent JabberID. | ||
optional string jabber_id = 5; | ||
|
||
// JID-like ID of the form user@domain.com/chromoting_ftl_<reg ID>. | ||
optional string ftl_id = 6; | ||
|
||
// Status of the host. | ||
enum Status { | ||
// Field was not set. | ||
STATUS_UNSET = 0; | ||
// The host is offline. | ||
OFFLINE = 1; | ||
// The host is online. | ||
ONLINE = 2; | ||
} | ||
// The current online status of the host based on the last heartbeat seen. | ||
optional Status status = 7 [default = OFFLINE]; | ||
|
||
// Host offline reason. See also: | ||
// - chromium/src/remoting/host/heartbeat_sender.h | ||
// - kHostExitCodeStrings in chromium/src/remoting/host/host_exit_codes.cc | ||
optional string host_offline_reason = 8; | ||
|
||
// Time when the host was last online (milliseconds since 01/01/1970 GMT). | ||
optional int64 last_seen_time = 9; | ||
|
||
// State of the host registration process. | ||
enum RegistrationState { | ||
// Field was not set. | ||
REGISTRATION_STATE_UNSET = 0; | ||
// The service is waiting for the host to send its signaling ID. | ||
WAITING_FOR_HOST_STATUS = 1; | ||
// The service has timed out waiting for the host to send its signaling ID. | ||
TIMED_OUT_WAITING_FOR_HOST_STATUS = 2; | ||
// The host has sent its signaling ID and completed registration. | ||
HOST_STATUS_RECEIVED = 3; | ||
} | ||
// The registration state of the host. | ||
optional RegistrationState registration_state = 10; | ||
|
||
// A RegEx used to validate an incoming third-party auth URL from the host. | ||
repeated string token_url_pattern = 11; | ||
|
||
// Version of the Me2Me/It2Me host software installed on the host. | ||
optional string host_version = 12; | ||
|
||
// Operating system type of the host. | ||
optional string host_os_name = 13; | ||
|
||
// Operating system version of the host. | ||
optional string host_os_version = 14; | ||
} |