Indrivo.Audit.Accessor.Contracts
1.0.17
dotnet add package Indrivo.Audit.Accessor.Contracts --version 1.0.17
NuGet\Install-Package Indrivo.Audit.Accessor.Contracts -Version 1.0.17
<PackageReference Include="Indrivo.Audit.Accessor.Contracts" Version="1.0.17" />
paket add Indrivo.Audit.Accessor.Contracts --version 1.0.17
#r "nuget: Indrivo.Audit.Accessor.Contracts, 1.0.17"
// Install Indrivo.Audit.Accessor.Contracts as a Cake Addin #addin nuget:?package=Indrivo.Audit.Accessor.Contracts&version=1.0.17 // Install Indrivo.Audit.Accessor.Contracts as a Cake Tool #tool nuget:?package=Indrivo.Audit.Accessor.Contracts&version=1.0.17
.Net Modules | Background Processing
Introduction
The audit component will allow you to provide information about user actions in the system. The audit component will provide information on user access to the system, authentication attempts, accessed folders, data changes, etc.
Purpose
The module is designed to monitor all changes and logs within the system. Depending on the role, access will only be allowed on certain system components. The system will record detailed logs so that access can be monitored, and situations where someone accesses data they should not be able to access can be examined.
How to set up
A reference web api is already set up in the current repository you can check that one for detailed implementation information. Below only a small set of nuances will be explained. Set up is pretty straightforward you will need to install the following packages inside your solution:
<PackageReference Include="Indrivo.Audit.Accessor" Version="1.0.1" />
In your appsettings.json
file, add the configuration for the connection string:
"ConnectionStrings": {
"AuditConnection": "Data Source=(localdb)\\mssqllocaldb;Database=aspnet-auditTest;Trusted_Connection=True;MultipleActiveResultSets=true"
}
Configuring the Database Providers
The AuditResourceAccessorBuilder
is designed to be flexible and allow configuration for different database providers:
SQL Server:
var auditResourceAccessorBuilder = new AuditResourceAccessorBuilder(builder.Services); auditResourceAccessorBuilder.WithSqlServer( builder.Configuration["ConnectionStrings:SqlServerConnection"]) .AddServiceLayer() .AddValidators() .Build();
PostgreSQL:
var auditResourceAccessorBuilder = new AuditResourceAccessorBuilder(builder.Services); auditResourceAccessorBuilder.WithPostgreSql( builder.Configuration["ConnectionStrings:PostgreSqlConnection"]) .AddServiceLayer() .AddValidators() .Build();
You can also create custom configurations by implementing the IDbConfigurer
interface for any other database provider and integrating it similarly using the builder pattern.
Applying Migrations
To apply the migrations at the start of the application, you can run the following line of code in your Program.cs
:
app.ApplyAuditMigrations();
This nuget exposes 4 methods for creating and geting the audit information:
Task<Result> CreateAuditEventAsync(CreateAuditEventCommand command, CancellationToken cancellationToken);
Task<Result> CreateAuditEventTypeAsync(CreateAuditEventTypeCommand command, CancellationToken cancellationToken);
Task<Result> CreateAuditEventTypesAsync(List<CreateAuditEventTypeCommand> command, CancellationToken cancellationToken);
Task<Result<List<EventTypeDTO>>> GetEventTypesAsync(CancellationToken cancellationToken);
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. |
-
net8.0
- AutoMapper (>= 13.0.1)
- FluentValidation.AspNetCore (>= 11.3.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.1)
- Result.Net (>= 1.5.0)
- Scrutor (>= 4.2.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Indrivo.Audit.Accessor.Contracts:
Package | Downloads |
---|---|
Indrivo.Audit.ResourceAccessor.Service
Package Description |
|
Indrivo.Audit.ResourceAccessor.EfAuditTrail
Package Description |
|
Audit.ResourceAccessor.Routing
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.17 | 1,421 | 7/23/2024 |
1.0.16 | 124 | 7/23/2024 |
1.0.15 | 124 | 7/23/2024 |
1.0.14 | 122 | 7/23/2024 |
1.0.13 | 126 | 7/23/2024 |
1.0.12 | 143 | 7/22/2024 |
1.0.11 | 185 | 7/12/2024 |
1.0.10 | 137 | 7/12/2024 |
1.0.9 | 124 | 7/11/2024 |
1.0.8 | 128 | 7/11/2024 |
1.0.7 | 389 | 6/10/2024 |
1.0.6 | 413 | 5/16/2024 |
1.0.5 | 146 | 5/16/2024 |
1.0.4 | 140 | 5/15/2024 |
1.0.3 | 122 | 5/10/2024 |
1.0.1 | 144 | 4/30/2024 |
1.0.0 | 1,435 | 4/25/2023 |