Building WASM policies from Rego policy from GoLang library, not CLI #429
Unanswered
tomsfernandez
asked this question in
Wasm
Replies: 2 comments 1 reply
-
Heya! I believe your answer is correct -- the dobuild methos uses the compile package, and that's probably what you'd want to use, too. I guess once you've cut off all slack that you don't need, the actual calls won't be that bad 🤔 You should be able to pull the wasm module out of the bundle you get from |
Beta Was this translation helpful? Give feedback.
0 replies
-
Nice! How can I provide the Rego code in-memory instead of reading it from a file? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm currently in charge of a library that from YAML files, generates a Rego policy and evaluates it. We have reached a performance problem in Node JS where this whole process takes too long. That is why we started investigating about WASM OPA policies.
As far as I am aware, I can build a WASM Policy from the CLI. This alongside the NPM library for loading policies works really well. The thing is that providing the WASM OPA Policy statically is very complicated for us and therefore we would like to build it directly from our GoLang library to cache it and use it in the Node JS runtime.
Is there an example on how to do this? I have been reading the "dobuild" method that is used in the CLI but I would like to know if there is an easier way or if somebody is already doing the same.
Beta Was this translation helpful? Give feedback.
All reactions