Why are functions, as opposed to regular rules, loaded "greedily"? #20
Replies: 3 comments 1 reply
-
The reason boils downs to the fact that base and virtual documents can be mixed at the package level. The type checker errors on the second example because it knows that Related open-policy-agent/opa#491 |
Beta Was this translation helpful? Give feedback.
-
The type checker might know While we can use Thanks for the link! Funny how that seems to ask for precisely the opposite :) |
Beta Was this translation helpful? Give feedback.
-
Right, the type checker can only operate on what it's given--it can't know that
Using multple bundles to distribute helpers should be discouraged. We caution against using multiple bundles here where multi-bundle support is introduced. We could provide this use case as an anti-pattern example if that helps folks.
Thinking about the future, I would want OPA to be more strict about this kind of thing (rather than less) which is why I linked to the issue. |
Beta Was this translation helpful? Give feedback.
-
If I have a policy like:
then
x
won't be evaluated untilallow
is. But ifx
is a function, like:allow { data.some.other.package.x(input.y) }
then the file won't compile (undefined function error) unless the dependency has been pre-loaded..
What is the reason for this?
Beta Was this translation helpful? Give feedback.
All reactions