opa
opa copied to clipboard
Enforce some of the compiler Strict Mode constraints and checks
The Rego compiler enforces the following rules when strict mode is enabled:
- Duplicate imports
- Unused local assignments
- Unused imports
inputanddatareserved keywords- Use of deprecated built-ins
OPA could enforce some of these checks by default such as 1,4 and 5. If deprecated builtins are removed, then 5 will have been taken care of. We can still have opt-in for 2 and 3.
I am new to using the OPA rule engine and have a question regarding the use of the "re_match" function, which I believe is a deprecated built-in function. Is their any possibility to utilize this function in strict mode? if yes can you please share some example maybe.
That function has been replaced by regex.match. Just change the name to use that instead. See https://blog.openpolicyagent.org/opa-1-0-is-coming-heres-what-you-need-to-know-c8fb0d258368 for more details.
This was implemented as a feature of the rego.v1 import, and later made the default behavior when introducing the v1 API.