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

Method order

src/Server/ACME/API.cpp:235–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235std::string API::order(const Domains & domains, OrderCallback callback) const
236{
237 std::string payload_from_domains;
238 {
239 Poco::JSON::Object payload_json_object;
240 auto payload_identifiers = Poco::JSON::Array();
241
242 for (const auto & domain : domains)
243 {
244 Poco::JSON::Object identifier;
245 identifier.set("type", "dns");
246 identifier.set("value", domain);
247 payload_identifiers.add(identifier);
248 }
249
250 payload_json_object.set("identifiers", payload_identifiers);
251
252 std::ostringstream payload; // STYLE_CHECK_ALLOW_STD_STRING_STREAM
253 payload.exceptions(std::ios::failbit);
254 Poco::JSON::Stringifier::stringify(payload_json_object, payload);
255
256 payload_from_domains = payload.str();
257 }
258
259 auto http_response = std::make_shared<Poco::Net::HTTPResponse>();
260 auto json = doJWSRequestExpectingJSON(directory->new_order, payload_from_domains, http_response);
261
262 ProfileEvents::increment(ProfileEvents::ACMECertificateOrders);
263
264 auto status = json->getValue<std::string>("status");
265 auto expires = json->getValue<std::string>("expires");
266 auto authorizations = json->getArray("authorizations");
267 auto finalize = json->getValue<std::string>("finalize");
268
269 LOG_TEST(log, "Status: {}, Expires: {}, Finalize: {}", status, expires, finalize);
270
271 auto order_url = http_response->get("Location");
272
273 for (const auto & auth : *authorizations)
274 processAuthorization(Poco::URI(auth.toString()), callback);
275
276 return order_url;
277}
278
279Order API::describeOrder(const Poco::URI & order_url) const
280{

Callers 7

eFunction · 0.80
d3.v4.min.jsFile · 0.80
CONV_FNFunction · 0.80
generateNextTTLMethod · 0.80
swapTableDefinitionsMethod · 0.80

Calls 9

ArrayClass · 0.50
incrementFunction · 0.50
URIClass · 0.50
setMethod · 0.45
addMethod · 0.45
strMethod · 0.45
getArrayMethod · 0.45
getMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected