Skip to content

Commit

Permalink
Adding support for NET 9 (#711), Audit.NET.AzureCosmos: upgrade Micro…
Browse files Browse the repository at this point in the history
…soft.Azure.Cosmos (#713), Audit.NET.Kafka: Adding headers to the Kafka messages (#715), Audit.MongoClient: Upgrade MongoDB.Driver (#708)
  • Loading branch information
thepirat000 committed Dec 8, 2024
1 parent a2027cb commit fda3402
Show file tree
Hide file tree
Showing 29 changed files with 222 additions and 122 deletions.
20 changes: 10 additions & 10 deletions Audit.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Audit.Polly.UnitTest", "tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Audit.NET.Channels", "src\Audit.NET.Channels\Audit.NET.Channels.csproj", "{5574EA92-47A5-4483-BF7E-89231D38D318}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Audit.EntityFramework.Abstractions", "src\Audit.EntityFramework.Abstractions\Audit.EntityFramework.Abstractions.csproj", "{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Audit.EntityFramework.Abstractions", "src\Audit.EntityFramework.Abstractions\Audit.EntityFramework.Abstractions.csproj", "{59DE2732-27CE-43D3-BFE7-055C51714731}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -719,14 +719,14 @@ Global
{5574EA92-47A5-4483-BF7E-89231D38D318}.Release|Any CPU.Build.0 = Release|Any CPU
{5574EA92-47A5-4483-BF7E-89231D38D318}.Release|x64.ActiveCfg = Release|Any CPU
{5574EA92-47A5-4483-BF7E-89231D38D318}.Release|x64.Build.0 = Release|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Debug|x64.ActiveCfg = Debug|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Debug|x64.Build.0 = Debug|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Release|Any CPU.Build.0 = Release|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Release|x64.ActiveCfg = Release|Any CPU
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB}.Release|x64.Build.0 = Release|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Debug|x64.ActiveCfg = Debug|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Debug|x64.Build.0 = Debug|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Release|Any CPU.Build.0 = Release|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Release|x64.ActiveCfg = Release|Any CPU
{59DE2732-27CE-43D3-BFE7-055C51714731}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -802,7 +802,7 @@ Global
{CA13DD91-30D5-45E8-AD0E-4F9049E7DC78} = {E62475E8-0BE1-4464-BBD9-FD06CC546593}
{E3097E23-9191-4028-83F2-D231590563FD} = {A54B4BB6-3439-432B-AFD9-FE62D6528D42}
{5574EA92-47A5-4483-BF7E-89231D38D318} = {E62475E8-0BE1-4464-BBD9-FD06CC546593}
{C45B1DD0-7C1D-406D-BC44-B356AFA226DB} = {E62475E8-0BE1-4464-BBD9-FD06CC546593}
{59DE2732-27CE-43D3-BFE7-055C51714731} = {E62475E8-0BE1-4464-BBD9-FD06CC546593}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B1989475-43D6-4AA5-9717-6DBF734B0C6E}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to Audit.NET and its extensions will be documented in this f

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [27.3.0] - 2024-12-08:
- Adding support for NET 9 (#711)
- Audit.NET.AzureCosmos: Security upgrade Microsoft.Azure.Cosmos from 3.37.0 to 3.46.0 (#713)
- Audit.NET.Kafka: Adding support to add custom headers to the Kafka messages (#715)
- Audit.MongoClient: Upgrade MongoDB.Driver reference to the latest version 3.1.0 (#708)

## [27.2.0] - 2024-11-23:
- Audit.EntityFramework.Abstractions: Introducing `Audit.EntityFramework.Abstractions` assembly to decouple your domain layer from direct dependencies on EntityFramework or EntityFrameworkCore (#714)

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>27.2.0</Version>
<Version>27.3.0</Version>
<PackageReleaseNotes></PackageReleaseNotes>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>
Expand Down
17 changes: 12 additions & 5 deletions src/Audit.EntityFramework.Core/Audit.EntityFramework.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Copyright>Copyright 2016</Copyright>
<AssemblyTitle>Audit.EntityFramework.Core</AssemblyTitle>
<Authors>Federico Colombo</Authors>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<DefineConstants>$(DefineConstants);STRONG_NAME;EF_CORE</DefineConstants>
<NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down Expand Up @@ -37,6 +37,9 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<DefineConstants>$(DefineConstants);EF_CORE_8;EF_CORE_5_OR_GREATER;EF_CORE_6_OR_GREATER;EF_CORE_7_OR_GREATER;EF_CORE_8_OR_GREATER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<DefineConstants>$(DefineConstants);EF_CORE_8;EF_CORE_5_OR_GREATER;EF_CORE_6_OR_GREATER;EF_CORE_7_OR_GREATER;EF_CORE_8_OR_GREATER;EF_CORE_9_OR_GREATER</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE" Pack="true" PackagePath="LICENSE" />
Expand All @@ -60,16 +63,20 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.36" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.36" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.14" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.11" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Copyright>Copyright 2018</Copyright>
<AssemblyTitle>Audit.EntityFramework.Identity.Core</AssemblyTitle>
<Authors>Federico Colombo</Authors>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<DefineConstants>$(DefineConstants);STRONG_NAME</DefineConstants>
<NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down Expand Up @@ -49,22 +49,28 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<DefineConstants>$(DefineConstants);EF_CORE_8;EF_CORE_5_OR_GREATER;EF_CORE_6_OR_GREATER;EF_CORE_7_OR_GREATER;EF_CORE_8_OR_GREATER</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<DefineConstants>$(DefineConstants);EF_CORE_8;EF_CORE_5_OR_GREATER;EF_CORE_6_OR_GREATER;EF_CORE_7_OR_GREATER;EF_CORE_8_OR_GREATER;EF_CORE_9_OR_GREATER</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Audit.EntityFramework.Core\Audit.EntityFramework.Core.csproj" />
<ProjectReference Include="..\Audit.NET\Audit.NET.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.11" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.14" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.25" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.36" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
Expand Down
10 changes: 7 additions & 3 deletions src/Audit.MongoClient/Audit.MongoClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Copyright>Copyright 2023</Copyright>
<AssemblyTitle>Audit.MongoClient</AssemblyTitle>
<Authors>Federico Colombo</Authors>
<TargetFrameworks>net472;netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net472;netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<DefineConstants>$(DefineConstants);STRONG_NAME</DefineConstants>
<NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -27,8 +27,12 @@
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.22.0" />
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="MongoDB.Driver" Version="2.30.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net472' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="MongoDB.Driver" Version="3.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
Expand Down
3 changes: 2 additions & 1 deletion src/Audit.NET.AzureCosmos/Audit.NET.AzureCosmos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/thepirat000/Audit.NET</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'net462' ">
Expand All @@ -44,7 +45,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net462' ">
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.37.0" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.46.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.NET.AzureStorage/Audit.NET.AzureStorage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<ItemGroup>
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.0.3" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="4.5.1" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
Expand Down
4 changes: 2 additions & 2 deletions src/Audit.NET.Channels/Audit.NET.Channels.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand Down Expand Up @@ -40,7 +40,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Threading.Channels" Version="8.0.0" />
<PackageReference Include="System.Threading.Channels" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.NET.ElasticSearch/Audit.NET.Elasticsearch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.14.6" />
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.16.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Audit.NET.Kafka/Audit.NET.Kafka.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Confluent.Kafka" Version="2.3.0" />
<PackageReference Include="Confluent.Kafka" Version="2.6.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public interface IKafkaProviderSubConfigurator<TKey>
/// <param name="keySelector">The key selector.</param>
IKafkaProviderSubConfigurator<TKey> KeySelector(Func<AuditEvent, TKey> keySelector);
/// <summary>
/// Sets the Headers selector. Optional to use message headers. Configure the message headers to be used for a given audit event.
/// </summary>
/// <param name="headersSelector"></param>
/// <returns></returns>
IKafkaProviderSubConfigurator<TKey> HeadersSelector(Func<AuditEvent, Headers> headersSelector);
/// <summary>
/// Sets the Key serializer. Optional when using keyed messages and a custom serializer for the key is needed.
/// </summary>
/// <param name="keySerializer">The key serializer.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class KafkaProviderConfigurator<TKey> : IKafkaProviderConfigurator<TKey>,
internal Setting<string> _topic;
internal Action<ProducerBuilder<TKey, AuditEvent>> _producerBuilderAction;
internal Action<DeliveryResult<TKey, AuditEvent>> _resultHandler;
internal Func<AuditEvent, Headers> _headersSelector;

public IKafkaProviderSubConfigurator<TKey> AuditEventSerializer(ISerializer<AuditEvent> auditEventSerializer)
{
Expand Down Expand Up @@ -74,5 +75,11 @@ public IKafkaProviderSubConfigurator<TKey> TopicSelector(Func<AuditEvent, string
_topic = topicSelector;
return this;
}

public IKafkaProviderSubConfigurator<TKey> HeadersSelector(Func<AuditEvent, Headers> headersSelector)
{
_headersSelector = headersSelector;
return this;
}
}
}
4 changes: 4 additions & 0 deletions src/Audit.NET.Kafka/Providers/DefaultJsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace Audit.Kafka.Providers
{
/// <summary>
/// Default JSON serializer for Kafka messages using Audit.Core.JsonAdapter
/// </summary>
/// <typeparam name="T"></typeparam>
public class DefaultJsonSerializer<T> : ISerializer<T>, IDeserializer<T>
{
public T Deserialize(ReadOnlySpan<byte> data, bool isNull, SerializationContext context) =>
Expand Down
Loading

0 comments on commit fda3402

Please sign in to comment.