1- // Copyright 2023 Google LLC
1+ // Copyright 2025 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ // Copied from https://github.com/googleapis/cndb-client-testing-protos/blob/16a532ea8a56164b921e5f015f04d39e531f8d4d/google/bigtable/testproxy/test_proxy.proto
16+
1517syntax = "proto3" ;
1618
1719package google.bigtable.testproxy ;
1820
1921import "google/api/client.proto" ;
2022import "google/bigtable/v2/bigtable.proto" ;
2123import "google/bigtable/v2/data.proto" ;
24+ import "google/protobuf/descriptor.proto" ;
2225import "google/protobuf/duration.proto" ;
2326import "google/rpc/status.proto" ;
2427
25- option go_package = "./ testproxypb" ;
28+ option go_package = "cloud.google.com/go/bigtable/testproxy/testproxypb; testproxypb" ;
2629option java_multiple_files = true ;
2730option java_package = "com.google.cloud.bigtable.testproxy" ;
2831
32+ // A config flag that dictates how the optional features should be enabled
33+ // during the client creation. The optional features customize how the client
34+ // interacts with the server, and are defined in
35+ // https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/feature_flags.proto
36+ enum OptionalFeatureConfig {
37+ OPTIONAL_FEATURE_CONFIG_DEFAULT = 0 ;
38+
39+ OPTIONAL_FEATURE_CONFIG_ENABLE_ALL = 1 ;
40+ }
41+
2942// Request to test proxy service to create a client object.
3043message CreateClientRequest {
44+ message SecurityOptions {
45+ // Access token to use for client credentials. If empty, the client will not
46+ // use any call credentials. Certain implementations may require `use_ssl`
47+ // to be set when using this.
48+ string access_token = 1 ;
49+
50+ // Whether to use SSL channel credentials when connecting to the data
51+ // endpoint.
52+ bool use_ssl = 2 ;
53+
54+ // If using SSL channel credentials, override the SSL endpoint to match the
55+ // host that is specified in the backend's certificate. Also sets the
56+ // client's authority header value.
57+ string ssl_endpoint_override = 3 ;
58+
59+ // PEM encoding of the server root certificates. If not set, the default
60+ // root certs will be used instead. The default can be overridden via the
61+ // GRPC_DEFAULT_SSL_ROOTS_FILE_PATH env var.
62+ string ssl_root_certs_pem = 4 ;
63+ }
64+
3165 // A unique ID associated with the client object to be created.
3266 string client_id = 1 ;
3367
@@ -52,6 +86,21 @@ message CreateClientRequest {
5286 // the created client. Otherwise, the default timeout from the client library
5387 // will be used. Note that the override applies to all the methods.
5488 google.protobuf.Duration per_operation_timeout = 6 ;
89+
90+ // Optional config that dictates how the optional features should be enabled
91+ // during the client creation. Please check the enum type's docstring above.
92+ OptionalFeatureConfig optional_feature_config = 7 ;
93+
94+ // Options to allow connecting to backends with channel and/or call
95+ // credentials. This is needed internally by Cloud Bigtable's own testing
96+ // frameworks.It is not necessary to support these fields for client
97+ // conformance testing.
98+ //
99+ // WARNING: this allows the proxy to connect to a real production
100+ // CBT backend with the right options, however, the proxy itself is insecure
101+ // so it is not recommended to use it with real credentials or outside testing
102+ // contexts.
103+ SecurityOptions security_options = 8 ;
55104}
56105
57106// Response from test proxy service for CreateClientRequest.
@@ -203,6 +252,44 @@ message ReadModifyWriteRowRequest {
203252 google.bigtable.v2.ReadModifyWriteRowRequest request = 2 ;
204253}
205254
255+ // Request to test proxy service to execute a query.
256+ message ExecuteQueryRequest {
257+ // The ID of the target client object.
258+ string client_id = 1 ;
259+
260+ // The raw request to the Bigtable server.
261+ google.bigtable.v2.ExecuteQueryRequest request = 2 ;
262+
263+ // A collection of proto descriptor files for deserializing PROTO/ENUM columns
264+ // in the query result. The descriptor files must be provided in dependency
265+ // order.
266+ google.protobuf.FileDescriptorSet file_descriptor_set = 3 ;
267+ }
268+
269+ // Response from test proxy service for ExecuteQueryRequest.
270+ message ExecuteQueryResult {
271+ // The RPC status from the client binding.
272+ google.rpc.Status status = 1 ;
273+
274+ // Name and type information for the query result.
275+ ResultSetMetadata metadata = 4 ;
276+
277+ // Encoded version of the ResultSet. Should not contain type information.
278+ repeated SqlRow rows = 3 ;
279+ }
280+
281+ // Schema information for the query result.
282+ message ResultSetMetadata {
283+ // Column metadata for each column inthe query result.
284+ repeated google.bigtable.v2.ColumnMetadata columns = 1 ;
285+ }
286+
287+ // Representation of a single row in the query result.
288+ message SqlRow {
289+ // Columnar values returned by the query.
290+ repeated google.bigtable.v2.Value values = 1 ;
291+ }
292+
206293// Note that all RPCs are unary, even when the equivalent client binding call
207294// may be streaming. This is an intentional simplification.
208295//
@@ -265,4 +352,7 @@ service CloudBigtableV2TestProxy {
265352
266353 // Performs a read-modify-write operation with the client.
267354 rpc ReadModifyWriteRow (ReadModifyWriteRowRequest ) returns (RowResult ) {}
355+
356+ // Executes a BTQL query with the client.
357+ rpc ExecuteQuery (ExecuteQueryRequest ) returns (ExecuteQueryResult ) {}
268358}
0 commit comments