question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't call Rego built-in functions?

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Jason-ikhokhacommented, Feb 17, 2020

I’ve implemented the builtins for numbers, aggregates and strings. Will be sending a PR soon.

0reactions
JasonTrutercommented, May 13, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found