[Libreoffice-commits] online.git: loolwsd/Admin.cpp loolwsd/FileServer.hpp
Pranav Kant
pranavk at collabora.com
Wed Mar 30 19:27:36 UTC 2016
loolwsd/Admin.cpp | 3 ++-
loolwsd/FileServer.hpp | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit d26246dab0e2171150767ab3a79499e4241ab783
Author: Pranav Kant <pranavk at collabora.com>
Date: Thu Mar 31 00:53:31 2016 +0530
loolwsd: Temporarily use hard-coded path to key file
We will switch to reading all these values as soon as wip
configuration file object is accessible globally.
Change-Id: I16eff339349683050be1985eefabc34854cccba3
diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp
index 1bbfc22..2ad3d3d 100644
--- a/loolwsd/Admin.cpp
+++ b/loolwsd/Admin.cpp
@@ -356,7 +356,8 @@ void AdminRequestHandler::handleRequest(HTTPServerRequest& request, HTTPServerRe
const std::string jwtToken = request["Cookie"].substr(pos + 1);
Log::info("Verifying JWT token: " + jwtToken);
- const std::string keyPath = Poco::Path(Application::instance().commandPath()).parent().toString() + SSL_KEY_FILE;
+ // TODO: Read key from configuration file
+ const std::string keyPath = "/etc/loolwsd/" + std::string(SSL_KEY_FILE);
JWTAuth authAgent(keyPath, "admin", "admin", "admin");
if (authAgent.verify(jwtToken))
{
diff --git a/loolwsd/FileServer.hpp b/loolwsd/FileServer.hpp
index 787fbbd..c1c8dd7 100644
--- a/loolwsd/FileServer.hpp
+++ b/loolwsd/FileServer.hpp
@@ -74,7 +74,8 @@ public:
{
const std::string htmlMimeType = "text/html";
// generate and set the cookie
- const std::string keyPath = Poco::Path(Application::instance().commandPath()).parent().toString() + SSL_KEY_FILE;
+ // TODO: Read key from configuration file
+ const std::string keyPath = "/etc/loolwsd/" + std::string(SSL_KEY_FILE);
JWTAuth authAgent(keyPath, "admin", "admin", "admin");
const std::string jwtToken = authAgent.getAccessToken();
Poco::Net::HTTPCookie cookie("jwt", jwtToken);
More information about the Libreoffice-commits
mailing list