Open
Description
Describe the bug
An expression of the following form will type-check just fine, if the identifier x
is declared as a type containing a struct type reference to a fully qualified protobuf message name:
x{ auth: google.rpc.context.AttributeContext.Auth{} }
env, err := cel.NewEnv(
cel.Types(&rpcpb.AttributeContext_Request{}),
)
provider := env.CELTypeProvider()
attributeCtxType, _ := provider.FindStructType("google.rpc.context.AttributeContext.Request")
env, err = env.Extend(
cel.Variable("x", attributeCtxType),
)
ast, _ := env.Compile(`x{ auth: google.rpc.context.AttributeContext.Auth{} }`)
To Reproduce
Check which components this affects:
- parser
- [ x ] checker
- interpreter
Expected behavior
No runtimes across all CEL stacks can consume this AST to produce a new message, nor is it planned to do so. Type-checker should be made to explicitly fail in this scenario.
Additional context
java xref b/398261303
The issue is less pronounced in CEL-Go, since it requires an additional step of declaring the type variable fetched from a type provider, but the issue is still present nonetheless.
Metadata
Metadata
Assignees
Labels
No labels