Hey Cerbos team, I'm using Cerbos with a dynamic s...
# help
n
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
addOrUpdatePolicies
. 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.
c
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
cerbosctl
utility to do that as well. It can handle YAML files too. https://docs.cerbos.dev/cerbos/latest/cli/cerbosctl.html#put
n
Awesome! Thanks for the help
a
I'm planning to add a JS package for loading YAML/JSON files to make this achievable with the SDK, too
n
@Andrew Haines (Cerbos) That would be awesome. Is this on schedule for next release?
a
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
n
Works great! Thank you