NovusCore.AuditService.ChangeTracking 1.0.0

dotnet add package NovusCore.AuditService.ChangeTracking --version 1.0.0
                    
NuGet\Install-Package NovusCore.AuditService.ChangeTracking -Version 1.0.0
                    
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="NovusCore.AuditService.ChangeTracking" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NovusCore.AuditService.ChangeTracking" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NovusCore.AuditService.ChangeTracking" />
                    
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 NovusCore.AuditService.ChangeTracking --version 1.0.0
                    
#r "nuget: NovusCore.AuditService.ChangeTracking, 1.0.0"
                    
#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 NovusCore.AuditService.ChangeTracking@1.0.0
                    
#: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=NovusCore.AuditService.ChangeTracking&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NovusCore.AuditService.ChangeTracking&version=1.0.0
                    
Install as a Cake Tool

AuditService.ChangeTracking

EF Core change tracking and audit interceptor for RetireAix microservices.

Features

  • Automatic audit trail for EF Core entities (Add/Modify/Delete)
  • Captures user context, IP address, request path, and trace ID
  • Publishes audit events to AWS SQS with retry logic
  • Batch publishing support for performance
  • Configurable entity and property filtering
  • Zero-code integration with EF Core SaveChanges

Installation

dotnet add package AuditService.ChangeTracking

Usage

1. Configure in appsettings.json

{
  "Audit": {
    "SourceService": "PlanSponsorService",
    "QueueUrl": "********",
    "AwsRegion": "********",
    "AwsAccessKeyId": "******",
    "AwsSecretAccessKey": "******",
    "Enabled": true,
    "MaxRetryAttempts": 3,
    "RetryDelayMilliseconds": 100,
    "IgnoredEntities": ["AuditLog", "Session"],
    "IgnoredProperties": ["CreatedAt", "UpdatedAt", "ModifiedAt"]
  }
}

For Production (using IAM Roles):

{
  "Audit": {
    "SourceService": "PlanSponsorService",
    "QueueUrl": "https://sqs.us-east-1.amazonaws.com/266735844636/prod-retireaix-audit-events-queue",
    "AwsRegion": "us-east-1",
    "Enabled": true
  }
}

Note: In production, omit AwsAccessKeyId and AwsSecretAccessKey to use IAM role credentials.

2. Register in Program.cs

using AuditService.ChangeTracking.Extensions;

builder.Services.AddAuditChangeTracking(builder.Configuration);

3. Add Interceptor to DbContext

public class MyDbContext : DbContext
{
    private readonly IServiceProvider _serviceProvider;

    public MyDbContext(DbContextOptions<MyDbContext> options, IServiceProvider serviceProvider)
        : base(options)
    {
        _serviceProvider = serviceProvider;
    }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.AddAuditInterceptor(_serviceProvider);
        base.OnConfiguring(optionsBuilder);
    }
}

Configuration Options

  • SourceService: Name of the microservice (required)
  • QueueUrl: AWS SQS queue URL (required)
  • AwsRegion: AWS region (optional, defaults to SDK default)
  • AwsAccessKeyId: AWS Access Key ID (optional, for local dev only)
  • AwsSecretAccessKey: AWS Secret Access Key (optional, for local dev only)
  • AwsServiceUrl: Custom AWS endpoint for LocalStack (optional)
  • Enabled: Enable/disable audit tracking (default: true)
  • MaxRetryAttempts: Number of retry attempts for failed publishes (default: 3)
  • RetryDelayMilliseconds: Delay between retries in milliseconds (default: 100)
  • BatchSize: Maximum batch size for SQS (1-10, default: 10)
  • IgnoredEntities: List of entity names to exclude from audit
  • IgnoredProperties: List of property names to exclude from audit

Authentication

Local Development

Provide explicit AWS credentials in appsettings.json:

{
  "Audit": {
    "AwsAccessKeyId": "your-access-key",
    "AwsSecretAccessKey": "your-secret-key"
  }
}

Production

Omit credentials to use AWS IAM roles (recommended):

  • ECS/Fargate: Task execution role
  • EKS: IRSA (IAM Roles for Service Accounts)
  • EC2: Instance profile

The SDK will automatically use the IAM role attached to your container/pod.

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on NovusCore.AuditService.ChangeTracking:

Package Downloads
NovusCore.Shared.Data

Shared data access layer combining domain entities and database infrastructure for RetireAix microservices. Includes PlanSponsor entities (29 entities across app, plan, and action schemas) with stored procedures and functions. BREAKING CHANGE: AuditableEntity user IDs changed from string to int.

RetireAix.Shared.Data

Shared data access layer combining domain entities and database infrastructure for RetireAix microservices. Includes PlanSponsor entities (29 entities across app, plan, and action schemas) with stored procedures and functions. BREAKING CHANGE: AuditableEntity user IDs changed from string to int.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 637 12/31/2025