MongoDbRepository.Extensions.Audit.Cryptography
6.4.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MongoDbRepository.Extensions.Audit.Cryptography --version 6.4.2
NuGet\Install-Package MongoDbRepository.Extensions.Audit.Cryptography -Version 6.4.2
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="MongoDbRepository.Extensions.Audit.Cryptography" Version="6.4.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MongoDbRepository.Extensions.Audit.Cryptography" Version="6.4.2" />
<PackageReference Include="MongoDbRepository.Extensions.Audit.Cryptography" />
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 MongoDbRepository.Extensions.Audit.Cryptography --version 6.4.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MongoDbRepository.Extensions.Audit.Cryptography, 6.4.2"
#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 MongoDbRepository.Extensions.Audit.Cryptography@6.4.2
#: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=MongoDbRepository.Extensions.Audit.Cryptography&version=6.4.2
#tool nuget:?package=MongoDbRepository.Extensions.Audit.Cryptography&version=6.4.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MongoDbRepository.Extensions.Audit.Cryptography
Exposes decoupled corporate compliance features for security-hardened environments, providing field-level encryption at rest and structural forensic modification history tracking.
🌟 Features
- Transparent Column Cryptography: Attaches an encrypted BSON mapping convention via the
[ProtectedString]attribute to encrypt strings transparently before they exit the network socket. - Anti-Pattern Proof DI Configuration: Utilizes an modern
IConfigureOptions<MongoDbOptions>interceptor pipeline to defer static convention mappings until the container is fully constructed, completely eliminating prematureBuildServiceProvider()crashes. - Forensic Differential Tracking: A rapid, light reflection engine that computes clean JSON delta mutations (old value vs. new value) across your domain models to generate audit logs.
🚀 Quick Start
1. Annotate Secured Entity Fields
Mark sensitive plain-text strings with the [ProtectedString] attribute. Identifier keys and audit properties are automatically passed safely up via standard constructor initialization chaining rules:
using MongoDB.Bson;
using MongoDbRepository.Core.Models;
using MongoDbRepository.Extensions.Audit.Cryptography.Attributes;
public class EmployeeContract : ObjectIdDocument
{
public string CorporateId { get; init; } = string.Empty;
[ProtectedString] // Encrypted/Decrypted transparently at the driver socket layer
public string TaxIdentifier { get; set; } = string.Empty;
}
2. Activate the Cryptography Pipeline (Program.cs)
C#
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDataProtection(); // Required for machine/cluster crypto keys
builder.Services.AddMongoDbRepositoryCore(builder.Configuration.GetSection("MongoDb"));
// Safely registers the cryptographic serialization convention pack
builder.Services.AddMongoDbFieldEncryption();
3. Generate Structural Audit History Deltas
C#
// Deeply compares two instances to generate a queryable audit tracking string
string changesJson = MongoDbRepository.Extensions.Audit.Engine.AuditDiffEngine.ComputeDelta(originalContract, modifiedContract);
// Output schema: {"TaxIdentifier":{"OldValue":"123-45","NewValue":"987-65"}}
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.AspNetCore.DataProtection.Abstractions (>= 10.0.10)
- MongoDbRepositoryCore (>= 6.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.