1 #ifndef SOTA_CLIENT_TOOLS_TREEHUB_SERVER_H_
2 #define SOTA_CLIENT_TOOLS_TREEHUB_SERVER_H_
8 #include "server_credentials.h"
9 #include "utilities/utils.h"
14 void SetToken(
const std::string &token);
15 void SetContentType(
const std::string &content_type);
16 void SetCerts(
const std::string &client_p12);
17 void SetAuthBasic(
const std::string &username,
const std::string &password);
19 void InjectIntoCurl(
const std::string &url_suffix, CURL *curl_handle,
bool tufrepo =
false)
const;
21 void ca_certs(
const std::string &cacerts) { ca_certs_ = cacerts; }
22 void root_url(
const std::string &_root_url);
23 void repo_url(
const std::string &_repo_url);
24 std::string root_url() {
return root_url_; };
27 std::string ca_certs_;
28 std::string root_url_;
29 std::string repo_url_;
30 std::string username_;
31 std::string password_;
32 std::string root_cert_;
34 AuthMethod method_{AuthMethod::kNone};
35 struct curl_slist auth_header_ {};
38 std::string auth_header_contents_;
39 struct curl_slist force_header_ {};
42 std::string force_header_contents_;
43 struct curl_slist content_type_header_ {};
46 std::string content_type_header_contents_;
50 #endif // SOTA_CLIENT_TOOLS_TREEHUB_SERVER_H_