Can't call Rego built-in functions?
See original GitHub issueI get error: illegal call: unknown operator contains
when trying to build the policy.
package package.name.here
default pass = false
pass {
string_input := "Full String Here"
contains(string_input, "String Here")
}
Tested it in the Rego playground here https://play.openpolicyagent.org/
EDIT: more clarification, the policy works in the playground but fails to build with opa
to generate .wasm
file
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Language Reference - Open Policy Agent
All policies in OPA are written in Rego. Built-in Functions. The built-in functions for the language provide basic operations to manipulate scalar values...
Read more >Chap 4. Built-in Functions · GitBook
Contents. Basic built-in functions, such as type-related functions; Built-in functions that handle strings, regular expressions, and globs; Built-in HTTP ...
Read more >5 tips for using the Rego language for Open Policy Agent (OPA)
Continuing down the same path, any and all are extremly useful in more places, expecially around list comprehensions – these two features make...
Read more >Effective Go - The Go Programming Language
For instance, the buffered reader type in the bufio package is called Reader ... Go has two allocation primitives, the built-in functions new...
Read more >Atlas Functions — Atlas App Services - MongoDB
Functions can call other functions and include a built-in client for working with data in MongoDB Atlas clusters. ... Email/Password Registration ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve implemented the builtins for numbers, aggregates and strings. Will be sending a PR soon.
Hi @salahalsaleh Your rego policy should now work as I’ve implemented the builtins, which is now merged into master. Please feel free to post any other issues you find.