BccCode.Privacy
0.4.4
See the version list below for details.
dotnet add package BccCode.Privacy --version 0.4.4
NuGet\Install-Package BccCode.Privacy -Version 0.4.4
<PackageReference Include="BccCode.Privacy" Version="0.4.4" />
<PackageVersion Include="BccCode.Privacy" Version="0.4.4" />
<PackageReference Include="BccCode.Privacy" />
paket add BccCode.Privacy --version 0.4.4
#r "nuget: BccCode.Privacy, 0.4.4"
#:package BccCode.Privacy@0.4.4
#addin nuget:?package=BccCode.Privacy&version=0.4.4
#tool nuget:?package=BccCode.Privacy&version=0.4.4
BccCode.Privacy
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 | net11.0 is compatible. |
-
net11.0
- Microsoft.Extensions.Compliance.Abstractions (>= 11.0.0)
NuGet packages (4)
Showing the top 4 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.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.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. |
GitHub repositories
This package is not used by any popular GitHub repositories.