To try and prevent any security issues, use an external package to
generate key instead of doing it ourselves. Note: we have to use nanoid
version 3 as nanoid version 4 requires ESM. Currently, nanoid v3 is
still supported.
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Prometheus doesn't support using custom headers for exporters, however
it does support using the Authorisation header with basic auth. As
such, we switched from using X-API-Key to Authorization with the basic
scheme and an empty username field.
Also added a rate limit for API endpoints of 60 requests in a minute
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Fixed a logic error where a comma was used instead of an or, also
removed leftover console.logs from testing.
Date picker is now dissabled when don't expire is checked.
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
API key authentication is now possible by making use of the X-API-Key
header. API authentication will only be enabled when a user adds their
first API key, up until this point, they can still use their username
and password to authenticate with API endpoints. After the user adds
their first API key, they may only use API keys in future to
authenticate with the API.
In this commit, the prometheus /metrics endpoint has been changed over
to the new authentication system.
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Web interfaces for manging API keys have been added however translation
keys are still required.
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
A check to ensure that the backup database exists before deleting the
current database.
Fixes#2778
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>