# Cerbos Client Example
## Setup

Set up with PDM
```sh
brew install pdm

pdm init
pdm install
```

Set up with virtual env
```sh
python3 -m venv env
env/bin/pip3 install --upgrade pip
env/bin/pip3 install -r requirements-dev.txt
```

## Run
Run your cerbos server (see `../cerbos-orchard-docker`)

Run with PDM
```sh
pdm run python3 main.py
```

Run with virtual env
```sh
source env/bin/activate
python3 main.py
```

## Postman Testing
There now exists a `postman.json` file, with all of our Principal/Resource/Action test combinations,
which can be imported into Postman as a data file when running a collection.
The collection is here: https://www.getpostman.com/collections/fbdc6a79d80b4633ef93
Currently the collection just has one POST to https://dev-dev-cerbos.dev.theorchard.io/api/check/resources?pretty where the
body is passed in as a variable from the data file.

After running the collection with the data file, I saved the results to `Cerbos Orchard.postman_test_run.json`
where you can see status codes of each request and how long each reqeust took.

#TODO Write a script to update the postman.json file every time we update a Principal or Resource