xref: /aosp_15_r20/prebuilts/android-emulator/linux-x86_64/lib/grpc_endpoint_description.proto (revision d870e0501505f2fc9999364ffe386a6b6151adc1)
1// Copyright (C) 2022 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14syntax = "proto3";
15
16option java_multiple_files = true;
17option java_package = "com.android.emulation.remote";
18
19package android.emulation.remote;
20
21// A set of gRPC credentials that can be used to configure a secure TLS channel.
22message Credentials {
23    // The PEM encoding of the server root certificates, or none if the default
24    // roots should be used.
25    string pem_root_certs = 1;
26
27    // The PEM encoding of the client's private key, or none if the client does
28    // not have a private key.
29    string pem_private_key = 2;
30
31    // The PEM encoding of the client's certificate chain. This parameter can be
32    // empty if the client does not have a certificate chain.
33    string pem_cert_chain = 3;
34}
35
36// A set of headers that should be set on requests that are being made
37// to the given endpoint.
38message Header {
39    // The header key, for example: 'authorization'
40    string key = 1;
41
42    // The header value, for example: 'Bearer token'
43    string value = 2;
44}
45
46message Endpoint {
47    // The URI of the endpoint to connect to. This can be either a valid
48    // NameResolver-compliant URI, or an authority string. For example:
49    // - "localhost"
50    // - "localhost:8080"
51    // - "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443"
52    // - "dns://8.8.8.8/foo.googleapis.com:8080"
53    string target = 1;
54
55    // Tls credentials to use, if any to establish a connection to the given
56    // endpoint. The emulated bluetooth device will use these credentials
57    // to establish a connection and read/write/subscribe to the data
58    // of interest.
59    Credentials tls_credentials = 2;
60
61    // Set of required headers that should be set in order to establish
62    // a connection.
63    //
64    // These headers are usually used to set access tokens etc.
65    repeated Header required_headers = 3;
66}
67