BccCode.Privacy.Hosting
0.5.1
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
<PackageReference Include="BccCode.Privacy.Hosting" Version="0.5.1" />
<PackageVersion Include="BccCode.Privacy.Hosting" Version="0.5.1" />
<PackageReference Include="BccCode.Privacy.Hosting" />
paket add BccCode.Privacy.Hosting --version 0.5.1
#r "nuget: BccCode.Privacy.Hosting, 0.5.1"
#:package BccCode.Privacy.Hosting@0.5.1
#addin nuget:?package=BccCode.Privacy.Hosting&version=0.5.1
#tool nuget:?package=BccCode.Privacy.Hosting&version=0.5.1
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 | 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.Platform.Apis (>= 2.0.0.22)
- BccCode.Platform.Config (>= 2.0.0.22)
- BccCode.Privacy (>= 0.5.1)
- BccCode.Privacy.AspNetCore (>= 0.5.1)
- BccCode.Privacy.Client (>= 0.1.0)
- BccCode.Privacy.EntityFrameworkCore (>= 0.5.1)
- BccCode.Privacy.Wolverine (>= 0.5.1)
- BccCode.PubSub.Client (>= 1.0.49)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.15)
- Microsoft.Extensions.Compliance.Abstractions (>= 10.11.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.3)
- WolverineFx (>= 6.64.0)
- YamlDotNet (>= 18.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.