Get desktop application:
View/edit binary Protocol Buffers messages
A CEL expression which has been successfully type checked.
Used in:
, ,A map from expression ids to resolved references. The following entries are in this table: - An Ident or Select expression is represented here if it resolves to a declaration. For instance, if `a.b.c` is represented by `select(select(id(a), b), c)`, and `a.b` resolves to a declaration, while `c` is a field selection, then the reference is attached to the nested select expression (but not to the id or or the outer select). In turn, if `a` resolves to a declaration and `b.c` are field selections, the reference is attached to the ident expression. - Every Call expression has an entry here, identifying the function being called. - Every CreateStruct expression for a message has an entry, identifying the message.
A map from expression ids to types. Every expression node which has a type different than DYN has a mapping here. If an expression has type DYN, it is omitted from this map to save space.
The source info derived from input that generated the parsed `expr` and any optimizations made during the type-checking pass.
The expr version indicates the major / minor version number of the `expr` representation. The most common reason for a version change will be to indicate to the CEL runtimes that transformations have been performed on the expr during static analysis. In some cases, this will save the runtime the work of applying the same or similar transformations prior to evaluation.
The checked expression. Semantically equivalent to the parsed `expr`, but may have structural differences.
Represents a primitive literal. Named 'Constant' here for backwards compatibility. This is similar as the primitives supported in the well-known type `google.protobuf.Value`, but richer so it can represent CEL's full range of primitives. Lists and structs are not included as constants as these aggregate types may contain [Expr][cel.expr.Expr] elements which require evaluation and are thus not constant. Examples of constants include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, `true`, `null`.
Used in:
, ,Required. The valid constant kinds.
null value.
boolean value.
int64 value.
uint64 value.
double value.
string value.
bytes value.
protobuf.Duration value. Deprecated: duration is no longer considered a builtin cel type.
protobuf.Timestamp value. Deprecated: timestamp is no longer considered a builtin cel type.
Represents a declaration of a named value or function. A declaration is part of the contract between the expression, the agent evaluating that expression, and the caller requesting evaluation.
Used in:
, , ,The fully qualified name of the declaration. Declarations are organized in containers and this represents the full path to the declaration in its container, as in `cel.expr.Decl`. Declarations used as [FunctionDecl.Overload][cel.expr.Decl.FunctionDecl.Overload] parameters may or may not have a name depending on whether the overload is function declaration or a function definition containing a result [Expr][cel.expr.Expr].
Required. The declaration kind.
Identifier declaration.
Function declaration.
Function declaration specifies one or more overloads which indicate the function's parameter types and return type. Functions have no observable side-effects (there may be side-effects like logging which are not observable from CEL).
Used in:
Required. List of function overloads, must contain at least one overload.
Documentation string for the function that indicates the general purpose of the function and its behavior. Documentation strings for the function should be general purpose with specific examples provided in the overload doc string. Examples: The 'in' operator tests whether an item exists in a collection. The 'substring' function returns a substring of a target string.
An overload indicates a function's parameter types and return type, and may optionally include a function body described in terms of [Expr][cel.expr.Expr] values. Functions overloads are declared in either a function or method call-style. For methods, the `params[0]` is the expected type of the target receiver. Overloads must have non-overlapping argument types after erasure of all parameterized type variables (similar as type erasure in Java).
Used in:
Required. Globally unique overload name of the function which reflects the function name and argument types. This will be used by a [Reference][cel.expr.Reference] to indicate the `overload_id` that was resolved for the function `name`.
List of function parameter [Type][cel.expr.Type] values. Param types are disjoint after generic type parameters have been replaced with the type `DYN`. Since the `DYN` type is compatible with any other type, this means that if `A` is a type parameter, the function types `int<A>` and `int<int>` are not disjoint. Likewise, `map<string, string>` is not disjoint from `map<K, V>`. When the `result_type` of a function is a generic type param, the type param name also appears as the `type` of on at least one params.
The type param names associated with the function declaration. For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield the type params of `K, V`.
Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`.
Whether the function is to be used in a method call-style `x.f(...)` of a function call-style `f(x, ...)`. For methods, the first parameter declaration, `params[0]` is the expected type of the target receiver.
Documentation string for the overload. Provide examples of the overload behavior, preferring to use literal values as input with a comment on the return value. Examples: // Determine whether a value of type <V> exists within a list<V>. 2 in [1, 2, 3] // returns true // Determine whether a key of type <K> exists within a map<K,V>. 'hello' in {'hi': 'you', 'hello': 'there'} // returns true 'help' in {'hi': 'you', 'hello': 'there'} // returns false // Take the substring of a string starting at a specific character // offset (inclusive). "tacocat".substring(1) // returns "acocat" "tacocat".substring(20) // error // Take the substring of a string starting at a specific character // offset (inclusive) and ending at the given offset (exclusive). "tacocat".substring(1, 6) // returns "acoca"
Identifier declaration which specifies its type and optional `Expr` value. An identifier without a value is a declaration that must be provided at evaluation time. An identifier with a value should resolve to a constant, but may be used in conjunction with other identifiers bound at evaluation time.
Used in:
Required. The type of the identifier.
The constant value of the identifier. If not specified, the identifier must be supplied at evaluation time.
Documentation string for the identifier. Provide a brief description of what the variable represents and whether there are any constraints on the formatting or supported value range. Examples: 'request.auth.principal' - string which uniquely identifies an authenticated principal. For JSON Web Tokens (JWTs), the principal is the combination of the issuer ('iss') and subject ('sub') token fields concatenated by a forward slash: iss + `/` + sub. 'min_cpus' - integer value indicates the minimum number of CPUs required for a compute cluster. The 'min_cpus' value must be greater than zero and less than 'max_cpus' or 64 whichever is less.
An enum value.
Used in:
The fully qualified name of the enum type.
The value of the enum.
A set of errors. The errors included depend on the context. See `ExprValue.error`.
Used in:
, , ,The state of an evaluation. Can represent an initial, partial, or completed state of evaluation.
The unique values referenced in this message.
An ordered list of results. Tracks the flow of evaluation through the expression. May be sparse.
A single evaluation result.
Used in:
The id of the expression this result if for.
The index in `values` of the resulting value.
Values of intermediate expressions produced when evaluating expression.
All of the observed values. The field value_index is an index in the values list. Separating values from steps is needed to remove redundant values.
List of steps. Repeated evaluations of the same expression generate new ExprStep instances. The order of such ExprStep instances matches the order of elements returned by Comprehension.iter_range.
ID and value index of one step.
Used in:
ID of corresponding Expr node.
Index of the value in the values list.
An abstract representation of a common expression. Expressions are abstractly represented as a collection of identifiers, select statements, function calls, literals, and comprehensions. All operators with the exception of the '.' operator are modelled as function calls. This makes it easy to represent new operators into the existing AST. All references within expressions must resolve to a [Decl][cel.expr.Decl] provided at type-check for an expression to be valid. A reference may either be a bare identifier `name` or a qualified identifier `google.api.name`. References may either refer to a value or a function declaration. For example, the expression `google.api.name.startsWith('expr')` references the declaration `google.api.name` within a [Expr.Select][cel.expr.Expr.Select] expression, and the function declaration `startsWith`.
Used in:
, , , , , , ,Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree.
Required. Variants of expressions.
A constant expression.
An identifier expression.
A field selection expression, e.g. `request.auth`.
A call expression, including calls to predefined functions and operators.
A list creation expression.
A map or message creation expression.
A comprehension expression.
A call expression, including calls to predefined functions and operators. For example, `value == 10`, `size(map_value)`.
Used in:
The target of an method call-style expression. For example, `x` in `x.f()`.
Required. The name of the function or method being called.
The arguments.
A comprehension expression applied to a list or map. Comprehensions are not part of the core syntax, but enabled with macros. A macro matches a specific call signature within a parsed AST and replaces the call with an alternate AST block. Macro expansion happens at parse time. The following macros are supported within CEL: Aggregate type macros may be applied to all elements in a list or all keys in a map: * `all`, `exists`, `exists_one` - test a predicate expression against the inputs and return `true` if the predicate is satisfied for all, any, or only one value `list.all(x, x < 10)`. * `filter` - test a predicate expression against the inputs and return the subset of elements which satisfy the predicate: `payments.filter(p, p > 1000)`. * `map` - apply an expression to all elements in the input and return the output aggregate type: `[1, 2, 3].map(i, i * i)`. The `has(m.x)` macro tests whether the property `x` is present in struct `m`. The semantics of this macro depend on the type of `m`. For proto2 messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the macro tests whether the property is set to its default. For map and struct types, the macro tests whether the property `x` is defined on `m`. Comprehensions for the standard environment macros evaluation can be best visualized as the following pseudocode: ``` let `accu_var` = `accu_init` for (let `iter_var` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ``` Comprehensions for the optional V2 macros which support map-to-map translation differ slightly from the standard environment macros in that they expose both the key or index in addition to the value for each list or map entry: ``` let `accu_var` = `accu_init` for (let `iter_var`, `iter_var2` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ```
Used in:
The name of the first iteration variable. For the single iteration variable macros, when iter_range is a list, this variable is the list element and when the iter_range is a map, this variable is the map key.
The name of the second iteration variable, empty if not set. This field is only set for comprehension v2 macros.
The range over which the comprehension iterates.
The name of the variable used for accumulation of the result.
The initial value of the accumulator.
An expression which can contain iter_var, iter_var2, and accu_var. Returns false when the result has been computed and may be used as a hint to short-circuit the remainder of the comprehension.
An expression which can contain iter_var, iter_var2, and accu_var. Computes the next value of accu_var.
An expression which can contain accu_var. Computes the result.
A list creation expression. Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g. `dyn([1, 'hello', 2.0])`
Used in:
The elements part of the list.
The indices within the elements list which are marked as optional elements. When an optional-typed value is present, the value it contains is included in the list. If the optional-typed value is absent, the list element is omitted from the CreateList result.
A map or message creation expression. Maps are constructed as `{'key_name': 'value'}`. Message construction is similar, but prefixed with a type name and composed of field ids: `types.MyType{field_id: 'value'}`.
Used in:
The type name of the message to be created, empty when creating map literals.
The entries in the creation expression.
Represents an entry.
Used in:
Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to the node.
The `Entry` key kinds.
The field key for a message creator statement.
The key expression for a map creation statement.
Required. The value assigned to the key. If the optional_entry field is true, the expression must resolve to an optional-typed value. If the optional value is present, the key will be set; however, if the optional value is absent, the key will be unset.
Whether the key-value pair is optional.
An identifier expression. e.g. `request`.
Used in:
Required. Holds a single, unqualified identifier, possibly preceded by a '.'. Qualified names are represented by the [Expr.Select][cel.expr.Expr.Select] expression.
A field selection expression. e.g. `request.auth`.
Used in:
Required. The target of the selection expression. For example, in the select expression `request.auth`, the `request` portion of the expression is the `operand`.
Required. The name of the field to select. For example, in the select expression `request.auth`, the `auth` portion of the expression would be the `field`.
Whether the select is to be interpreted as a field presence test. This results from the macro `has(request.auth)`.
The value of an evaluated expression.
Used in:
, , ,An expression can resolve to a value, error or unknown.
The set of errors in the critical path of evaluation. Only errors in the critical path are included. For example, `(<error1> || true) && <error2>` will only result in `<error2>`, while `<error1> || <error2>` will result in both `<error1>` and `<error2>`. Errors cause by the presence of other errors are not included in the set. For example `<error1>.foo`, `foo(<error1>)`, and `<error1> + 1` will only result in `<error1>`. Multiple errors *might* be included when evaluation could result in different errors. For example `<error1> + <error2>` and `foo(<error1>, <error2>)` may result in `<error1>`, `<error2>` or both. The exact subset of errors included for this case is unspecified and depends on the implementation details of the evaluator.
The set of unknowns in the critical path of evaluation. Unknown behaves identically to Error with regards to propagation. Specifically, only unknowns in the critical path are included, unknowns caused by the presence of other unknowns are not included, and multiple unknowns *might* be included when evaluation could result in different unknowns. For example: (<unknown[1]> || true) && <unknown[2]> -> <unknown[2]> <unknown[1]> || <unknown[2]> -> <unknown[1,2]> <unknown[1]>.foo -> <unknown[1]> foo(<unknown[1]>) -> <unknown[1]> <unknown[1]> + <unknown[2]> -> <unknown[1]> or <unknown[2[> Unknown takes precedence over Error in cases where a `Value` can short circuit the result: <error> || <unknown> -> <unknown> <error> && <unknown> -> <unknown> Errors take precedence in all other cases: <unknown> + <error> -> <error> foo(<unknown>, <error>) -> <error>
A list. Wrapped in a message so 'not set' and empty can be differentiated, which is required for use in a 'oneof'.
Used in:
The ordered values in the list.
A map. Wrapped in a message so 'not set' and empty can be differentiated, which is required for use in a 'oneof'.
Used in:
The set of map entries. CEL has fewer restrictions on keys, so a protobuf map representation cannot be used.
Used in:
The key. Must be unique with in the map. Currently only boolean, int, uint, and string values can be keys.
The value.
An expression together with source information as returned by the parser.
Used in:
, , ,The parsed expression.
The source info derived from input that generated the parsed `expr`.
Describes a resolved reference to a declaration.
Used in:
The fully qualified name of the declaration.
For references to functions, this is a list of `Overload.overload_id` values which match according to typing rules. If the list has more than one element, overload resolution among the presented candidates must happen at runtime because of dynamic types. The type checker attempts to narrow down this list as much as possible. Empty if this is not a reference to a [Decl.FunctionDecl][cel.expr.Decl.FunctionDecl].
For references to constants, this may contain the value of the constant if known at compile time.
Source information collected at parse time.
Used in:
,The syntax version of the source, e.g. `cel1`.
The location name. All position information attached to an expression is relative to this location. The location could be a file, UI element, or similar. For example, `acme/app/AnvilPolicy.cel`.
Monotonically increasing list of code point offsets where newlines `\n` appear. The line number of a given position is the index `i` where for a given `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The column may be derived from `id_positions[id] - line_offsets[i]`.
A map from the parse node id (e.g. `Expr.id`) to the code point offset within the source.
A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion. For example, `has(value.field)` is a function call that is replaced by a `test_only` field selection in the AST. Likewise, the call `list.exists(e, e > 10)` translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call `Expr` that was replaced.
A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported.
An extension that was requested for the source expression.
Used in:
Identifier for the extension. Example: constant_folding
If set, the listed components must understand the extension for the expression to evaluate correctly. This field has set semantics, repeated values should be deduplicated.
Version info. May be skipped if it isn't meaningful for the extension. (for example constant_folding might always be v0.0).
CEL component specifier.
Used in:
Unspecified, default.
Parser. Converts a CEL string to an AST.
Type checker. Checks that references in an AST are defined and types agree.
Runtime. Evaluates a parsed and optionally checked CEL AST against a context.
Version
Used in:
Major version changes indicate different required support level from the required components.
Minor version changes must not change the observed behavior from existing implementations, but may be provided informationally.
Represents a CEL type.
Used in:
, , , , , , , ,The kind of type.
Dynamic type.
Null value.
Primitive types: `true`, `1u`, `-2.0`, `'string'`, `b'bytes'`.
Wrapper of a primitive type, e.g. `google.protobuf.Int64Value`.
Well-known protobuf type such as `google.protobuf.Timestamp`.
Parameterized list with elements of `list_type`, e.g. `list<timestamp>`.
Parameterized map with typed keys and values.
Function type.
Protocol buffer message type. The `message_type` string specifies the qualified message type name. For example, `google.type.PhoneNumber`.
Type param type. The `type_param` string specifies the type parameter name, e.g. `list<E>` would be a `list_type` whose element type was a `type_param` type named `E`.
Type type. The `type` value specifies the target type. e.g. int is type with a target type of `Primitive.INT64`.
Error type. During type-checking if an expression is an error, its type is propagated as the `ERROR` type. This permits the type-checker to discover other errors present in the expression.
Abstract, application defined type. An abstract type has no accessible field names, and it can only be inspected via helper / member functions.
Application defined abstract type.
Used in:
The fully qualified name of this abstract type.
Parameter types for this abstract type.
Function type with result and arg types.
Used in:
Result type of the function.
Argument types of the function.
List type with typed elements, e.g. `list<example.proto.MyMessage>`.
Used in:
The element type.
Map type with parameterized key and value types, e.g. `map<string, int>`.
Used in:
The type of the key.
The type of the value.
CEL primitive types.
Used in:
Unspecified type.
Boolean type.
Int64 type. 32-bit integer values are widened to int64.
Uint64 type. 32-bit unsigned integer values are widened to uint64.
Double type. 32-bit float values are widened to double values.
String type.
Bytes type.
Well-known protobuf types treated with first-class support in CEL.
Used in:
Unspecified type.
Well-known protobuf.Any type. Any types are a polymorphic message type. During type-checking they are treated like `DYN` types, but at runtime they are resolved to a specific message type specified at evaluation time.
Well-known protobuf.Timestamp type, internally referenced as `timestamp`.
Well-known protobuf.Duration type, internally referenced as `duration`.
A set of expressions for which the value is unknown. The unknowns included depend on the context. See `ExprValue.unknown`.
Used in:
, , ,The ids of the expressions with unknown values.
Represents a CEL value. This is similar to `google.protobuf.Value`, but can represent CEL's full range of values.
Used in:
, , , , , , ,Required. The valid kinds of values.
Null value.
Boolean value.
Signed integer value.
Unsigned integer value.
Floating point value.
UTF-8 string value.
Byte string value.
An enum value.
The proto message backing an object value.
Map value.
List value.
Type value.