google / cel-go

Fast, portable, non-Turing complete expression evaluation with gradual typing (Go)
https://cel.dev
Apache License 2.0
2.19k stars 218 forks source link

[Policy compiler] Return explanation output policy #974

Open seirl opened 2 months ago

seirl commented 2 months ago

The policy compiler now parses the "explanation" field of match blocks, but does not do anything with it.

It would be useful to provide an API that returns a copy of the policy, except the output would be replaced by the contents of the "explanation" block. This would effectively generate a separate expression that outputs the explanation instead of the result of the policy.