Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Oct 25, 2024
2 parents 075c957 + 34cff9b commit e5e601e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/EthernaSSO.Domain/EthernaSSO.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
<PackageReference Include="Etherna.Authentication.AspNetCore" Version="0.4.0-alpha.29" />
<PackageReference Include="Etherna.DomainEvents" Version="1.4.0" />
<PackageReference Include="EthernaACR" Version="0.4.0-alpha.60" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.10" />
<PackageReference Include="MongODM.Core" Version="0.24.0" />
<PackageReference Include="Nethereum.Accounts" Version="4.25.0" />
<PackageReference Include="Nethereum.Accounts" Version="4.26.0" />
</ItemGroup>

</Project>
25 changes: 7 additions & 18 deletions src/EthernaSSO.Persistence/SsoDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AlphaPassRequest, string> AlphaPassRequests { get; } = new DomainRepository<AlphaPassRequest, string>(
Expand Down Expand Up @@ -147,7 +136,7 @@ public SsoDbContext(
public override IEnumerable<DocumentMigration> DocumentMigrationList => Array.Empty<DocumentMigration>();

//other properties
public IEventDispatcher EventDispatcher { get; }
public IEventDispatcher EventDispatcher { get; } = eventDispatcher;

// Protected properties.
protected override IEnumerable<IModelMapsCollector> ModelMapsCollectors =>
Expand Down Expand Up @@ -193,7 +182,7 @@ protected override async Task SeedAsync()
true,
null,
null,
new[] { adminRole },
[adminRole],
false);

if (user is null)
Expand Down
6 changes: 3 additions & 3 deletions src/EthernaSSO/EthernaSSO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0" />
<PackageReference Include="MongODM" Version="0.24.0" />
<PackageReference Include="MongODM.AspNetCore.UI" Version="0.24.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="10.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/EthernaSSO/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,13 @@ static Task unauthorizedApiCallHandler(RedirectContext<CookieAuthenticationOptio
//register hangfire server
services.AddHangfireServer(options =>
{
options.Queues = new[]
{
options.Queues =
[
Queues.DB_MAINTENANCE,
Queues.DOMAIN_MAINTENANCE,
Queues.STATS,
"default"
};
];
options.WorkerCount = Environment.ProcessorCount * 2;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit e5e601e

Please sign in to comment.