Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
context.proto93 linesDownload Raw Back to api
1// Copyright 2026 Google LLC2//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 at6//7//     http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// 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 and13// limitations under the License.14 15syntax = "proto3";16 17package google.api;18 19option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";20option java_multiple_files = true;21option java_outer_classname = "ContextProto";22option java_package = "com.google.api";23option objc_class_prefix = "GAPI";24 25// `Context` defines which contexts an API requests.26//27// Example:28//29//     context:30//       rules:31//       - selector: "*"32//         requested:33//         - google.rpc.context.ProjectContext34//         - google.rpc.context.OriginContext35//36// The above specifies that all methods in the API request37// `google.rpc.context.ProjectContext` and38// `google.rpc.context.OriginContext`.39//40// Available context types are defined in package41// `google.rpc.context`.42//43// This also provides mechanism to allowlist any protobuf message extension that44// can be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and45// “x-goog-ext-<extension_id>-jspb” format. For example, list any service46// specific protobuf types that can appear in grpc metadata as follows in your47// yaml file:48//49// Example:50//51//     context:52//       rules:53//        - selector: "google.example.library.v1.LibraryService.CreateBook"54//          allowed_request_extensions:55//          - google.foo.v1.NewExtension56//          allowed_response_extensions:57//          - google.foo.v1.NewExtension58//59// You can also specify extension ID instead of fully qualified extension name60// here.61message Context {62  // A list of RPC context rules that apply to individual API methods.63  //64  // **NOTE:** All service configuration rules follow "last one wins" order.65  repeated ContextRule rules = 1;66}67 68// A context rule provides information about the context for an individual API69// element.70message ContextRule {71  // Selects the methods to which this rule applies.72  //73  // Refer to [selector][google.api.DocumentationRule.selector] for syntax74  // details.75  string selector = 1;76 77  // A list of full type names of requested contexts, only the requested context78  // will be made available to the backend.79  repeated string requested = 2;80 81  // A list of full type names of provided contexts. It is used to support82  // propagating HTTP headers and ETags from the response extension.83  repeated string provided = 3;84 85  // A list of full type names or extension IDs of extensions allowed in grpc86  // side channel from client to backend.87  repeated string allowed_request_extensions = 4;88 89  // A list of full type names or extension IDs of extensions allowed in grpc90  // side channel from backend to client.91  repeated string allowed_response_extensions = 5;92}93 
codekingpro/portable-devtools · Team Ai