Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to dotnet 8.0 #146

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading