Skip to content

Commit

Permalink
chore: upgrade to dotnet 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AleF83 committed Apr 1, 2024
1 parent 55dc46f commit bf4ea20
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build
FROM mcr.microsoft.com/dotnet/sdk:6.0 as source
FROM mcr.microsoft.com/dotnet/sdk:8.0 as source
ARG target="Release"

RUN apt-get update && apt-get install unzip -y
Expand All @@ -19,7 +19,7 @@ RUN dotnet publish -c $target -o obj/docker/publish
RUN cp -r /src/obj/docker/publish /OpenIdConnectServerMock

# Stage 2: Release
FROM mcr.microsoft.com/dotnet/aspnet:6.0 as release
FROM mcr.microsoft.com/dotnet/aspnet:8.0 as release
ARG target="Release"

RUN apt-get update && apt-get install curl -y && rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/OptionsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public static void ConfigureOptions<T>(string optionsStr)
var targetFields = typeof(T).GetFields();
var jValueValueProp = typeof(JValue).GetProperty(nameof(JValue.Value));
Array.ForEach(targetFields, k => {
if (options.ContainsKey(k.Name)) {
if (options != null && options.ContainsKey(k.Name)) {
var fieldJValue = options[k.Name] as JValue;
var fieldValue = jValueValueProp.GetValue(fieldJValue);
var fieldValue = jValueValueProp?.GetValue(fieldJValue);
k.SetValue(null, fieldValue);
}
});
Expand Down
5 changes: 3 additions & 2 deletions src/Middlewares/BasePathMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Duende.IdentityServer.Extensions;
using Duende.IdentityServer.Configuration;
using Duende.IdentityServer.Services;

#pragma warning disable 1591

Expand All @@ -20,10 +21,10 @@ public async Task Invoke(HttpContext context)
{
var basePath = Config.GetAspNetServicesOptions().BasePath;
var request = context.Request;
if(request.Path.Value.Length > basePath.Length)
if(request.Path.Value?.Length > basePath.Length)
{
request.Path = request.Path.Value.Substring(basePath.Length);
context.SetIdentityServerBasePath(basePath);
context.RequestServices.GetRequiredService<IServerUrls>().BasePath = basePath;
}
await _next(context);
}
Expand Down
12 changes: 6 additions & 6 deletions src/OpenIdConnectServerMock.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
Expand All @@ -26,11 +26,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer" Version="6.3.6" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.24" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.24" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="YamlDotNet" Version="13.7.0" />
<PackageReference Include="Duende.IdentityServer" Version="7.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.3" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="YamlDotNet" Version="15.1.2" />
</ItemGroup>

</Project>

0 comments on commit bf4ea20

Please sign in to comment.