aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/zenserver.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-02-17 14:00:53 +0100
committerGitHub Enterprise <[email protected]>2026-02-17 14:00:53 +0100
commit5e1e23e209eec75a396c18f8eee3d93a9e196bfc (patch)
tree31b2b3938468aacdb0621e8b932cb9e9738ee918 /src/zenserver/zenserver.h
parentmisc fixes brought over from sb/proto (#759) (diff)
downloadzen-5e1e23e209eec75a396c18f8eee3d93a9e196bfc.tar.xz
zen-5e1e23e209eec75a396c18f8eee3d93a9e196bfc.zip
add http server root password protection (#757)
- Feature: Added `--security-config-path` option to zenserver to configure security settings - Expects a path to a .json file - Default is an empty path resulting in no extra security settings and legacy behavior - Current support is a top level filter of incoming http requests restricted to the `password` type - `password` type will check the `Authorization` header and match it to the selected authorization strategy - Currently the security settings is very basic and configured to a fixed username+password at startup { "http" { "root": { "filter": { "type": "password", "config": { "password": { "username": "<username>", "password": "<password>" }, "protect-machine-local-requests": false, "unprotected-uris": [ "/health/", "/health/info", "/health/version" ] } } } } }
Diffstat (limited to 'src/zenserver/zenserver.h')
-rw-r--r--src/zenserver/zenserver.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/zenserver/zenserver.h b/src/zenserver/zenserver.h
index ab7122fcc..efa46f361 100644
--- a/src/zenserver/zenserver.h
+++ b/src/zenserver/zenserver.h
@@ -72,7 +72,10 @@ protected:
std::function<void()> m_IsReadyFunc;
void OnReady();
- Ref<HttpServer> m_Http;
+ Ref<HttpServer> m_Http;
+
+ std::unique_ptr<IHttpRequestFilter> m_HttpRequestFilter;
+
HttpHealthService m_HealthService;
HttpStatusService m_StatusService;
@@ -107,6 +110,9 @@ protected:
// IHttpStatusProvider
virtual void HandleStatusRequest(HttpServerRequest& Request) override;
+
+private:
+ void InitializeSecuritySettings(const ZenServerConfig& ServerOptions);
};
class ZenServerMain