Skip to content

Commit 6c52782

Browse files
committed
upgrade to 9
1 parent 23bf9b8 commit 6c52782

File tree

7 files changed

+65
-45
lines changed

7 files changed

+65
-45
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,21 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
os: [macOS-latest, ubuntu-latest, windows-latest]
12+
os: [ubuntu-latest, windows-latest]
1313
steps:
1414
- name: Setup .NET Core 3.1
15-
uses: actions/setup-dotnet@v1
15+
uses: actions/setup-dotnet@v4
1616
with:
17-
dotnet-version: '3.1.x'
18-
- name: Setup .NET 5.0
19-
uses: actions/setup-dotnet@v1
20-
with:
21-
dotnet-version: '5.0.x'
22-
- name: Setup .NET 6.0
23-
uses: actions/setup-dotnet@v1
24-
with:
25-
dotnet-version: '6.0.x'
17+
dotnet-version: |
18+
3.1.x
19+
5.0.x
20+
6.0.x
21+
7.0.x
22+
8.0.x
23+
9.0.x
2624
- name: Checkout
27-
uses: actions/checkout@v2
28-
- name: Build with dotnet for .NET CORE 3.1
29-
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release --framework netcoreapp3.1
30-
- name: Build with dotnet for .NET 5.0
31-
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release --framework net5.0
32-
- name: Build with dotnet for .NET 6.0
33-
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release --framework net6.0
34-
- name: Test with dotnet for .NET CORE 3.1
35-
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --framework netcoreapp3.1
36-
- name: Test with dotnet for .NET 5.0
37-
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --framework net5.0
38-
- name: Test with dotnet for .NET 6.0
39-
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --framework net6.0
25+
uses: actions/checkout@v4
26+
- name: Build
27+
run: dotnet build ./src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj --configuration Release
28+
- name: Test
29+
run: dotnet test ./test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj --configuration Release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ When you install the package, it should be added to your `.csproj`. Alternativel
4040

4141
```xml
4242
<ItemGroup>
43-
<PackageReference Include="ZNetCS.AspNetCore.Authentication.Basic" Version="6.0.1" />
43+
<PackageReference Include="ZNetCS.AspNetCore.Authentication.Basic" Version="9.0.0" />
4444
</ItemGroup>
4545
```
4646

ZNetCS.AspNetCore.Authentication.Basic.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{5A300F
2626
stylecop.json = stylecop.json
2727
EndProjectSection
2828
EndProject
29+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{7F77A17E-B923-4666-A820-2A047B9689F1}"
30+
ProjectSection(SolutionItems) = preProject
31+
.github\workflows\dotnetcore.yml = .github\workflows\dotnetcore.yml
32+
EndProjectSection
33+
EndProject
2934
Global
3035
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3136
Debug|Any CPU = Debug|Any CPU

src/Directory.Build.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>6.0.1</Version>
4-
<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>
3+
<Version>9.0.0</Version>
4+
<PackageReleaseNotes>Added support for .net core 7, 8, and 9</PackageReleaseNotes>
55
</PropertyGroup>
66

77
<PropertyGroup>
@@ -10,7 +10,7 @@
1010
<Description>A simple basic authentication middleware.</Description>
1111
<Authors>Marcin Smółka</Authors>
1212
<Owners>Marcin Smółka</Owners>
13-
<Copyright>Copyright © Marcin Smółka 2017 - 2022</Copyright>
13+
<Copyright>Copyright © Marcin Smółka 2017 - 2024</Copyright>
1414
<Company>Marcin Smółka zNET Computer Solutions</Company>
1515
</PropertyGroup>
1616

@@ -43,12 +43,12 @@
4343
</ItemGroup>
4444

4545
<ItemGroup>
46-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
47-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
46+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
47+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
4848
<PrivateAssets>all</PrivateAssets>
4949
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5050
</PackageReference>
51-
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
51+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
5252
<PrivateAssets>all</PrivateAssets>
5353
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5454
</PackageReference>

src/ZNetCS.AspNetCore.Authentication.Basic/BasicAuthenticationHandler.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,23 @@ public class BasicAuthenticationHandler : AuthenticationHandler<BasicAuthenticat
6464

6565
#region Constructors and Destructors
6666

67+
#if NET8_0_OR_GREATER
68+
/// <summary>
69+
/// Initializes a new instance of the <see cref="BasicAuthenticationHandler"/> class.
70+
/// </summary>
71+
/// <param name="options">
72+
/// The options.
73+
/// </param>
74+
/// <param name="loggerFactory">
75+
/// The logger factory.
76+
/// </param>
77+
/// <param name="encoder">
78+
/// The encoder.
79+
/// </param>
80+
public BasicAuthenticationHandler(IOptionsMonitor<BasicAuthenticationOptions> options, ILoggerFactory loggerFactory, UrlEncoder encoder)
81+
: base(options, loggerFactory, encoder)
82+
=> this.logger = loggerFactory.CreateLogger<BasicAuthenticationHandler>();
83+
#else
6784
/// <summary>
6885
/// Initializes a new instance of the <see cref="BasicAuthenticationHandler"/> class.
6986
/// </summary>
@@ -82,7 +99,7 @@ public class BasicAuthenticationHandler : AuthenticationHandler<BasicAuthenticat
8299
public BasicAuthenticationHandler(IOptionsMonitor<BasicAuthenticationOptions> options, ILoggerFactory loggerFactory, UrlEncoder encoder, ISystemClock clock)
83100
: base(options, loggerFactory, encoder, clock)
84101
=> this.logger = loggerFactory.CreateLogger<BasicAuthenticationHandler>();
85-
102+
#endif
86103
#endregion
87104

88105
#region Properties

src/ZNetCS.AspNetCore.Authentication.Basic/ZNetCS.AspNetCore.Authentication.Basic.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<AssemblyName>ZNetCS.AspNetCore.Authentication.Basic</AssemblyName>
5-
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>

test/ZNetCS.AspNetCore.Authentication.BasicTests/ZNetCS.AspNetCore.Authentication.BasicTests.csproj

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Authors>Marcin Smółka</Authors>
5-
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
66
<IsPackable>false</IsPackable>
77
<LangVersion>latest</LangVersion>
88
<Nullable>enable</Nullable>
@@ -14,18 +14,18 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
18-
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
19-
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
20-
<PackageReference Include="coverlet.collector" Version="3.1.0">
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
18+
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
19+
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
20+
<PackageReference Include="coverlet.collector" Version="6.0.2">
2121
<PrivateAssets>all</PrivateAssets>
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
</PackageReference>
24-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
24+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
</PackageReference>
28-
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
28+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
2929
<PrivateAssets>all</PrivateAssets>
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3131
</PackageReference>
@@ -36,16 +36,24 @@
3636
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.22" />
3737
</ItemGroup>
3838

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

43-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
44-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.1" />
43+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
44+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.20" />
45+
</ItemGroup>
46+
47+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
48+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.11" />
49+
</ItemGroup>
50+
51+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
52+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
4553
</ItemGroup>
4654

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

51-
</Project>
59+
</Project>

0 commit comments

Comments
 (0)