This message was deleted.
# opal
s
This message was deleted.
f
Hey @Adrian Patterson πŸ‘‹ Someone will be with you shortly to answer your question! @Ori Shavit
❀️ 1
a
Update: After some more digging, it is in fact a rego parsing error. I see the following:
'errors': [{'code': 'rego_parse_error', 'message': 'var cannot be used for rule name',
I don't really understand how this is possible since I can run a local OPA server perfectly fine and all tests pass. Either way, sorry for the spam it turned out to be a rego error just as others on here have seen. Maybe a suggestion would be to have some more verbose error handling for the set_policy function and print a message telling the user their rego code/json data is invalid πŸ™‚ Thanks and sorry for the spam again!
o
Might be different versions of OPA - I think β€œvar” was added in later versions as a reserved keyword. I agree re: better error messages πŸ’œ Would you perhaps be willing to take this on as a PR to contribute ? - the more help the better πŸ’ͺ CC: @Asaf Cohen, @Ori Shavit
a
I believe it was because I was defining rules like so:
Copy code
import future.keywords

allow if {
 # rules here
}
After changing to
Copy code
allow {
 # rules
}
It works! Must be a version issue. I'll take a look at which OPA version I have locally vs. what OPAL uses. Thanks for the tip! I'll see what I can do for a PR πŸ™‚ Would love to contribute. Thanks to the team for being super responsive & helpful.
πŸ’œ 1