Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic in evaluator when with modifier applied to data document #1083

Closed
tsandall opened this issue Nov 23, 2018 · 0 comments
Closed

Panic in evaluator when with modifier applied to data document #1083

tsandall opened this issue Nov 23, 2018 · 0 comments
Labels

Comments

@tsandall
Copy link
Member

Actual Behavior

If the with modifier is applied to the data document (and not the input document) and a rule that refers to the input document is encountered during evaluation, the evaluator panics during resolve operations on the rule that refers to input. This is occurring because the evaluator's input term is being set incorrectly when the with modifier is handled.

Steps to Reproduce the Problem

  1. Define a rule that depends on input
package test

p { input.x = 1 }
  1. Execute a query that applies with to data and requires evaluation of the rule
data.test.p = true with data.foo as "bar"
@tsandall tsandall added the bug label Nov 23, 2018
tsandall added a commit to tsandall/opa that referenced this issue Nov 23, 2018
The input on the evaluator was being set incorrectly when the with
keyword is handled in the evaluator. These changes just update evalWith
to set the input term correctly.

Fixes open-policy-agent#1083

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall added a commit that referenced this issue Nov 23, 2018
The input on the evaluator was being set incorrectly when the with
keyword is handled in the evaluator. These changes just update evalWith
to set the input term correctly.

Fixes #1083

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant