BccCode.Privacy.Hosting 0.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package BccCode.Privacy.Hosting --version 0.5.1
                    
NuGet\Install-Package BccCode.Privacy.Hosting -Version 0.5.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BccCode.Privacy.Hosting" Version="0.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BccCode.Privacy.Hosting" Version="0.5.1" />
                    
Directory.Packages.props
<PackageReference Include="BccCode.Privacy.Hosting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BccCode.Privacy.Hosting --version 0.5.1
                    
#r "nuget: BccCode.Privacy.Hosting, 0.5.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BccCode.Privacy.Hosting@0.5.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BccCode.Privacy.Hosting&version=0.5.1
                    
Install as a Cake Addin
#tool nuget:?package=BccCode.Privacy.Hosting&version=0.5.1
                    
Install as a Cake Tool

BccCode.Privacy.Hosting

One call that installs BCC Privacy in an application, and pushes the application's processes to the Privacy API when it is deployed. Part of the BCC Privacy package family: it brings the core, EntityFrameworkCore, AspNetCore, Wolverine and BccCode.Privacy.Client.

builder.Services.AddDbContext<AppDbContext>(o => o.UseNpgsql(connectionString).UsePrivacy());
builder.Services.AddBccPrivacyClient(PrivacyApiScopes.CatalogueRead, PrivacyApiScopes.ProcessesWrite, PrivacyApiScopes.ItemsWrite);
builder.Services.AddPrivacy<AppDbContext>(o => o.Application = "events");
// ...
app.UseAuthentication();
app.UsePrivacy();
app.MapPrivacyDocument();                    // GET /.well-known/bcc-privacy

Definitions: processes and items

A process declared in code (rules.Process(3, new("registration"))) needs a definition: its purpose, legal basis and texts. Its code in Privacy is {application}-{key}, dots as hyphens: events-registration. Definitions come from any of these, as one JSON contract (the document of PUT /api/processes/{code} and PUT /api/items/{code}):

Source Example
Files: privacy/processes/<code>.md Markdown with YAML frontmatter, as Privacy's admin import reads it (texts per language under ## EN / ### Purpose)
Files: privacy/processes/<code>.json or .yml The same fields as JSON or YAML
Files: privacy/items/<code>.json or .yml name, classification, scopes, names, dataSource
Configuration BccPrivacy:Processes:<code>:..., BccPrivacy:Items:<code>:...
Code o.Process("events-registration", new() { ... }), o.Item(...)

A process names its data items by item code (defined by the application) or by name in Privacy's catalogue; they are resolved to ids when pushed. Set BccPrivacy:DataControllerId for processes that do not name their data controller.

Per environment

The defaults follow the BCC platform environment: BccPlatform:HostingEnvironment (Prod, Dev, Local) when set, otherwise BccPlatform:Environment. ASP.NET Core's environment name does not count.

Dev, Local (or Environment Dev, Emulator) Sandbox, Staging Prod
Definitions checked against the code Yes, logged Yes, logged Yes; a problem stops start-up
Pushed to Privacy at start-up (once per content hash) No Yes Yes; a failure stops start-up

With neither setting, start-up stops and names them, unless BccPrivacy:Push and BccPrivacy:FailOnError are both set. In Prod, a missing setting stops start-up: a process without a definition, a process without a data controller (and no BccPrivacy:DataControllerId), an item the catalogue does not know, or no Privacy client to push with.

Override with BccPrivacy:Push and BccPrivacy:FailOnError. Pushing needs the client registered with the write scopes; Privacy keeps a version per change and ignores an unchanged document.

Version 0.x. Licence: Apache 2.0. Source: bcc-code/bcc-privacy, libraries/dotnet.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.2 0 11/16/2026
0.5.1 11 11/16/2026
0.5.0 9 11/16/2026
0.4.4 53 11/15/2026