Skip to content

ministryofjustice/hmpps-incident-reporting-api

HMPPS Incident Reporting API

Docker Repository on ghcr Runbook API docs Event docs

This application is the REST api and database that owns incident report data for prisons.

Running locally against dev/T3 services

This is straight-forward as authentication is delegated down to the calling services in dev environment.

Use all environment variables starting with API_BASE_URL_ from helm chart values. Choose a suitable hmpps-auth oauth client, for instance from kubernetes hmpps-incentives-api secret and add INCIDENT_REPORTING_API_CLIENT_ID and INCIDENT_REPORTING_API_CLIENT_SECRET.

Start the database and other required services via docker-compose with:

docker compose -f docker-compose-local.yml up

Then run the API; for example using IntelliJ.

Testing and linting

Run unit and integration tests with:

./gradlew test

Run automatic lint fixes:

./gradlew ktlintformat

Connecting to AWS resources from a local port

There are custom gradle tasks that make it easier to connect to AWS resources (RDS and ElastiCache Redis) in Cloud Platform from a local port:

./gradlew portForwardRDS
# and
./gradlew portForwardRedis

These could be useful to, for instance, clear out a development database or edit data live.

They require kubectl to already be set up to access the kubernetes cluster; essentially these tasks are just convenience wrappers.

Both accept the --environment argument to select between dev, preprod and prod namespaces or prompt for user input when run.

Both also accept the --port argument to choose a different local port, other than the resource’s default.

Architecture

Architecture decision records start here

About

HMPPS Incident Reporting Service API

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 8