Skip to content

Commit

Permalink
upgrade to 9
Browse files Browse the repository at this point in the history
  • Loading branch information
msmolka committed Dec 15, 2024
1 parent 23bf9b8 commit 6c52782
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 45 deletions.
38 changes: 14 additions & 24 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,21 @@ jobs:

strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
steps:
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '3.1.x'
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
9.0.x
- name: Checkout
uses: actions/checkout@v2
- name: Build with dotnet for .NET CORE 3.1
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release --framework netcoreapp3.1
- name: Build with dotnet for .NET 5.0
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release --framework net5.0
- name: Build with dotnet for .NET 6.0
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release --framework net6.0
- name: Test with dotnet for .NET CORE 3.1
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --framework netcoreapp3.1
- name: Test with dotnet for .NET 5.0
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --framework net5.0
- name: Test with dotnet for .NET 6.0
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --framework net6.0
uses: actions/checkout@v4
- name: Build
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release
- name: Test
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --configuration Release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ When you install the package, it should be added to your `.csproj`. Alternativel

```xml
<ItemGroup>
<PackageReference Include="ZNetCS.AspNetCore.Authentication.Basic" Version="6.0.1" />
<PackageReference Include="ZNetCS.AspNetCore.Authentication.Basic" Version="9.0.0" />
</ItemGroup>
```

Expand Down
5 changes: 5 additions & 0 deletions ZNetCS.AspNetCore.Authentication.Basic.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{5A300F
stylecop.json = stylecop.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{7F77A17E-B923-4666-A820-2A047B9689F1}"
ProjectSection(SolutionItems) = preProject
.github\workflows\dotnetcore.yml = .github\workflows\dotnetcore.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
12 changes: 6 additions & 6 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<Version>6.0.1</Version>
<PackageReleaseNotes>Breaking Change: Drop support for netstandard and .net framework. Code refactoring. Dependency update. Nullable enable. Events are initialized once in handler only or configuration.</PackageReleaseNotes>
<Version>9.0.0</Version>
<PackageReleaseNotes>Added support for .net core 7, 8, and 9</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -10,7 +10,7 @@
<Description>A simple basic authentication middleware.</Description>
<Authors>Marcin Smółka</Authors>
<Owners>Marcin Smółka</Owners>
<Copyright>Copyright © Marcin Smółka 2017 - 2022</Copyright>
<Copyright>Copyright © Marcin Smółka 2017 - 2024</Copyright>
<Company>Marcin Smółka zNET Computer Solutions</Company>
</PropertyGroup>

Expand Down Expand Up @@ -43,12 +43,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ public class BasicAuthenticationHandler : AuthenticationHandler<BasicAuthenticat

#region Constructors and Destructors

#if NET8_0_OR_GREATER
/// <summary>
/// Initializes a new instance of the <see cref="BasicAuthenticationHandler"/> class.
/// </summary>
/// <param name="options">
/// The options.
/// </param>
/// <param name="loggerFactory">
/// The logger factory.
/// </param>
/// <param name="encoder">
/// The encoder.
/// </param>
public BasicAuthenticationHandler(IOptionsMonitor<BasicAuthenticationOptions> options, ILoggerFactory loggerFactory, UrlEncoder encoder)
: base(options, loggerFactory, encoder)
=> this.logger = loggerFactory.CreateLogger<BasicAuthenticationHandler>();
#else
/// <summary>
/// Initializes a new instance of the <see cref="BasicAuthenticationHandler"/> class.
/// </summary>
Expand All @@ -82,7 +99,7 @@ public class BasicAuthenticationHandler : AuthenticationHandler<BasicAuthenticat
public BasicAuthenticationHandler(IOptionsMonitor<BasicAuthenticationOptions> options, ILoggerFactory loggerFactory, UrlEncoder encoder, ISystemClock clock)
: base(options, loggerFactory, encoder, clock)
=> this.logger = loggerFactory.CreateLogger<BasicAuthenticationHandler>();

#endif
#endregion

#region Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<AssemblyName>ZNetCS.AspNetCore.Authentication.Basic</AssemblyName>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Authors>Marcin Smółka</Authors>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -14,18 +14,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -36,16 +36,24 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.22" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.13" />
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.36" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.1" />
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.20" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.11" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\ZNetCS.AspNetCore.Authentication.Basic\ZNetCS.AspNetCore.Authentication.Basic.csproj" />
</ItemGroup>

</Project>
</Project>

0 comments on commit 6c52782

Please sign in to comment.