Skip to content

Commit

Permalink
Merge pull request #220 from skoruba/release/2.2.0
Browse files Browse the repository at this point in the history
Release/2.2.2
  • Loading branch information
skoruba authored Jun 16, 2024
2 parents f85662d + b1e1bdb commit 1426b4f
Show file tree
Hide file tree
Showing 574 changed files with 29,243 additions and 7,665 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<Version>2.1.0</Version>
<Version>2.2.2</Version>
<Authors>Jan Škoruba</Authors>
<PackageTags>Duende IdentityServer Admin OpenIDConnect OAuth2 Identity</PackageTags>
<PackageLicenseUrl>https://github.com/skoruba/Duende.IdentityServer.Admin/blob/main/LICENSE</PackageLicenseUrl>
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The application is written in the **Asp.Net Core MVC - using .NET 8.0**
- 🔒 **NOTE:** The project uses the default database migrations which affect your database, therefore double check the migrations according to your database provider and create a database backup

```sh
dotnet new install Skoruba.Duende.IdentityServer.Admin.Templates::2.1.0
dotnet new install Skoruba.Duende.IdentityServer.Admin.Templates::2.2.2
```

### Create new project:
Expand Down Expand Up @@ -768,6 +768,13 @@ It is possible to define the configuration according the client type - by defaul
- [x] Change the AdminIdentityDbContext tablenames to be derived from appsettings ([#196](https://github.com/skoruba/Duende.IdentityServer.Admin/issues/196))
- [x] Raise UserLoginSuccessEvent when logging in with 2fa or recovery code ([#202](https://github.com/skoruba/Duende.IdentityServer.Admin/issues/202))

### 2.2.2

- [x] Create a New Project `Skoruba.Duende.IdentityServer.Admin.UI.Api` to be Shipped as a NuGet Package
- [x] Fix DockerFile for All Projects for Multiplatform Builds `(linux/amd64, linux/arm64)` ([#194](https://github.com/skoruba/Duende.IdentityServer.Admin/issues/194))
- [x] Add a New API Endpoint for Dashboard View
- [x] Fix Import of dayjs for NSwag TypeScript Definition

### 3.0.0

- [ ] New UI in React and Typescript ([#182](https://github.com/skoruba/Duende.IdentityServer.Admin/issues/182))
Expand Down
7 changes: 7 additions & 0 deletions Skoruba.Duende.IdentityServer.Admin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Skoruba.Duende.IdentityServ
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Skoruba.Duende.IdentityServer.Admin.Api.UnitTests", "tests\Skoruba.Duende.IdentityServer.Admin.Api.UnitTests\Skoruba.Duende.IdentityServer.Admin.Api.UnitTests.csproj", "{976197B1-8657-4A14-8083-F933073BC550}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Skoruba.Duende.IdentityServer.Admin.UI.Api", "src\Skoruba.Duende.IdentityServer.Admin.UI.Api\Skoruba.Duende.IdentityServer.Admin.UI.Api.csproj", "{09C6ED82-ED20-464D-97AC-48A47E18804E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -157,6 +159,10 @@ Global
{976197B1-8657-4A14-8083-F933073BC550}.Debug|Any CPU.Build.0 = Debug|Any CPU
{976197B1-8657-4A14-8083-F933073BC550}.Release|Any CPU.ActiveCfg = Release|Any CPU
{976197B1-8657-4A14-8083-F933073BC550}.Release|Any CPU.Build.0 = Release|Any CPU
{09C6ED82-ED20-464D-97AC-48A47E18804E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09C6ED82-ED20-464D-97AC-48A47E18804E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09C6ED82-ED20-464D-97AC-48A47E18804E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09C6ED82-ED20-464D-97AC-48A47E18804E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -184,6 +190,7 @@ Global
{45FB23BE-A7F9-4172-8868-B5E387007644} = {2A514C8F-6A53-41CA-AB41-B644E7BC92A7}
{D49A2D61-AEEB-457C-B3BA-D1322EB2F4EC} = {EE588CE5-51D0-4E98-A2B3-40EC8E655931}
{976197B1-8657-4A14-8083-F933073BC550} = {0BC0CC4E-A0F1-45E8-B41A-AE0FA76BF3E5}
{09C6ED82-ED20-464D-97AC-48A47E18804E} = {588205D4-3A30-4DA4-849D-C7422C396DAA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B3166EDE-037B-4C68-BEBA-5DE9C5E3DB82}
Expand Down
3 changes: 3 additions & 0 deletions build/create-nuget-packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ dotnet pack .\..\src\Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configu

# UI
dotnet pack .\..\src\Skoruba.Duende.IdentityServer.Admin.UI\Skoruba.Duende.IdentityServer.Admin.UI.csproj -c Release -o $packagesOutput

# API
dotnet pack .\..\src\Skoruba.Duende.IdentityServer.Admin.UI.Api\Skoruba.Duende.IdentityServer.Admin.UI.Api.csproj -c Release -o $packagesOutput
21 changes: 6 additions & 15 deletions build/publish-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,20 @@

# Ensure a version is provided
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
echo "Usage: $0 <version> <platforms>"
exit 1
fi

version=$1
platforms=${2:-linux/amd64,linux/arm64} # Default to linux/amd64 and linux/arm64 if not provided

# Ensure buildx is set up
docker buildx create --use

# Change directory to the project root
cd ..

# Build docker images with platform specified and load them into the local Docker image store
docker buildx build --platform linux/amd64 -t skoruba-duende-identityserver-admin:latest --load -f src/Skoruba.Duende.IdentityServer.Admin/Dockerfile .
docker buildx build --platform linux/amd64 -t skoruba-duende-identityserver-admin-api:latest --load -f src/Skoruba.Duende.IdentityServer.Admin.Api/Dockerfile .
docker buildx build --platform linux/amd64 -t skoruba-duende-identityserver-sts-identity:latest --load -f src/Skoruba.Duende.IdentityServer.STS.Identity/Dockerfile .

# Rename images with the specified tag
docker tag skoruba-duende-identityserver-admin:latest skoruba/duende-identityserver-admin:$version
docker tag skoruba-duende-identityserver-admin-api:latest skoruba/duende-identityserver-admin-api:$version
docker tag skoruba-duende-identityserver-sts-identity:latest skoruba/duende-identityserver-sts-identity:$version

# Push to Docker Hub
docker push skoruba/duende-identityserver-admin:$version
docker push skoruba/duende-identityserver-admin-api:$version
docker push skoruba/duende-identityserver-sts-identity:$version
# Build and push docker images with platforms specified
docker buildx build --platform $platforms -t skoruba/duende-identityserver-admin:latest -t skoruba/duende-identityserver-admin:$version --push --no-cache -f src/Skoruba.Duende.IdentityServer.Admin/Dockerfile .
docker buildx build --platform $platforms -t skoruba/duende-identityserver-admin-api:latest -t skoruba/duende-identityserver-admin-api:$version --push --no-cache -f src/Skoruba.Duende.IdentityServer.Admin.Api/Dockerfile .
docker buildx build --platform $platforms -t skoruba/duende-identityserver-sts-identity:latest -t skoruba/duende-identityserver-sts-identity:$version --push --no-cache -f src/Skoruba.Duende.IdentityServer.STS.Identity/Dockerfile .
3 changes: 2 additions & 1 deletion build/publish-nuget-packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ dotnet nuget push ./packages/Skoruba.Duende.IdentityServer.Admin.EntityFramework
dotnet nuget push ./packages/Skoruba.Duende.IdentityServer.Admin.EntityFramework.Configuration.$version.nupkg -k $key -s https://api.nuget.org/v3/index.json
dotnet nuget push ./packages/Skoruba.Duende.IdentityServer.Shared.Configuration.$version.nupkg -k $key -s https://api.nuget.org/v3/index.json

dotnet nuget push ./packages/Skoruba.Duende.IdentityServer.Admin.UI.$version.nupkg -k $key -s https://api.nuget.org/v3/index.json
dotnet nuget push ./packages/Skoruba.Duende.IdentityServer.Admin.UI.$version.nupkg -k $key -s https://api.nuget.org/v3/index.json
dotnet nuget push ./packages/Skoruba.Duende.IdentityServer.Admin.UI.Api.$version.nupkg -k $key -s https://api.nuget.org/v3/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using NSwag;
using NSwag.Generation.Processors.Security;
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Configuration;
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Configuration.Authorization;

namespace Skoruba.Duende.IdentityServer.Admin.Api.Configuration;

public static class StartupHelpers
{
public static void AddSwaggerServices(this IServiceCollection services, AdminApiConfiguration adminApiConfiguration)
{
services.AddEndpointsApiExplorer();
services.AddOpenApiDocument(configure =>
{
configure.Title = adminApiConfiguration.ApiName;
configure.Version = adminApiConfiguration.ApiVersion;
configure.AddSecurity("OAuth2", new OpenApiSecurityScheme
{
Type = OpenApiSecuritySchemeType.OAuth2,
Flows = new OpenApiOAuthFlows
{
AuthorizationCode = new OpenApiOAuthFlow
{
AuthorizationUrl = $"{adminApiConfiguration.IdentityServerBaseUrl}/connect/authorize",
TokenUrl = $"{adminApiConfiguration.IdentityServerBaseUrl}/connect/token",
Scopes = new Dictionary<string, string>
{
{ adminApiConfiguration.OidcApiName, adminApiConfiguration.ApiName }
}
}
}
});
configure.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("OAuth2"));
configure.OperationProcessors.Add(new AuthorizeCheckOperationProcessor(adminApiConfiguration));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Skoruba.Duende.IdentityServer.Admin.Api.Helpers;
using Skoruba.Duende.IdentityServer.Admin.Api.Middlewares;
using Skoruba.Duende.IdentityServer.Admin.EntityFramework.Shared.DbContexts;
using Skoruba.Duende.IdentityServer.Admin.EntityFramework.Shared.Entities.Identity;
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Helpers;
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Middlewares;

namespace Skoruba.Duende.IdentityServer.Admin.Api.Configuration.Test
{
Expand Down
13 changes: 8 additions & 5 deletions src/Skoruba.Duende.IdentityServer.Admin.Api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG TARGETARCH
WORKDIR /src

COPY ["src/Skoruba.Duende.IdentityServer.Admin.Api/Skoruba.Duende.IdentityServer.Admin.Api.csproj", "src/Skoruba.Duende.IdentityServer.Admin.Api/"]
COPY ["src/Skoruba.Duende.IdentityServer.Admin.EntityFramework.PostgreSQL/Skoruba.Duende.IdentityServer.Admin.EntityFramework.PostgreSQL.csproj", "src/Skoruba.Duende.IdentityServer.Admin.EntityFramework.PostgreSQL/"]
COPY ["src/Skoruba.Duende.IdentityServer.Admin.EntityFramework.Shared/Skoruba.Duende.IdentityServer.Admin.EntityFramework.Shared.csproj", "src/Skoruba.Duende.IdentityServer.Admin.EntityFramework.Shared/"]
Expand All @@ -19,16 +21,17 @@ COPY ["src/Skoruba.Duende.IdentityServer.Admin.EntityFramework.MySql/Skoruba.Due
COPY ["src/Skoruba.Duende.IdentityServer.Admin.EntityFramework.SqlServer/Skoruba.Duende.IdentityServer.Admin.EntityFramework.SqlServer.csproj", "src/Skoruba.Duende.IdentityServer.Admin.EntityFramework.SqlServer/"]
COPY ["src/Skoruba.Duende.IdentityServer.Shared/Skoruba.Duende.IdentityServer.Shared.csproj", "src/Skoruba.Duende.IdentityServer.Shared/"]
COPY ["src/Skoruba.Duende.IdentityServer.Admin.BusinessLogic/Skoruba.Duende.IdentityServer.Admin.BusinessLogic.csproj", "src/Skoruba.Duende.IdentityServer.Admin.BusinessLogic/"]
RUN dotnet restore "src/Skoruba.Duende.IdentityServer.Admin.Api/Skoruba.Duende.IdentityServer.Admin.Api.csproj"

RUN dotnet restore -a $TARGETARCH "src/Skoruba.Duende.IdentityServer.Admin.Api/Skoruba.Duende.IdentityServer.Admin.Api.csproj"
COPY . .
WORKDIR "/src/src/Skoruba.Duende.IdentityServer.Admin.Api"
RUN dotnet build "Skoruba.Duende.IdentityServer.Admin.Api.csproj" -c Release -o /app/build
RUN dotnet build -a $TARGETARCH "Skoruba.Duende.IdentityServer.Admin.Api.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Skoruba.Duende.IdentityServer.Admin.Api.csproj" -c Release -o /app/publish
RUN dotnet publish -a $TARGETARCH "Skoruba.Duende.IdentityServer.Admin.Api.csproj" -c Release --no-restore -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
ENTRYPOINT ["dotnet", "Skoruba.Duende.IdentityServer.Admin.Api.dll"]
ENTRYPOINT ["dotnet", "Skoruba.Duende.IdentityServer.Admin.Api.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="8.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="8.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.OpenIdConnectServer" Version="8.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="8.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="8.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.0" />
<PackageReference Include="AutoMapper" Version="13.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.3.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.5.1" />
<PackageReference Include="Serilog.Sinks.Seq" Version="6.0.0" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.EntityFramework.MySql\Skoruba.Duende.IdentityServer.Admin.EntityFramework.MySql.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.EntityFramework.PostgreSQL\Skoruba.Duende.IdentityServer.Admin.EntityFramework.PostgreSQL.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.EntityFramework.SqlServer\Skoruba.Duende.IdentityServer.Admin.EntityFramework.SqlServer.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.UI.Api\Skoruba.Duende.IdentityServer.Admin.UI.Api.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Shared\Skoruba.Duende.IdentityServer.Shared.csproj" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="NSwag.CodeGeneration" Version="14.0.7" />
<PackageReference Include="NSwag.CodeGeneration.TypeScript" Version="14.0.7" />
<PackageReference Include="NSwag.Generation" Version="14.0.7" />
Expand All @@ -49,36 +30,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.BusinessLogic.Identity\Skoruba.Duende.IdentityServer.Admin.BusinessLogic.Identity.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.BusinessLogic\Skoruba.Duende.IdentityServer.Admin.BusinessLogic.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.EntityFramework.MySql\Skoruba.Duende.IdentityServer.Admin.EntityFramework.MySql.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.EntityFramework.PostgreSQL\Skoruba.Duende.IdentityServer.Admin.EntityFramework.PostgreSQL.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Admin.EntityFramework.SqlServer\Skoruba.Duende.IdentityServer.Admin.EntityFramework.SqlServer.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Shared.Configuration\Skoruba.Duende.IdentityServer.Shared.Configuration.csproj" />
<ProjectReference Include="..\Skoruba.Duende.IdentityServer.Shared\Skoruba.Duende.IdentityServer.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources\ApiErrorResource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ApiErrorResource.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resources\ApiErrorResource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ApiErrorResource.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Dtos\Key\" />
</ItemGroup>


<Target Name="NSwag" BeforeTargets="AfterBuild" Condition="'$(Configuration)'=='Debug'">
<Exec ConsoleToMSBuild="true" ContinueOnError="true" Command="$(NSwagExe_Net80) run nswag.json /variables:Configuration=$(Configuration)">
<Output TaskParameter="ExitCode" PropertyName="NSwagExitCode" />
Expand All @@ -88,6 +40,7 @@
<Message Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' == '0'" Importance="low" />
<Error Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' != '0'" />
</Target>


</Project>

Expand Down
Loading

0 comments on commit 1426b4f

Please sign in to comment.