]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Clarify different webserver auths 15773/head
authorKarel Bilek <kb@karelbilek.com>
Mon, 1 Sep 2025 21:28:46 +0000 (23:28 +0200)
committerKarel Bilek <kb@karelbilek.com>
Mon, 1 Sep 2025 21:28:46 +0000 (23:28 +0200)
pdns/dnsdistdist/docs/guides/webserver.rst
pdns/dnsdistdist/docs/reference/config.rst

index 534deb1788dff06c56fdb3a1b2f37544db183ae6..6b3447cfca16ce9f99726b9085864e5755863c82 100755 (executable)
@@ -51,6 +51,45 @@ For example, to remove the X-Frame-Options header and add a X-Custom one:
 
 Credentials can be changed at run time using the :func:`setWebserverConfig` function.
 
+Credentials
+-----------
+
+The webserver uses two kind of authorization: one is HTTP basic auth, with name and
+password; username doesn't matter, only password is checked. Second kind of authorization is
+with an API key, which must be in ``X-API-Key`` request header. Those keys can be different,
+and are two different options to :func:`setWebserverConfig`.
+
+There are also three different options for :func:`setWebserverConfig`, which can disable
+the auth for the calls altogether by setting them to false; they are true by default.
+
+.. list-table::
+   :header-rows: 1
+
+   * - endpoint
+     - option to disable auth
+     - basic auth
+     - API header auth
+   * - main dashboard
+     - ``dashboardRequiresAuthentication``
+     - allowed
+     - not allowed
+   * - ``/jsonstat``
+     - ``statsRequireAuthentication``
+     - allowed
+     - allowed
+   * - ``/metrics``
+     - ``statsRequireAuthentication``
+     - allowed
+     - allowed
+   * - ``/api/v1/servers/localhost``
+     - ``dashboardRequiresAuthentication``
+     - allowed
+     - allowed
+   * - other ``/api/`` endpoints
+     - ``apiRequiresAuthentication``
+     - not allowed
+     - allowed
+
 dnsdist API
 -----------
 
index 644dfe54a80285ca9cf04ae02dfb03e505aa161e..7970de1f07ac638fe734a2bbe61b942a8b3fc14b 100644 (file)
@@ -467,7 +467,7 @@ Webserver configuration
   .. versionchanged:: 1.8.0
     ``apiRequiresAuthentication``, ``dashboardRequiresAuthentication`` optional parameters added.
 
-  Setup webserver configuration. See :func:`webserver`.
+  Setup webserver configuration. See :func:`webserver` and :doc:`../guides/webserver`.
 
   :param table options: A table with key: value pairs with webserver options.