Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ cachet = { path = "crates/cachet", default-features = false, version = "0.5.1" }
cachet_memory = { path = "crates/cachet_memory", default-features = false, version = "0.2.1" }
cachet_service = { path = "crates/cachet_service", default-features = false, version = "0.1.0" }
cachet_tier = { path = "crates/cachet_tier", default-features = false, version = "0.1.0" }
data_privacy = { path = "crates/data_privacy", default-features = false, version = "0.11.0" }
data_privacy_macros = { path = "crates/data_privacy_macros", default-features = false, version = "0.9.0" }
data_privacy_macros_impl = { path = "crates/data_privacy_macros_impl", default-features = false, version = "0.9.0" }
data_privacy = { path = "crates/data_privacy", default-features = false, version = "0.12.0" }
data_privacy_core = { path = "crates/data_privacy_core", default-features = false, version = "0.1.0" }
data_privacy_macros = { path = "crates/data_privacy_macros", default-features = false, version = "0.10.0" }
data_privacy_macros_impl = { path = "crates/data_privacy_macros_impl", default-features = false, version = "0.10.0" }
fetch_hyper = { path = "crates/fetch_hyper", default-features = false, version = "0.1.1" }
fundle = { path = "crates/fundle", default-features = false, version = "0.3.0" }
fundle_macros = { path = "crates/fundle_macros", default-features = false, version = "0.3.0" }
Expand Down
2 changes: 1 addition & 1 deletion crates/anyspawn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contention-free, NUMA-friendly task dispatch.
This crate was developed as part of <a href="../..">The Oxidizer Project</a>. Browse this crate's <a href="https://github.com/microsoft/oxidizer/tree/main/crates/anyspawn">source code</a>.
</sub>

[__cargo_doc2readme_dependencies_info]: ggGkYW0CYXSEGy4k8ldDFPOhG2VNeXtD5nnKG6EPY6OfW5wBG8g18NOFNdxpYXKEG5RxOwZfGEjeG2_e5NBDlvq5G2UGvhnaHUvnGwpHmIxmYGfgYWSCgmhhbnlzcGF3bmUwLjUuMIJsdGhyZWFkX2F3YXJlZTAuNy4w
[__cargo_doc2readme_dependencies_info]: ggGmYW0CYXZlMC43LjJhdIQbLiTyV0MU86EbZU15e0PmecoboQ9jo59bnAEbyDXw04U13GlhYvRhcoQblHE7Bl8YSN4bb97k0EOW-rkbZQa-GdodS-cbCkeYjGZgZ-BhZIKCaGFueXNwYXduZTAuNS4wgmx0aHJlYWRfYXdhcmVlMC43LjA
[__link0]: https://docs.rs/anyspawn/0.5.0/anyspawn/?search=Spawner
[__link1]: https://docs.rs/anyspawn/0.5.0/anyspawn/?search=SpawnCustom
[__link2]: https://docs.rs/anyspawn/0.5.0/anyspawn/?search=CustomSpawnerBuilder
Expand Down
2 changes: 1 addition & 1 deletion crates/bytesbuf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ See the `mem::testing` module for details (requires `test-util` Cargo feature).
This crate was developed as part of <a href="../..">The Oxidizer Project</a>. Browse this crate's <a href="https://github.com/microsoft/oxidizer/tree/main/crates/bytesbuf">source code</a>.
</sub>

[__cargo_doc2readme_dependencies_info]: ggGkYW0CYXSEGy4k8ldDFPOhG2VNeXtD5nnKG6EPY6OfW5wBG8g18NOFNdxpYXKEG91Jt_IDJ8uaGzw7UvcHuNDdG2jPnTC62v9nG8FGesia3fwjYWSBgmhieXRlc2J1ZmUwLjUuMA
[__cargo_doc2readme_dependencies_info]: ggGmYW0CYXZlMC43LjJhdIQbLiTyV0MU86EbZU15e0PmecoboQ9jo59bnAEbyDXw04U13GlhYvRhcoQb3Um38gMny5obPDtS9we40N0baM-dMLra_2cbwUZ6yJrd_CNhZIGCaGJ5dGVzYnVmZTAuNS4w
[__link0]: https://docs.rs/bytesbuf/0.5.0/bytesbuf/?search=BytesBuf
[__link1]: https://docs.rs/bytesbuf/0.5.0/bytesbuf/?search=BytesView
[__link10]: https://docs.rs/bytesbuf/0.5.0/bytesbuf/?search=BytesView
Expand Down
2 changes: 1 addition & 1 deletion crates/bytesbuf_io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ types that produce or consume streams of bytes. These are in the `testing` modul
This crate was developed as part of <a href="../..">The Oxidizer Project</a>. Browse this crate's <a href="https://github.com/microsoft/oxidizer/tree/main/crates/bytesbuf_io">source code</a>.
</sub>

[__cargo_doc2readme_dependencies_info]: ggGkYW0CYXSEGy4k8ldDFPOhG2VNeXtD5nnKG6EPY6OfW5wBG8g18NOFNdxpYXKEG8wC2qKB5vPMG5c8vZ8ulsvSGwSlXV9Pnjr5GyAAXY8thjNKYWSBgmtieXRlc2J1Zl9pb2UwLjUuMA
[__cargo_doc2readme_dependencies_info]: ggGmYW0CYXZlMC43LjJhdIQbLiTyV0MU86EbZU15e0PmecoboQ9jo59bnAEbyDXw04U13GlhYvRhcoQbzALaooHm88wblzy9ny6Wy9IbBKVdX0-eOvkbIABdjy2GM0phZIGCa2J5dGVzYnVmX2lvZTAuNS4w
[__link0]: https://docs.io/bytesbuf
[__link1]: https://docs.rs/bytesbuf_io/0.5.0/bytesbuf_io/?search=Read
[__link2]: https://docs.rs/bytesbuf_io/0.5.0/bytesbuf_io/?search=Write
Expand Down
11 changes: 11 additions & 0 deletions crates/data_privacy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [0.12.0] - 2026-05-28

- ✨ Features

- Introduce the `Redactor` trait as the primary interface for redaction, replacing direct use of `RedactionEngine` in trait signatures.
- `RedactionEngine` now implements the `Redactor` trait.
- `RedactedDebug::fmt` and `RedactedDisplay::fmt` now accept `&dyn Redactor` instead of `&RedactionEngine`.
- `RedactedToString::to_redacted_string` now accepts `&dyn Redactor` instead of `&RedactionEngine`.
- Rename `would_redact` into `redacts` and implement it for all redactors.
- Move core types and traits (`Classified`, `DataClass`, `IntoDataClass`, `RedactedDebug`, `RedactedDisplay`, `RedactedToString`, `Redactor`) to the new `data_privacy_core` crate, re-exported from `data_privacy`.
Comment thread
Vaiz marked this conversation as resolved.

Comment thread
Vaiz marked this conversation as resolved.
## [0.11.0] - 2026-03-20

- ✨ Features
Expand Down
7 changes: 5 additions & 2 deletions crates/data_privacy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[package]
name = "data_privacy"
description = "Data annotation and redaction system providing a robust way to manipulate sensitive information."
version = "0.11.0"
version = "0.12.0"
readme = "README.md"
keywords = ["oxidizer", "compliance", "privacy", "redaction", "scrubbing"]
categories = ["data-structures"]
Expand All @@ -23,17 +23,19 @@ all-features = true
allowed_external_types = [
"serde_core::de::*",
"serde_core::ser::*",
"data_privacy_core::*",
"data_privacy_macros::*",
"rapidhash::v3::seed::RapidSecrets",
]

[features]
default = ["serde"]
rapidhash = ["dep:rapidhash"]
serde = ["dep:serde_core"]
serde = ["dep:serde_core", "data_privacy_core/serde"]
xxh3 = ["dep:xxhash-rust"]

[dependencies]
data_privacy_core.workspace = true
data_privacy_macros.workspace = true
rapidhash = { workspace = true, optional = true }
rustc-hash = { workspace = true, features = ["std"] }
Expand All @@ -42,6 +44,7 @@ xxhash-rust = { workspace = true, optional = true, features = ["xxh3"] }

[dev-dependencies]
derive_more = { workspace = true, features = ["constructor", "from"] }
insta.workspace = true
mutants.workspace = true
once_cell = { workspace = true, features = ["std"] }
serde = { workspace = true, features = ["std", "derive"] }
Expand Down
39 changes: 20 additions & 19 deletions crates/data_privacy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ This crate is built around two primary traits:

* The [`Classified`][__link0] trait is used to mark types that hold sensitive data.

* The [`Redactor`][__link1] trait defines the logic needed by an individual redactor. This crate provides a
few implementations of this trait, such as [`SimpleRedactor`][__link2], but others can
be implemented and used by applications as well.
* The [`Redactor`][__link1] trait defines the interface for applying redaction. Both
[`RedactionEngine`][__link2] (the high-level engine that routes data classes to
strategies) and individual redaction strategies (e.g. hash-based or
replacement-based redactors) implement this trait.

This crate also exposes additional traits which are usually, but not necessarily, implemented by types that implement the
[`Classified`][__link3] trait:
Expand Down Expand Up @@ -191,19 +192,19 @@ assert_eq!(output_buffer, "********");
This crate was developed as part of <a href="../..">The Oxidizer Project</a>. Browse this crate's <a href="https://github.com/microsoft/oxidizer/tree/main/crates/data_privacy">source code</a>.
</sub>

[__cargo_doc2readme_dependencies_info]: ggGkYW0CYXSEGy4k8ldDFPOhG2VNeXtD5nnKG6EPY6OfW5wBG8g18NOFNdxpYXKEG3M_vhUtB5gFG-D1ZeP7gWyXGzaYsyQD3GO7GwPXvYMSh3Z2YWSBgmxkYXRhX3ByaXZhY3lmMC4xMS4w
[__link0]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=Classified
[__link1]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=Redactor
[__link10]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=classified
[__link11]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=taxonomy
[__link12]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=classified
[__link13]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=RedactionEngine
[__link14]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=RedactionEngine::builder
[__link2]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=simple_redactor::SimpleRedactor
[__link3]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=Classified
[__link4]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=RedactedDebug
[__link5]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=RedactedDisplay
[__link6]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=RedactedToString
[__link7]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=taxonomy
[__link8]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=DataClass
[__link9]: https://docs.rs/data_privacy/0.11.0/data_privacy/?search=Classified
[__cargo_doc2readme_dependencies_info]: ggGmYW0CYXZlMC43LjJhdIQbLiTyV0MU86EbZU15e0PmecoboQ9jo59bnAEbyDXw04U13GlhYvRhcoQbfPAU5OoNavUbRy0yQBG8se0b5QdS3UiPpR4bCQr6vjqou8phZIOCbGRhdGFfcHJpdmFjeWYwLjEyLjCCcWRhdGFfcHJpdmFjeV9jb3JlZTAuMS4wgnNkYXRhX3ByaXZhY3lfbWFjcm9zZjAuMTAuMA
[__link0]: https://docs.rs/data_privacy_core/0.1.0/data_privacy_core/?search=Classified
[__link1]: https://docs.rs/data_privacy_core/0.1.0/data_privacy_core/?search=Redactor
[__link10]: https://docs.rs/data_privacy_macros/0.10.0/data_privacy_macros/?search=classified
[__link11]: https://docs.rs/data_privacy_macros/0.10.0/data_privacy_macros/?search=taxonomy
[__link12]: https://docs.rs/data_privacy_macros/0.10.0/data_privacy_macros/?search=classified
[__link13]: https://docs.rs/data_privacy/0.12.0/data_privacy/?search=RedactionEngine
[__link14]: https://docs.rs/data_privacy/0.12.0/data_privacy/?search=RedactionEngine::builder
[__link2]: https://docs.rs/data_privacy/0.12.0/data_privacy/?search=RedactionEngine
[__link3]: https://docs.rs/data_privacy_core/0.1.0/data_privacy_core/?search=Classified
[__link4]: https://docs.rs/data_privacy_macros/0.10.0/data_privacy_macros/?search=RedactedDebug
[__link5]: https://docs.rs/data_privacy_macros/0.10.0/data_privacy_macros/?search=RedactedDisplay
[__link6]: https://docs.rs/data_privacy_core/0.1.0/data_privacy_core/?search=RedactedToString
[__link7]: https://docs.rs/data_privacy_macros/0.10.0/data_privacy_macros/?search=taxonomy
[__link8]: https://docs.rs/data_privacy_core/0.1.0/data_privacy_core/?search=DataClass
[__link9]: https://docs.rs/data_privacy_core/0.1.0/data_privacy_core/?search=Classified
27 changes: 13 additions & 14 deletions crates/data_privacy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
//!
//! * The [`Classified`] trait is used to mark types that hold sensitive data.
//!
//! * The [`Redactor`] trait defines the logic needed by an individual redactor. This crate provides a
//! few implementations of this trait, such as [`SimpleRedactor`](simple_redactor::SimpleRedactor), but others can
//! be implemented and used by applications as well.
//! * The [`Redactor`] trait defines the interface for applying redaction. Both
//! [`RedactionEngine`] (the high-level engine that routes data classes to
//! strategies) and individual redaction strategies (e.g. hash-based or
//! replacement-based redactors) implement this trait.
//!
//! This crate also exposes additional traits which are usually, but not necessarily, implemented by types that implement the
//! [`Classified`] trait:
Expand Down Expand Up @@ -177,29 +178,27 @@
#![doc(html_logo_url = "https://media.githubusercontent.com/media/microsoft/oxidizer/refs/heads/main/crates/data_privacy/logo.png")]
#![doc(html_favicon_url = "https://media.githubusercontent.com/media/microsoft/oxidizer/refs/heads/main/crates/data_privacy/favicon.ico")]

// Needed for the `taxonomy` macro to be able to use `data_privacy` instead of `crate` in examples
// Workaround for https://github.com/bkchr/proc-macro-crate/issues/14
// Needed for the `taxonomy` macro to be able to use `data_privacy` instead of `crate` in examples.
extern crate self as data_privacy;

mod classified;
mod data_class;
mod macros;
mod redacted;
// Re-export types and traits from data_privacy_core.
#[doc(inline)]
pub use data_privacy_core::{Classified, DataClass, IntoDataClass, RedactedDebug, RedactedDisplay, RedactedToString, Redactor};
// Re-export derive macros and attribute macros.
#[doc(inline)]
pub use data_privacy_macros::{RedactedDebug, RedactedDisplay, classified, taxonomy};

mod redaction_engine;
mod redaction_engine_builder;
mod redaction_engine_inner;
mod redactors;
mod sensitive;

pub use classified::Classified;
pub use data_class::{DataClass, IntoDataClass};
pub use macros::{RedactedDebug, RedactedDisplay, classified, taxonomy};
pub use redacted::{RedactedDebug, RedactedDisplay, RedactedToString};
pub use redaction_engine::RedactionEngine;
pub use redaction_engine_builder::RedactionEngineBuilder;
#[cfg(feature = "rapidhash")]
pub use redactors::rapidhash_redactor;
pub use redactors::simple_redactor;
#[cfg(feature = "xxh3")]
pub use redactors::xxh3_redactor;
pub use redactors::{Redactor, simple_redactor};
pub use sensitive::Sensitive;
111 changes: 0 additions & 111 deletions crates/data_privacy/src/macros.rs

This file was deleted.

Loading
Loading