A demo implementation of a Golang backend with APIs for creating, updating and validating policies using the Admin API. The demo also provides a sample client (built in React) which utilises the API.
The client provides basic policy creation, as well as an editing interface (via the Monaco editor) which continually validates the policy and allows updates.
- Docker for running the Cerbos Policy Decision Point (PDP), or both services via
docker-compose
- Golang 1.19 (required if running manually)
- Node.js (required if running manually)
- Start up the Cerbos PDP instance docker container. This will be called by the Go app to check authorization.
cd cerbos
./start.sh
- Build the React front end
# from project root
cd client
npm i
npm run build
- Start the Go server
# from project root
go run main.go
- Open the web app at
localhost:8090
docker-compose up -d
A separate endpoint is provided demoing the retrieval of audit logs from the PDP:
curl "http://localhost:8090/auditlog"
- Similar APIs are provided by the AdminClient which allow management of Schemas.
- The Admin API is under heavy development, and might include breaking changes in future releases. This demo represents it's current state.