Debian Codegraph @

googleapis/api/serviceconfig/context.pb.go

raw
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 // Code generated by protoc-gen-go. DO NOT EDIT.
16 // versions:
17 // protoc-gen-go v1.26.0
18 // protoc v4.24.4
19 // source: google/api/context.proto
20
21 package serviceconfig
22
23 import (
24 reflect "reflect"
25 sync "sync"
26
27 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
28 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
29 )
30
31 const (
32 // Verify that this generated code is sufficiently up-to-date.
33 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
34 // Verify that runtime/protoimpl is sufficiently up-to-date.
35 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
36 )
37
38 // `Context` defines which contexts an API requests.
39 //
40 // Example:
41 //
42 // context:
43 // rules:
44 // - selector: "*"
45 // requested:
46 // - google.rpc.context.ProjectContext
47 // - google.rpc.context.OriginContext
48 //
49 // The above specifies that all methods in the API request
50 // `google.rpc.context.ProjectContext` and
51 // `google.rpc.context.OriginContext`.
52 //
53 // Available context types are defined in package
54 // `google.rpc.context`.
55 //
56 // This also provides mechanism to allowlist any protobuf message extension that
57 // can be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and
58 // “x-goog-ext-<extension_id>-jspb” format. For example, list any service
59 // specific protobuf types that can appear in grpc metadata as follows in your
60 // yaml file:
61 //
62 // Example:
63 //
64 // context:
65 // rules:
66 // - selector: "google.example.library.v1.LibraryService.CreateBook"
67 // allowed_request_extensions:
68 // - google.foo.v1.NewExtension
69 // allowed_response_extensions:
70 // - google.foo.v1.NewExtension
71 //
72 // You can also specify extension ID instead of fully qualified extension name
73 // here.
74 type Context struct {
75 state protoimpl.MessageState
76 sizeCache protoimpl.SizeCache
77 unknownFields protoimpl.UnknownFields
78
79 // A list of RPC context rules that apply to individual API methods.
80 //
81 // **NOTE:** All service configuration rules follow "last one wins" order.
82 Rules []*ContextRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
83 }
84
85 func (x *Context) Reset() {
86 *x = Context{}
87 if protoimpl.UnsafeEnabled {
88 mi := &file_google_api_context_proto_msgTypes[0]
89 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
90 ms.StoreMessageInfo(mi)
91 }
92 }
93
94 func (x *Context) String() string {
95 return protoimpl.X.MessageStringOf(x)
96 }
97
98 func (*Context) ProtoMessage() {}
99
100 func (x *Context) ProtoReflect() protoreflect.Message {
101 mi := &file_google_api_context_proto_msgTypes[0]
102 if protoimpl.UnsafeEnabled && x != nil {
103 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
104 if ms.LoadMessageInfo() == nil {
105 ms.StoreMessageInfo(mi)
106 }
107 return ms
108 }
109 return mi.MessageOf(x)
110 }
111
112 // Deprecated: Use Context.ProtoReflect.Descriptor instead.
113 func (*Context) Descriptor() ([]byte, []int) {
114 return file_google_api_context_proto_rawDescGZIP(), []int{0}
115 }
116
117 func (x *Context) GetRules() []*ContextRule {
118 if x != nil {
119 return x.Rules
120 }
121 return nil
122 }
123
124 // A context rule provides information about the context for an individual API
125 // element.
126 type ContextRule struct {
127 state protoimpl.MessageState
128 sizeCache protoimpl.SizeCache
129 unknownFields protoimpl.UnknownFields
130
131 // Selects the methods to which this rule applies.
132 //
133 // Refer to [selector][google.api.DocumentationRule.selector] for syntax
134 // details.
135 Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
136 // A list of full type names of requested contexts, only the requested context
137 // will be made available to the backend.
138 Requested []string `protobuf:"bytes,2,rep,name=requested,proto3" json:"requested,omitempty"`
139 // A list of full type names of provided contexts. It is used to support
140 // propagating HTTP headers and ETags from the response extension.
141 Provided []string `protobuf:"bytes,3,rep,name=provided,proto3" json:"provided,omitempty"`
142 // A list of full type names or extension IDs of extensions allowed in grpc
143 // side channel from client to backend.
144 AllowedRequestExtensions []string `protobuf:"bytes,4,rep,name=allowed_request_extensions,json=allowedRequestExtensions,proto3" json:"allowed_request_extensions,omitempty"`
145 // A list of full type names or extension IDs of extensions allowed in grpc
146 // side channel from backend to client.
147 AllowedResponseExtensions []string `protobuf:"bytes,5,rep,name=allowed_response_extensions,json=allowedResponseExtensions,proto3" json:"allowed_response_extensions,omitempty"`
148 }
149
150 func (x *ContextRule) Reset() {
151 *x = ContextRule{}
152 if protoimpl.UnsafeEnabled {
153 mi := &file_google_api_context_proto_msgTypes[1]
154 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
155 ms.StoreMessageInfo(mi)
156 }
157 }
158
159 func (x *ContextRule) String() string {
160 return protoimpl.X.MessageStringOf(x)
161 }
162
163 func (*ContextRule) ProtoMessage() {}
164
165 func (x *ContextRule) ProtoReflect() protoreflect.Message {
166 mi := &file_google_api_context_proto_msgTypes[1]
167 if protoimpl.UnsafeEnabled && x != nil {
168 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
169 if ms.LoadMessageInfo() == nil {
170 ms.StoreMessageInfo(mi)
171 }
172 return ms
173 }
174 return mi.MessageOf(x)
175 }
176
177 // Deprecated: Use ContextRule.ProtoReflect.Descriptor instead.
178 func (*ContextRule) Descriptor() ([]byte, []int) {
179 return file_google_api_context_proto_rawDescGZIP(), []int{1}
180 }
181
182 func (x *ContextRule) GetSelector() string {
183 if x != nil {
184 return x.Selector
185 }
186 return ""
187 }
188
189 func (x *ContextRule) GetRequested() []string {
190 if x != nil {
191 return x.Requested
192 }
193 return nil
194 }
195
196 func (x *ContextRule) GetProvided() []string {
197 if x != nil {
198 return x.Provided
199 }
200 return nil
201 }
202
203 func (x *ContextRule) GetAllowedRequestExtensions() []string {
204 if x != nil {
205 return x.AllowedRequestExtensions
206 }
207 return nil
208 }
209
210 func (x *ContextRule) GetAllowedResponseExtensions() []string {
211 if x != nil {
212 return x.AllowedResponseExtensions
213 }
214 return nil
215 }
216
217 var File_google_api_context_proto protoreflect.FileDescriptor
218
219 var file_google_api_context_proto_rawDesc = []byte{
220 0x0a, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e,
221 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67,
222 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x38, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
223 0x74, 0x12, 0x2d, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
224 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f,
225 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73,
226 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x75, 0x6c, 0x65,
227 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
228 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09,
229 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
230 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72,
231 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72,
232 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x1a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65,
233 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
234 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x18, 0x61, 0x6c, 0x6c, 0x6f,
235 0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
236 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x1b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f,
237 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
238 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
239 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
240 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x6e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
241 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50,
242 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67,
243 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f,
244 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70,
245 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3b,
246 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0xa2, 0x02, 0x04,
247 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
248 }
249
250 var (
251 file_google_api_context_proto_rawDescOnce sync.Once
252 file_google_api_context_proto_rawDescData = file_google_api_context_proto_rawDesc
253 )
254
255 func file_google_api_context_proto_rawDescGZIP() []byte {
256 file_google_api_context_proto_rawDescOnce.Do(func() {
257 file_google_api_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_context_proto_rawDescData)
258 })
259 return file_google_api_context_proto_rawDescData
260 }
261
262 var file_google_api_context_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
263 var file_google_api_context_proto_goTypes = []interface{}{
264 (*Context)(nil), // 0: google.api.Context
265 (*ContextRule)(nil), // 1: google.api.ContextRule
266 }
267 var file_google_api_context_proto_depIdxs = []int32{
268 1, // 0: google.api.Context.rules:type_name -> google.api.ContextRule
269 1, // [1:1] is the sub-list for method output_type
270 1, // [1:1] is the sub-list for method input_type
271 1, // [1:1] is the sub-list for extension type_name
272 1, // [1:1] is the sub-list for extension extendee
273 0, // [0:1] is the sub-list for field type_name
274 }
275
276 func init() { file_google_api_context_proto_init() }
277 func file_google_api_context_proto_init() {
278 if File_google_api_context_proto != nil {
279 return
280 }
281 if !protoimpl.UnsafeEnabled {
282 file_google_api_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
283 switch v := v.(*Context); i {
284 case 0:
285 return &v.state
286 case 1:
287 return &v.sizeCache
288 case 2:
289 return &v.unknownFields
290 default:
291 return nil
292 }
293 }
294 file_google_api_context_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
295 switch v := v.(*ContextRule); i {
296 case 0:
297 return &v.state
298 case 1:
299 return &v.sizeCache
300 case 2:
301 return &v.unknownFields
302 default:
303 return nil
304 }
305 }
306 }
307 type x struct{}
308 out := protoimpl.TypeBuilder{
309 File: protoimpl.DescBuilder{
310 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
311 RawDescriptor: file_google_api_context_proto_rawDesc,
312 NumEnums: 0,
313 NumMessages: 2,
314 NumExtensions: 0,
315 NumServices: 0,
316 },
317 GoTypes: file_google_api_context_proto_goTypes,
318 DependencyIndexes: file_google_api_context_proto_depIdxs,
319 MessageInfos: file_google_api_context_proto_msgTypes,
320 }.Build()
321 File_google_api_context_proto = out.File
322 file_google_api_context_proto_rawDesc = nil
323 file_google_api_context_proto_goTypes = nil
324 file_google_api_context_proto_depIdxs = nil
325 }