Skip to content

feat: Support redaction suppression.#332

Merged
geeknoid merged 1 commit intomainfrom
dp
Mar 23, 2026
Merged

feat: Support redaction suppression.#332
geeknoid merged 1 commit intomainfrom
dp

Conversation

@geeknoid
Copy link
Copy Markdown
Member

@geeknoid geeknoid commented Mar 20, 2026

  • Add RedactionEngineBuilder::suppress_redaction() to allow users to specify that redaction should be skipped for a specific data class. This would typically be used for things that are classified as public for example.

  • Add RedactionEngine::would_redact() to allow users to check if a specific data class would be redacted or not. This enables fast path optimizations for non-redacted data.

@geeknoid geeknoid marked this pull request as ready for review March 20, 2026 18:20
Copilot AI review requested due to automatic review settings March 20, 2026 18:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds API support for suppressing redaction per data class and for querying whether a class would be redacted, enabling fast-path handling for non-redacted classes.

Changes:

  • Introduces RedactionEngineBuilder::suppress_redaction() and internal suppression tracking.
  • Adds RedactionEngine::would_redact() / inner would_redact() to query redaction behavior.
  • Refactors redaction internals by moving the Redactor trait and splitting engine builder/inner into separate modules.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/data_privacy/tests/redaction_engine.rs Adds integration tests for suppression/would_redact behavior.
crates/data_privacy/src/redactors/redactor.rs Extracts Redactor trait into its own module.
crates/data_privacy/src/redactors/mod.rs Re-exports Redactor and updates tests after refactor.
crates/data_privacy/src/redaction_engine_inner.rs New internal storage supporting suppressed classes and would_redact.
crates/data_privacy/src/redaction_engine_builder.rs New builder module adding suppress_redaction.
crates/data_privacy/src/redaction_engine.rs Wires engine to new inner/builder and exposes would_redact.
crates/data_privacy/src/redacted.rs Doc comment wording tweak (“returns Err” vs “should return Err”).
crates/data_privacy/src/lib.rs Exposes new builder module and internal refactor modules.
crates/data_privacy/README.md Updates docs.rs links/version metadata to 0.11.0.
crates/data_privacy/Cargo.toml Bumps crate version to 0.11.0.
crates/data_privacy/CHANGELOG.md Adds 0.11.0 changelog entry.
Cargo.toml Bumps workspace dependency version for data_privacy to 0.11.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/data_privacy/src/redaction_engine.rs Outdated
Comment thread crates/data_privacy/src/redaction_engine_builder.rs Outdated
Comment thread crates/data_privacy/src/redaction_engine_builder.rs
Comment thread crates/data_privacy/tests/redaction_engine.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (7a29123) to head (f0982d8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #332   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         205      207    +2     
  Lines       15367    15399   +32     
=======================================
+ Hits        15367    15399   +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/data_privacy/src/redaction_engine_builder.rs
Comment thread crates/data_privacy/src/redaction_engine_builder.rs Outdated
Comment thread crates/data_privacy/src/redaction_engine.rs Outdated
Comment thread crates/data_privacy/src/redactors/redactor.rs Outdated
Comment thread crates/data_privacy/CHANGELOG.md Outdated
Comment thread crates/data_privacy/CHANGELOG.md
Comment thread crates/data_privacy/src/redaction_engine_builder.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/templated_uri/src/templated.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/data_privacy/src/redaction_engine.rs
Comment thread crates/data_privacy/src/redaction_engine_builder.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@geeknoid geeknoid enabled auto-merge (squash) March 20, 2026 19:58
Comment thread crates/data_privacy/src/redaction_engine_inner.rs Outdated
Comment thread crates/data_privacy/CHANGELOG.md Outdated
Copilot AI review requested due to automatic review settings March 23, 2026 12:16
- Add RedactionEngineBuilder::suppress_redactions() to allow users to specify
  that redaction should be skipped for a specific data class. This would
  typically be used for things that are classified as public for example.

- Add RedactionEngine::would_redact() to allow users to check if a specific
  data class would be redacted or not. This enables fast path optimizations
  for non-redacted data.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@geeknoid geeknoid merged commit bf8537f into main Mar 23, 2026
27 checks passed
@geeknoid geeknoid deleted the dp branch March 23, 2026 12:57
Vaiz added a commit that referenced this pull request Apr 10, 2026
- ✨ Features

- Support redaction suppression.
([#332](#332))

- 🐛 Bug Fixes

- restore const on UriSafeString::from_static
([#328](#328))

- 📚 Documentation

- fix BaseUri docs to reflect path prefix support
([#327](#327))

- ♻️ Code Refactoring

- use re-exported macros instead of importing templated_uri_macros
directly ([#324](#324))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants