Validation: Daily Limit (lowers) #138
Labels
Dev Reviewed
Reviewed by Tech Lead
Notify
Board trigger
PM Reviewed
Reviewed by Product Manager
QA Reviewed
Reviewed by Quality Assurance
QA
Issue requires QA collaboration
Ready for Refinement
User Story - Business Need
We will use redis to handle daily limits.
User Story(ies)
As a VA Notify reliability dev
I want to limit API requests in the lowers
So that one client is not capable of affecting another
Additional Info and Resources
We likely want to use:
and set that as part of our
EnpState
with lifespan (setup/shutdown), making sure to close it with the shutdown.Redis Keys should be
remaining-daily-limit-<service_id>-<api_key_id>
of an authenticated request because some clients have sub-groups using different keys.Example taken (and tweaked) from Redis' Youtube account:
Acceptance Criteria
This AC is based on the suggestion in the Additional Info. If the dev would like to move in a different direction please discuss with @k-macmillan so we can update the AC.
daily_limit
(value for keys). Default = 100remaining-daily-limit-<service_id>-<api_key_id>
ci/.env.local
Depends
on sms/email/ POST routes and notification GET route (for any that are implemented)QA Considerations
Multiple services and api keys should all work as expected. This does not have the same race condition concerns that rate limiting has and should be much more straight-forward to test.
Potential Dependencies
The text was updated successfully, but these errors were encountered: