Skip to content

Commit

Permalink
Add public information about local development on audit endpoints (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-chappell authored Feb 11, 2025
1 parent 718c64f commit f8239bc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ automatically recompile and reload when changes are made.

sbt -Dconfig.file=<PATH>/janus.local.conf run

#### Local audit log support

To get the audit endpoints to work and test audit logging locally, follow the instructions in this
[README](local-dev/README.md).


## Configuration

### Janus' AWS config
Expand Down Expand Up @@ -242,4 +248,4 @@ Updates can be published by running the `release` workflow in GitHub Actions.

This repo uses [`gha-scala-library-release-workflow`](https://github.com/guardian/gha-scala-library-release-workflow)
to automate publishing the Scala client (both full and preview releases) - see
[**Making a Release**](https://github.com/guardian/gha-scala-library-release-workflow/blob/main/docs/making-a-release.md) for more details.
[**Making a Release**](https://github.com/guardian/gha-scala-library-release-workflow/blob/main/docs/making-a-release.md) for more details.
16 changes: 16 additions & 0 deletions local-dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Setting up Audit Database

When running locally, the audit endpoints require a Dynamo DB service to be running on port 8000.

The service hosts a database holding a table that stores audit logs.

To make this table available for testing auditing functionality:

1. Start Docker
2. Start up a local Dynamo DB container:
```shell
cd local-dev
docker-compose up -d
```
3. Create the audit table schema by running [Creation test](https://github.com/guardian/janus-app/blob/f522bca83d9d90657634b038c7734a9871974161/test/aws/AuditTrailDBTest.scala#L48-L50).
4. Populate the table with some test data by running [Insertion test](https://github.com/guardian/janus-app/blob/f522bca83d9d90657634b038c7734a9871974161/test/aws/AuditTrailDBTest.scala#L16-L46).
16 changes: 16 additions & 0 deletions local-dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
dynamo:
container_name: local-dynamodb
image: amazon/dynamodb-local
networks:
- local-dynamodb
ports:
- "8000:8000"
volumes:
- ${HOME}/.gu/janus-app/data:/home/dynamodblocal/data
working_dir: /home/dynamodblocal
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath data"

networks:
local-dynamodb:
name: local-dynamodb

0 comments on commit f8239bc

Please sign in to comment.