Hey Cerbos team, I'm using Cerbos with a dynamic s...
# help
Hey Cerbos team, I'm using Cerbos with a dynamic store. I'm noticing my directory with the yaml policies is not being added to my policy database. I've come to the conclusion that, if you're using Cerbos in "dynamic mode", you have to add policies through
. Is this correct? If so, Is there a way to programmatically add my yaml policies to my database, without having to convert them into their javascript object representation? If not, is there a way to programmatically convert yaml to javascript object? I'm using the JS SDK.
Hi. Yes, if you're using a database store, the policies have to be added to it using the Admin API. You could use the
utility to do that as well. It can handle YAML files too. https://docs.cerbos.dev/cerbos/latest/cli/cerbosctl.html#put
Awesome! Thanks for the help
I'm planning to add a JS package for loading YAML/JSON files to make this achievable with the SDK, too
@Andrew Haines (Cerbos) That would be awesome. Is this on schedule for next release?
Oops, I forgot to post here when I published it! There's a new package available to load policy files: https://www.npmjs.com/package/@cerbos/files
Works great! Thank you