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

Function parseRootObject

src/Server/WebTerminalRequestHandler.cpp:265–269  ·  view source on GitHub ↗

Parse the JSON document and return its root object. Throws on malformed input; the caller treats that as an invalid message and closes the socket. We must parse the full structure (rather than searching for keys by substring) because top-level fields like `type`/`user`/`password` could otherwise be matched inside nested objects in attacker-controlled input.

Source from the content-addressed store, hash-verified

263/// substring) because top-level fields like `type`/`user`/`password` could
264/// otherwise be matched inside nested objects in attacker-controlled input.
265Poco::JSON::Object::Ptr parseRootObject(const String & json)
266{
267 Poco::JSON::Parser parser;
268 return parser.parse(json).extract<Poco::JSON::Object::Ptr>();
269}
270
271/// Read a top-level string field. Returns empty string if the key is missing.
272/// Throws on type mismatch.

Callers 2

parseResizeMessageFunction · 0.85
parseAuthMessageFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected