I'm new to OPA/Rego am having a hard time understanding what exactly is the issue here: https://play.openpolicyagent.org/p/h08NbfmF4j
I'd like to have teams associated with the * category, for which I'd expect the accessible[team] rule to return all existing categories. If the team has a specific category assigned, only that one should be returned.
The requirements are really trivial, but I can't figure out why I'm getting the `eval_conflict_error: object keys must be unique" error.
Here's a modified version of your policy. The error resulted from the value that would have been generated for team
c. In your policy,data.categories[_]expression would have iterated over the values in the categories map and caused a conflict with the result already set for keycin yourcatsrule. You'll need to return a collection for keycas shown in the modified policy.