I'm setting up my local development environment. ...
# help
m
I'm setting up my local development environment. Are there any way I can check if I've formatted the policy yml files correctly?
Like, what I would do in with a Node/Next.js app.
npm run build
And as a followup. What features of the playground is available for open source users? *the client we are currently building a web portal for can not (mainly for compliance reasons) become a Cerbos Hub customer
d
Hi Martin, Regarding your first question: • To check formatting, you can configure your editor to check policies against the Cerbos policy schema. • Use the
cerbos compile
command to validate, compile and run tests on a policy repo. • You can define the JSON schemas “for all your principal and resource attributes on a per-resource basis by specifying them in the resource policy”. These schemas will be used to validate Cerbos requests.
m
About the
cerbos compile
command. I am unable to install the binary
Copy code
$ curl -L -o cerbos.tar.gz "<https://github.com/cerbos/cerbos/releases/download/v0.43.0/arm64>"   
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0     19      0 --:--:-- --:--:-- --:--:--    19
 $
The file cerbos.tar.gz that is downloaded just contains the string: Not Found
d
The URL is incorrect. To download Linux arm64 binary:
curl -L -o cerbos.tar.gz "<https://github.com/cerbos/cerbos/releases/download/v0.43.0/cerbos_0.43.0_Linux_arm64.tar.gz>"
To download MacOS arm64 binary:
curl -L -o cerbos.tar.gz "<https://github.com/cerbos/cerbos/releases/download/v0.43.0/cerbos_0.43.0_Darwin_all.tar.gz>"
You can also use the Cerbos Docker image.
m
Thanks, that worked. I took the URL from https://docs.cerbos.dev/cerbos/latest/installation/binary Good point, for me the "use the Cerbos Docker image" is the best approach, thanks for that!
docker exec cerbos /cerbos compile /workspace/cerbos
🙌 1
d
Here’s an example of how to run the Cerbos container.
👍 1