backend.proto 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // Copyright 2019 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. package google.api;
  17. option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "BackendProto";
  20. option java_package = "com.google.api";
  21. option objc_class_prefix = "GAPI";
  22. // `Backend` defines the backend configuration for a service.
  23. message Backend {
  24. // A list of API backend rules that apply to individual API methods.
  25. //
  26. // **NOTE:** All service configuration rules follow "last one wins" order.
  27. repeated BackendRule rules = 1;
  28. }
  29. // A backend rule provides configuration for an individual API element.
  30. message BackendRule {
  31. // Path Translation specifies how to combine the backend address with the
  32. // request path in order to produce the appropriate forwarding URL for the
  33. // request.
  34. //
  35. // Path Translation is applicable only to HTTP-based backends. Backends which
  36. // do not accept requests over HTTP/HTTPS should leave `path_translation`
  37. // unspecified.
  38. enum PathTranslation {
  39. PATH_TRANSLATION_UNSPECIFIED = 0;
  40. // Use the backend address as-is, with no modification to the path. If the
  41. // URL pattern contains variables, the variable names and values will be
  42. // appended to the query string. If a query string parameter and a URL
  43. // pattern variable have the same name, this may result in duplicate keys in
  44. // the query string.
  45. //
  46. // # Examples
  47. //
  48. // Given the following operation config:
  49. //
  50. // Method path: /api/company/{cid}/user/{uid}
  51. // Backend address: https://example.cloudfunctions.net/getUser
  52. //
  53. // Requests to the following request paths will call the backend at the
  54. // translated path:
  55. //
  56. // Request path: /api/company/widgetworks/user/johndoe
  57. // Translated:
  58. // https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe
  59. //
  60. // Request path: /api/company/widgetworks/user/johndoe?timezone=EST
  61. // Translated:
  62. // https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe
  63. CONSTANT_ADDRESS = 1;
  64. // The request path will be appended to the backend address.
  65. //
  66. // # Examples
  67. //
  68. // Given the following operation config:
  69. //
  70. // Method path: /api/company/{cid}/user/{uid}
  71. // Backend address: https://example.appspot.com
  72. //
  73. // Requests to the following request paths will call the backend at the
  74. // translated path:
  75. //
  76. // Request path: /api/company/widgetworks/user/johndoe
  77. // Translated:
  78. // https://example.appspot.com/api/company/widgetworks/user/johndoe
  79. //
  80. // Request path: /api/company/widgetworks/user/johndoe?timezone=EST
  81. // Translated:
  82. // https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
  83. APPEND_PATH_TO_ADDRESS = 2;
  84. }
  85. // Selects the methods to which this rule applies.
  86. //
  87. // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
  88. string selector = 1;
  89. // The address of the API backend.
  90. string address = 2;
  91. // The number of seconds to wait for a response from a request. The default
  92. // deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds.
  93. double deadline = 3;
  94. // Minimum deadline in seconds needed for this method. Calls having deadline
  95. // value lower than this will be rejected.
  96. double min_deadline = 4;
  97. // The number of seconds to wait for the completion of a long running
  98. // operation. The default is no deadline.
  99. double operation_deadline = 5;
  100. PathTranslation path_translation = 6;
  101. // Authentication settings used by the backend.
  102. //
  103. // These are typically used to provide service management functionality to
  104. // a backend served on a publicly-routable URL. The `authentication`
  105. // details should match the authentication behavior used by the backend.
  106. //
  107. // For example, specifying `jwt_audience` implies that the backend expects
  108. // authentication via a JWT.
  109. oneof authentication {
  110. // The JWT audience is used when generating a JWT id token for the backend.
  111. string jwt_audience = 7;
  112. }
  113. }