Skip to content

RedHatInsights/policies-ui-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom policies UI backend

This backend is to serve (data to) the UI for Custom Policies

For some functionality it relies on the Engine part.

Get started

To get started (locally) you can build a local docker image with Postgres, that has example tables set up and then run this via Docker-Compose, which starts Postgres and a local Kafka instance for use with the Engine.

cd helpers
sh build-local-pg.sh
docker-compose up

The UI backend is written in Java and can be compiled via

mvn package

Which also runs some Rest-API tests (under the hood it starts a postgres instance in a container).

When developing you can use Quarkus hot-reload

mvn compile quarkus:dev
NOTE

The backend requires a valid x-rh-identity to be supplied on calls. For testing purposes you can take the one that is stored in link:src/test/resources/rhid.txt

List existing policies

curl  -Hx-rh-identity:`cat src/test/resources/rhid.txt` http://localhost:8080/api/custom-policies/v1.0/policies/<id> # id = 1 or 2

List fact keys (for the UI)

curl  -Hx-rh-identity:`cat src/test/resources/rhid.txt` http://localhost:8080//api/custom-policies/v1.0/facts

OpenAPI Endpoint / Swagger-UI

OpenAPI spec of the API is available under http://localhost:8080/api/custom-policies/v1.0/openapi.json

When the server is running in dev mode, there is also the Swagger-UI available under http://localhost:8080/swagger-ui/

Releases

No releases published

Packages

No packages published

Languages