Skip to main content

Module json

Module json 

Source
Expand description

JSON processing for ejson files.

This module provides functions to:

  • Extract the public key from an ejson document
  • Walk the JSON tree and selectively encrypt/decrypt string values

The walker uses a scanner-based approach instead of parsing and re-serializing to preserve key ordering and make diffs meaningful over time.

Structs§

JsonHandler
JSON format handler implementing the FormatHandler trait.
Walker
Walker walks a JSON structure, applying an action to encryptable string values.

Enums§

JsonError
Errors that can occur during JSON processing.

Functions§

collapse_multiline_string_literals
Collapse multiline string literals by replacing embedded newlines with \n.
extract_public_key
Extract the _public_key value from an EJSON document.
trim_underscore_prefix_from_keys
Trim the first leading underscore from all keys in a JSON document. The _public_key field is excluded from trimming.