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 Mar 31, 2024
1 parent 1b84056 commit 6d59fb4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 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 @@ -18,7 +18,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
2 changes: 1 addition & 1 deletion src/Middlewares/BasePathMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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);
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>
5 changes: 2 additions & 3 deletions src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Duende.IdentityServer.Hosting;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.FileProviders;
using OpenIdConnectServer;
using OpenIdConnectServer.Helpers;
using OpenIdConnectServer.JsonConverters;
Expand Down Expand Up @@ -36,7 +35,7 @@
});

builder.Services
.AddIdentityServer(options =>
.AddIdentityServerBuilder(options =>
{
var configuredOptions = Config.GetServerOptions();
MergeHelper.Merge(configuredOptions, options);
Expand Down

0 comments on commit 6d59fb4

Please sign in to comment.