Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cerbos/demo-admin-api
https://github.com/cerbos/demo-admin-api
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cerbos/demo-admin-api
- Owner: cerbos
- Created: 2022-10-24T18:49:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-25T09:08:51.000Z (8 months ago)
- Last Synced: 2024-06-21T15:44:17.727Z (7 months ago)
- Language: Go
- Size: 281 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Admin API demo
A demo implementation of a Golang backend with APIs for creating, updating and validating policies using the [Admin API](https://docs.cerbos.dev/cerbos/latest/api/admin_api.html). 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](https://microsoft.github.io/monaco-editor/)) which continually validates the policy and allows updates.
## Dependencies
- Docker for running the [Cerbos Policy Decision Point (PDP)](https://docs.cerbos.dev/cerbos/latest/installation/container.html), or both services via `docker-compose`
- Golang 1.19 (required if running manually)
- Node.js (required if running manually)## Getting started
### Manually
1. Start up the Cerbos PDP instance docker container. This will be called by the Go app to check authorization.
```sh
cd cerbos
./start.sh
```2. Build the React front end
```sh
# from project root
cd client
npm i
npm run build
```3. Start the Go server
```sh
# from project root
go run main.go
```4. Open the web app at `localhost:8090`
### Docker-compose
```sh
docker-compose up -d
```## Audit logs
A separate endpoint is provided demoing the retrieval of audit logs from the PDP:
```sh
curl "http://localhost:8090/auditlog"
```## Other considerations
- 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.