redact

Function redact 

Source
pub fn redact(
    json: &mut JsonSchema,
    range: VersionRange,
) -> Result<(), RedactError>
Expand description

Redacts sensitive content within the specified range by replacing it with default values.

This method applies the following redaction rules:

  • Preserves delete and move operations without changes
  • Replaces text insertion content with the Unicode replacement character (U+FFFD)
  • Substitutes list and map insert values with LoroValue::Null
  • Maintains child container creation operations
  • Replaces text mark values with LoroValue::Null
  • Preserves map insertion and text annotation keys
  • Resets counter operations to zero
  • Leaves unknown operation types (from future Loro versions) unchanged

This approach ensures sensitive data removal while preserving the document’s overall structure. Redacted documents maintain seamless collaboration capabilities with both redacted and non-redacted versions.