42 public std::enable_shared_from_this<LauncherHttpRegistry>
49 void setReadToken(
const std::string& token);
50 void setControlToken(
const std::string& token);
51 void setHtmlTemplate(
const std::string& path);
60 const std::string& path,
61 Poco::Net::HTTPServerRequest& req,
62 Poco::Net::HTTPServerResponse& resp)
override;
65 Poco::JSON::Object::Ptr handleStatus();
66 Poco::JSON::Object::Ptr handleProcesses();
67 Poco::JSON::Object::Ptr handleProcess(
const std::string& name);
68 Poco::JSON::Object::Ptr handleProcessAction(
69 const std::string& name,
70 std::function<
bool(
const std::string&)> action,
71 const std::string& errorMessage);
72 Poco::JSON::Object::Ptr handleBulkOp(
74 std::function<
void()> action,
75 const std::string& alreadyMsg,
76 const std::string& initiatedMsg);
77 Poco::JSON::Object::Ptr handleStopAll();
78 Poco::JSON::Object::Ptr handleHealth();
79 Poco::JSON::Object::Ptr handleGroups();
80 Poco::JSON::Object::Ptr handleHelp();
82 Poco::JSON::Object::Ptr processToJSON(
const ProcessInfo& proc);
83 Poco::JSON::Object::Ptr groupToJSON(
const ProcessGroup& group);
86 bool checkReadAuth(
const Poco::Net::HTTPServerRequest& req);
87 bool checkControlAuth(
const Poco::Net::HTTPServerRequest& req);
89 static bool validateBearerToken(
const Poco::Net::HTTPServerRequest& req,
90 const std::string& expectedToken);
93 bool sendStaticFile(
const std::string& filename,
94 const std::string& contentType,
96 Poco::Net::HTTPServerRequest& req,
97 Poco::Net::HTTPServerResponse& resp);
98 std::string findFile(
const std::string& filename);
99 std::string applyTemplateVars(
const std::string& content);
102 std::string readToken_;
103 std::string controlToken_;
104 std::string htmlTemplatePath_;
Definition UHttpRequestHandler.h:87