From 2d9fa3b241ebc1e0c4cd8eaf8ba70af353555c0d Mon Sep 17 00:00:00 2001 From: wzh425 Date: Thu, 5 Dec 2024 15:58:57 +0800 Subject: [PATCH] feat: OpenIdConnect supports PostgreSQL --- Masa.Framework.sln | 11 ++++++ ...ApiResourceClaimEntityTypeConfiguration.cs | 12 +++++++ .../ApiResourceEntityTypeConfiguration.cs | 20 +++++++++++ ...ResourcePropertyEntityTypeConfiguration.cs | 13 +++++++ ...ApiResourceScopeEntityTypeConfiguration.cs | 12 +++++++ ...piResourceSecretEntityTypeConfiguration.cs | 14 ++++++++ .../ApiScopeClaimEntityTypeConfiguration.cs | 12 +++++++ .../ApiScopeEntityTypeConfiguration.cs | 18 ++++++++++ ...ApiScopePropertyEntityTypeConfiguration.cs | 13 +++++++ .../ClientClaimEntityTypeConfiguration.cs | 13 +++++++ ...ClientCorsOriginEntityTypeConfiguration.cs | 12 +++++++ .../ClientEntityTypeConfiguration.cs | 35 +++++++++++++++++++ .../ClientGrantTypeEntityTypeConfiguration.cs | 12 +++++++ ...ntIdPRestrictionEntityTypeConfiguration.cs | 12 +++++++ ...ogoutRedirectUriEntityTypeConfiguration.cs | 12 +++++++ .../ClientPropertyEntityTypeConfiguration.cs | 13 +++++++ ...lientRedirectUriEntityTypeConfiguration.cs | 12 +++++++ .../ClientScopeEntityTypeConfiguration.cs | 12 +++++++ .../ClientSecretEntityTypeConfiguration.cs | 14 ++++++++ .../DeviceFlowCodesEntityTypeConfiguration.cs | 27 ++++++++++++++ ...ityResourceClaimEntityTypeConfiguration.cs | 12 +++++++ ...IdentityResourceEntityTypeConfiguration.cs | 18 ++++++++++ ...ResourcePropertyEntityTypeConfiguration.cs | 13 +++++++ .../PersistedGrantEntityTypeConfiguration.cs | 27 ++++++++++++++ .../UserClaimEntityTypeConfiguration.cs | 14 ++++++++ ...ion.OpenIdConnect.EFCore.PostgreSql.csproj | 12 +++++++ .../OpenIdConnectEFPostgreSql.cs | 9 +++++ .../_Imports.cs | 7 ++++ 28 files changed, 411 insertions(+) create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/UserClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.csproj create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/OpenIdConnectEFPostgreSql.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/_Imports.cs diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 866922a49..cc8eb1278 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -625,6 +625,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.DynamicsCrm.Core EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.DynamicsCrm.EntityFrameworkCore", "src\Utils\DynamicsCrm\Masa.Utils.DynamicsCrm.EntityFrameworkCore\Masa.Utils.DynamicsCrm.EntityFrameworkCore.csproj", "{8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql\Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.csproj", "{F100414F-CD8D-49D4-BFE0-88D94E53E628}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2185,6 +2187,14 @@ Global {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|Any CPU.Build.0 = Release|Any CPU {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|x64.ActiveCfg = Release|Any CPU {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|x64.Build.0 = Release|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Debug|x64.ActiveCfg = Debug|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Debug|x64.Build.0 = Debug|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Release|Any CPU.Build.0 = Release|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Release|x64.ActiveCfg = Release|Any CPU + {F100414F-CD8D-49D4-BFE0-88D94E53E628}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2493,6 +2503,7 @@ Global {64B54122-44F1-4379-9422-953EF706A3A6} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} {83310F46-E1C7-4438-B32A-9F6F7EA13FCF} = {64B54122-44F1-4379-9422-953EF706A3A6} {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC} = {64B54122-44F1-4379-9422-953EF706A3A6} + {F100414F-CD8D-49D4-BFE0-88D94E53E628} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..cb11b8487 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs new file mode 100644 index 000000000..7637f57d9 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiResourceEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); + builder.Property(x => x.DisplayName).HasMaxLength(200); + builder.Property(x => x.Description).HasMaxLength(1000); + builder.Property(x => x.AllowedAccessTokenSigningAlgorithms).HasMaxLength(100); + builder.HasIndex(x => x.Name).IsUnique().HasFilter("NOT \"IsDeleted\""); + builder.HasMany(x => x.Secrets).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.ApiScopes).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.UserClaims).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.Properties).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..151287b05 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs new file mode 100644 index 000000000..e9ed459e2 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiResourceScopeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(apiResourceScope => apiResourceScope.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs new file mode 100644 index 000000000..6caf1d9d0 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiResourceSecretEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Description).HasMaxLength(1000); + builder.Property(x => x.Value).HasMaxLength(4000).IsRequired(); + builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..47400da6c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiScopeClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(apiScopeClaim => apiScopeClaim.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs new file mode 100644 index 000000000..d4db58972 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiScopeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasIndex(apiScope => apiScope.Name).IsUnique(); + + builder.Property(apiScope => apiScope.Name).HasMaxLength(200).IsRequired(); + builder.Property(apiScope => apiScope.DisplayName).HasMaxLength(200); + builder.Property(apiScope => apiScope.Description).HasMaxLength(1000); + + builder.HasMany(apiScope => apiScope.UserClaims).WithOne(apiScope => apiScope.ApiScope).HasForeignKey(apiScope => apiScope.ApiScopeId).IsRequired().OnDelete(DeleteBehavior.Cascade); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..c5d3a8435 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ApiScopePropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..456623537 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(250).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs new file mode 100644 index 000000000..493a21626 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientCorsOriginEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Origin).HasMaxLength(150).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientEntityTypeConfiguration.cs new file mode 100644 index 000000000..b465d955b --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientEntityTypeConfiguration.cs @@ -0,0 +1,35 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); + builder.Property(x => x.ProtocolType).HasMaxLength(200).IsRequired(); + builder.Property(x => x.ClientName).HasMaxLength(200); + builder.Property(x => x.ClientUri).HasMaxLength(2000); + builder.Property(x => x.LogoUri).HasMaxLength(2000); + builder.Property(x => x.Description).HasMaxLength(1000); + builder.Property(x => x.FrontChannelLogoutUri).HasMaxLength(2000); + builder.Property(x => x.BackChannelLogoutUri).HasMaxLength(2000); + builder.Property(x => x.ClientClaimsPrefix).HasMaxLength(200); + builder.Property(x => x.PairWiseSubjectSalt).HasMaxLength(200); + builder.Property(x => x.UserCodeType).HasMaxLength(100); + builder.Property(x => x.AllowedIdentityTokenSigningAlgorithms).HasMaxLength(100); + builder.HasIndex(x => x.ClientId); + builder.HasIndex(x => x.ClientId).IsUnique().HasFilter("NOT \"IsDeleted\""); + + builder.HasMany(x => x.AllowedGrantTypes).WithOne(x => x.Client); + builder.HasMany(x => x.RedirectUris).WithOne(x => x.Client); + builder.HasMany(x => x.PostLogoutRedirectUris).WithOne(x => x.Client); + builder.HasMany(x => x.AllowedScopes).WithOne(x => x.Client); + builder.HasMany(x => x.ClientSecrets).WithOne(x => x.Client); + builder.HasMany(x => x.Claims).WithOne(x => x.Client); + builder.HasMany(x => x.IdentityProviderRestrictions).WithOne(x => x.Client); + builder.HasMany(x => x.AllowedCorsOrigins).WithOne(x => x.Client); + builder.HasMany(x => x.Properties).WithOne(x => x.Client); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs new file mode 100644 index 000000000..65420d668 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientGrantTypeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.GrantType).HasMaxLength(250).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs new file mode 100644 index 000000000..13a8ab90e --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientIdPRestrictionEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Provider).HasMaxLength(200).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs new file mode 100644 index 000000000..0b9a60484 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientPostLogoutRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..4a65cb2bb --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientPropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs new file mode 100644 index 000000000..fb6bf8008 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.RedirectUri).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs new file mode 100644 index 000000000..b1d0da3dc --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientScopeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Scope).HasMaxLength(200).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs new file mode 100644 index 000000000..3e886bfe7 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class ClientSecretEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Value).HasMaxLength(4000).IsRequired(); + builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(2000); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs new file mode 100644 index 000000000..14ec6612e --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class DeviceFlowCodesEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.DeviceCode).HasMaxLength(200).IsRequired(); + builder.Property(x => x.UserCode).HasMaxLength(200).IsRequired(); + builder.Property(x => x.SubjectId).HasMaxLength(200); + builder.Property(x => x.SessionId).HasMaxLength(100); + builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(200); + builder.Property(x => x.CreationTime).IsRequired(); + builder.Property(x => x.Expiration).IsRequired(); + // 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K + // apparently anything over 4K converts to nvarchar(max) on SqlServer + builder.Property(x => x.Data).HasMaxLength(50000).IsRequired(); + + builder.HasKey(x => new { x.UserCode }); + + builder.HasIndex(x => x.DeviceCode).IsUnique().HasFilter("NOT \"IsDeleted\""); + builder.HasIndex(x => x.Expiration); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..bc895771b --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class IdentityResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(identityResourceClaim => identityResourceClaim.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs new file mode 100644 index 000000000..4ff36b8a9 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class IdentityResourceEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); + builder.Property(x => x.DisplayName).HasMaxLength(200); + builder.Property(x => x.Description).HasMaxLength(1000); + builder.HasIndex(x => x.Name).IsUnique().HasFilter("NOT \"IsDeleted\""); + + builder.HasMany(x => x.UserClaims).WithOne(x => x.IdentityResource).HasForeignKey(x => x.IdentityResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.Properties).WithOne(x => x.IdentityResource).HasForeignKey(x => x.IdentityResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..d6ca50e64 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class IdentityResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs new file mode 100644 index 000000000..cb923d693 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class PersistedGrantEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(200).ValueGeneratedNever(); + builder.Property(x => x.Type).HasMaxLength(50).IsRequired(); + builder.Property(x => x.SubjectId).HasMaxLength(200); + builder.Property(x => x.SessionId).HasMaxLength(100); + builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(200); + builder.Property(x => x.CreationTime).IsRequired(); + // 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K + // apparently anything over 4K converts to nvarchar(max) on SqlServer + builder.Property(x => x.Data).HasMaxLength(50000).IsRequired(); + + builder.HasKey(x => x.Key); + + builder.HasIndex(x => new { x.SubjectId, x.ClientId, x.Type }); + builder.HasIndex(x => new { x.SubjectId, x.SessionId, x.Type }); + builder.HasIndex(x => x.Expiration); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/UserClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/UserClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..8dc81927f --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/UserClaimEntityTypeConfiguration.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.EntityConfigurations; + +public class UserClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.Id); + builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(1000); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.csproj new file mode 100644 index 000000000..cda6548c8 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql.csproj @@ -0,0 +1,12 @@ + + + + enable + enable + + + + + + + diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/OpenIdConnectEFPostgreSql.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/OpenIdConnectEFPostgreSql.cs new file mode 100644 index 000000000..00f0e0645 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/OpenIdConnectEFPostgreSql.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql; + +public static class OpenIdConnectEFPostgreSql +{ + public static Assembly Assembly => typeof(OpenIdConnectEFPostgreSql).Assembly; +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/_Imports.cs new file mode 100644 index 000000000..0d0b3fb3c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using System.Reflection;