Open cch0 opened 1 year ago
It's because regex.split builtin function is not supported.
I tested the rego code on npm-opa-wasm, it worked because npm-opa-wasm supported the builtin function. I tested the rego code on python-opa-wasm, I got following error.
Traceback (most recent call last):
File "/home/sangkenlee/pipregextest/test.py", line 4, in
May be the error occured in the java-opa-wam for the same reason.
I'll add checking for not supported builtin functions like the implementation of the python-opa-wasm in the next release. I'll check implementing regex.split in the opa-java-wasm is possible when I have a time. Or ask the OPA team, they can include regex.split implementation in WASM on the policy.wasm in the future version of the OPA
Thanks.
Thank you for the explanation.
regex.split
could be added to wasmtime-java
library ?regex.splt
in this java-opa-wasm
project without the change in wasmtime-java
?Thanks again.
regex.split could be added to the java-opa-wasm. Changing wasmtime-java is not required.
It could be added to OPAModule.initImports().
In the npm-opa-wasm, implementation of regex.split is very straight foward.(https://github.com/open-policy-agent/npm-opa-wasm/blob/main/src/builtins/regex.js)
But implenting the code in the Java working exactly same may be not easy work.
Description
wasmtime-java
.regex.split
method is added to the policy, I am seeing exception when evaluating the policy in Java.The exception can be seen when executing the bundle file illustrated in the following Unit test.
Rego Policy
Versions
java-opa-wasm
:v0.2.3
wasmtime-java
:0.14.0