Package dev.cel.checker
Class ProtoTypeMask
- java.lang.Object
-
- dev.cel.checker.ProtoTypeMask
-
@Immutable public abstract class ProtoTypeMask extends java.lang.ObjectProtoTypeMaskdescribes the fraction of a protobuf type's object graph that should be visible within CEL expressions. The top-level fields of the type identified by thegetTypeName()are treated as variable declarations.
-
-
Constructor Summary
Constructors Constructor Description ProtoTypeMask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtoTypeMaskof(java.lang.String typeName, FieldMask fieldMask)Construct a newProtoTypeMaskwith aFieldMaskindicating which fields should be visible to CEL expressions.static ProtoTypeMaskofAllFields(java.lang.String fullyQualifiedTypeName)Construct a newProtoTypeMaskwhich exposes all fields in the giventypeNamefor use within CEL expressions.ProtoTypeMaskwithFieldsAsVariableDeclarations()
-
-
-
Method Detail
-
withFieldsAsVariableDeclarations
public ProtoTypeMask withFieldsAsVariableDeclarations()
-
of
public static ProtoTypeMask of(java.lang.String typeName, FieldMask fieldMask)
Construct a newProtoTypeMaskwith aFieldMaskindicating which fields should be visible to CEL expressions.All top-level fields from the combined set of
pathsin the field mask should be treated as variable identifiers bound to the protobuf field name and its associated field type.A
FieldMaskcontains one or morepathswhich contain identifier characters that have been dot delimited, e.g.resource.name, request.auth.claims. Here are a few things to keep in mind:- All descendent fields after the last element in the field mask path are visible.
- The asterisk '*' can be used as an explicit indicator that all descedent fields are visible to CEL.
- Repeated fields are not supported.
-
ofAllFields
public static ProtoTypeMask ofAllFields(java.lang.String fullyQualifiedTypeName)
Construct a newProtoTypeMaskwhich exposes all fields in the giventypeNamefor use within CEL expressions.The
typeNameshould be a fully-qualified path, e.g.,"google.rpc.context.AttributeContext".All top-level fields in the given
typeNameshould be treated as variable identifiers bound to the protobuf field name and the associated field type.
-
-