https://cerbos.dev logo
#help
Title
# help
r

Rick W.

08/01/2023, 9:24 PM
Is it expected that Cerbos turns nested maps in resource attributes into JSON, when calling via gRPC? e.g.: I'm sending something like this in a resource's attributes:
Copy code
{
  "level": 1,
  "nested": {
    "level": 2
  }
}
but, then when I see it in Cerbos's logs, it's being serialized like:
Copy code
{
  "level": 1,
  "nested": "{\"level\": 2}"
}
It does seem like the CEL in the resource policy is able to access
R.attr.nested.level
as expected, but I'm a little surprised how its handling nested maps
d

Dennis (Cerbos)

08/01/2023, 9:55 PM
Yes, you can use nested maps in Cerbos policies. It’s only the logger “stringifies” the nested map here.
2 Views