guardian / typerighter

Even if you’re the right typer, couldn’t hurt to use Typerighter!
Apache License 2.0
276 stars 12 forks source link

Use Localstack s3 bucket when running locally #282

Closed rhystmills closed 1 year ago

rhystmills commented 1 year ago

Co-authored with @aracho1

What does this change?

This PR adds a localstack S3 bucket which will be written to and read from when running checker or rule manager locally (rather than writing to the CODE S3 bucket).

The localstack/init-aws.sh script is copied to the Docker localstack instance due to the following rules in docker-compose.yml: - "./localstack/init-aws.sh:/etc/localstack/init/ready.d/init-aws.sh"

Docker will run the script on initialisation and create the local bucket.

pan-domain-authentication requires its own s3 client because we don't run it locally.

How to test

  1. Run the app locally - ./script/start. Ensure docker is running.
  2. Visit https://checker.typerighter.local.dev-gutools.co.uk/ and head to the 'Rules' tab.
  3. Click 'Refresh rules'
  4. Are rules pulled into your checker app? Do they include the nonsense rule 'advantagemently'?
  5. Consider checking the localstack log output in Docker to see if it's handling s3 requests

image