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

Fix/otk event fix #425

Closed CalvinRodo closed 3 years ago

CalvinRodo commented 3 years ago

Fixes: This is a further fix to correct the way OTK's are counted

Description of what your PR accomplishes:

Only persist counts for OTKExpired, OTKExhausted, OTKExpiredNoUploads and OTKUnclaimed if a deletion actually occurs.

This PR also fixes a small potential bug where SQL Queries are using fmt.sprintf that can potentially allow a sql injection attack if someone was able to modify our Server Secrets. Although if that were to occur we would have significantly greater problems then a sql injection. This is just closing up a small issue.

Why this approach? Any notable design decisions?

In order to not have to amend ATO we are modifying the existing services instead of breaking out expiration code into a serverless function ala #422