#include <userver/formats/json/masking.hpp>
Immutable compiled masking rules, cheaply copyable and safe to share. A whole segment "*" matches any member name unless an exact child exists. Exact and wildcard branches are not merged or retried on a later mismatch. An empty path selects the root. Empty blacklists preserve everything; empty whitelists mask everything. Incomplete whitelist paths hide scalars.
Definition at line 32 of file masking.hpp.
Public Member Functions | |
| MaskingRules (const std::vector< MaskingPath > &paths={}, MaskingListMode mode=MaskingListMode::kBlacklist) | |
| Compile paths once for reuse by subsequent masking calls. | |
|
friend |
Mask JSON using RapidJSON streaming parsing and serialization. Scalars become "...", objects "{...}", and arrays "[...]". Output is compact JSON until log_limit bytes are produced; then parsing stops and the result may be incomplete JSON. No suffix is added. Reaching the budget, even exactly, sets formats::json::MaskedJson::limit_reached; the unread input suffix is not validated. A zero budget skips parsing. A single input token may be fully decoded before its SAX callback runs.
| formats::json::ParseException | on invalid JSON, invalid UTF-8, or excessive nesting encountered before reaching the budget. Error messages contain no input fragments. Rules and input are never modified. |