| 1 |
// Copyright 2026 Google LLC |
| 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. |
| 14 |
|
| 15 |
syntax = "proto3"; |
| 16 |
|
| 17 |
package google.api; |
| 18 |
|
| 19 |
option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"; |
| 20 |
option java_multiple_files = true; |
| 21 |
option java_outer_classname = "BackendProto"; |
| 22 |
option java_package = "com.google.api"; |
| 23 |
option objc_class_prefix = "GAPI"; |
| 24 |
|
| 25 |
// `Backend` defines the backend configuration for a service. |
| 26 |
message Backend { |
| 27 |
// A list of API backend rules that apply to individual API methods. |
| 28 |
// |
| 29 |
// **NOTE:** All service configuration rules follow "last one wins" order. |
| 30 |
repeated BackendRule rules = 1; |
| 31 |
} |
| 32 |
|
| 33 |
// A backend rule provides configuration for an individual API element. |
| 34 |
message BackendRule { |
| 35 |
// Path Translation specifies how to combine the backend address with the |
| 36 |
// request path in order to produce the appropriate forwarding URL for the |
| 37 |
// request. |
| 38 |
// |
| 39 |
// Path Translation is applicable only to HTTP-based backends. Backends which |
| 40 |
// do not accept requests over HTTP/HTTPS should leave `path_translation` |
| 41 |
// unspecified. |
| 42 |
enum PathTranslation { |
| 43 |
PATH_TRANSLATION_UNSPECIFIED = 0; |
| 44 |
|
| 45 |
// Use the backend address as-is, with no modification to the path. If the |
| 46 |
// URL pattern contains variables, the variable names and values will be |
| 47 |
// appended to the query string. If a query string parameter and a URL |
| 48 |
// pattern variable have the same name, this may result in duplicate keys in |
| 49 |
// the query string. |
| 50 |
// |
| 51 |
// # Examples |
| 52 |
// |
| 53 |
// Given the following operation config: |
| 54 |
// |
| 55 |
// Method path: /api/company/{cid}/user/{uid} |
| 56 |
// Backend address: https://example.cloudfunctions.net/getUser |
| 57 |
// |
| 58 |
// Requests to the following request paths will call the backend at the |
| 59 |
// translated path: |
| 60 |
// |
| 61 |
// Request path: /api/company/widgetworks/user/johndoe |
| 62 |
// Translated: |
| 63 |
// https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe |
| 64 |
// |
| 65 |
// Request path: /api/company/widgetworks/user/johndoe?timezone=EST |
| 66 |
// Translated: |
| 67 |
// https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe |
| 68 |
CONSTANT_ADDRESS = 1; |
| 69 |
|
| 70 |
// The request path will be appended to the backend address. |
| 71 |
// |
| 72 |
// # Examples |
| 73 |
// |
| 74 |
// Given the following operation config: |
| 75 |
// |
| 76 |
// Method path: /api/company/{cid}/user/{uid} |
| 77 |
// Backend address: https://example.appspot.com |
| 78 |
// |
| 79 |
// Requests to the following request paths will call the backend at the |
| 80 |
// translated path: |
| 81 |
// |
| 82 |
// Request path: /api/company/widgetworks/user/johndoe |
| 83 |
// Translated: |
| 84 |
// https://example.appspot.com/api/company/widgetworks/user/johndoe |
| 85 |
// |
| 86 |
// Request path: /api/company/widgetworks/user/johndoe?timezone=EST |
| 87 |
// Translated: |
| 88 |
// https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST |
| 89 |
APPEND_PATH_TO_ADDRESS = 2; |
| 90 |
} |
| 91 |
|
| 92 |
// Selects the methods to which this rule applies. |
| 93 |
// |
| 94 |
// Refer to [selector][google.api.DocumentationRule.selector] for syntax |
| 95 |
// details. |
| 96 |
string selector = 1; |
| 97 |
|
| 98 |
// The address of the API backend. |
| 99 |
// |
| 100 |
// The scheme is used to determine the backend protocol and security. |
| 101 |
// The following schemes are accepted: |
| 102 |
// |
| 103 |
// SCHEME PROTOCOL SECURITY |
| 104 |
// http:// HTTP None |
| 105 |
// https:// HTTP TLS |
| 106 |
// grpc:// gRPC None |
| 107 |
// grpcs:// gRPC TLS |
| 108 |
// |
| 109 |
// It is recommended to explicitly include a scheme. Leaving out the scheme |
| 110 |
// may cause constrasting behaviors across platforms. |
| 111 |
// |
| 112 |
// If the port is unspecified, the default is: |
| 113 |
// - 80 for schemes without TLS |
| 114 |
// - 443 for schemes with TLS |
| 115 |
// |
| 116 |
// For HTTP backends, use [protocol][google.api.BackendRule.protocol] |
| 117 |
// to specify the protocol version. |
| 118 |
string address = 2; |
| 119 |
|
| 120 |
// The number of seconds to wait for a response from a request. The default |
| 121 |
// varies based on the request protocol and deployment environment. |
| 122 |
double deadline = 3; |
| 123 |
|
| 124 |
// Deprecated, do not use. |
| 125 |
double min_deadline = 4 [deprecated = true]; |
| 126 |
|
| 127 |
// The number of seconds to wait for the completion of a long running |
| 128 |
// operation. The default is no deadline. |
| 129 |
double operation_deadline = 5; |
| 130 |
|
| 131 |
// Path translation specifies how to combine the backend address with the |
| 132 |
// request path in order to produce the appropriate forwarding URL for the |
| 133 |
// request. See [PathTranslation][google.api.BackendRule.PathTranslation] for |
| 134 |
// more details. |
| 135 |
PathTranslation path_translation = 6; |
| 136 |
|
| 137 |
// Authentication settings used by the backend. |
| 138 |
// |
| 139 |
// These are typically used to provide service management functionality to |
| 140 |
// a backend served on a publicly-routable URL. The `authentication` |
| 141 |
// details should match the authentication behavior used by the backend. |
| 142 |
// |
| 143 |
// For example, specifying `jwt_audience` implies that the backend expects |
| 144 |
// authentication via a JWT. |
| 145 |
// |
| 146 |
// When authentication is unspecified, the resulting behavior is the same |
| 147 |
// as `disable_auth` set to `true`. |
| 148 |
// |
| 149 |
// Refer to https://developers.google.com/identity/protocols/OpenIDConnect for |
| 150 |
// JWT ID token. |
| 151 |
oneof authentication { |
| 152 |
// The JWT audience is used when generating a JWT ID token for the backend. |
| 153 |
// This ID token will be added in the HTTP "authorization" header, and sent |
| 154 |
// to the backend. |
| 155 |
string jwt_audience = 7; |
| 156 |
|
| 157 |
// When disable_auth is true, a JWT ID token won't be generated and the |
| 158 |
// original "Authorization" HTTP header will be preserved. If the header is |
| 159 |
// used to carry the original token and is expected by the backend, this |
| 160 |
// field must be set to true to preserve the header. |
| 161 |
bool disable_auth = 8; |
| 162 |
} |
| 163 |
|
| 164 |
// The protocol used for sending a request to the backend. |
| 165 |
// The supported values are "http/1.1" and "h2". |
| 166 |
// |
| 167 |
// The default value is inferred from the scheme in the |
| 168 |
// [address][google.api.BackendRule.address] field: |
| 169 |
// |
| 170 |
// SCHEME PROTOCOL |
| 171 |
// http:// http/1.1 |
| 172 |
// https:// http/1.1 |
| 173 |
// grpc:// h2 |
| 174 |
// grpcs:// h2 |
| 175 |
// |
| 176 |
// For secure HTTP backends (https://) that support HTTP/2, set this field |
| 177 |
// to "h2" for improved performance. |
| 178 |
// |
| 179 |
// Configuring this field to non-default values is only supported for secure |
| 180 |
// HTTP backends. This field will be ignored for all other backends. |
| 181 |
// |
| 182 |
// See |
| 183 |
// https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids |
| 184 |
// for more details on the supported values. |
| 185 |
string protocol = 9; |
| 186 |
|
| 187 |
// The map between request protocol and the backend address. |
| 188 |
map<string, BackendRule> overrides_by_request_protocol = 10; |
| 189 |
|
| 190 |
// The load balancing policy used for connection to the application backend. |
| 191 |
// |
| 192 |
// Defined as an arbitrary string to accomondate custom load balancing |
| 193 |
// policies supported by the underlying channel, but suggest most users use |
| 194 |
// one of the standard policies, such as the default, "RoundRobin". |
| 195 |
string load_balancing_policy = 11; |
| 196 |
} |