api keys: add IP whitelist and API permission system.

Add the ability to restrict API keys so that they can only be used with
certain IP addresses or certain API endpoints.

Restricting your key is useful to limit damage in case it gets leaked or
stolen. For example, if your key is on a remote server and it gets
hacked, or if you accidentally check-in your key to Github.

Restricting your key's API permissions is useful if a third-party app or
script wants your key, but you don't want to give full access to your
account.

If you're an app or userscript developer, and your app needs an API key
from the user, you should only request a key with the minimum
permissions needed by your app.

If you have a privileged account, and you have scripts running under
your account, you are highly encouraged to restrict your key to limit
damage in case your key gets leaked or stolen.
This commit is contained in:
evazion
2021-02-14 18:05:32 -06:00
parent a6707fbfa2
commit 25fda1ecc2
19 changed files with 286 additions and 32 deletions

View File

@@ -1,3 +1,17 @@
## Unreleased
### API Changes
* You can now have multiple API keys.
* API keys can be restricted to only work with certain IPs or certain API
endpoints.
* If you're an app or script developer, and you have an app that requests API
keys from users, you're highly encouraged to only request the minimum API
permissions necessary for your app to work.
* If you have a privileged account, and you run scripts under your account,
you're highly encouraged to restrict your API keys to limit damage in case
they get leaked or stolen.
## 2021-02-05
### Changes