Skip to content

Commit 075dd53

Browse files
[protobuf] Update protobuf definitions to v1.34.0 (#465)
Signed-off-by: envoy-bot <envoy-bot@users.noreply.github.com> Co-authored-by: envoy-bot <envoy-bot@users.noreply.github.com>
1 parent e54ff3c commit 075dd53

File tree

68 files changed

+1566
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1566
-209
lines changed

api/src/main/proto/cel/expr/checked.proto

+48
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,20 @@ message Decl {
236236
Constant value = 2;
237237

238238
// Documentation string for the identifier.
239+
//
240+
// Provide a brief description of what the variable represents and whether
241+
// there are any constraints on the formatting or supported value range.
242+
//
243+
// Examples:
244+
//
245+
// 'request.auth.principal' - string which uniquely identifies an
246+
// authenticated principal. For JSON Web Tokens (JWTs), the principal
247+
// is the combination of the issuer ('iss') and subject ('sub') token
248+
// fields concatenated by a forward slash: iss + `/` + sub.
249+
//
250+
// 'min_cpus' - integer value indicates the minimum number of CPUs
251+
// required for a compute cluster. The 'min_cpus' value must be
252+
// greater than zero and less than 'max_cpus' or 64 whichever is less.
239253
string doc = 3;
240254
}
241255

@@ -293,11 +307,45 @@ message Decl {
293307
bool is_instance_function = 5;
294308

295309
// Documentation string for the overload.
310+
//
311+
// Provide examples of the overload behavior, preferring to use literal
312+
// values as input with a comment on the return value.
313+
//
314+
// Examples:
315+
//
316+
// // Determine whether a value of type <V> exists within a list<V>.
317+
// 2 in [1, 2, 3] // returns true
318+
//
319+
// // Determine whether a key of type <K> exists within a map<K,V>.
320+
// 'hello' in {'hi': 'you', 'hello': 'there'} // returns true
321+
// 'help' in {'hi': 'you', 'hello': 'there'} // returns false
322+
//
323+
// // Take the substring of a string starting at a specific character
324+
// // offset (inclusive).
325+
// "tacocat".substring(1) // returns "acocat"
326+
// "tacocat".substring(20) // error
327+
//
328+
// // Take the substring of a string starting at a specific character
329+
// // offset (inclusive) and ending at the given offset (exclusive).
330+
// "tacocat".substring(1, 6) // returns "acoca"
296331
string doc = 6;
297332
}
298333

299334
// Required. List of function overloads, must contain at least one overload.
300335
repeated Overload overloads = 1;
336+
337+
// Documentation string for the function that indicates the general purpose
338+
// of the function and its behavior.
339+
//
340+
// Documentation strings for the function should be general purpose with
341+
// specific examples provided in the overload doc string.
342+
//
343+
// Examples:
344+
//
345+
// The 'in' operator tests whether an item exists in a collection.
346+
//
347+
// The 'substring' function returns a substring of a target string.
348+
string doc = 2;
301349
}
302350

303351
// The fully qualified name of the declaration.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
// Copyright 2025 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 cel.expr.conformance;
18+
19+
import "cel/expr/checked.proto";
20+
import "google/protobuf/struct.proto";
21+
import "google/protobuf/descriptor.proto";
22+
23+
option cc_enable_arenas = true;
24+
option go_package = "cel.dev/expr/conformance";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "EnvironmentProto";
27+
option java_package = "cel.dev.expr.conformance";
28+
29+
// Representation of a CEL Environment, defining what features and extensions
30+
// are available for conformance testing.
31+
message Environment {
32+
// Name of the environment
33+
string name = 1;
34+
35+
// Description for the current environment
36+
string description = 2;
37+
38+
// Sets the namespace (container) for the expression.
39+
// This is used to simplify resolution.
40+
// For example with container
41+
// `google.rpc.context`
42+
// an identifier of `google.rpc.context.AttributeContext` could be referred
43+
// to simply as `AttributeContext` in the CEL expression.
44+
string container = 3;
45+
46+
// Import represents a type name that will be abbreviated by its simple name
47+
// making it easier to reference simple type names from packages other than
48+
// the expression container.
49+
// For ex:
50+
// Import{name: 'google.rpc.Status'}
51+
// The above import will ensure that `google.rpc.Status` is available by the
52+
// simple name `Status` within CEL expressions.
53+
message Import {
54+
// Qualified type name which will be abbreviated
55+
string name = 1;
56+
}
57+
58+
// List of abbreviations to be added to the CEL environment
59+
repeated Import imports = 4;
60+
61+
// Set of options to subset a subsettable library
62+
LibrarySubset stdlib = 5;
63+
64+
// List of extensions to enable in the CEL environment.
65+
repeated Extension extensions = 6;
66+
67+
// ContextVariable represents a message type to be made available as a
68+
// context variable to the CEL environment.
69+
message ContextVariable {
70+
// Fully qualified type name of the context proto.
71+
string type_name = 1;
72+
}
73+
74+
// If set, adds a context declaration from a proto message.
75+
//
76+
// Context messages have all of their top-level fields available as variables
77+
// in the type checker.
78+
ContextVariable context_variable = 7;
79+
80+
// List of declarations to be configured in the CEL environment.
81+
//
82+
// Note: The CEL environment can be configured with either the
83+
// context_variable or a set of ident_decls provided as part of declarations.
84+
// Providing both will result in an error.
85+
repeated cel.expr.Decl declarations = 8;
86+
87+
// List of validators for validating the parsed ast.
88+
repeated Validator validators = 9;
89+
90+
// List of feature flags to be enabled or disabled.
91+
repeated Feature features = 10;
92+
93+
// Disables including the declarations from the standard CEL environment.
94+
//
95+
// NOTE: Do not disable the standard CEL declarations unless you are aware of
96+
// the implications and have discussed your use case on cel-discuss@
97+
// or with the members of the cel-governance-team@
98+
//
99+
// Deprecated: Use LibrarySubset to disable standard cel declarations instead:
100+
// stdlib = LibrarySubset{ disable: true }
101+
bool disable_standard_cel_declarations = 11;
102+
103+
// If provided, uses the provided FileDescriptorSet to extend types available
104+
// the CEL expression. All "well-known" protobuf messages (google.protobuf.*)
105+
// are known to the CEL compiler, but all others must be provided for type
106+
// checking.
107+
google.protobuf.FileDescriptorSet message_type_extension = 12;
108+
109+
// When macro call tracking is enabled, the resulting SourceInfo in the
110+
// CheckedExpr will contain a collection of expressions representing the
111+
// function calls which were replaced by macros.
112+
//
113+
// Deprecated: Use Feature to enable macro call tracking
114+
// Feature{ name: "cel.feature.macro_call_tracking", enabled: true }
115+
bool enable_macro_call_tracking = 13;
116+
}
117+
118+
// Represents a named validator with an optional map-based configuration object.
119+
// Naming convention followed by validators:
120+
// <domain>.validator.<validator_name>
121+
// For ex:
122+
// `cel.validator.timestamp`
123+
//
124+
// Note: the map-keys must directly correspond to the internal representation of
125+
// the original validator, and should only use primitive scalar types as values
126+
// at this time.
127+
message Validator {
128+
string name = 1;
129+
130+
// Additional configurations to be included as part of the validation
131+
map<string, google.protobuf.Value> config = 2;
132+
}
133+
134+
// Represents a named boolean feature flag supported by CEL.
135+
// Naming convention followed by features:
136+
// <domain>.feature.<feature_name>
137+
// For ex:
138+
// `cel.feature.cross_type_numeric_comparisons`
139+
message Feature {
140+
// Name of the feature flag.
141+
string name = 1;
142+
143+
// State of the feature flab.
144+
bool enabled = 2;
145+
}
146+
147+
// Extension represents a versioned extension library reference to enable in the
148+
// CEL environment.
149+
message Extension {
150+
// Name of the extension library.
151+
string name = 1;
152+
// Version of the extension library.
153+
string version = 2;
154+
}
155+
156+
// LibrarySubset indicates a subset of the macros and functions supported by a
157+
// subsettable library.
158+
message LibrarySubset {
159+
// Indicates whether the library has been disabled, typically only
160+
// used for default-enabled libraries like stdlib.
161+
bool disabled = 1;
162+
163+
// Disables macros for the given library.
164+
bool disable_macros = 2;
165+
166+
// Specifies a set of macro function names to include in the subset.
167+
repeated string include_macros = 3;
168+
169+
// Specifies a set of macro function names to exclude from the subset.
170+
// Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored.
171+
repeated string exclude_macros = 4;
172+
173+
// Specifies a set of functions to include in the subset.
174+
//
175+
// Note: the overloads specified in the subset need only specify their ID.
176+
// Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored.
177+
repeated cel.expr.Decl include_functions = 5;
178+
179+
// Specifies the set of functions to exclude from the subset.
180+
//
181+
// Note: the overloads specified in the subset need only specify their ID.
182+
repeated cel.expr.Decl exclude_functions = 6;
183+
}

api/src/main/proto/cel/expr/conformance/proto2/test_all_types.proto

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ message TestAllTypes {
6363
optional string single_string = 14 [default = "empty"];
6464
optional bytes single_bytes = 15 [default = "none"];
6565

66+
// Collides with 'in' operator.
67+
optional bool in = 18;
68+
6669
// Wellknown.
6770
optional google.protobuf.Any single_any = 100;
6871
optional google.protobuf.Duration single_duration = 101;

api/src/main/proto/cel/expr/conformance/proto3/test_all_types.proto

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ message TestAllTypes {
6565
optional bool optional_bool = 16;
6666
optional bool optional_string = 17;
6767

68+
// Collides with 'in' operator.
69+
bool in = 18;
70+
6871
// Wellknown.
6972
google.protobuf.Any single_any = 100;
7073
google.protobuf.Duration single_duration = 101;

api/src/main/proto/cel/expr/conformance/test/simple.proto

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ option java_package = "dev.cel.expr.conformance.test";
3131
// The format of a simple test file, expected to be stored in text format.
3232
// A file is the unit of granularity for selecting conformance tests,
3333
// so tests of optional features should be segregated into separate files.
34+
//
35+
// Deprecated: Use cel.expr.conformance.test.Suite
3436
message SimpleTestFile {
3537
// Required. The name of the file. Should match the filename.
3638
string name = 1;

0 commit comments

Comments
 (0)