Skip to content

Accept the per-strategy color property in policies #52

Description

@jzonthemtn

Implements the engine side of philterd/phisql#31 for the Python port: accept the optional per-strategy color property added to the redaction-policy schema.

Blocked by philterd/phisql#31. Do not start until that RFC is accepted and the change lands in redaction-policy schema 1.2.0 (an additive edit in place of the current schema version).

Scope

phileas-python is a text redaction engine. It has no PDF or image rendering path today (no PDF redactor, no graphical bounding boxes), so color has no rendering effect here. The requirement is compatibility: a policy that sets color on a strategy must load and redact text exactly as it does today, with color accepted and ignored. This keeps a single policy portable across the PDF-capable engine (phileas, Java) and the text engine.

Acceptance criteria

  • The strategy model (phileas/policy/strategy.py) accepts an optional color field without error.
  • A policy with color set on one or more strategies loads and redacts text identically to the same policy without color (no behavior change, and no warning that implies malfunction).
  • Validation against redaction-policy schema 1.2.0 (the revision that adds color, wherever the project pins or validates the schema) passes for colored policies.
  • A test round-trips a colored-strategy policy and asserts the text output is unchanged.
  • Documentation is updated if the project documents strategy properties.

Note for a future PDF path

If a PDF or image redaction path is ever added to phileas-python, it must honor color per philterd/phisql#31: named set black, white, red, orange, yellow, green, blue, gray, or 6-digit #RRGGBB, falling back to black for anything else, with per-span color resolving to the redacting strategy's color, then config.pdf.redactionColor, then black. Recorded here for reference; not required by this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions