Title
#help
i

Imadul Islam

11/03/2022, 2:54 PM
Hello I am new with
Cerbos
. I was trying to run
Cerbos
with
MySQL
. There is a doc for how to run and create schemas. But I could not find any doc how should I insert my policies on the
MySQL
tables. Sample Finance Application Policyhttps://play.cerbos.dev/p/XhkOi82fFKk3YW60e2c806Yvm0trKEje This is the playground URL I was trying to read from
MySQL
. Thanks
oguzhan

oguzhan

11/03/2022, 3:31 PM
Hi @Imadul Islam, For the mutable stores (postgres, mysql etc.), you may use the AdminAPI to add or update policies. AdminAPI should be enabled under the
server
in your configuration like this (Also, here is the list of all possible configuration options if you’d like to explore more);
server:
  adminAPI:
    adminCredentials:
      passwordHash: JDJ5JDEwJEdEOVFzZDE2VVhoVkR0N2VkUFBVM09nalc0QnNZaC9xc2E4bS9mcUJJcEZXenp5OUpjMi91Cgo= # PasswordHash is the base64-encoded bcrypt hash of the password to use for authentication.
      username: cerbos # Username is the hardcoded username to use for authentication.
    enabled: true # Enabled defines whether the admin API is enabled.
Here is the relevant part to send a request to the AdminAPI for adding/updating policies;https://docs.cerbos.dev/cerbos/latest/api/admin_api.html#_addupdate_policies
3:34 PM
Also, one other option is using the
cerbosctl
CLI. https://docs.cerbos.dev/cerbos/latest/cli/cerbosctl.html#put Hope this helps, please let me know if you encounter any problems or have any questions.
i

Imadul Islam

11/03/2022, 3:38 PM
Thank you so much @oguzhan for the help. This might work. I will try with Admin API.
Sam Lock (Cerbos)

Sam Lock (Cerbos)

11/07/2022, 3:38 PM
Hi @Imadul Islam! Coincidentally, I’ve just finished building a demo showing how an admin API integration might look, using Golang. I’m not sure of your tech stack, but perhaps this could be useful: https://github.com/cerbos/demo-admin-api
i

Imadul Islam

11/08/2022, 6:00 AM
Thank you @Sam Lock (Cerbos)