From 8233cc520878569be6e40ba0c3c1336f50c2855f Mon Sep 17 00:00:00 2001 From: Mirko Da Corte Date: Tue, 24 Sep 2024 20:56:28 +0200 Subject: [PATCH 1/4] fix dependency issue in prod --- src/EthernaSSO/EthernaSSO.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EthernaSSO/EthernaSSO.csproj b/src/EthernaSSO/EthernaSSO.csproj index bf740e0..9a11d26 100644 --- a/src/EthernaSSO/EthernaSSO.csproj +++ b/src/EthernaSSO/EthernaSSO.csproj @@ -21,6 +21,7 @@ + From eb2f43eb2717112faef5247baabe4ce28516486f Mon Sep 17 00:00:00 2001 From: Mirko Da Corte Date: Tue, 24 Sep 2024 21:04:37 +0200 Subject: [PATCH 2/4] dependency fix attempt --- src/EthernaSSO.Domain/EthernaSSO.Domain.csproj | 1 + src/EthernaSSO/EthernaSSO.csproj | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj b/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj index 00972db..5575758 100644 --- a/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj +++ b/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj @@ -16,6 +16,7 @@ + diff --git a/src/EthernaSSO/EthernaSSO.csproj b/src/EthernaSSO/EthernaSSO.csproj index 9a11d26..bf740e0 100644 --- a/src/EthernaSSO/EthernaSSO.csproj +++ b/src/EthernaSSO/EthernaSSO.csproj @@ -21,7 +21,6 @@ - From 77e7c18fb278639751964ffabdfd4200aa4860ff Mon Sep 17 00:00:00 2001 From: Mirko Da Corte Date: Wed, 16 Oct 2024 22:07:49 +0200 Subject: [PATCH 3/4] Refactor SsoDbContext constructor to C# primary constructor --- src/EthernaSSO.Persistence/SsoDbContext.cs | 25 ++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/EthernaSSO.Persistence/SsoDbContext.cs b/src/EthernaSSO.Persistence/SsoDbContext.cs index 6016965..6dd1cd3 100644 --- a/src/EthernaSSO.Persistence/SsoDbContext.cs +++ b/src/EthernaSSO.Persistence/SsoDbContext.cs @@ -33,26 +33,15 @@ namespace Etherna.SSOServer.Persistence { - public class SsoDbContext : DbContext, IEventDispatcherDbContext, ISsoDbContext + public class SsoDbContext( + IEventDispatcher eventDispatcher, + SsoDbSeedSettings seedSettings, + IServiceProvider serviceProvider) + : DbContext, IEventDispatcherDbContext, ISsoDbContext { // Consts. private const string ModelMapsNamespace = "Etherna.SSOServer.Persistence.ModelMaps.Sso"; - // Fields. - private readonly SsoDbSeedSettings seedSettings; - private readonly IServiceProvider serviceProvider; - - // Constructor. - public SsoDbContext( - IEventDispatcher eventDispatcher, - SsoDbSeedSettings seedSettings, - IServiceProvider serviceProvider) - { - EventDispatcher = eventDispatcher; - this.seedSettings = seedSettings; - this.serviceProvider = serviceProvider; - } - // Properties. //repositories public IRepository AlphaPassRequests { get; } = new DomainRepository( @@ -147,7 +136,7 @@ public SsoDbContext( public override IEnumerable DocumentMigrationList => Array.Empty(); //other properties - public IEventDispatcher EventDispatcher { get; } + public IEventDispatcher EventDispatcher { get; } = eventDispatcher; // Protected properties. protected override IEnumerable ModelMapsCollectors => @@ -193,7 +182,7 @@ protected override async Task SeedAsync() true, null, null, - new[] { adminRole }, + [adminRole], false); if (user is null) From 34cff9b517329c4879037c6baa19ca536ec74fb4 Mon Sep 17 00:00:00 2001 From: Mirko Da Corte Date: Fri, 25 Oct 2024 15:33:12 +0200 Subject: [PATCH 4/4] update dependencies --- src/EthernaSSO.Domain/EthernaSSO.Domain.csproj | 4 ++-- src/EthernaSSO/EthernaSSO.csproj | 6 +++--- src/EthernaSSO/Program.cs | 6 +++--- .../EthernaSSO.Persistence.Tests.csproj | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj b/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj index 5575758..dee4f28 100644 --- a/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj +++ b/src/EthernaSSO.Domain/EthernaSSO.Domain.csproj @@ -16,9 +16,9 @@ - + - + diff --git a/src/EthernaSSO/EthernaSSO.csproj b/src/EthernaSSO/EthernaSSO.csproj index bf740e0..b63a1fe 100644 --- a/src/EthernaSSO/EthernaSSO.csproj +++ b/src/EthernaSSO/EthernaSSO.csproj @@ -20,15 +20,15 @@ - + - + - + diff --git a/src/EthernaSSO/Program.cs b/src/EthernaSSO/Program.cs index 334de5f..be849fc 100644 --- a/src/EthernaSSO/Program.cs +++ b/src/EthernaSSO/Program.cs @@ -413,13 +413,13 @@ static Task unauthorizedApiCallHandler(RedirectContext { - options.Queues = new[] - { + options.Queues = + [ Queues.DB_MAINTENANCE, Queues.DOMAIN_MAINTENANCE, Queues.STATS, "default" - }; + ]; options.WorkerCount = Environment.ProcessorCount * 2; }); } diff --git a/test/EthernaSSO.Persistence.Tests/EthernaSSO.Persistence.Tests.csproj b/test/EthernaSSO.Persistence.Tests/EthernaSSO.Persistence.Tests.csproj index a51d555..35a833f 100644 --- a/test/EthernaSSO.Persistence.Tests/EthernaSSO.Persistence.Tests.csproj +++ b/test/EthernaSSO.Persistence.Tests/EthernaSSO.Persistence.Tests.csproj @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive