Skip to content

Best way to use Rego Go lib to process policies with changing data and input #214

Answered by srenatus
VasiliyS asked this question in OPA and Rego
Discussion options

You must be logged in to vote

Would it be better to add the attributes part via new function, which will be called from within the module? Or shall I just put in int the Input (it feels somehow wrong)? Any other way to do it better?

The docs on external data mostly apply to the golang lib use case, too.

It usually boils down to how often your data changes whether input or data is the right place. How large is your data? Unless it's very very large, updating the inmem store for data that doesn't change too frequently is a good approach. It'll do heap allocations, it's in memory after all, but it won't do that for every policy evaluation.

You can think of OPA's store as a workbench: what should be at hand for policy e…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by VasiliyS
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants