Fields of partial evaluation result: queries, support. What to do next? #503
Unanswered
mcelik34
asked this question in
OPA and Rego
Replies: 1 comment 2 replies
-
"Support" are extra modules that PE generates in the process of partially evaluating your query given your known/unknown inputs. There are constructs that care only expressible in Rego with the help of rules, that cannot be put into queries alone. That's what ends up in supporting modules. For the sake of translating the queries that are the result of PE into SQL, or MongoDB, any other form of query language, support modules are a problem: Translating them is much more difficult than translating a query. I'd thus try to rewrite the policy in such a way that you end up without support modules if you want to get closer to your desired setup. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am getting this result. Can you help about where should I check out or what to do next? Any comprehensive guide about how to interpret Compile API output?
Command:
opa eval "data.endpoints.ids" -d ./policy -f pretty -p -u data.users -u data.orders
Edit: I realized that the result above is because of that I didn't supply a data which is not unknown. I did it for this time. Now, it looks like this, which is better :) :
I have checked out many pages about how to use the results of a PE.
... including https://blog.openpolicyagent.org/write-policy-in-opa-enforce-policy-in-sql-d9d24db93bf4
I have not seen a mention or code piece regarding "support" field and a query like "data.partial" neither in pages nor github@.../contrib/data_filter_... but only here:
Ultimately, I am trying to reach a setup such as:
Or it maybe making evaluation request to OPA in endpoint blocks of express.js. For requests which requires working on only single or a couple of documents, it is perfect. But, anyway, when it comes to collection, without partial evaluation, I see, for now, the only option that requires to fetch all documents of related collections to OPA from mongoDB beforehand. No way.
Beta Was this translation helpful? Give feedback.
All reactions