BccCode.Privacy
0.18.0
See the version list below for details.
dotnet add package BccCode.Privacy --version 0.18.0
NuGet\Install-Package BccCode.Privacy -Version 0.18.0
<PackageReference Include="BccCode.Privacy" Version="0.18.0" />
<PackageVersion Include="BccCode.Privacy" Version="0.18.0" />
<PackageReference Include="BccCode.Privacy" />
paket add BccCode.Privacy --version 0.18.0
#r "nuget: BccCode.Privacy, 0.18.0"
#:package BccCode.Privacy@0.18.0
#addin nuget:?package=BccCode.Privacy&version=0.18.0
#tool nuget:?package=BccCode.Privacy&version=0.18.0
BccCode.Privacy
Changes in 0.14. The final design (design, plan) replaces parts of this API: items become data categories (
DataCategory,PrivacyCatalogue.*), and the declaration types (data classes, processes) live here. This README is rewritten with the code (plan steps 12–21).
The framework-neutral core of BCC Privacy. It holds what every adapter shares and references no
framework: no EF Core, ASP.NET Core or Wolverine. Its only dependency is
Microsoft.Extensions.Compliance.Abstractions.
| Type | What it is |
|---|---|
PrivacyRules, ProcessRule, GroupRule |
An application's processes (what, for one purpose) and groups (who), declared in code |
ItemKey, ProcessKey |
Typed keys for data items and processes; a misspelt key fails to compile |
PrivacyScope |
Who is asking: the organisation and process of a request or message |
Basis, GroupMember |
Why an organisation may use data for a process, for one person or a group |
BasisChanged |
The event raised when a basis starts or ends at its moment |
PrivacyDocument |
What an application does with personal data, read from its rules and storage |
IPrivacyContext |
What adapters read from the application: scope, rules, clock, storage mapping |
PrivacyProcessAttribute, IPrivacyProcessMetadata |
What an endpoint or handler declares: its process, and the items it may return |
PrivacyItemAttribute |
Marks a property, field or parameter as holding a data item, so adapters can mask it. A DataClassificationAttribute |
ItemKey.Classification, PrivacyTaxonomy |
Each data item as a DataClassification in the BccPrivacy taxonomy, for Microsoft.Extensions.Compliance |
IPrivacyMoments |
Bases' start and end moments and their BasisChanged outbox, as storage keeps them, for a host to act on |
PrivacyScope.Current, PrivacyScope.MissingProcess |
The ambient scope adapters hand on; refusal of personal reads by work that declares no process |
Redaction in logs
A data item is a data classification, so .NET's redaction pipeline redacts it in log lines written with
[LoggerMessage] (classified parameters, and properties under [LogProperties]). The logging source
generator creates the attribute without arguments, so declare one per item next to its key:
public sealed class EmailAttribute() : PrivacyItemAttribute("email");
[LoggerMessage(LogLevel.Information, "Registered {Name} with {Email}")]
static partial void Registered(ILogger logger, string name, [Email] string email);
services.AddRedaction(r => r.SetRedactor<ErasingRedactor>(PrivacyTaxonomy.Set(Items.Email))); // optional: per item
services.AddLogging(b => b.EnableRedaction());
An item with no redactor of its own gets the fallback redactor. Packages: Microsoft.Extensions.Compliance.Redaction
and Microsoft.Extensions.Telemetry (for EnableRedaction() and the generator).
Most applications reference an adapter instead, which brings this package:
BccCode.Privacy.EntityFrameworkCore.
BccCode.Privacy.AspNetCore builds on it
for HTTP and BccCode.Privacy.Wolverine for
messages; a hosting package follows.
Version 0.x: the API will change. Licence: Apache 2.0. Source and design:
bcc-code/bcc-privacy, libraries/dotnet and
docs/architecture-proposal.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- BccCode.Privacy.Vocabulary (>= 0.1.31)
- Microsoft.Extensions.Compliance.Abstractions (>= 10.11.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on BccCode.Privacy:
| Package | Downloads |
|---|---|
|
BccCode.Privacy.EntityFrameworkCore
Purpose-bound access to personal data in EF Core and PostgreSQL: a basis per organisation and process, a query filter, sharing between organisations by data item, and generated read views. |
|
|
BccCode.Privacy.Hosting
One AddPrivacy() for BCC Privacy: the EF Core, ASP.NET Core and Wolverine packages wired together, defaults per environment, the privacy document at /.well-known/bcc-privacy, and the application's processes and data items pushed to the Privacy API at deploy. |
|
|
BccCode.Privacy.AspNetCore
BCC Privacy for ASP.NET Core: the privacy scope per request from the signed-in organisation and the endpoint's declared process, refusal of endpoints that read personal data without a process, and per-endpoint masking of data items in JSON responses. |
|
|
BccCode.Privacy.Wolverine
BCC Privacy for Wolverine: the privacy scope carried on message envelopes, handler middleware that runs each handler under its sender's organisation and process, and publishing of BasisChanged events and basis moments through Wolverine. |
|
|
BccCode.Privacy.Postgres
The PostgreSQL layer of BCC Privacy: the privacy columns, column comments, constraints, the catalogue and the package tables, generated from the data classes and processes. PrivacySql.Script(...) serves migrators other than EF Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.27.1 | 0 | 11/24/2026 |
| 0.27.0 | 0 | 11/24/2026 |
| 0.26.0 | 0 | 11/24/2026 |
| 0.25.1 | 0 | 11/24/2026 |
| 0.25.0 | 8 | 11/24/2026 |
| 0.24.0 | 10 | 11/24/2026 |
| 0.23.6 | 10 | 11/24/2026 |
| 0.23.5 | 10 | 11/24/2026 |
| 0.23.4 | 9 | 11/24/2026 |
| 0.23.3 | 54 | 11/24/2026 |
| 0.23.2 | 61 | 11/24/2026 |
| 0.23.1 | 55 | 11/24/2026 |
| 0.23.0 | 54 | 11/24/2026 |
| 0.22.0 | 59 | 11/24/2026 |
| 0.21.0 | 75 | 11/23/2026 |
| 0.20.0 | 56 | 11/23/2026 |
| 0.19.0 | 64 | 11/23/2026 |
| 0.18.0 | 62 | 11/23/2026 |
| 0.17.0 | 60 | 11/23/2026 |
| 0.16.0 | 69 | 11/23/2026 |