MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / requestNonce

Method requestNonce

src/Server/ACME/API.cpp:108–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108std::string API::requestNonce() const
109{
110 if (!directory)
111 throw Exception(ErrorCodes::LOGICAL_ERROR, "Directory is not initialized");
112
113 LOG_TEST(log, "Requesting nonce from {}", directory->new_nonce.toString());
114
115 auto uri = Poco::URI(directory->new_nonce);
116 auto r = Poco::Net::HTTPRequest(Poco::Net::HTTPRequest::HTTP_HEAD, uri.getPathAndQuery(), Poco::Net::HTTPMessage::HTTP_1_1);
117 r.set("User-Agent", fmt::format("ClickHouse/{}", VERSION_STRING));
118
119 auto session = makeHTTPSession(HTTPConnectionGroupType::HTTP, uri, connection_timeout_settings, proxy_configuration);
120 session->setKeepAlive(false);
121 session->sendRequest(r);
122
123 auto response = Poco::Net::HTTPResponse();
124 receiveResponse(*session, r, response, /* allow_redirects */ false);
125
126 return response.get(NONCE_HEADER_NAME);
127}
128
129std::string API::formatJWSRequestData(const Poco::URI & url, const std::string & payload, const std::string & nonce) const
130{

Callers

nothing calls this directly

Calls 13

makeHTTPSessionFunction · 0.85
receiveResponseFunction · 0.85
getPathAndQueryMethod · 0.80
ExceptionClass · 0.50
URIClass · 0.50
HTTPRequestClass · 0.50
formatFunction · 0.50
HTTPResponseClass · 0.50
toStringMethod · 0.45
setMethod · 0.45
setKeepAliveMethod · 0.45
sendRequestMethod · 0.45

Tested by

no test coverage detected