Skip to content

Add a new compiler tool which can be used to compile CEL expressions and policies using serialized environment#1143

Merged
TristonianJones merged 40 commits intogoogle:masterfrom
aakash070:master
Mar 25, 2025
Merged

Add a new compiler tool which can be used to compile CEL expressions and policies using serialized environment#1143
TristonianJones merged 40 commits intogoogle:masterfrom
aakash070:master

Conversation

@aakash070
Copy link
Copy Markdown
Collaborator

@aakash070 aakash070 commented Mar 12, 2025

This change adds a new compiler tool which can be used to generate an ast for CEL expressions and policies provided in the form of:

  1. CEL policy file
  2. CEL expression string file
  3. CEL checked expression
  4. Raw CEL string

The compiler has the ability to extend a serialized environment file to create the environment which is used for compilation. The file can be in either Textproto or YAML format.

@TristonianJones
Copy link
Copy Markdown
Collaborator

/gcbrun

Comment thread tools/compiler/testdata/custom_policy.celpolicy
Comment thread tools/compiler/testdata/config.textproto Outdated
@TristonianJones
Copy link
Copy Markdown
Collaborator

/gcbrun

@TristonianJones
Copy link
Copy Markdown
Collaborator

@aakash070 looks like the build deps for policy need to be opened up for compiler to depend on them.

Comment thread tools/compiler/compiler_test.go
Comment thread tools/compiler/compiler.go
Comment thread tools/compiler/compiler.go Outdated
@aakash070
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@TristonianJones TristonianJones merged commit dc6468b into google:master Mar 25, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants