Skip to content

redact: keep secret context across pretty-printed JSON in logs #401

Open

Description

@ElbertePlinio

Evidence redaction handles each line of a text artifact on its own. Pretty-printed JSON split across log lines therefore loses the key context for nested values.

Example logcat excerpt:

  "password": {
    "v": "pw2"
  }

The second line has no secret key, so pw2 is stored. A single-line value such as {"password":{"v":"pw2"}} is redacted, and so is a whole JSON document.

Found in the council review of #352 (Rust text artifact redaction in crates/pickforge-cli/src/evidence/text_redaction.rs). It predates that change.

Acceptance criteria:

  • A secret key whose value opens a container on one log line covers the nested values on the following lines until that container closes.

  • Lines without JSON keep today's output byte for byte.

  • Linear time on 4 MiB inputs.

  • Carry JSON key context across log lines

  • Tests for pretty-printed objects and arrays under secret keys

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions