sangkeon / java-opa-wasm

Apache License 2.0
15 stars 2 forks source link

evaluate function doesn't work with entrypoint parameter. #5

Closed rai-prashanna closed 1 year ago

rai-prashanna commented 1 year ago

OPA version used == 0.52.0 I optimized rego file using -O=1 flag which generated new rego file. After that i generated, wasm binary using build -t wasm flag. when i try to evaluate json with wasm compile binary using java-opa-wasm library. It doesn't work with following methods. public String evaluate(String json, String entrypoint) or public String evaluate(String json, int entrypoint) But, it works with public String evaluate(String json) only. In my case rego contains multiple entrypoints. Any help will be appreciated! Thanks!

sangkeon commented 1 year ago

Please call loadEntrypoints() prior to call String evaluate(String json, String entrypoint) and check it works. If it works, call loadEntrypoints() prior to call evaluate(json, entrypoint) until I will fix this until next release.

rai-prashanna commented 1 year ago

Thanks, it works now!

sangkeon commented 1 year ago

Resolved in 0.2.2