@@ -19,15 +19,47 @@ package google.bigtable.testproxy;
1919import "google/api/client.proto" ;
2020import "google/bigtable/v2/bigtable.proto" ;
2121import "google/bigtable/v2/data.proto" ;
22+ import "google/protobuf/descriptor.proto" ;
2223import "google/protobuf/duration.proto" ;
2324import "google/rpc/status.proto" ;
2425
25- option go_package = "./ testproxypb" ;
26+ option go_package = "cloud.google.com/go/bigtable/testproxy/testproxypb; testproxypb" ;
2627option java_multiple_files = true ;
2728option java_package = "com.google.cloud.bigtable.testproxy" ;
2829
30+ // A config flag that dictates how the optional features should be enabled
31+ // during the client creation. The optional features customize how the client
32+ // interacts with the server, and are defined in
33+ // https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/feature_flags.proto
34+ enum OptionalFeatureConfig {
35+ OPTIONAL_FEATURE_CONFIG_DEFAULT = 0 ;
36+
37+ OPTIONAL_FEATURE_CONFIG_ENABLE_ALL = 1 ;
38+ }
39+
2940// Request to test proxy service to create a client object.
3041message CreateClientRequest {
42+ message SecurityOptions {
43+ // Access token to use for client credentials. If empty, the client will not
44+ // use any call credentials. Certain implementations may require `use_ssl`
45+ // to be set when using this.
46+ string access_token = 1 ;
47+
48+ // Whether to use SSL channel credentials when connecting to the data
49+ // endpoint.
50+ bool use_ssl = 2 ;
51+
52+ // If using SSL channel credentials, override the SSL endpoint to match the
53+ // host that is specified in the backend's certificate. Also sets the
54+ // client's authority header value.
55+ string ssl_endpoint_override = 3 ;
56+
57+ // PEM encoding of the server root certificates. If not set, the default
58+ // root certs will be used instead. The default can be overridden via the
59+ // GRPC_DEFAULT_SSL_ROOTS_FILE_PATH env var.
60+ string ssl_root_certs_pem = 4 ;
61+ }
62+
3163 // A unique ID associated with the client object to be created.
3264 string client_id = 1 ;
3365
@@ -52,6 +84,21 @@ message CreateClientRequest {
5284 // the created client. Otherwise, the default timeout from the client library
5385 // will be used. Note that the override applies to all the methods.
5486 google.protobuf.Duration per_operation_timeout = 6 ;
87+
88+ // Optional config that dictates how the optional features should be enabled
89+ // during the client creation. Please check the enum type's docstring above.
90+ OptionalFeatureConfig optional_feature_config = 7 ;
91+
92+ // Options to allow connecting to backends with channel and/or call
93+ // credentials. This is needed internally by Cloud Bigtable's own testing
94+ // frameworks.It is not necessary to support these fields for client
95+ // conformance testing.
96+ //
97+ // WARNING: this allows the proxy to connect to a real production
98+ // CBT backend with the right options, however, the proxy itself is insecure
99+ // so it is not recommended to use it with real credentials or outside testing
100+ // contexts.
101+ SecurityOptions security_options = 8 ;
55102}
56103
57104// Response from test proxy service for CreateClientRequest.
@@ -203,6 +250,44 @@ message ReadModifyWriteRowRequest {
203250 google.bigtable.v2.ReadModifyWriteRowRequest request = 2 ;
204251}
205252
253+ // Request to test proxy service to execute a query.
254+ message ExecuteQueryRequest {
255+ // The ID of the target client object.
256+ string client_id = 1 ;
257+
258+ // The raw request to the Bigtable server.
259+ google.bigtable.v2.ExecuteQueryRequest request = 2 ;
260+
261+ // A collection of proto descriptor files for deserializing PROTO/ENUM columns
262+ // in the query result. The descriptor files must be provided in dependency
263+ // order.
264+ google.protobuf.FileDescriptorSet file_descriptor_set = 3 ;
265+ }
266+
267+ // Response from test proxy service for ExecuteQueryRequest.
268+ message ExecuteQueryResult {
269+ // The RPC status from the client binding.
270+ google.rpc.Status status = 1 ;
271+
272+ // Name and type information for the query result.
273+ ResultSetMetadata metadata = 4 ;
274+
275+ // Encoded version of the ResultSet. Should not contain type information.
276+ repeated SqlRow rows = 3 ;
277+ }
278+
279+ // Schema information for the query result.
280+ message ResultSetMetadata {
281+ // Column metadata for each column inthe query result.
282+ repeated google.bigtable.v2.ColumnMetadata columns = 1 ;
283+ }
284+
285+ // Representation of a single row in the query result.
286+ message SqlRow {
287+ // Columnar values returned by the query.
288+ repeated google.bigtable.v2.Value values = 1 ;
289+ }
290+
206291// Note that all RPCs are unary, even when the equivalent client binding call
207292// may be streaming. This is an intentional simplification.
208293//
@@ -265,4 +350,7 @@ service CloudBigtableV2TestProxy {
265350
266351 // Performs a read-modify-write operation with the client.
267352 rpc ReadModifyWriteRow (ReadModifyWriteRowRequest ) returns (RowResult ) {}
353+
354+ // Executes a BTQL query with the client.
355+ rpc ExecuteQuery (ExecuteQueryRequest ) returns (ExecuteQueryResult ) {}
268356}
0 commit comments