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
If you try to refer to a base document with a composite key value, the storage function will return an error that halts evaluation. For example, if data is empty then data.foo.bar will return undefined, but data.foo[["bar"]] will return an error.
OPA should not return an error in this case, the result should just be undefined.
We can fix this issue by updating the evaluator to check the ref contains any non-scalar values before reading from storage. If a non-scalar value is found, we can return undefined immediately.
The text was updated successfully, but these errors were encountered:
Previously this would raise an error when attempting to build the
storage path for some ref like `data.foo[["bar"]]`, but there isn't
really any reason why it should halt evaluation. It should just
be undefined.
This changes to look for this type of ref _before_ handing it off to
the store and will just return undefined now instead.
Fixes: open-policy-agent#1057
Signed-off-by: Patrick East <east.patrick@gmail.com>
Previously this would raise an error when attempting to build the
storage path for some ref like `data.foo[["bar"]]`, but there isn't
really any reason why it should halt evaluation. It should just
be undefined.
This changes to look for this type of ref _before_ handing it off to
the store and will just return undefined now instead.
Fixes: #1057
Signed-off-by: Patrick East <east.patrick@gmail.com>
If you try to refer to a base document with a composite key value, the storage function will return an error that halts evaluation. For example, if data is empty then
data.foo.bar
will return undefined, butdata.foo[["bar"]]
will return an error.OPA should not return an error in this case, the result should just be undefined.
We can fix this issue by updating the evaluator to check the ref contains any non-scalar values before reading from storage. If a non-scalar value is found, we can return undefined immediately.
The text was updated successfully, but these errors were encountered: