You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rule indexer should correctly incorporate input & data values overridden by the with keyword.
Actual Behavior
The rule indexer is not returning rules that ought to match given certain evaluation contexts.
Steps to Reproduce the Problem
Given the following rego and json, q and r should generate the same value, however, the indexer incorrectly determines that r does not have to be evaluated. As a result, data.foo.r is undefined.
{"bar": "baz"}
package foo
p = x {
data.bar = x
}
q = x {
p = x
}
r = x {
p = x with input as {}
}
Additional Info
It looks like this issue was introduced in 986d82f
The text was updated successfully, but these errors were encountered:
In 986d82f we added support for applying the with keyword to the data
document. In the implementation, the ref resolver had to be updated to
check an additional cache. Those changes contained a bug that caused the
ref resolver to exit early and indicate that the ref was undefined if
the cache did not contain a value for the ref (partial or complete).
If the with cache does not contain a value for the ref, the value from
storage ought to be used. These changes just remove the early
exit--which is safe since the rest of the code checks if the value
returned by the with cache is non-nil (and handles the nil case
accordingly).
Fixesopen-policy-agent#1110
Signed-off-by: Torin Sandall <[email protected]>
In 986d82f we added support for applying the with keyword to the data
document. In the implementation, the ref resolver had to be updated to
check an additional cache. Those changes contained a bug that caused the
ref resolver to exit early and indicate that the ref was undefined if
the cache did not contain a value for the ref (partial or complete).
If the with cache does not contain a value for the ref, the value from
storage ought to be used. These changes just remove the early
exit--which is safe since the rest of the code checks if the value
returned by the with cache is non-nil (and handles the nil case
accordingly).
Fixes#1110
Signed-off-by: Torin Sandall <[email protected]>
Expected Behavior
The rule indexer should correctly incorporate input & data values overridden by the with keyword.
Actual Behavior
The rule indexer is not returning rules that ought to match given certain evaluation contexts.
Steps to Reproduce the Problem
Given the following rego and json, q and r should generate the same value, however, the indexer incorrectly determines that r does not have to be evaluated. As a result, data.foo.r is undefined.
Additional Info
It looks like this issue was introduced in 986d82f
The text was updated successfully, but these errors were encountered: