Skip to content

Commit 0c4073a

Browse files
authored
Add base64 encoder to cel expression evaluation (#599)
1 parent d63a8c4 commit 0c4073a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pkg/cel/ast/inspector.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ type Inspector struct {
103103
// knownFunctions contains the list of all CEL functions that are supported
104104
var knownFunctions = []string{
105105
"random.seededString",
106+
"base64.decode",
107+
"base64.encode",
106108
}
107109

108110
// DefaultInspector creates a new Inspector instance with the given resources and functions.

pkg/cel/environment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func DefaultEnvironment(options ...EnvOption) (*cel.Env, error) {
5454
declarations := []cel.EnvOption{
5555
ext.Lists(),
5656
ext.Strings(),
57+
ext.Encoders(),
5758
library.Random(),
5859
}
5960

0 commit comments

Comments
 (0)