feat: Introduce the #[classified] macro#48
Merged
ralfbiedert merged 2 commits intomainfrom Nov 14, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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
Classifiedtrait fromClassified<T>to use associated typePayload - Renamed
RedactionEnginemethods for consistency (e.g.,display_redacted→redacted_display) - Extracted taxonomy implementation from
lib.rstotaxonomy.rsand created newclassified.rsmodule - 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 |
b2438cf to
79fba1c
Compare
ralfbiedert
approved these changes
Nov 14, 2025
martintmk
approved these changes
Nov 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.