Hi, we use UUIDs as the string for `resourcePolicy...
# help
a
Hi, we use UUIDs as the string for
resourcePolicy.resource
. When we create policies in this manner, we have noticed the underlying identifier that Cerbos then requires when referring to the policy uses underscores instead of hyphens. Is this intended by cerbos? Is there a way to configure it such that it doesn't alter the string used as the resource key? Example. Resource policy with
resource
set to
d3eca871-3ba3-4aec-8ff5-ad5cc7cbb546
Produces an identifier that is
resource.d3eca871_3ba3_4aec_8ff5_ad5cc7cbb546.vdefault
Interestingly this does not seem to be consistent...
Sometimes the hyphens for some UUIDs are left alone, other times it transforms the hyphen to an underscore...
Ok, I have found the pattern. If a UUID starts with a letter, the hyphens get transformed into underscores, if the UUID starts with a number it leaves the hyphens as they are... Is this a bug or is this intended behavior by Cerbos?
c
This is a hangover from the past that we have to maintain for backward compatibility. We used to be much more strict about policy names because of the way they were internally represented. When we relaxed those requirements, we still had to maintain the name munging algorithm for old-style names. I personally won't recommend using UUIDs for policy names. But if that's what you want to do, I'd suggest adding a standard prefix so that the names are consistently transformed by Cerbos.
a
Got it! Working around this since I only see this in the Admin API. Have a quickly transformer to fix the IDs as it goes through my proxy API