cmu-delphi / delphi-epidata

An open API for epidemiological data.
https://cmu-delphi.github.io/delphi-epidata/
MIT License
100 stars 68 forks source link

API keys / user maintenance fixes and additions #1485

Open melange396 opened 3 months ago

melange396 commented 3 months ago

These are listed roughly in order of increasing difficulty/complexity:

Most of these tasks should be pretty straightforward except perhaps for adding the "active" column, which will need to be accounted for when looking up a key/user on API requests.

(Key deletion email text:) ``` EMAIL_SUBJECT = "Delphi Epidata API Key Inactivity Notice" PREFIX = "Hello!\n\nYou previously registered with the Delphi Epidata API and received an API key.\n\n" ALERT_EMAIL_MESSAGE = f"Your API Key has not been used in the past {INACTIVE_KEY_LIFETIME} months. It is scheduled to be removed in one month if it remains inactive. To renew it, simply use it again before then." DELETED_EMAIL_MESSAGE = f"Your API Key was removed due to inactivity and will no longer work. To obtain a new one, please visit our registration form at {API_KEY_REGISTRATION_FORM_LINK_LOCAL} ." SUFFIX = "\n\n For usage information, see the API Keys section of the documentation: https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html \n\n Best,\n Delphi Team" ```