diff --git a/grpc/lookup/v1/rls.proto b/grpc/lookup/v1/rls.proto index bf399a03..d204d8ea 100644 --- a/grpc/lookup/v1/rls.proto +++ b/grpc/lookup/v1/rls.proto @@ -24,10 +24,12 @@ option java_outer_classname = "RlsProto"; message RouteLookupRequest { // Full host name of the target server, e.g. firestore.googleapis.com. // Only set for gRPC requests; HTTP requests must use key_map explicitly. - string server = 1; + // Deprecated in favor of setting key_map keys with GrpcKeyBuilder.extra_keys. + string server = 1 [deprecated = true]; // Full path of the request, i.e. "/service/method". // Only set for gRPC requests; HTTP requests must use key_map explicitly. - string path = 2; + // Deprecated in favor of setting key_map keys with GrpcKeyBuilder.extra_keys. + string path = 2 [deprecated = true]; // Target type allows the client to specify what kind of target format it // would like from RLS to allow it to find the regional server, e.g. "grpc". string target_type = 3; diff --git a/grpc/lookup/v1/rls_config.proto b/grpc/lookup/v1/rls_config.proto index f2ed78d6..db99a894 100644 --- a/grpc/lookup/v1/rls_config.proto +++ b/grpc/lookup/v1/rls_config.proto @@ -29,6 +29,9 @@ option java_outer_classname = "RlsConfigProto"; // present for the keybuilder to match. message NameMatcher { // The name that will be used in the RLS key_map to refer to this value. + // If required_match is true, you may omit this field or set it to an empty + // string, in which case the matcher will require a match, but won't update + // the key_map. string key = 1; // Ordered list of names (headers or query parameter names) that can supply @@ -52,10 +55,29 @@ message GrpcKeyBuilder { } repeated Name names = 1; + // If you wish to include the host, service, or method names as keys in the + // generated RouteLookupRequest, specify key names to use in the extra_keys + // submessage. If a key name is empty, no key will be set for that value. + // If this submessage is specified, the normal host/path fields will be left + // unset in the RouteLookupRequest. We are deprecating host/path in the + // RouteLookupRequest, so services should migrate to the ExtraKeys approach. + message ExtraKeys { + string host = 1; + string service = 2; + string method = 3; + } + ExtraKeys extra_keys = 3; + // Extract keys from all listed headers. // For gRPC, it is an error to specify "required_match" on the NameMatcher // protos. repeated NameMatcher headers = 2; + + // You can optionally set one or more specific key/value pairs to be added to + // the key_map. This can be useful to identify which builder built the key, + // for example if you are suppressing the actual method, but need to + // separately cache and request all the matched methods. + map constant_keys = 4; } // An HttpKeyBuilder applies to a given HTTP URL and headers. @@ -131,6 +153,12 @@ message HttpKeyBuilder { // to match. If a given header appears multiple times in the request we will // report it as a comma-separated string, in standard HTTP fashion. repeated NameMatcher headers = 4; + + // You can optionally set one or more specific key/value pairs to be added to + // the key_map. This can be useful to identify which builder built the key, + // for example if you are suppressing a lot of information from the URL, but + // need to separately cache and request URLs with that content. + map constant_keys = 5; } message RouteLookupConfig {