7 Commits
23 changed files with 361 additions and 882 deletions
+11 -24
View File
@@ -1,38 +1,25 @@
# Source Control / IDEs **/.classpath
**/.dockerignore
**/.env
**/.git **/.git
**/.gitignore **/.gitignore
**/.gitattributes
**/.vs
**/.vscode
**/.classpath
**/.project **/.project
**/.settings **/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user **/*.*proj.user
**/*.dbmdl **/*.dbmdl
**/*.jfm **/*.jfm
**/azds.yaml
# Build / Dependency Artifacts
**/bin **/bin
**/obj **/charts
**/docker-compose*
**/Dockerfile*
**/node_modules **/node_modules
**/npm-debug.log **/npm-debug.log
**/.toolstarget **/obj
# Docker / Deployment Files
**/.dockerignore
**/.env
**/Dockerfile*
**/charts
**/secrets.dev.yaml **/secrets.dev.yaml
**/values.dev.yaml **/values.dev.yaml
**/azds.yaml
# Explicitly target Docker Compose configuration files while sparing .dcproj
**/docker-compose.yml
**/docker-compose.override.yml
**/docker-compose.prod.yml
**/docker-compose.staging.yml
# Miscellaneous
LICENSE LICENSE
README.md README.md
+14 -13
View File
@@ -1,3 +1,5 @@
version: '3.4'
services: services:
litecharmssecurity.admin: litecharmssecurity.admin:
image: skoruba-duende-identityserver-admin image: skoruba-duende-identityserver-admin
@@ -21,7 +23,7 @@ services:
- AdminConfiguration__BasicConfiguration__BasePath=/ - AdminConfiguration__BasicConfiguration__BasePath=/
# Postgres Database Overrides # Postgres Database Overrides
- ConnectionStrings__DataProtectionDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__DataProtectionDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_admin_dp;
litecharmssecurity.admin.api: litecharmssecurity.admin.api:
image: skoruba-duende-identityserver-admin-api image: skoruba-duende-identityserver-admin-api
@@ -33,7 +35,6 @@ services:
ports: ports:
- "8082:8080" - "8082:8080"
environment: environment:
- EF_CORE_SUPPRESS_PENDING_MODEL_CHANGES_WARNING=true
- ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_ENVIRONMENT=Production
- ForwardedHeadersConfiguration__Enabled=true - ForwardedHeadersConfiguration__Enabled=true
- ForwardedHeadersConfiguration__AllowAll=true - ForwardedHeadersConfiguration__AllowAll=true
@@ -46,13 +47,13 @@ services:
- AdminApiConfiguration__IdentityServerBaseUrl=https://sts.security.khongisa.co.za - AdminApiConfiguration__IdentityServerBaseUrl=https://sts.security.khongisa.co.za
# Postgres Database Overrides # Postgres Database Overrides
- ConnectionStrings__ConfigurationDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__ConfigurationDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_config;
- ConnectionStrings__PersistedGrantDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__PersistedGrantDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_grant;
- ConnectionStrings__IdentityDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__IdentityDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_identity;
- ConnectionStrings__AdminLogDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__AdminLogDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_log;
- ConnectionStrings__AdminAuditLogDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__AdminAuditLogDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_audit;
- ConnectionStrings__AdminConfigurationDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__AdminConfigurationDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_admin_config;
- ConnectionStrings__DataProtectionDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__DataProtectionDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_api_dp;
# Operational Management Switches (Controlled via Dockhand UI variables) # Operational Management Switches (Controlled via Dockhand UI variables)
- SeedConfiguration__ApplySeed=${APPLY_SEED:-true} - SeedConfiguration__ApplySeed=${APPLY_SEED:-true}
@@ -97,7 +98,7 @@ services:
- SmtpConfiguration__Password=${SMTP_PASSWORD} - SmtpConfiguration__Password=${SMTP_PASSWORD}
# Postgres Database Overrides # Postgres Database Overrides
- ConnectionStrings__ConfigurationDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__ConfigurationDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_sts_config;
- ConnectionStrings__PersistedGrantDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__PersistedGrantDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_sts_grant;
- ConnectionStrings__IdentityDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__IdentityDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_sts_identity;
- ConnectionStrings__DataProtectionDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD}; - ConnectionStrings__DataProtectionDbConnection=Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=${DB_PASSWORD};application_name=litecharms_security_sts_dp;
-13
View File
@@ -1,13 +0,0 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "10.0.7",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
+11 -7
View File
@@ -3,15 +3,19 @@ WORKDIR /app
EXPOSE 80 EXPOSE 80
EXPOSE 443 EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG TARGETARCH ARG TARGETARCH
WORKDIR /app_source WORKDIR /src
COPY ["src/LiteCharmsSecurity.Admin.Api/LiteCharmsSecurity.Admin.Api.csproj", "src/LiteCharmsSecurity.Admin.Api/"]
COPY ["src/LiteCharmsSecurity.Admin.EntityFramework.Shared/LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj", "src/LiteCharmsSecurity.Admin.EntityFramework.Shared/"]
COPY ["src/LiteCharmsSecurity.Admin.EntityFramework.SqlServer/LiteCharmsSecurity.Admin.EntityFramework.SqlServer.csproj", "src/LiteCharmsSecurity.Admin.EntityFramework.SqlServer/"]
COPY ["src/LiteCharmsSecurity.Shared/LiteCharmsSecurity.Shared.csproj", "src/LiteCharmsSecurity.Shared/"]
COPY ["src/LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL/LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.csproj", "src/LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL/"]
RUN dotnet restore "src/LiteCharmsSecurity.Admin.Api/LiteCharmsSecurity.Admin.Api.csproj" --source "https://nexus.khongisa.co.za/repository/nuget-group/index.json" --verbosity detailed
COPY . . COPY . .
WORKDIR "src/LiteCharmsSecurity.Admin.Api"
RUN dotnet restore "LiteCharmsSecurity.AdminUI.sln"
WORKDIR "/app_source/src/LiteCharmsSecurity.Admin.Api"
RUN dotnet build "LiteCharmsSecurity.Admin.Api.csproj" -c Release -o /app/build RUN dotnet build "LiteCharmsSecurity.Admin.Api.csproj" -c Release -o /app/build
FROM build AS publish FROM build AS publish
@@ -21,4 +25,4 @@ FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
ENTRYPOINT ["dotnet", "LiteCharmsSecurity.Admin.Api.dll"] ENTRYPOINT ["dotnet", "LiteCharmsSecurity.Admin.Api.dll"]
@@ -1,60 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<UserSecretsId>1cc472a2-4e4b-48ce-846b-5219f71fc643</UserSecretsId> <UserSecretsId>1cc472a2-4e4b-48ce-846b-5219f71fc643</UserSecretsId>
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath> <DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext> <DockerfileContext>..\..</DockerfileContext>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.csproj" />
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.SqlServer\LiteCharmsSecurity.Admin.EntityFramework.SqlServer.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.SqlServer\LiteCharmsSecurity.Admin.EntityFramework.SqlServer.csproj" />
<ProjectReference Include="..\LiteCharmsSecurity.Shared\LiteCharmsSecurity.Shared.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Shared\LiteCharmsSecurity.Shared.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSwag.CodeGeneration" Version="14.7.1" />
<PackageReference Include="NSwag.CodeGeneration.TypeScript" Version="14.7.1" />
<PackageReference Include="NSwag.Generation" Version="14.7.1" />
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.7.1" />
<PackageReference Include="NSwag.Generation.WebApi" Version="14.7.1" />
<PackageReference Include="NSwag.AspNetCore" Version="14.7.1" />
<PackageReference Include="NSwag.MSBuild" Version="14.7.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.UI.Api" Version="3.0.0-rc4" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7"> <ItemGroup>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <Content Include="..\..\.dockerignore">
<PrivateAssets>all</PrivateAssets> <Link>.dockerignore</Link>
</PackageReference> </Content>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.7"> </ItemGroup>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <Target Name="NSwag" BeforeTargets="AfterBuild" Condition="'$(Configuration)'=='Debug'">
</PackageReference> <Exec ContinueOnError="true" Command="$(NSwagExe_Net100) run nswag.json /variables:Configuration=$(Configuration)">
<PackageReference Include="NSwag.CodeGeneration" Version="14.7.1" /> <Output TaskParameter="ExitCode" PropertyName="NSwagExitCode" />
<PackageReference Include="NSwag.CodeGeneration.TypeScript" Version="14.7.1" /> <Output TaskParameter="ConsoleOutput" PropertyName="NSwagOutput" />
<PackageReference Include="NSwag.Generation" Version="14.7.1" /> </Exec>
<PackageReference Include="NSwag.Generation.AspNetCore" Version="14.7.1" />
<PackageReference Include="NSwag.Generation.WebApi" Version="14.7.1" />
<PackageReference Include="NSwag.AspNetCore" Version="14.7.1" />
<PackageReference Include="NSwag.MSBuild" Version="14.7.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.UI.Api" Version="3.0.0-rc4" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
</ItemGroup>
<Target Name="NSwag" BeforeTargets="AfterBuild" Condition="'$(Configuration)'=='Debug'">
<Exec ContinueOnError="true" Command="$(NSwagExe_Net100) run nswag.json /variables:Configuration=$(Configuration)">
<Output TaskParameter="ExitCode" PropertyName="NSwagExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="NSwagOutput" />
</Exec>
<Message Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' == '0'" Importance="low" />
<Error Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' != '0'" />
</Target>
<Message Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' == '0'" Importance="low" />
<Error Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' != '0'" />
</Target>
</Project> </Project>
@@ -24,11 +24,6 @@ namespace LiteCharmsSecurity.Admin.Api
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
// Force EF Core to globally ignore the Model Drift warning at the AppDomain level
AppContext.SetSwitch("Microsoft.EntityFrameworkCore.Issue34300", true);
// OR if using standard diagnostics suppression:
System.Environment.SetEnvironmentVariable("EF_CORE_SUPPRESS_PENDING_MODEL_CHANGES_WARNING", "true");
var configuration = GetConfiguration(args); var configuration = GetConfiguration(args);
Log.Logger = new LoggerConfiguration() Log.Logger = new LoggerConfiguration()
+6 -8
View File
@@ -1,27 +1,25 @@
// Copyright (c) Jan Škoruba. All Rights Reserved. // Copyright (c) Jan Škoruba. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System.IdentityModel.Tokens.Jwt;
using HealthChecks.UI.Client; using HealthChecks.UI.Client;
using LiteCharmsSecurity.Admin.Api.Configuration;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity;
using LiteCharmsSecurity.Shared.Dtos;
using LiteCharmsSecurity.Shared.Dtos.Identity;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using NSwag.AspNetCore; using NSwag.AspNetCore;
using Skoruba.AuditLogging.EntityFramework.Entities; using Skoruba.AuditLogging.EntityFramework.Entities;
using LiteCharmsSecurity.Admin.Api.Configuration;
using Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configuration.Configuration; using Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configuration.Configuration;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity;
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Configuration; using Skoruba.Duende.IdentityServer.Admin.UI.Api.Configuration;
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Helpers; using Skoruba.Duende.IdentityServer.Admin.UI.Api.Helpers;
using Skoruba.Duende.IdentityServer.Shared.Configuration.Helpers; using Skoruba.Duende.IdentityServer.Shared.Configuration.Helpers;
using System.IdentityModel.Tokens.Jwt; using LiteCharmsSecurity.Shared.Dtos;
using LiteCharmsSecurity.Shared.Dtos.Identity;
using StartupHelpers = Skoruba.Duende.IdentityServer.Shared.Configuration.Helpers.StartupHelpers; using StartupHelpers = Skoruba.Duende.IdentityServer.Shared.Configuration.Helpers.StartupHelpers;
namespace LiteCharmsSecurity.Admin.Api namespace LiteCharmsSecurity.Admin.Api
@@ -10,16 +10,16 @@
"ForwardLimit": 1 "ForwardLimit": 1
}, },
"ConnectionStrings": { "ConnectionStrings": {
"ConfigurationDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "ConfigurationDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"PersistedGrantDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "PersistedGrantDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"IdentityDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "IdentityDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"AdminLogDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "AdminLogDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"AdminAuditLogDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "AdminAuditLogDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"DataProtectionDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "DataProtectionDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"AdminConfigurationDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;" "AdminConfigurationDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;"
}, },
"AdminApiConfiguration": { "AdminApiConfiguration": {
"ApplicationName": "Lite Charms Security", "ApplicationName": "Lite Charms Security UI",
"ApiName": "Lite Charms Security Api", "ApiName": "Lite Charms Security Api",
"ApiVersion": "v1", "ApiVersion": "v1",
"ApiBaseUrl": "https://localhost:44302", "ApiBaseUrl": "https://localhost:44302",
@@ -80,9 +80,9 @@
"ReadConfigurationFromKeyVault": false "ReadConfigurationFromKeyVault": false
}, },
"SeedConfiguration": { "SeedConfiguration": {
"ApplySeed": false "ApplySeed": true
}, },
"DatabaseMigrationsConfiguration": { "DatabaseMigrationsConfiguration": {
"ApplyDatabaseMigrations": false "ApplyDatabaseMigrations": true
} }
} }
@@ -1,20 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Description>Entity Framework layer for the administration of the Duende IdentityServer and Asp.Net Core Identity with PostrgreSQL support</Description> <Description>Entity Framework layer for the administration of the Duende IdentityServer and Asp.Net Core Identity with PostrgreSQL support</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" PrivateAssets="All" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" PrivateAssets="All" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Admin.Storage" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Admin.Storage" Version="3.0.0-rc4" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.11" /> </ItemGroup>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>
@@ -1,350 +0,0 @@
// <auto-generated />
using System;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.Identity
{
[DbContext(typeof(AdminIdentityDbContext))]
[Migration("20260606104139_FixModelDrift")]
partial class FixModelDrift
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("Users", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityPasskey", b =>
{
b.Property<byte[]>("CredentialId")
.HasMaxLength(1024)
.HasColumnType("bytea");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("CredentialId");
b.HasIndex("UserId");
b.ToTable("UserPasskeys", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityRoleClaim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("RoleClaims", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserClaim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("UserClaims", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserLogin", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("ProviderKey")
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("UserLogins", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserRole", b =>
{
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<string>("RoleId")
.HasColumnType("text");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserToken", b =>
{
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("Name")
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("UserTokens", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityPasskey", b =>
{
b.HasOne("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 =>
{
b1.Property<byte[]>("UserIdentityPasskeyCredentialId");
b1.Property<byte[]>("AttestationObject")
.IsRequired();
b1.Property<byte[]>("ClientDataJson")
.IsRequired();
b1.Property<DateTimeOffset>("CreatedAt");
b1.Property<bool>("IsBackedUp");
b1.Property<bool>("IsBackupEligible");
b1.Property<bool>("IsUserVerified");
b1.Property<string>("Name");
b1.Property<byte[]>("PublicKey")
.IsRequired();
b1.Property<long>("SignCount");
b1.PrimitiveCollection<string>("Transports");
b1.HasKey("UserIdentityPasskeyCredentialId");
b1.ToTable("UserPasskeys");
b1
.ToJson("Data")
.HasColumnType("jsonb");
b1.WithOwner()
.HasForeignKey("UserIdentityPasskeyCredentialId");
});
b.Navigation("Data")
.IsRequired();
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityRoleClaim", b =>
{
b.HasOne("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserClaim", b =>
{
b.HasOne("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserLogin", b =>
{
b.HasOne("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserRole", b =>
{
b.HasOne("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserToken", b =>
{
b.HasOne("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -1,98 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.Identity
{
/// <inheritdoc />
public partial class FixModelDrift : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "UserTokens",
type: "character varying(450)",
maxLength: 450,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(128)",
oldMaxLength: 128);
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "UserTokens",
type: "character varying(450)",
maxLength: 450,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(128)",
oldMaxLength: 128);
migrationBuilder.AlterColumn<string>(
name: "ProviderKey",
table: "UserLogins",
type: "character varying(450)",
maxLength: 450,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(128)",
oldMaxLength: 128);
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "UserLogins",
type: "character varying(450)",
maxLength: 450,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(128)",
oldMaxLength: 128);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "UserTokens",
type: "character varying(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(450)",
oldMaxLength: 450);
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "UserTokens",
type: "character varying(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(450)",
oldMaxLength: 450);
migrationBuilder.AlterColumn<string>(
name: "ProviderKey",
table: "UserLogins",
type: "character varying(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(450)",
oldMaxLength: 450);
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "UserLogins",
type: "character varying(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(450)",
oldMaxLength: 450);
}
}
}
@@ -1,10 +1,10 @@
// <auto-generated /> // <auto-generated />
using System; using System;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
#nullable disable #nullable disable
@@ -17,11 +17,28 @@ namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.Identit
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "10.0.7") .HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityPasskey", b =>
{
b.Property<byte[]>("CredentialId")
.HasMaxLength(1024)
.HasColumnType("bytea");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("CredentialId");
b.HasIndex("UserId");
b.ToTable("UserPasskeys", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", b => modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentity", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
@@ -87,23 +104,6 @@ namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.Identit
b.ToTable("Users", (string)null); b.ToTable("Users", (string)null);
}); });
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityPasskey", b =>
{
b.Property<byte[]>("CredentialId")
.HasMaxLength(1024)
.HasColumnType("bytea");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("CredentialId");
b.HasIndex("UserId");
b.ToTable("UserPasskeys", (string)null);
});
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityRole", b => modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityRole", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
@@ -183,12 +183,12 @@ namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.Identit
modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserLogin", b => modelBuilder.Entity("LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity.UserIdentityUserLogin", b =>
{ {
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(450) .HasMaxLength(128)
.HasColumnType("character varying(450)"); .HasColumnType("character varying(128)");
b.Property<string>("ProviderKey") b.Property<string>("ProviderKey")
.HasMaxLength(450) .HasMaxLength(128)
.HasColumnType("character varying(450)"); .HasColumnType("character varying(128)");
b.Property<string>("ProviderDisplayName") b.Property<string>("ProviderDisplayName")
.HasColumnType("text"); .HasColumnType("text");
@@ -225,12 +225,12 @@ namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.Identit
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(450) .HasMaxLength(128)
.HasColumnType("character varying(450)"); .HasColumnType("character varying(128)");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(450) .HasMaxLength(128)
.HasColumnType("character varying(450)"); .HasColumnType("character varying(128)");
b.Property<string>("Value") b.Property<string>("Value")
.HasColumnType("text"); .HasColumnType("text");
@@ -1,21 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Description>DbContexts and Identity entities for the administration of the Duende IdentityServer and Asp.Net Core Identity</Description> <Description>DbContexts and Identity entities for the administration of the Duende IdentityServer and Asp.Net Core Identity</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7"> <PackageReference Include="Skoruba.AuditLogging.EntityFramework" Version="3.0.0" />
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Admin.Storage" Version="3.0.0-rc4" />
<PrivateAssets>all</PrivateAssets> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configuration" Version="3.0.0-rc4" />
</PackageReference> </ItemGroup>
<PackageReference Include="Skoruba.AuditLogging.EntityFramework" Version="3.0.0" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Admin.Storage" Version="3.0.0-rc4" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configuration" Version="3.0.0-rc4" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.11" />
</ItemGroup>
</Project> </Project>
@@ -1,20 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Description>Entity Framework layer for the administration of the Duende IdentityServer and Asp.Net Core Identity with SqlServer support</Description> <Description>Entity Framework layer for the administration of the Duende IdentityServer and Asp.Net Core Identity with SqlServer support</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.7" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" PrivateAssets="All" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7" PrivateAssets="All" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Admin.Storage" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Admin.Storage" Version="3.0.0-rc4" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.11" /> </ItemGroup>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+14 -8
View File
@@ -5,22 +5,28 @@ EXPOSE 443
FROM node:22-bookworm-slim AS node FROM node:22-bookworm-slim AS node
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG TARGETARCH ARG TARGETARCH
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 \ ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 \
NUGET_XMLDOC_MODE=skip NUGET_XMLDOC_MODE=skip
WORKDIR /app_source WORKDIR /src
COPY --from=node /usr/local/bin/node /usr/local/bin/node COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& npm install -g npm@latest && npm install -g npm@latest \
&& node --version && npm --version
COPY ["src/LiteCharmsSecurity.Admin/LiteCharmsSecurity.Admin.csproj", "src/LiteCharmsSecurity.Admin/"]
COPY ["src/LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL/LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.csproj", "src/LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL/"]
COPY ["src/LiteCharmsSecurity.Admin.EntityFramework.Shared/LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj", "src/LiteCharmsSecurity.Admin.EntityFramework.Shared/"]
COPY ["src/LiteCharmsSecurity.Admin.EntityFramework.SqlServer/LiteCharmsSecurity.Admin.EntityFramework.SqlServer.csproj", "src/LiteCharmsSecurity.Admin.EntityFramework.SqlServer/"]
COPY ["src/LiteCharmsSecurity.Shared/LiteCharmsSecurity.Shared.csproj", "src/LiteCharmsSecurity.Shared/"]
RUN dotnet restore "src/LiteCharmsSecurity.Admin/LiteCharmsSecurity.Admin.csproj" --source "https://nexus.khongisa.co.za/repository/nuget-group/index.json" --verbosity detailed
COPY . . COPY . .
WORKDIR "src/LiteCharmsSecurity.Admin"
RUN dotnet restore "LiteCharmsSecurity.AdminUI.sln"
WORKDIR "/app_source/src/LiteCharmsSecurity.Admin"
RUN dotnet build "LiteCharmsSecurity.Admin.csproj" -c Release -o /app/build RUN dotnet build "LiteCharmsSecurity.Admin.csproj" -c Release -o /app/build
FROM build AS publish FROM build AS publish
@@ -30,4 +36,4 @@ FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
ENTRYPOINT ["dotnet", "LiteCharmsSecurity.Admin.dll"] ENTRYPOINT ["dotnet", "LiteCharmsSecurity.Admin.dll"]
@@ -1,33 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>f4677efe-bc9a-4778-b625-4f0be700881a</UserSecretsId> <UserSecretsId>f4677efe-bc9a-4778-b625-4f0be700881a</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.7" />
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="10.0.7" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" /> <PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.UI" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.UI" Version="3.0.0-rc4" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.UI.Spa" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.UI.Spa" Version="3.0.0-rc4" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Shared.Configuration" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Shared.Configuration" Version="3.0.0-rc4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" />
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL\LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.csproj" />
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.SqlServer\LiteCharmsSecurity.Admin.EntityFramework.SqlServer.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.SqlServer\LiteCharmsSecurity.Admin.EntityFramework.SqlServer.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="..\..\.dockerignore"> <Content Include="..\..\.dockerignore">
<Link>.dockerignore</Link> <Link>.dockerignore</Link>
</Content> </Content>
</ItemGroup> </ItemGroup>
</Project> </Project>
@@ -15,7 +15,7 @@
}, },
"AdminConfiguration": { "AdminConfiguration": {
"BasicConfiguration": { "BasicConfiguration": {
"Title": "Lite Charms Security", "Title": "Lite Charms Security UI",
"BasePath": "/" "BasePath": "/"
}, },
"AuthenticationConfiguration": { "AuthenticationConfiguration": {
@@ -41,7 +41,7 @@
"ProtectKeysWithAzureKeyVault": false "ProtectKeysWithAzureKeyVault": false
}, },
"ConnectionStrings": { "ConnectionStrings": {
"DataProtectionDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;" "DataProtectionDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;"
}, },
"AzureKeyVaultConfiguration": { "AzureKeyVaultConfiguration": {
"AzureKeyVaultEndpoint": "", "AzureKeyVaultEndpoint": "",
@@ -1,17 +1,19 @@
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
EXPOSE 443 EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG TARGETARCH ARG TARGETARCH
WORKDIR /app_source WORKDIR /src
COPY ["src/LiteCharmsSecurity.STS.Identity/LiteCharmsSecurity.STS.Identity.csproj", "src/LiteCharmsSecurity.STS.Identity/"]
COPY ["src/LiteCharmsSecurity.Admin.EntityFramework.Shared/LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj", "src/LiteCharmsSecurity.Admin.EntityFramework.Shared/"]
COPY ["src/LiteCharmsSecurity.Shared/LiteCharmsSecurity.Shared.csproj", "src/LiteCharmsSecurity.Shared/"]
RUN dotnet restore "src/LiteCharmsSecurity.STS.Identity/LiteCharmsSecurity.STS.Identity.csproj" --source "https://nexus.khongisa.co.za/repository/nuget-group/index.json" --verbosity detailed
COPY . . COPY . .
WORKDIR "src/LiteCharmsSecurity.STS.Identity"
RUN dotnet restore "LiteCharmsSecurity.AdminUI.sln"
WORKDIR "/app_source/src/LiteCharmsSecurity.STS.Identity"
RUN dotnet build "LiteCharmsSecurity.STS.Identity.csproj" -c Release -o /app/build RUN dotnet build "LiteCharmsSecurity.STS.Identity.csproj" -c Release -o /app/build
FROM build AS publish FROM build AS publish
@@ -1,127 +1,127 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<UserSecretsId>9c91d295-54c5-4d09-9bd6-fa56fb74011b</UserSecretsId> <UserSecretsId>9c91d295-54c5-4d09-9bd6-fa56fb74011b</UserSecretsId>
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath> <DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext> <DockerfileContext>..\..</DockerfileContext>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="10.0.0" /> <PackageReference Include="AspNet.Security.OAuth.GitHub" Version="10.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" /> <PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="9.0.0" /> <PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" /> <PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" /> <PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageReference Include="KubernetesClient" Version="19.0.2" /> <PackageReference Include="KubernetesClient" Version="19.0.2" />
<PackageReference Include="IdentityModel" Version="7.0.0" /> <PackageReference Include="IdentityModel" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.7" /> <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.7" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.7"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.7">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="10.0.7" /> <PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="10.0.7" />
<PackageReference Include="Microsoft.Identity.Web" Version="4.8.0" /> <PackageReference Include="Microsoft.Identity.Web" Version="4.8.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.7" />
<PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="7.4.7" /> <PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="7.4.7" />
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.4.7" /> <PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.4.7" />
<PackageReference Include="Serilog" Version="4.3.1" /> <PackageReference Include="Serilog" Version="4.3.1" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" /> <PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" /> <PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="10.0.0" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="10.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="10.0.0" /> <PackageReference Include="Serilog.Settings.Configuration" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" /> <PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="9.0.3" /> <PackageReference Include="Serilog.Sinks.MSSqlServer" Version="9.0.3" />
<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" /> <PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />
<PackageReference Include="Skoruba.AuditLogging.EntityFramework" Version="3.0.0" /> <PackageReference Include="Skoruba.AuditLogging.EntityFramework" Version="3.0.0" />
<PackageReference Include="NWebsec.AspNetCore.Middleware" Version="3.0.0" /> <PackageReference Include="NWebsec.AspNetCore.Middleware" Version="3.0.0" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configuration" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configuration" Version="3.0.0-rc4" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Shared.Configuration" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Shared.Configuration" Version="3.0.0-rc4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Admin.EntityFramework.Shared\LiteCharmsSecurity.Admin.EntityFramework.Shared.csproj" />
<ProjectReference Include="..\LiteCharmsSecurity.Shared\LiteCharmsSecurity.Shared.csproj" /> <ProjectReference Include="..\LiteCharmsSecurity.Shared\LiteCharmsSecurity.Shared.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.ru.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.ru.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.zh.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.zh.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.sv.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.sv.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.fi.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.fi.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.fr.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.fr.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.fa.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.fa.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.es.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.es.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.de.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.de.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.da.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.da.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.en.resx"> <EmbeddedResource Update="Resources\Views\Account\RegisterConfirmation.en.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.eot" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.eot" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.svg" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.svg" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.ttf" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.woff" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.woff" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.woff2" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\fontawesome-webfont.woff2" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\FontAwesome.otf" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\FontAwesome.otf" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.eot" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.eot" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.otf" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.otf" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.svg" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.svg" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.ttf" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.woff" /> <_ContentIncludedByDefault Remove="wwwroot\dist\fonts\open-iconic.woff" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\bundle.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\bundle.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\cerulean\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\cerulean\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\cosmo\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\cosmo\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\cyborg\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\cyborg\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\darkly\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\darkly\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\flatly\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\flatly\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\journal\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\journal\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\litera\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\litera\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\lumen\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\lumen\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\lux\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\lux\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\materia\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\materia\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\minty\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\minty\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\pulse\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\pulse\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\sandstone\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\sandstone\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\simplex\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\simplex\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\sketchy\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\sketchy\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\slate\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\slate\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\solar\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\solar\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\spacelab\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\spacelab\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\superhero\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\superhero\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\united\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\united\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\yeti\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\themes\yeti\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\web.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\web.css" />
<_ContentIncludedByDefault Remove="wwwroot\dist\css\web.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\dist\css\web.min.css" />
</ItemGroup> </ItemGroup>
</Project> </Project>
@@ -1,39 +0,0 @@
using Duende.IdentityServer.Models;
using Duende.IdentityServer.Services;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity;
using Microsoft.AspNetCore.Identity;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
namespace LiteCharmsSecurity.STS.Identity.Services;
public sealed class ClaimsInjectorProfileService(UserManager<UserIdentity> userManager) : IProfileService
{
public Task GetProfileDataAsync(ProfileDataRequestContext context)
=> GetProfileDataAsync(context, CancellationToken.None);
public async Task GetProfileDataAsync(ProfileDataRequestContext context, CancellationToken ct)
{
var user = await userManager.GetUserAsync(context.Subject);
if (user != null && !string.IsNullOrEmpty(user.Email))
{
context.IssuedClaims.Add(new Claim("email", user.Email));
context.IssuedClaims.Add(new Claim("email_verified", user.EmailConfirmed ? "true" : "false"));
if (!string.IsNullOrEmpty(user.UserName))
{
context.IssuedClaims.Add(new Claim("preferred_username", user.UserName));
}
}
}
public Task IsActiveAsync(IsActiveContext context)
=> IsActiveAsync(context, CancellationToken.None);
public async Task IsActiveAsync(IsActiveContext context, CancellationToken ct)
{
var user = await userManager.GetUserAsync(context.Subject);
context.IsActive = user != null;
}
}
+12 -14
View File
@@ -1,25 +1,24 @@
using System;
using System.Threading.Tasks;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using IdentityModel;
using Duende.IdentityServer; using Duende.IdentityServer;
using Duende.IdentityServer.Configuration; using Duende.IdentityServer.Configuration;
using HealthChecks.UI.Client;
using IdentityModel;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts; using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
using LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity; using LiteCharmsSecurity.Admin.EntityFramework.Shared.Entities.Identity;
using Skoruba.Duende.IdentityServer.Shared.Configuration.Helpers;
using LiteCharmsSecurity.STS.Identity.Configuration; using LiteCharmsSecurity.STS.Identity.Configuration;
using LiteCharmsSecurity.STS.Identity.Configuration.Constants; using LiteCharmsSecurity.STS.Identity.Configuration.Constants;
using LiteCharmsSecurity.STS.Identity.Configuration.Interfaces; using LiteCharmsSecurity.STS.Identity.Configuration.Interfaces;
using LiteCharmsSecurity.STS.Identity.Helpers; using LiteCharmsSecurity.STS.Identity.Helpers;
using LiteCharmsSecurity.STS.Identity.Passkeys; using LiteCharmsSecurity.STS.Identity.Passkeys;
using LiteCharmsSecurity.STS.Identity.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Skoruba.Duende.IdentityServer.Shared.Configuration.Helpers;
using System;
using System.Threading.Tasks;
namespace LiteCharmsSecurity.STS.Identity namespace LiteCharmsSecurity.STS.Identity
{ {
@@ -130,8 +129,7 @@ namespace LiteCharmsSecurity.STS.Identity
public virtual void RegisterAuthentication(IServiceCollection services) public virtual void RegisterAuthentication(IServiceCollection services)
{ {
services.AddAuthenticationServices<AdminIdentityDbContext, UserIdentity, UserIdentityRole>(Configuration); services.AddAuthenticationServices<AdminIdentityDbContext, UserIdentity, UserIdentityRole>(Configuration);
services.AddIdentityServer<IdentityServerConfigurationDbContext, IdentityServerPersistedGrantDbContext, UserIdentity>(Configuration) services.AddIdentityServer<IdentityServerConfigurationDbContext, IdentityServerPersistedGrantDbContext, UserIdentity>(Configuration);
.AddProfileService<ClaimsInjectorProfileService>();
} }
public virtual void RegisterAuthorization(IServiceCollection services) public virtual void RegisterAuthorization(IServiceCollection services)
@@ -1,9 +1,9 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"ConfigurationDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "ConfigurationDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"PersistedGrantDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "PersistedGrantDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"IdentityDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;", "IdentityDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;",
"DataProtectionDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;" "DataProtectionDbConnection": "Server=192.168.1.170;Port=5432;Database=skoruba;User Id=skoruba;Password=wsb7sebwm$BoZ9;application_name=litecharms_security;"
}, },
"DatabaseProviderConfiguration": { "DatabaseProviderConfiguration": {
"ProviderType": "PostgreSQL" "ProviderType": "PostgreSQL"
@@ -61,7 +61,7 @@
"ResolutionPolicy": "Username" "ResolutionPolicy": "Username"
}, },
"AdminConfiguration": { "AdminConfiguration": {
"PageTitle": "Lite Charms Security", "PageTitle": "Lite Charms IdentityServer",
"HomePageLogoUri": "~/images/skoruba-icon.svg", "HomePageLogoUri": "~/images/skoruba-icon.svg",
"FaviconUri": "~/favicon.svg", "FaviconUri": "~/favicon.svg",
"Theme": null, "Theme": null,
@@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Description>Shared common layer for the administration of the Duende IdentityServer and Asp.Net Core Identity</Description> <Description>Shared common layer for the administration of the Duende IdentityServer and Asp.Net Core Identity</Description>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" /> <PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" />
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.1" /> <PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.1" />
<PackageReference Include="Azure.Identity" Version="1.21.0" /> <PackageReference Include="Azure.Identity" Version="1.21.0" />
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.8.0" /> <PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.8.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.7" />
<PackageReference Include="Sendgrid" Version="9.29.3" /> <PackageReference Include="Sendgrid" Version="9.29.3" />
<PackageReference Include="Skoruba.Duende.IdentityServer.Admin.BusinessLogic.Identity" Version="3.0.0-rc4" /> <PackageReference Include="Skoruba.Duende.IdentityServer.Admin.BusinessLogic.Identity" Version="3.0.0-rc4" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.11" /> </ItemGroup>
</ItemGroup>
</Project> </Project>