on creation, make sure keys are not zero-prefixed and that they are the appropriate length (its probably also worth it to move the key generation out of the js hook and into the server code)
add an "active" column so we can disable keys without deleting them
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"
```
These are listed roughly in order of increasing difficulty/complexity:
today_date
last_time_used
so we can actually see keys that have never been usedactive
" column so we can disable keys without deleting themMost 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" ```