Skip to content

feat: Introduce the #[classified] macro#48

Merged
ralfbiedert merged 2 commits intomainfrom
privacy
Nov 14, 2025
Merged

feat: Introduce the #[classified] macro#48
ralfbiedert merged 2 commits intomainfrom
privacy

Conversation

@geeknoid
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff            @@
##             main      #48    +/-   ##
========================================
  Coverage   100.0%   100.0%            
========================================
  Files          14       16     +2     
  Lines        1415     1597   +182     
========================================
+ Hits         1415     1597   +182     

☔ 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
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

This PR introduces a new #[classified] procedural macro for marking sensitive data types, refactors the existing Classified trait to use associated types instead of type parameters, and reorganizes the codebase by extracting taxonomy-related code into separate modules. Key changes include:

  • Added new #[classified] macro for newtype wrappers
  • Refactored Classified trait from Classified<T> to use associated type Payload
  • Renamed RedactionEngine methods for consistency (e.g., display_redactedredacted_display)
  • Extracted taxonomy implementation from lib.rs to taxonomy.rs and created new classified.rs module
  • Updated Debug format from <taxonomy/class:REDACTED> to <CLASSIFIED:taxonomy/class>

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/data_privacy_macros/src/taxonomy.rs Extracted taxonomy macro implementation from lib.rs with updated trait signature
crates/data_privacy_macros/src/classified.rs New module implementing the #[classified] macro for newtype structs
crates/data_privacy_macros/src/lib.rs Refactored to delegate to taxonomy and classified modules
crates/data_privacy/src/classified.rs Updated trait definition to use associated type pattern
crates/data_privacy/src/redaction_engine.rs Renamed methods for better naming consistency
crates/data_privacy/src/lib.rs Added documentation for new classified macro
crates/data_privacy/examples/employees/*.rs Updated to use new newtype pattern with #[classified] macro
snapshot files Updated to reflect new Debug format and trait signatures

@geeknoid geeknoid force-pushed the privacy branch 2 times, most recently from b2438cf to 79fba1c Compare November 14, 2025 04:26
@ralfbiedert ralfbiedert enabled auto-merge (squash) November 14, 2025 09:43
@ralfbiedert ralfbiedert disabled auto-merge November 14, 2025 09:45
@ralfbiedert ralfbiedert merged commit de100b0 into main Nov 14, 2025
18 checks passed
@ralfbiedert ralfbiedert deleted the privacy branch November 14, 2025 11:55
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