37 class LauncherHttpRegistry :
39 public std::enable_shared_from_this<LauncherHttpRegistry>
43 virtual ~LauncherHttpRegistry() =
default;
46 void setReadToken(
const std::string& token);
47 void setControlToken(
const std::string& token);
48 void setHtmlTemplate(
const std::string& path);
57 const std::string& path,
58 Poco::Net::HTTPServerRequest& req,
59 Poco::Net::HTTPServerResponse& resp)
override;
62 Poco::JSON::Object::Ptr handleStatus();
63 Poco::JSON::Object::Ptr handleProcesses();
64 Poco::JSON::Object::Ptr handleProcess(
const std::string& name);
65 Poco::JSON::Object::Ptr handleRestart(
const std::string& name);
66 Poco::JSON::Object::Ptr handleStop(
const std::string& name);
67 Poco::JSON::Object::Ptr handleStart(
const std::string& name);
68 Poco::JSON::Object::Ptr handleRestartAll();
69 Poco::JSON::Object::Ptr handleReloadAll();
70 Poco::JSON::Object::Ptr handleHealth();
71 Poco::JSON::Object::Ptr handleGroups();
72 Poco::JSON::Object::Ptr handleHelp();
74 Poco::JSON::Object::Ptr processToJSON(
const ProcessInfo& proc);
75 Poco::JSON::Object::Ptr groupToJSON(
const ProcessGroup& group);
78 bool checkReadAuth(
const Poco::Net::HTTPServerRequest& req);
79 bool checkControlAuth(
const Poco::Net::HTTPServerRequest& req);
80 static bool validateBearerToken(
const Poco::Net::HTTPServerRequest& req,
81 const std::string& expectedToken);
84 bool sendHtmlFile(
const std::string& filename,
85 Poco::Net::HTTPServerRequest& req,
86 Poco::Net::HTTPServerResponse& resp);
87 bool sendJsFile(
const std::string& filename,
88 Poco::Net::HTTPServerRequest& req,
89 Poco::Net::HTTPServerResponse& resp);
90 std::string findFile(
const std::string& filename);
91 std::string applyTemplateVars(
const std::string& content);
94 std::string readToken_;
95 std::string controlToken_;
96 std::string htmlTemplatePath_;
Определения UHttpRequestHandler.h:87