Skip to content

Commit 4ec0215

Browse files
committed
Supports .NET 6 and .NET 7
1 parent 7e8029c commit 4ec0215

10 files changed

Lines changed: 102 additions & 53 deletions

File tree

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
</PropertyGroup>
6-
7-
<PropertyGroup>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
5+
<ImplicitUsings>enable</ImplicitUsings>
86
<GenerateDocumentationFile>true</GenerateDocumentationFile>
97
</PropertyGroup>
108

11-
<ItemGroup>
12-
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.11" />
13-
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="6.0.11" />
14-
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
15-
</ItemGroup>
9+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
10+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.11" />
11+
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="6.0.11" />
12+
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
13+
</ItemGroup>
14+
15+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
16+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.0" />
17+
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.0.0" />
18+
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
19+
</ItemGroup>
1620

17-
<ItemGroup>
18-
<ProjectReference Include="..\AuthPermissions\AuthPermissions.csproj" />
19-
</ItemGroup>
21+
<ItemGroup>
22+
<ProjectReference Include="..\AuthPermissions\AuthPermissions.csproj" />
23+
</ItemGroup>
2024

2125
</Project>

AuthPermissions.AspNetCore/MultiProjPack.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
<!-- See documentation for all the possible values -->
55
<metadata>
66
<id>AuthPermissions.AspNetCore</id>
7-
<version>3.5.0</version>
7+
<version>4.0.0</version>
88
<authors>Jon P Smith</authors>
99
<product>AuthPermissions.AspNetCore</product>
1010
<copyright>Copyright (c) 2021 Jon P Smith</copyright>
1111
<description>Provides extra authorization and multi-tenant features to a ASP.NET Core application.</description>
1212
<releaseNotes>
13-
- BREAKING CHANGE (small): The DisableJwtRefreshToken service has been updated to handle multiple logins from one user
14-
- BREAKING CHANGE (small): Changed TenantChangeCookieEvent name to SomethingChangedCookieEvent
15-
- Improved feature: AuthPermissionsDbContext now takes multiple IDatabaseStateChangeEvent
16-
- Improved feature: No AuthP database event change listeners will be triggered during bulk loading
13+
- Improved feature: Now supports .NET6 and .NET 7 frameworks.
14+
- Simplification (non-breaking): All tenant version now have a `DataKey` of length of 250.
1715
</releaseNotes>
1816
<license type="expression">MIT</license>
1917
<projectUrl>https://github.com/JonPSmith/AuthPermissions.AspNetCore</projectUrl>
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
6-
</PropertyGroup>
7-
8-
<PropertyGroup>
96
<GenerateDocumentationFile>true</GenerateDocumentationFile>
107
</PropertyGroup>
118

12-
<ItemGroup>
9+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
1310
<PackageReference Include="EntityFrameworkCore.Exceptions.PostgreSQL" Version="6.0.3" />
1411
<PackageReference Include="EntityFrameworkCore.Exceptions.Sqlite" Version="6.0.3" />
1512
<PackageReference Include="EntityFrameworkCore.Exceptions.SqlServer" Version="6.0.3.1" />
@@ -20,4 +17,15 @@
2017
<PackageReference Include="Net.RunMethodsSequentially" Version="2.0.0" />
2118
</ItemGroup>
2219

20+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
21+
<PackageReference Include="EntityFrameworkCore.Exceptions.PostgreSQL" Version="6.0.3" />
22+
<PackageReference Include="EntityFrameworkCore.Exceptions.Sqlite" Version="6.0.3" />
23+
<PackageReference Include="EntityFrameworkCore.Exceptions.SqlServer" Version="6.0.3.1" />
24+
<PackageReference Include="GenericServices.StatusGeneric" Version="1.2.0" />
25+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
26+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
27+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
28+
<PackageReference Include="Net.RunMethodsSequentially" Version="2.0.0" />
29+
</ItemGroup>
30+
2331
</Project>

AuthPermissions.PostgreSql/AuthPermissions.PostgreSql.csproj

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7+
</PropertyGroup>
78

8-
<ItemGroup>
9-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.11" />
10-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.7" />
11-
</ItemGroup>
9+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
10+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.11" />
11+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.7" />
12+
</ItemGroup>
13+
14+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
15+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
16+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
17+
</ItemGroup>
1218

1319
<ItemGroup>
1420
<ProjectReference Include="..\AuthPermissions.BaseCode\AuthPermissions.BaseCode.csproj" />

AuthPermissions.SqlServer/AuthPermissions.SqlServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
</PropertyGroup>
77

AuthPermissions.SupportCode/AuthPermissions.SupportCode.csproj

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
67
</PropertyGroup>
78

8-
<PropertyGroup>
9-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
10-
</PropertyGroup>
11-
12-
<ItemGroup>
9+
<ItemGroup>
1310
<PackageReference Include="DistributedLock" Version="2.3.2" />
1411
<PackageReference Include="EfCore.TestSupport" Version="5.3.0" />
1512
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
1613
<PackageReference Include="Microsoft.Graph" Version="4.37.0" />
1714
<PackageReference Include="Net.DistributedFileStoreCache" Version="2.0.0" />
1815
</ItemGroup>
1916

20-
<ItemGroup>
17+
<ItemGroup>
2118
<ProjectReference Include="..\AuthPermissions.AspNetCore\AuthPermissions.AspNetCore.csproj" />
2219
<ProjectReference Include="..\AuthPermissions.BaseCode\AuthPermissions.BaseCode.csproj" />
2320
</ItemGroup>

AuthPermissions/AuthPermissions.csproj

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
57
</PropertyGroup>
6-
7-
<PropertyGroup>
8-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9-
</PropertyGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="GenericServices.StatusGeneric" Version="1.2.0" />
8+
9+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
10+
<PackageReference Include="GenericServices.StatusGeneric" Version="1.2.0" />
1311
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.11" />
1412
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="6.0.11" />
1513
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.11" />
@@ -25,6 +23,23 @@
2523
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.7" />
2624
</ItemGroup>
2725

26+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
27+
<PackageReference Include="GenericServices.StatusGeneric" Version="1.2.0" />
28+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0" />
29+
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.0" />
30+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
31+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0" />
32+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
33+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
34+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0">
35+
<PrivateAssets>all</PrivateAssets>
36+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
37+
</PackageReference>
38+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
39+
<PackageReference Include="Net.RunMethodsSequentially" Version="2.0.0" />
40+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
41+
</ItemGroup>
42+
2843
<ItemGroup>
2944
<Folder Include="AdminCode\Services\Internal\" />
3045
</ItemGroup>

ReleaseNotes.md

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

33
## 4.0.0
44

5-
- Improved feature: Now supports .NET 7
6-
- Simplication (non-breaking): All tenant version now have a `DataKey` of length of 250.
5+
- Improved feature: Now supports .NET6 and .NET 7 frameworks.
6+
- Simplification (non-breaking): All tenant version now have a `DataKey` of length of 250.
77

88
## 3.5.0
99

Test/Test.csproj

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
5+
<ImplicitUsings>enable</ImplicitUsings>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

@@ -11,8 +11,8 @@
1111
<None Remove="TestData\combinedshardingsettings.json" />
1212
<None Remove="TestData\example3-appsettings.json" />
1313
</ItemGroup>
14-
15-
<ItemGroup>
14+
15+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
1616
<PackageReference Include="EfCore.TestSupport" Version="5.3.0" />
1717
<PackageReference Include="EntityFrameworkCore.Exceptions.SqlServer" Version="6.0.3.1" />
1818
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
@@ -33,6 +33,27 @@
3333
</PackageReference>
3434
</ItemGroup>
3535

36+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
37+
<PackageReference Include="EfCore.TestSupport" Version="5.3.0" />
38+
<PackageReference Include="EntityFrameworkCore.Exceptions.SqlServer" Version="6.0.3.1" />
39+
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
40+
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
41+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0" />
42+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
43+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
44+
<PackageReference Include="Moq" Version="4.17.2" />
45+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
46+
<PackageReference Include="xunit" Version="2.4.2" />
47+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
48+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
49+
<PrivateAssets>all</PrivateAssets>
50+
</PackageReference>
51+
<PackageReference Include="coverlet.collector" Version="3.2.0">
52+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
53+
<PrivateAssets>all</PrivateAssets>
54+
</PackageReference>
55+
</ItemGroup>
56+
3657
<ItemGroup>
3758
<ProjectReference Include="..\AuthPermissions.AspNetCore\AuthPermissions.AspNetCore.csproj" />
3859
<ProjectReference Include="..\AuthPermissions.SupportCode\AuthPermissions.SupportCode.csproj" />

Test/TestHelpers/DynamicModelCacheKeyFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Test.TestHelpers;
99

1010
public class DynamicModelCacheKeyFactory : IModelCacheKeyFactory
1111
{
12-
public object Create(DbContext context)
12+
public object Create(DbContext context, bool designTime = true)
1313
=> context is AuthPermissionsDbContext dynamicContext
1414
? (context.GetType(), dynamicContext.ProviderName)
1515
: (object)context.GetType();

0 commit comments

Comments
 (0)