cds-snc / covid-alert-server

Exposure Notification: Diagnosis Server implementation / Notification d’exposition : Mise en œuvre du serveur de diagnostic
Apache License 2.0
298 stars 31 forks source link

Feature/metric endpoint #312

Closed CalvinRodo closed 3 years ago

CalvinRodo commented 3 years ago

Adds an events endpoint to the submission server

This end point uses basic auth. It takes one parameter which is the date you would like to query for events

You will get back a json array containing objects with the following properties:

I also did some refactoring on the TestNewKeyClaim method to make it easier to identify where it has failed as well as the state of the unit being tested.

The submission server requires the following Environment Variables to be present

METRICS_USERNAME METRICS_PASSWORD

Mocks were also updated.

You can test this locally by running the following curl command which will return all events on 2020-10-05.

This assumes that you are running in the dev container and haven't modified the METRICS_PASSWORD and METRICS_USERNAME

curl -POST --user "foo:bar" "http://127.0.0.1:8001/events/2020-10-05"