Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Rsk.Audit.EF/Rsk.Audit.EF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.9" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="10.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Rsk.DuendeIdentityServer.AuditEventSink/AuditSink.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Duende.IdentityServer.Events;
using Duende.IdentityServer.Services;
Expand All @@ -19,7 +20,7 @@ public class AuditSink(

internal IAdapterFactory Factory { get; init; } = new AdapterFactory(customEventAdapters);

public Task PersistAsync(Event evt)
public Task PersistAsync(Event evt, CancellationToken cancellationToken = default)
{
var auditArgument = Factory.Create(evt);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Duende.IdentityServer.Events;
using Duende.IdentityServer.Services;
Expand All @@ -17,13 +18,13 @@ public EventSinkAggregator(ILogger logger)
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
}

public Task PersistAsync(Event evt)
public Task PersistAsync(Event evt, CancellationToken cancellationToken = default)
{
var eventSinkTasks = new List<Task>();

foreach (var eventSink in EventSinks)
{
eventSinkTasks.Add(ProtectedExecution(() => eventSink.PersistAsync(evt)));
eventSinkTasks.Add(ProtectedExecution(() => eventSink.PersistAsync(evt, cancellationToken)));
}

return Task.WhenAll(eventSinkTasks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
<IncludeSymbols>true</IncludeSymbols>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Version>5.0.0</Version>
<Version>6.0.0</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer" Version="7.4.7" />
<PackageReference Include="Duende.IdentityServer" Version="8.0.1" />

<PackageReference Include="Rsk.Audit" Version="4.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.9" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.9" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Duende.IdentityServer.Events;
using Duende.IdentityServer.Services;
Expand All @@ -23,7 +24,7 @@
sut.EventSinks.Add(sink2);

// Act
await sut.PersistAsync(new StubEvent());

Check warning on line 27 in tests/Rsk.DuendeIdentityServer.AuditEventSink.Tests/EventSinkAggregatorTests.cs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive. (https://xunit.net/xunit.analyzers/rules/xUnit1051)

Check warning on line 27 in tests/Rsk.DuendeIdentityServer.AuditEventSink.Tests/EventSinkAggregatorTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive. (https://xunit.net/xunit.analyzers/rules/xUnit1051)

Check warning on line 27 in tests/Rsk.DuendeIdentityServer.AuditEventSink.Tests/EventSinkAggregatorTests.cs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive. (https://xunit.net/xunit.analyzers/rules/xUnit1051)

// Assert
Assert.Equal(1, sink1.WasCalled);
Expand All @@ -47,7 +48,7 @@
sut.EventSinks.Add(sink3);

// Act
await sut.PersistAsync(new StubEvent());

Check warning on line 51 in tests/Rsk.DuendeIdentityServer.AuditEventSink.Tests/EventSinkAggregatorTests.cs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive. (https://xunit.net/xunit.analyzers/rules/xUnit1051)

Check warning on line 51 in tests/Rsk.DuendeIdentityServer.AuditEventSink.Tests/EventSinkAggregatorTests.cs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive. (https://xunit.net/xunit.analyzers/rules/xUnit1051)

Check warning on line 51 in tests/Rsk.DuendeIdentityServer.AuditEventSink.Tests/EventSinkAggregatorTests.cs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive. (https://xunit.net/xunit.analyzers/rules/xUnit1051)

// Assert
Assert.Equal(1, sink1.WasCalled);
Expand All @@ -60,7 +61,7 @@
{
public int WasCalled { get; private set; }

public Task PersistAsync(Event evt)
public Task PersistAsync(Event evt, CancellationToken cancellationToken = default)
{
WasCalled++;
return Task.CompletedTask;
Expand All @@ -71,7 +72,7 @@
{
public int WasCalled { get; private set; }

public Task PersistAsync(Event evt)
public Task PersistAsync(Event evt, CancellationToken cancellationToken = default)
{
WasCalled++;
throw new Exception("Blah");
Expand Down
Loading