WDS.Audit.Sdk
1.0.0
dotnet add package WDS.Audit.Sdk --version 1.0.0
NuGet\Install-Package WDS.Audit.Sdk -Version 1.0.0
<PackageReference Include="WDS.Audit.Sdk" Version="1.0.0" />
<PackageVersion Include="WDS.Audit.Sdk" Version="1.0.0" />
<PackageReference Include="WDS.Audit.Sdk" />
paket add WDS.Audit.Sdk --version 1.0.0
#r "nuget: WDS.Audit.Sdk, 1.0.0"
#:package WDS.Audit.Sdk@1.0.0
#addin nuget:?package=WDS.Audit.Sdk&version=1.0.0
#tool nuget:?package=WDS.Audit.Sdk&version=1.0.0
WDS Audit SDK
The WDS Audit SDK is a lightweight .NET client for sending immutable audit events to the Audit Collector service.
It integrates with dependency injection and configuration providers (appsettings.json, environment variables) to make audit logging simple, consistent, and tamper-resistant across distributed applications.
✨ Features
- 📦 Easy integration with
IServiceCollectionandIConfiguration - ⚙️ Configurable via environment variables or appsettings
- 📝 Strongly typed
AuditEnvelopefor audit event data - 🔒 Immutable, compliance-ready audit trail
- 🌐 Works with HttpClient and async/await
📦 Installation
Add the package reference to your project:
dotnet add package WDS.Audit.Sdk
Or reference it directly from source:
dotnet add <YourProject> reference ../path/to/Antares.Audit.Sdk/Antares.Audit.Sdk.csproj
⚙️ Configuration
The SDK resolves settings automatically from environment variables or appsettings.json.
Environment variables
# Windows PowerShell
$env:AUDIT_SDK__BASE_URL = "http://localhost:8081"
$env:AUDIT_SDK__API_VERSION = "1.0"
# macOS/Linux
export AUDIT_SDK__BASE_URL=http://localhost:8081
export AUDIT_SDK__API_VERSION=1.0
Alternatively, you can use:
COLLECTOR__HOST=localhost
COLLECTOR__PORT=8081
appsettings.json
{
"AUDIT_SDK__API_VERSION": "1.0",
"COLLECTOR__HOST": "localhost",
"COLLECTOR__PORT": "8081"
}
🚀 Usage
Register the SDK in Program.cs
using Antares.Audit.Sdk.Abstractions;
using Antares.Audit.Sdk.Extensions;
var builder = Host.CreateApplicationBuilder(args);
// Register using configuration (env/appsettings)
builder.Services.AddAuditSdk(builder.Configuration);
var app = builder.Build();
var client = app.Services.GetRequiredService<IAuditClient>();
Send an audit event
using Antares.Audit.Shared.Contracts.Model;
var envelope = AuditEnvelope.Create(
eventType: "User",
actor: "demo-user",
action: "Create",
description: "Created a demo entity via SDK",
sourceSystem: "DummyApp"
);
await client.SendAsync(envelope);
Console.WriteLine("✅ Audit envelope sent.");
🛠 Programmatic configuration (optional)
builder.Services.AddAuditSdk(options =>
{
options.BaseUrl = "http://localhost:8081";
options.ApiVersion = "1.0";
});
📄 License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.0)
- WDS.Audit.Contracts.Test (>= 1.0.0)
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 |
|---|