aboutsummaryrefslogtreecommitdiff
path: root/zenserver/auth
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2022-01-24 11:11:10 +0100
committerPer Larsson <[email protected]>2022-01-24 11:11:10 +0100
commitdc6becffb513280170958f94e18c1b2966ade4d1 (patch)
treec7f9cccafcc21e241abdecde6f5219ab1009aff6 /zenserver/auth
parentFormat fix. (diff)
downloadzen-dc6becffb513280170958f94e18c1b2966ade4d1.tar.xz
zen-dc6becffb513280170958f94e18c1b2966ade4d1.zip
Refactored upstream cache to better handle different states in prep for dynamic auth tokens.
Diffstat (limited to 'zenserver/auth')
-rw-r--r--zenserver/auth/authservice.cpp37
-rw-r--r--zenserver/auth/authservice.h22
2 files changed, 59 insertions, 0 deletions
diff --git a/zenserver/auth/authservice.cpp b/zenserver/auth/authservice.cpp
new file mode 100644
index 000000000..c6def15b4
--- /dev/null
+++ b/zenserver/auth/authservice.cpp
@@ -0,0 +1,37 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#include <auth/authservice.h>
+#include <zencore/string.h>
+
+namespace zen {
+
+using namespace std::literals;
+
+HttpAuthService::HttpAuthService()
+{
+ m_Router.RegisterRoute(
+ "token",
+ [this](HttpRouterRequest& RouterRequest) {
+ HttpServerRequest& ServerRequest = RouterRequest.ServerRequest();
+ ServerRequest.WriteResponse(HttpResponseCode::OK);
+ },
+ HttpVerb::kPost);
+}
+
+HttpAuthService::~HttpAuthService()
+{
+}
+
+const char*
+HttpAuthService::BaseUri() const
+{
+ return "/auth/";
+}
+
+void
+HttpAuthService::HandleRequest(zen::HttpServerRequest& Request)
+{
+ m_Router.HandleRequest(Request);
+}
+
+} // namespace zen
diff --git a/zenserver/auth/authservice.h b/zenserver/auth/authservice.h
new file mode 100644
index 000000000..30b2b5864
--- /dev/null
+++ b/zenserver/auth/authservice.h
@@ -0,0 +1,22 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#include <zenhttp/httpserver.h>
+
+namespace zen {
+
+class HttpAuthService final : public zen::HttpService
+{
+public:
+ HttpAuthService();
+ virtual ~HttpAuthService();
+
+ virtual const char* BaseUri() const override;
+ virtual void HandleRequest(zen::HttpServerRequest& Request) override;
+
+private:
+ HttpRequestRouter m_Router;
+};
+
+} // namespace zen