-
Hi, I'm compiling policies with OPA Go to WASM, and then executing the WASM policy with my Rust SDK. In that sense I don't care about Go executing my policy and so I don't need to implement a custom BIF in Go, but just in my Rust SDK. So I compiled my own version of OPA Go with the addition:
I then built the policy into WASM, and executed it with my Rust SDK where I implemented a valid Now to my question: Is it possible to just tell OPA "if you see |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Short answer: Capabilities! If you create a capabilities.json with your builtin added, then An easy way to generate said capabilities file is probably to run All that said, |
Beta Was this translation helpful? Give feedback.
Short answer: Capabilities! If you create a capabilities.json with your builtin added, then
opa build -t wasm --capabilities my-caps.json
will build a wasm module that understands thatsemver.is_match
is an SDK-dependant builtin function.An easy way to generate said capabilities file is probably to run
opa capabilities --current
with your ownopa
version you've mentiond above. You'll only need to do that once, and you can reuse the capabilities.json file for a while (until OPA has another builtin that isn't yet in your capabilities.json but that you'd like to use).All that said,
semver.is_match
sounds like a very reasonable builtin to have in upstream OPA, too. That wouldn't come with a…