I've looked around a bit for answer to this but ca...
# help
n
I've looked around a bit for answer to this but can find anything. Is there a reason why resource IDs have to be send to cerbos as a string?
A lot of our resource IDs are numbers and doing the conversion to a string when sending to cerbos isn't too big of an issue until we use a query plan because the filters returned that contain IDs return them as string and we have to reconvert them before using the filter
s
I can't speak for Cerbos, but a string seems like the one universally accessible way to communicate an identifier. My org uses strings, uint64s and UUIDs for identifiers. Cerbos happily works with all of them
n
I mean don't get me wrong, I'd love for the datasources I'm working with to standardize on UUIDs, but I don't have a say in it 😄
c
Steve's got it right 100%. We can't dictate what data types Cerbos users have for identifiers but pretty much all of them should be easily convertible to be strings.
n
hmm I agree generally. It's only a problem for me when using cerbos query plans because you return an AST I then have to parse into filters. I'm using the
@cerbos/orm-prisma
module to generate these filters, but doing a second layer of conversion there is kind of clunky because the filter shape is determined by the policy conditions, not my source code
a
That’s an interesting case I hadn’t thought about. It maybe possible for the mapper to either provide a way to convert types or even introspect it from the prisms schema itself. How are you approaching it currently?