Extending OPA Golang SDK Builtins #703
Replies: 3 comments 4 replies
-
Hi @victoraugustolls, thanks for asking this question. It's come up a few times before in slack, but I can't seem to find an issue for it. Would you be able to create a new issue for this as a feature request outlining your use case and the value this would offer? 🙏 https://github.com/open-policy-agent/opa/issues/new?template=feature_request.md Please @ me on the issue too so I can keep tabs and promote it. |
Beta Was this translation helpful? Give feedback.
-
There may not be a convenience function for doing this via the SDK directly (and perhaps there should be), but built-ins registered globally should be picked up by the SDK just as anywhere else. Here's an example of this being done in a test. If you grep for those two calls, you should find other examples to browse. I just picked the first one that came up. Convenience function or not, we should have the docs on the SDK updated to cover this. |
Beta Was this translation helpful? Give feedback.
-
I forgot to update here but it ended up working yesterday. I think my initial mistake was I was following the docs and they weren't updated to use the v1 package. After noticing that and changing it, everything started working. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm having a hard time trying to figure out how to extend OPA to include a new builtin function when using the Golang SDK. Is it possible at all? I know you can do it using the low level packages, but it seems to add a lot of extra work just to add a builtin function.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions