diff --git a/EShopOnAbp.sln b/EShopOnAbp.sln index 62905513..90d932d1 100644 --- a/EShopOnAbp.sln +++ b/EShopOnAbp.sln @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.AdministrationSe EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.SaasService.HttpApi.Host", "services\saas\src\EShopOnAbp.SaasService.HttpApi.Host\EShopOnAbp.SaasService.HttpApi.Host.csproj", "{9203C6CC-F491-4A9F-93B3-3BEA018D87B4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.IdentityService.HttpApi.Host", "services\identity\src\EShopOnAbp.IdentityService.HttpApi.Host\EShopOnAbp.IdentityService.HttpApi.Host.csproj", "{FDFCA1B4-FD9D-445C-8655-3DF3F2D57CEA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -35,6 +37,7 @@ Global {49DDB3F1-6200-445E-9A0D-0339E31D5D77} = {B8B59303-2178-459B-91A8-DF353044E090} {0FA9667E-6A08-4EFF-8CAF-D2A3C3C1FBBD} = {F415FFFD-E52D-4EBE-98DC-067C1EFFFFE3} {9203C6CC-F491-4A9F-93B3-3BEA018D87B4} = {F415FFFD-E52D-4EBE-98DC-067C1EFFFFE3} + {FDFCA1B4-FD9D-445C-8655-3DF3F2D57CEA} = {F415FFFD-E52D-4EBE-98DC-067C1EFFFFE3} EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {09F9A583-778D-4940-83B0-958C5D4E6D52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -65,5 +68,9 @@ Global {9203C6CC-F491-4A9F-93B3-3BEA018D87B4}.Debug|Any CPU.Build.0 = Debug|Any CPU {9203C6CC-F491-4A9F-93B3-3BEA018D87B4}.Release|Any CPU.ActiveCfg = Release|Any CPU {9203C6CC-F491-4A9F-93B3-3BEA018D87B4}.Release|Any CPU.Build.0 = Release|Any CPU + {FDFCA1B4-FD9D-445C-8655-3DF3F2D57CEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDFCA1B4-FD9D-445C-8655-3DF3F2D57CEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDFCA1B4-FD9D-445C-8655-3DF3F2D57CEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDFCA1B4-FD9D-445C-8655-3DF3F2D57CEA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/services/identity/EShopOnAbp.IdentityService.sln b/services/identity/EShopOnAbp.IdentityService.sln new file mode 100644 index 00000000..fc6a031a --- /dev/null +++ b/services/identity/EShopOnAbp.IdentityService.sln @@ -0,0 +1,109 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29020.237 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.Domain", "src\EShopOnAbp.IdentityService.Domain\EShopOnAbp.IdentityService.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.Application", "src\EShopOnAbp.IdentityService.Application\EShopOnAbp.IdentityService.Application.csproj", "{1A94A50E-06DC-43C1-80B5-B662820EC3EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.EntityFrameworkCore", "src\EShopOnAbp.IdentityService.EntityFrameworkCore\EShopOnAbp.IdentityService.EntityFrameworkCore.csproj", "{C956DD76-69C8-4A9C-83EA-D17DF83340FD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CA9AC87F-097E-4F15-8393-4BC07735A5B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04DBDB01-70F4-4E06-B468-8F87850B22BE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.Application.Tests", "test\EShopOnAbp.IdentityService.Application.Tests\EShopOnAbp.IdentityService.Application.Tests.csproj", "{50B2631D-129C-47B3-A587-029CCD6099BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.Domain.Shared", "src\EShopOnAbp.IdentityService.Domain.Shared\EShopOnAbp.IdentityService.Domain.Shared.csproj", "{42F719ED-8413-4895-B5B4-5AB56079BC66}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.Application.Contracts", "src\EShopOnAbp.IdentityService.Application.Contracts\EShopOnAbp.IdentityService.Application.Contracts.csproj", "{520659C8-C734-4298-A3DA-B539DB9DFC0B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.HttpApi", "src\EShopOnAbp.IdentityService.HttpApi\EShopOnAbp.IdentityService.HttpApi.csproj", "{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.HttpApi.Client", "src\EShopOnAbp.IdentityService.HttpApi.Client\EShopOnAbp.IdentityService.HttpApi.Client.csproj", "{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.EntityFrameworkCore.Tests", "test\EShopOnAbp.IdentityService.EntityFrameworkCore.Tests\EShopOnAbp.IdentityService.EntityFrameworkCore.Tests.csproj", "{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.TestBase", "test\EShopOnAbp.IdentityService.TestBase\EShopOnAbp.IdentityService.TestBase.csproj", "{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.Domain.Tests", "test\EShopOnAbp.IdentityService.Domain.Tests\EShopOnAbp.IdentityService.Domain.Tests.csproj", "{E512F4D9-9375-480F-A2F6-A46509F9D824}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.IdentityService.HttpApi.Host", "src\EShopOnAbp.IdentityService.HttpApi.Host\EShopOnAbp.IdentityService.HttpApi.Host.csproj", "{748584B1-BA69-4F6A-81AA-F4BDE6BCE29D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.Build.0 = Release|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.Build.0 = Release|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.Build.0 = Release|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.Build.0 = Release|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.Build.0 = Release|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.Build.0 = Release|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.Build.0 = Release|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.Build.0 = Release|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.Build.0 = Release|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.Build.0 = Release|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.Build.0 = Release|Any CPU + {748584B1-BA69-4F6A-81AA-F4BDE6BCE29D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {748584B1-BA69-4F6A-81AA-F4BDE6BCE29D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {748584B1-BA69-4F6A-81AA-F4BDE6BCE29D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {748584B1-BA69-4F6A-81AA-F4BDE6BCE29D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {554AD327-6DBA-4F8F-96F8-81CE7A0C863F} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {1A94A50E-06DC-43C1-80B5-B662820EC3EB} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {C956DD76-69C8-4A9C-83EA-D17DF83340FD} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {42F719ED-8413-4895-B5B4-5AB56079BC66} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {520659C8-C734-4298-A3DA-B539DB9DFC0B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {4164BDF7-F527-4E85-9CE6-E3C2D7426A27} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {3B5A0094-670D-4BB1-BFDD-61B88A8773DC} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {91853F21-9CD9-4132-BC29-A7D5D84FFFE7} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {E512F4D9-9375-480F-A2F6-A46509F9D824} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} + {748584B1-BA69-4F6A-81AA-F4BDE6BCE29D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6AAFA1C6-603E-13FA-45E5-7910AA9F661D} + EndGlobalSection +EndGlobal diff --git a/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/EShopOnAbp.IdentityService.Application.Contracts.csproj b/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/EShopOnAbp.IdentityService.Application.Contracts.csproj new file mode 100644 index 00000000..f8cc8be9 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/EShopOnAbp.IdentityService.Application.Contracts.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/IdentityServiceApplicationContractsModule.cs b/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/IdentityServiceApplicationContractsModule.cs new file mode 100644 index 00000000..80694f3d --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/IdentityServiceApplicationContractsModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Account; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(IdentityServiceDomainSharedModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule) + )] + public class IdentityServiceApplicationContractsModule : AbpModule + { + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/IdentityServiceRemoteServiceConsts.cs b/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/IdentityServiceRemoteServiceConsts.cs new file mode 100644 index 00000000..231360db --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/IdentityServiceRemoteServiceConsts.cs @@ -0,0 +1,7 @@ +namespace EShopOnAbp.IdentityService +{ + public class IdentityServiceRemoteServiceConsts + { + public const string RemoteServiceName = "IdentityService"; + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Application/EShopOnAbp.IdentityService.Application.csproj b/services/identity/src/EShopOnAbp.IdentityService.Application/EShopOnAbp.IdentityService.Application.csproj new file mode 100644 index 00000000..838a11ca --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Application/EShopOnAbp.IdentityService.Application.csproj @@ -0,0 +1,18 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.Application/IdentityServiceApplicationModule.cs b/services/identity/src/EShopOnAbp.IdentityService.Application/IdentityServiceApplicationModule.cs new file mode 100644 index 00000000..4e7b05e3 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Application/IdentityServiceApplicationModule.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.AutoMapper; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(IdentityServiceDomainModule), + typeof(IdentityServiceApplicationContractsModule), + typeof(AbpAccountApplicationModule), + typeof(AbpIdentityApplicationModule) + )] + public class IdentityServiceApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/EShopOnAbp.IdentityService.Domain.Shared.csproj b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/EShopOnAbp.IdentityService.Domain.Shared.csproj new file mode 100644 index 00000000..ebae7c26 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/EShopOnAbp.IdentityService.Domain.Shared.csproj @@ -0,0 +1,22 @@ + + + + netstandard2.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceDomainErrorCodes.cs b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceDomainErrorCodes.cs new file mode 100644 index 00000000..dd134edd --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceDomainErrorCodes.cs @@ -0,0 +1,7 @@ +namespace EShopOnAbp.IdentityService +{ + public static class IdentityServiceDomainErrorCodes + { + /* You can add your business exception error codes here, as constants */ + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceDomainSharedModule.cs b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceDomainSharedModule.cs new file mode 100644 index 00000000..8cd6fe24 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceDomainSharedModule.cs @@ -0,0 +1,41 @@ +using EShopOnAbp.IdentityService.Localization; +using Volo.Abp.Identity; +using Volo.Abp.IdentityServer; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(AbpIdentityDomainSharedModule), + typeof(AbpIdentityServerDomainSharedModule) + )] + public class IdentityServiceDomainSharedModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + IdentityServiceModuleExtensionConfigurator.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/IdentityService"); + + options.DefaultResourceType = typeof(IdentityServiceResource); + }); + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceModuleExtensionConfigurator.cs b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceModuleExtensionConfigurator.cs new file mode 100644 index 00000000..493336a1 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/IdentityServiceModuleExtensionConfigurator.cs @@ -0,0 +1,72 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace EShopOnAbp.IdentityService +{ + public static class IdentityServiceModuleExtensionConfigurator + { + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + ConfigureExistingProperties(); + ConfigureExtraProperties(); + }); + } + + private static void ConfigureExistingProperties() + { + /* You can change max lengths for properties of the + * entities defined in the modules used by your application. + * + * Example: Change user and role name max lengths + + IdentityUserConsts.MaxNameLength = 99; + IdentityRoleConsts.MaxNameLength = 99; + + * Notice: It is not suggested to change property lengths + * unless you really need it. Go with the standard values wherever possible. + * + * If you are using EF Core, you will need to run the add-migration command after your changes. + */ + } + + private static void ConfigureExtraProperties() + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to define these extra properties + * with a high level, easy to use API. + * + * Example: Add a new property to the user entity of the identity module + + ObjectExtensionManager.Instance.Modules() + .ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( //property type: string + "SocialSecurityNumber", //property name + property => + { + //validation rules + property.Attributes.Add(new RequiredAttribute()); + property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); + + //...other configurations for this property + } + ); + }); + }); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions + */ + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/ar.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/ar.json new file mode 100644 index 00000000..05cb96a9 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/ar.json @@ -0,0 +1,8 @@ +{ + "culture": "ar", + "texts": { + "Menu:Home": "الرئيسية", + "Welcome": "مرحبا", + "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/cs.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/cs.json new file mode 100644 index 00000000..5a0bbf61 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/cs.json @@ -0,0 +1,8 @@ +{ + "culture": "cs", + "texts": { + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/de-DE.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/de-DE.json new file mode 100644 index 00000000..aca4528c --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/de-DE.json @@ -0,0 +1,8 @@ +{ + "culture": "de-DE", + "texts": { + "Menu:Home": "Home", + "Welcome": "Willkommen", + "LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/en-GB.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/en-GB.json new file mode 100644 index 00000000..d2ca0793 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/en-GB.json @@ -0,0 +1,8 @@ +{ + "culture": "en-GB", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/en.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/en.json new file mode 100644 index 00000000..d2a6a983 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/en.json @@ -0,0 +1,8 @@ +{ + "culture": "en", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/es.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/es.json new file mode 100644 index 00000000..31b4b59e --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/es.json @@ -0,0 +1,8 @@ +{ + "culture": "es", + "texts": { + "Menu:Home": "Inicio", + "Welcome": "Bienvenido", + "LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/fr.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/fr.json new file mode 100644 index 00000000..e76eac0c --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/fr.json @@ -0,0 +1,8 @@ +{ + "culture": "fr", + "texts": { + "Menu:Home": "Accueil", + "Welcome": "Bienvenue", + "LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/hu.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/hu.json new file mode 100644 index 00000000..c7b6a33a --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/hu.json @@ -0,0 +1,8 @@ +{ + "culture": "hu", + "texts": { + "Menu:Home": "Kezdőlap", + "Welcome": "Üdvözlöm", + "LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/nl.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/nl.json new file mode 100644 index 00000000..9ba8da47 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/nl.json @@ -0,0 +1,8 @@ +{ + "culture": "nl", + "texts": { + "Menu:Home": "Home", + "Welcome": "Welkom", + "LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/pl-PL.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/pl-PL.json new file mode 100644 index 00000000..33412f30 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/pl-PL.json @@ -0,0 +1,8 @@ +{ + "culture": "pl-PL", + "texts": { + "Menu:Home": "Home", + "Welcome": "Witaj", + "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/pt-BR.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/pt-BR.json new file mode 100644 index 00000000..8c818a07 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/pt-BR.json @@ -0,0 +1,8 @@ +{ + "culture": "pt-BR", + "texts": { + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/ru.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/ru.json new file mode 100644 index 00000000..8464e443 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/ru.json @@ -0,0 +1,8 @@ +{ + "culture": "ru", + "texts": { + "Menu:Home": "Главная", + "Welcome": "Добро пожаловать", + "LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io." + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/sl.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/sl.json new file mode 100644 index 00000000..a066ef26 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/sl.json @@ -0,0 +1,8 @@ +{ + "culture": "sl", + "texts": { + "Menu:Home": "Domov", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io." + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/tr.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/tr.json new file mode 100644 index 00000000..5bf83ee7 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/tr.json @@ -0,0 +1,8 @@ +{ + "culture": "tr", + "texts": { + "Menu:Home": "Ana sayfa", + "Welcome": "Hoşgeldiniz", + "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/vi.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/vi.json new file mode 100644 index 00000000..c115a357 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/vi.json @@ -0,0 +1,8 @@ +{ + "culture": "vi", + "texts": { + "Menu:Home": "Trang chủ", + "Welcome": "Chào mừng bạn", + "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/zh-Hans.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/zh-Hans.json new file mode 100644 index 00000000..23790bde --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/zh-Hans.json @@ -0,0 +1,8 @@ +{ + "culture": "zh-Hans", + "texts": { + "Menu:Home": "首页", + "Welcome": "欢迎", + "LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 abp.io." + } + } \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/zh-Hant.json b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/zh-Hant.json new file mode 100644 index 00000000..31e0ab5a --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityService/zh-Hant.json @@ -0,0 +1,8 @@ +{ + "culture": "zh-Hant", + "texts": { + "Menu:Home": "首頁", + "Welcome": "歡迎", + "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io." + } + } \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityServiceResource.cs b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityServiceResource.cs new file mode 100644 index 00000000..2702a6c9 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/Localization/IdentityServiceResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace EShopOnAbp.IdentityService.Localization +{ + [LocalizationResourceName("IdentityService")] + public class IdentityServiceResource + { + + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain/EShopOnAbp.IdentityService.Domain.csproj b/services/identity/src/EShopOnAbp.IdentityService.Domain/EShopOnAbp.IdentityService.Domain.csproj new file mode 100644 index 00000000..25b24f9f --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain/EShopOnAbp.IdentityService.Domain.csproj @@ -0,0 +1,17 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain/IdentityServiceDbProperties.cs b/services/identity/src/EShopOnAbp.IdentityService.Domain/IdentityServiceDbProperties.cs new file mode 100644 index 00000000..4a514392 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain/IdentityServiceDbProperties.cs @@ -0,0 +1,15 @@ +namespace EShopOnAbp.IdentityService +{ + public static class IdentityServiceDbProperties + { + public static string DbTablePrefix { get; set; } = ""; + + public static string DbSchema { get; set; } = null; + + public const string ConnectionStringName = "IdentityService"; + + public const string DefaultAdminEmailAddress = "admin@abp.io"; + + public const string DefaultAdminPassword = "1q2w3E*"; + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.Domain/IdentityServiceDomainModule.cs b/services/identity/src/EShopOnAbp.IdentityService.Domain/IdentityServiceDomainModule.cs new file mode 100644 index 00000000..609aa10d --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.Domain/IdentityServiceDomainModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Identity; +using Volo.Abp.IdentityServer; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(IdentityServiceDomainSharedModule), + typeof(AbpIdentityDomainModule), + typeof(AbpIdentityServerDomainModule) + )] + public class IdentityServiceDomainModule : AbpModule + { + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EShopOnAbp.IdentityService.EntityFrameworkCore.csproj b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EShopOnAbp.IdentityService.EntityFrameworkCore.csproj new file mode 100644 index 00000000..59c298d0 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EShopOnAbp.IdentityService.EntityFrameworkCore.csproj @@ -0,0 +1,25 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContext.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContext.cs new file mode 100644 index 00000000..a0a695f4 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContext.cs @@ -0,0 +1,72 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.IdentityServer.ApiScopes; +using Volo.Abp.IdentityServer.Clients; +using Volo.Abp.IdentityServer.Devices; +using Volo.Abp.IdentityServer.EntityFrameworkCore; +using Volo.Abp.IdentityServer.Grants; +using Volo.Abp.IdentityServer.IdentityResources; + +namespace EShopOnAbp.IdentityService.EntityFrameworkCore +{ + /* This is your actual DbContext used on runtime. + * It includes only your entities. + * It does not include entities of the used modules, because each module has already + * its own DbContext class. If you want to share some database tables with the used modules, + * just create a structure like done for AppUser. + * + * Don't use this DbContext for database migrations since it does not contain tables of the + * used modules (as explained above). See IdentityServiceMigrationsDbContext for migrations. + */ + [ConnectionStringName(IdentityServiceDbProperties.ConnectionStringName)] + public class IdentityServiceDbContext : AbpDbContext, IIdentityDbContext, + IIdentityServerDbContext + { + public DbSet Users { get; } + public DbSet Roles { get; } + public DbSet ClaimTypes { get; } + public DbSet OrganizationUnits { get; } + public DbSet SecurityLogs { get; } + public DbSet LinkUsers { get; } + public DbSet ApiResources { get; } + public DbSet ApiResourceSecrets { get; } + public DbSet ApiResourceClaims { get; } + public DbSet ApiResourceScopes { get; } + public DbSet ApiResourceProperties { get; } + public DbSet ApiScopes { get; } + public DbSet ApiScopeClaims { get; } + public DbSet ApiScopeProperties { get; } + public DbSet IdentityResources { get; } + public DbSet IdentityClaims { get; } + public DbSet IdentityResourceProperties { get; } + public DbSet Clients { get; } + public DbSet ClientGrantTypes { get; } + public DbSet ClientRedirectUris { get; } + public DbSet ClientPostLogoutRedirectUris { get; } + public DbSet ClientScopes { get; } + public DbSet ClientSecrets { get; } + public DbSet ClientClaims { get; } + public DbSet ClientIdPRestrictions { get; } + public DbSet ClientCorsOrigins { get; } + public DbSet ClientProperties { get; } + public DbSet PersistedGrants { get; } + public DbSet DeviceFlowCodes { get; } + + public IdentityServiceDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureIdentity(); + builder.ConfigureIdentityServer(); + } + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContextFactory.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContextFactory.cs new file mode 100644 index 00000000..26113817 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContextFactory.cs @@ -0,0 +1,46 @@ +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace EShopOnAbp.IdentityService.EntityFrameworkCore +{ + /* This class is needed for EF Core console commands + * (like Add-Migration and Update-Database commands) + * */ + public class IdentityServiceDbContextFactory : IDesignTimeDbContextFactory + { + public IdentityServiceDbContext CreateDbContext(string[] args) + { + IdentityServiceEfCoreEntityExtensionMappings.Configure(); + + var builder = new DbContextOptionsBuilder() + .UseSqlServer(GetConnectionStringFromConfiguration(), b => + { + b.MigrationsHistoryTable("__IdentityService_Migrations"); + }); + + return new IdentityServiceDbContext(builder.Options); + } + + private static string GetConnectionStringFromConfiguration() + { + return BuildConfiguration() + .GetConnectionString(IdentityServiceDbProperties.ConnectionStringName); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath( + Path.Combine( + Directory.GetCurrentDirectory(), + $"..{Path.DirectorySeparatorChar}EShopOnAbp.IdentityService.HttpApi.Host" + ) + ) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEfCoreEntityExtensionMappings.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEfCoreEntityExtensionMappings.cs new file mode 100644 index 00000000..7566b3eb --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEfCoreEntityExtensionMappings.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace EShopOnAbp.IdentityService.EntityFrameworkCore +{ + public static class IdentityServiceEfCoreEntityExtensionMappings + { + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + IdentityServiceModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to map these extra properties to table fields in the database. + * + * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. + * USE IdentityServiceModuleExtensionConfigurator CLASS (in the Domain.Shared project) + * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES + * + * Example: Map a property to a table field: + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "MyProperty", + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128); + } + ); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities + */ + }); + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreModule.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreModule.cs new file mode 100644 index 00000000..adc8a448 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreModule.cs @@ -0,0 +1,43 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.SqlServer; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.IdentityServer.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService.EntityFrameworkCore +{ + [DependsOn( + typeof(IdentityServiceDomainModule), + typeof(AbpEntityFrameworkCoreSqlServerModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpIdentityServerEntityFrameworkCoreModule) + )] + public class IdentityServiceEntityFrameworkCoreModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + IdentityServiceEfCoreEntityExtensionMappings.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + options.ReplaceDbContext(); + options.ReplaceDbContext(); + + /* includeAllEntities: true allows to use IRepository also for non aggregate root entities */ + options.AddDefaultRepositories(includeAllEntities: true); + }); + + Configure(options => + { + options.Configure(c => + { + c.UseSqlServer(b => { b.MigrationsHistoryTable("__IdentityService_Migrations"); }); + }); + }); + } + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/20210629140020_Initial.Designer.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/20210629140020_Initial.Designer.cs new file mode 100644 index 00000000..db1083e0 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/20210629140020_Initial.Designer.cs @@ -0,0 +1,1762 @@ +// +using System; +using EShopOnAbp.IdentityService.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace EShopOnAbp.IdentityService.Migrations +{ + [DbContext(typeof(IdentityServiceDbContext))] + [Migration("20210629140020_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.7") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("RequireRequestObject") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/20210629140020_Initial.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/20210629140020_Initial.cs new file mode 100644 index 00000000..898173c4 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/20210629140020_Initial.cs @@ -0,0 +1,1061 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopOnAbp.IdentityService.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Required = table.Column(type: "bit", nullable: false), + IsStatic = table.Column(type: "bit", nullable: false), + Regex = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + RegexDescription = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpLinkUsers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + SourceUserId = table.Column(type: "uniqueidentifier", nullable: false), + SourceTenantId = table.Column(type: "uniqueidentifier", nullable: true), + TargetUserId = table.Column(type: "uniqueidentifier", nullable: false), + TargetTenantId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnits", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + ParentId = table.Column(type: "uniqueidentifier", nullable: true), + Code = table.Column(type: "nvarchar(95)", maxLength: 95, nullable: false), + DisplayName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); + table.ForeignKey( + name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", + column: x => x.ParentId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsDefault = table.Column(type: "bit", nullable: false), + IsStatic = table.Column(type: "bit", nullable: false), + IsPublic = table.Column(type: "bit", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSecurityLogs", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + ApplicationName = table.Column(type: "nvarchar(96)", maxLength: 96, nullable: true), + Identity = table.Column(type: "nvarchar(96)", maxLength: 96, nullable: true), + Action = table.Column(type: "nvarchar(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uniqueidentifier", nullable: true), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + TenantName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ClientId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ClientIpAddress = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + EmailConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + PasswordHash = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + SecurityStamp = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsExternal = table.Column(type: "bit", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + TwoFactorEnabled = table.Column(type: "bit", nullable: false, defaultValue: false), + LockoutEnd = table.Column(type: "datetimeoffset", nullable: true), + LockoutEnabled = table.Column(type: "bit", nullable: false, defaultValue: false), + AccessFailedCount = table.Column(type: "int", nullable: false, defaultValue: 0), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResources", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + AllowedAccessTokenSigningAlgorithms = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + ShowInDiscoveryDocument = table.Column(type: "bit", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopes", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Enabled = table.Column(type: "bit", nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Required = table.Column(type: "bit", nullable: false), + Emphasize = table.Column(type: "bit", nullable: false), + ShowInDiscoveryDocument = table.Column(type: "bit", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClients", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + ClientName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + ClientUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + LogoUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + ProtocolType = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + RequireClientSecret = table.Column(type: "bit", nullable: false), + RequireConsent = table.Column(type: "bit", nullable: false), + AllowRememberConsent = table.Column(type: "bit", nullable: false), + AlwaysIncludeUserClaimsInIdToken = table.Column(type: "bit", nullable: false), + RequirePkce = table.Column(type: "bit", nullable: false), + AllowPlainTextPkce = table.Column(type: "bit", nullable: false), + RequireRequestObject = table.Column(type: "bit", nullable: false), + AllowAccessTokensViaBrowser = table.Column(type: "bit", nullable: false), + FrontChannelLogoutUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + FrontChannelLogoutSessionRequired = table.Column(type: "bit", nullable: false), + BackChannelLogoutUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + BackChannelLogoutSessionRequired = table.Column(type: "bit", nullable: false), + AllowOfflineAccess = table.Column(type: "bit", nullable: false), + IdentityTokenLifetime = table.Column(type: "int", nullable: false), + AllowedIdentityTokenSigningAlgorithms = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + AccessTokenLifetime = table.Column(type: "int", nullable: false), + AuthorizationCodeLifetime = table.Column(type: "int", nullable: false), + ConsentLifetime = table.Column(type: "int", nullable: true), + AbsoluteRefreshTokenLifetime = table.Column(type: "int", nullable: false), + SlidingRefreshTokenLifetime = table.Column(type: "int", nullable: false), + RefreshTokenUsage = table.Column(type: "int", nullable: false), + UpdateAccessTokenClaimsOnRefresh = table.Column(type: "bit", nullable: false), + RefreshTokenExpiration = table.Column(type: "int", nullable: false), + AccessTokenType = table.Column(type: "int", nullable: false), + EnableLocalLogin = table.Column(type: "bit", nullable: false), + IncludeJwtId = table.Column(type: "bit", nullable: false), + AlwaysSendClientClaims = table.Column(type: "bit", nullable: false), + ClientClaimsPrefix = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + PairWiseSubjectSalt = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + UserSsoLifetime = table.Column(type: "int", nullable: true), + UserCodeType = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClients", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + DeviceCode = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + UserCode = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + SubjectId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + SessionId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Expiration = table.Column(type: "datetime2", nullable: false), + Data = table.Column(type: "nvarchar(max)", maxLength: 50000, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResources", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Enabled = table.Column(type: "bit", nullable: false), + Required = table.Column(type: "bit", nullable: false), + Emphasize = table.Column(type: "bit", nullable: false), + ShowInDiscoveryDocument = table.Column(type: "bit", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerPersistedGrants", + columns: table => new + { + Key = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + SubjectId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + SessionId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Description = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + Expiration = table.Column(type: "datetime2", nullable: true), + ConsumedTime = table.Column(type: "datetime2", nullable: true), + Data = table.Column(type: "nvarchar(max)", maxLength: 50000, nullable: false), + Id = table.Column(type: "uniqueidentifier", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnitRoles", + columns: table => new + { + RoleId = table.Column(type: "uniqueidentifier", nullable: false), + OrganizationUnitId = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUnitId", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + RoleId = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + ClaimType = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + ClaimType = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(type: "uniqueidentifier", nullable: false), + LoginProvider = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + ProviderKey = table.Column(type: "nvarchar(196)", maxLength: 196, nullable: false), + ProviderDisplayName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserOrganizationUnits", + columns: table => new + { + UserId = table.Column(type: "uniqueidentifier", nullable: false), + OrganizationUnitId = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUnitId", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(type: "uniqueidentifier", nullable: false), + RoleId = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(type: "uniqueidentifier", nullable: false), + LoginProvider = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Value = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceClaims", + columns: table => new + { + Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + ApiResourceId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceProperties", + columns: table => new + { + ApiResourceId = table.Column(type: "uniqueidentifier", nullable: false), + Key = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceScopes", + columns: table => new + { + ApiResourceId = table.Column(type: "uniqueidentifier", nullable: false), + Scope = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceSecrets", + columns: table => new + { + Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false), + ApiResourceId = table.Column(type: "uniqueidentifier", nullable: false), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Expiration = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeClaims", + columns: table => new + { + Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + ApiScopeId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScopeId", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeProperties", + columns: table => new + { + ApiScopeId = table.Column(type: "uniqueidentifier", nullable: false), + Key = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_ApiScopeId", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientClaims", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientCorsOrigins", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + Origin = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); + table.ForeignKey( + name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientGrantTypes", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + GrantType = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); + table.ForeignKey( + name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientIdPRestrictions", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + Provider = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); + table.ForeignKey( + name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientPostLogoutRedirectUris", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + PostLogoutRedirectUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientProperties", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + Key = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientRedirectUris", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + RedirectUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientScopes", + columns: table => new + { + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + Scope = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientSecrets", + columns: table => new + { + Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false), + ClientId = table.Column(type: "uniqueidentifier", nullable: false), + Description = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + Expiration = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceClaims", + columns: table => new + { + Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + IdentityResourceId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceProperties", + columns: table => new + { + IdentityResourceId = table.Column(type: "uniqueidentifier", nullable: false), + Key = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_TargetTenantId", + table: "AbpLinkUsers", + columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, + unique: true, + filter: "[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", + table: "AbpOrganizationUnitRoles", + columns: new[] { "RoleId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_Code", + table: "AbpOrganizationUnits", + column: "Code"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_ParentId", + table: "AbpOrganizationUnits", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Action", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Action" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_ApplicationName", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "ApplicationName" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Identity", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Identity" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_UserId", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", + table: "AbpUserOrganizationUnits", + columns: new[] { "UserId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerClients_ClientId", + table: "IdentityServerClients", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_Expiration", + table: "IdentityServerPersistedGrants", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "ClientId", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpLinkUsers"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnitRoles"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSecurityLogs"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerClientCorsOrigins"); + + migrationBuilder.DropTable( + name: "IdentityServerClientGrantTypes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientIdPRestrictions"); + + migrationBuilder.DropTable( + name: "IdentityServerClientPostLogoutRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerPersistedGrants"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResources"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClients"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResources"); + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/IdentityServiceDbContextModelSnapshot.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/IdentityServiceDbContextModelSnapshot.cs new file mode 100644 index 00000000..9b458723 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/Migrations/IdentityServiceDbContextModelSnapshot.cs @@ -0,0 +1,1760 @@ +// +using System; +using EShopOnAbp.IdentityService.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace EShopOnAbp.IdentityService.Migrations +{ + [DbContext(typeof(IdentityServiceDbContext))] + partial class IdentityServiceDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.7") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("RequireRequestObject") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/EShopOnAbp.IdentityService.HttpApi.Client.csproj b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/EShopOnAbp.IdentityService.HttpApi.Client.csproj new file mode 100644 index 00000000..4099c6ce --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/EShopOnAbp.IdentityService.HttpApi.Client.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/IdentityServiceHttpApiClientModule.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/IdentityServiceHttpApiClientModule.cs new file mode 100644 index 00000000..72b8576c --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/IdentityServiceHttpApiClientModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(IdentityServiceApplicationContractsModule), + typeof(AbpAccountHttpApiClientModule), + typeof(AbpIdentityHttpApiClientModule) + )] + public class IdentityServiceHttpApiClientModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(IdentityServiceApplicationContractsModule).Assembly, + IdentityServiceRemoteServiceConsts.RemoteServiceName + ); + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Controllers/HomeController.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 00000000..897474e3 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace EShopOnAbp.IdentityService.Controllers +{ + public class HomeController : AbpController + { + public ActionResult Index() + { + return Redirect("~/swagger"); + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs new file mode 100644 index 00000000..864e8591 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs @@ -0,0 +1,342 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using IdentityServer4.Models; +using Microsoft.Extensions.Configuration; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.Identity; +using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.IdentityServer.ApiScopes; +using Volo.Abp.IdentityServer.Clients; +using Volo.Abp.IdentityServer.IdentityResources; +using Volo.Abp.MultiTenancy; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Uow; +using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; +using ApiScope = Volo.Abp.IdentityServer.ApiScopes.ApiScope; +using Client = Volo.Abp.IdentityServer.Clients.Client; + +namespace EShopOnAbp.IdentityService.DbMigrations +{ + public class IdentityServerDataSeeder : ITransientDependency + { + private readonly IApiResourceRepository _apiResourceRepository; + private readonly IApiScopeRepository _apiScopeRepository; + private readonly IClientRepository _clientRepository; + private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; + private readonly IGuidGenerator _guidGenerator; + private readonly IPermissionDataSeeder _permissionDataSeeder; + private readonly IConfiguration _configuration; + private readonly ICurrentTenant _currentTenant; + + public IdentityServerDataSeeder( + IClientRepository clientRepository, + IApiResourceRepository apiResourceRepository, + IApiScopeRepository apiScopeRepository, + IIdentityResourceDataSeeder identityResourceDataSeeder, + IGuidGenerator guidGenerator, + IPermissionDataSeeder permissionDataSeeder, + IConfiguration configuration, + ICurrentTenant currentTenant) + { + _clientRepository = clientRepository; + _apiResourceRepository = apiResourceRepository; + _apiScopeRepository = apiScopeRepository; + _identityResourceDataSeeder = identityResourceDataSeeder; + _guidGenerator = guidGenerator; + _permissionDataSeeder = permissionDataSeeder; + _configuration = configuration; + _currentTenant = currentTenant; + } + + [UnitOfWork] + public virtual async Task SeedAsync() + { + using (_currentTenant.Change(null)) + { + await _identityResourceDataSeeder.CreateStandardResourcesAsync(); + await CreateApiResourcesAsync(); + await CreateApiScopesAsync(); + await CreateSwaggerClientsAsync(); + await CreateClientsAsync(); + } + } + + private async Task CreateApiResourcesAsync() + { + var commonApiUserClaims = new[] + { + "email", + "email_verified", + "name", + "phone_number", + "phone_number_verified", + "role" + }; + + await CreateApiResourceAsync("IdentityService", commonApiUserClaims); + await CreateApiResourceAsync("AdministrationService", commonApiUserClaims); + await CreateApiResourceAsync("SaasService", commonApiUserClaims); + } + + private async Task CreateApiScopesAsync() + { + await CreateApiScopeAsync("IdentityService"); + await CreateApiScopeAsync("AdministrationService"); + await CreateApiScopeAsync("SaasService"); + } + + private async Task CreateSwaggerClientsAsync() + { + await CreateSwaggerClientAsync("InternalGateway", + new[] { "IdentityService", "AdministrationService", "SaasService" }); + await CreateSwaggerClientAsync("WebGateway", + new[] { "IdentityService", "AdministrationService", "SaasService" }); + await CreateSwaggerClientAsync("PublicWebGateway", new[] { "" }); + } + + private async Task CreateSwaggerClientAsync(string name, string[] scopes = null) + { + var commonScopes = new[] + { + "email", + "openid", + "profile", + "role", + "phone", + "address" + }; + scopes ??= new[] { name }; + + // Swagger Client + var swaggerClientId = $"{name}_Swagger"; + if (!swaggerClientId.IsNullOrWhiteSpace()) + { + var swaggerRootUrl = _configuration[$"IdentityServerClients:{name}:RootUrl"].TrimEnd('/'); + + await CreateClientAsync( + name: swaggerClientId, + scopes: commonScopes.Union(scopes), + grantTypes: new[] { "authorization_code" }, + secret: "1q2w3e*".Sha256(), + requireClientSecret: false, + redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", + corsOrigins: new[] { swaggerRootUrl.RemovePostFix("/") } + ); + } + } + + private async Task CreateApiResourceAsync(string name, IEnumerable claims) + { + var apiResource = await _apiResourceRepository.FindByNameAsync(name); + if (apiResource == null) + { + apiResource = await _apiResourceRepository.InsertAsync( + new ApiResource( + _guidGenerator.Create(), + name, + name + " API" + ), + autoSave: true + ); + } + + foreach (var claim in claims) + { + if (apiResource.FindClaim(claim) == null) + { + apiResource.AddUserClaim(claim); + } + } + + return await _apiResourceRepository.UpdateAsync(apiResource); + } + + private async Task CreateApiScopeAsync(string name) + { + var apiScope = await _apiScopeRepository.GetByNameAsync(name); + if (apiScope == null) + { + apiScope = await _apiScopeRepository.InsertAsync( + new ApiScope( + _guidGenerator.Create(), + name, + name + " API" + ), + autoSave: true + ); + } + + return apiScope; + } + + private async Task CreateClientsAsync() + { + var commonScopes = new[] + { + "email", + "openid", + "profile", + "role", + "phone", + "address" + }; + + //Public Web Client + var publicWebClientRootUrl = _configuration["IdentityServerClients:EShopOnAbp_PublicWeb:RootUrl"] + .EnsureEndsWith('/'); + await CreateClientAsync( + name: "EShopOnAbp_PublicWeb", + scopes: commonScopes.Union(new[] + { + "AdministrationService" + }), + grantTypes: new[] { "hybrid" }, + secret: "1q2w3e*".Sha256(), + redirectUri: $"{publicWebClientRootUrl}signin-oidc", + postLogoutRedirectUri: $"{publicWebClientRootUrl}signout-callback-oidc", + frontChannelLogoutUri: $"{publicWebClientRootUrl}Account/FrontChannelLogout", + corsOrigins: new[] { publicWebClientRootUrl.RemovePostFix("/") } + ); + + //Angular Client + var angularClientRootUrl = + _configuration["IdentityServerClients:EShopOnAbp_Angular:RootUrl"].TrimEnd('/'); + await CreateClientAsync( + name: "EShopOnAbp_Angular", + scopes: commonScopes.Union(new[] + { + "IdentityService", + "AdministrationService", + "SaasService" + }), + grantTypes: new[] { "authorization_code", "LinkLogin" }, + secret: "1q2w3e*".Sha256(), + requirePkce: true, + requireClientSecret: false, + redirectUri: $"{angularClientRootUrl}", + postLogoutRedirectUri: $"{angularClientRootUrl}", + corsOrigins: new[] { angularClientRootUrl } + ); + + //Administration Service Client + await CreateClientAsync( + name: "EShopOnAbp_AdministrationService", + scopes: commonScopes.Union(new[] + { + "IdentityService" + }), + grantTypes: new[] { "client_credentials" }, + secret: "1q2w3e*".Sha256(), + permissions: new[] { IdentityPermissions.Users.Default } + ); + } + + private async Task CreateClientAsync( + string name, + IEnumerable scopes, + IEnumerable grantTypes, + string secret = null, + string redirectUri = null, + string postLogoutRedirectUri = null, + string frontChannelLogoutUri = null, + bool requireClientSecret = true, + bool requirePkce = false, + IEnumerable permissions = null, + IEnumerable corsOrigins = null) + { + var client = await _clientRepository.FindByClientIdAsync(name); + if (client == null) + { + client = await _clientRepository.InsertAsync( + new Client( + _guidGenerator.Create(), + name + ) + { + ClientName = name, + ProtocolType = "oidc", + Description = name, + AlwaysIncludeUserClaimsInIdToken = true, + AllowOfflineAccess = true, + AbsoluteRefreshTokenLifetime = 31536000, //365 days + AccessTokenLifetime = 31536000, //365 days + AuthorizationCodeLifetime = 300, + IdentityTokenLifetime = 300, + RequireConsent = false, + FrontChannelLogoutUri = frontChannelLogoutUri, + RequireClientSecret = requireClientSecret, + RequirePkce = requirePkce + }, + autoSave: true + ); + } + + foreach (var scope in scopes) + { + if (client.FindScope(scope) == null) + { + client.AddScope(scope); + } + } + + foreach (var grantType in grantTypes) + { + if (client.FindGrantType(grantType) == null) + { + client.AddGrantType(grantType); + } + } + + if (!secret.IsNullOrEmpty()) + { + if (client.FindSecret(secret) == null) + { + client.AddSecret(secret); + } + } + + if (redirectUri != null) + { + if (client.FindRedirectUri(redirectUri) == null) + { + client.AddRedirectUri(redirectUri); + } + } + + if (postLogoutRedirectUri != null) + { + if (client.FindPostLogoutRedirectUri(postLogoutRedirectUri) == null) + { + client.AddPostLogoutRedirectUri(postLogoutRedirectUri); + } + } + + if (permissions != null) + { + await _permissionDataSeeder.SeedAsync( + ClientPermissionValueProvider.ProviderName, + name, + permissions, + null + ); + } + + if (corsOrigins != null) + { + foreach (var origin in corsOrigins) + { + if (!origin.IsNullOrWhiteSpace() && client.FindCorsOrigin(origin) == null) + { + client.AddCorsOrigin(origin); + } + } + } + + return await _clientRepository.UpdateAsync(client); + } + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServiceDatabaseMigrationChecker.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServiceDatabaseMigrationChecker.cs new file mode 100644 index 00000000..ec1805c5 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServiceDatabaseMigrationChecker.cs @@ -0,0 +1,27 @@ +using System; +using EShopOnAbp.IdentityService.EntityFrameworkCore; +using EShopOnAbp.Shared.Hosting.Microservices.DbMigrations; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Uow; + +namespace EShopOnAbp.IdentityService.DbMigrations +{ + public class IdentityServiceDatabaseMigrationChecker : PendingMigrationsCheckerBase + { + public IdentityServiceDatabaseMigrationChecker( + IUnitOfWorkManager unitOfWorkManager, + IServiceProvider serviceProvider, + ICurrentTenant currentTenant, + IDistributedEventBus distributedEventBus) + : base( + unitOfWorkManager, + serviceProvider, + currentTenant, + distributedEventBus, + IdentityServiceDbProperties.ConnectionStringName) + { + + } + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServiceDatabaseMigrationEventHandler.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServiceDatabaseMigrationEventHandler.cs new file mode 100644 index 00000000..b6901c68 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServiceDatabaseMigrationEventHandler.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using EShopOnAbp.IdentityService.EntityFrameworkCore; +using EShopOnAbp.Shared.Hosting.Microservices.DbMigrations; +using Serilog; +using Volo.Abp.Data; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TenantManagement; +using Volo.Abp.Uow; + +namespace EShopOnAbp.IdentityService.DbMigrations +{ + public class IdentityServiceDatabaseMigrationEventHandler + : DatabaseMigrationEventHandlerBase, + IDistributedEventHandler, + IDistributedEventHandler + { + private readonly IIdentityDataSeeder _identityDataSeeder; + private readonly IdentityServerDataSeeder _identityServerDataSeeder; + + public IdentityServiceDatabaseMigrationEventHandler( + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, + ITenantStore tenantStore, + IIdentityDataSeeder identityDataSeeder, + IdentityServerDataSeeder identityServerDataSeeder, + ITenantRepository tenantRepository, + IDistributedEventBus distributedEventBus + ) : base( + currentTenant, + unitOfWorkManager, + tenantStore, + tenantRepository, + distributedEventBus, + IdentityServiceDbProperties.ConnectionStringName) + { + _identityDataSeeder = identityDataSeeder; + _identityServerDataSeeder = identityServerDataSeeder; + } + + public async Task HandleEventAsync(ApplyDatabaseMigrationsEto eventData) + { + if (eventData.DatabaseName != DatabaseName) + { + return; + } + + try + { + var schemaMigrated = await MigrateDatabaseSchemaAsync(eventData.TenantId); + await SeedDataAsync( + tenantId: eventData.TenantId, + adminEmail: IdentityServiceDbProperties.DefaultAdminEmailAddress, + adminPassword: IdentityServiceDbProperties.DefaultAdminPassword + ); + + if (eventData.TenantId == null && schemaMigrated) + { + /* Migrate tenant databases after host migration */ + await QueueTenantMigrationsAsync(); + } + } + catch (Exception ex) + { + await HandleErrorOnApplyDatabaseMigrationAsync(eventData, ex); + } + } + + public async Task HandleEventAsync(TenantCreatedEto eventData) + { + try + { + await MigrateDatabaseSchemaAsync(eventData.Id); + await SeedDataAsync( + tenantId: eventData.Id, + adminEmail: eventData.Properties.GetOrDefault(IdentityDataSeedContributor.AdminEmailPropertyName) ?? IdentityServiceDbProperties.DefaultAdminEmailAddress, + adminPassword: eventData.Properties.GetOrDefault(IdentityDataSeedContributor.AdminPasswordPropertyName) ?? IdentityServiceDbProperties.DefaultAdminPassword + ); + } + catch (Exception ex) + { + await HandleErrorTenantCreatedAsync(eventData, ex); + } + } + private async Task SeedDataAsync(Guid? tenantId, string adminEmail, string adminPassword) + { + using (CurrentTenant.Change(tenantId)) + { + if (tenantId == null) + { + Log.Information($"Seeding IdentityServer data..."); + await _identityServerDataSeeder.SeedAsync(); + } + Log.Information($"Seeding user data..."); + await _identityDataSeeder.SeedAsync( + adminEmail, + adminPassword, + tenantId + ); + } + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj new file mode 100644 index 00000000..d4b1ac1c --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj @@ -0,0 +1,375 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + <_ContentIncludedByDefault Remove="wwwroot\global-styles.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\css\all.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\css\v4-shims.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-brands-400.eot" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-brands-400.svg" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-brands-400.ttf" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-brands-400.woff" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-brands-400.woff2" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-regular-400.eot" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-regular-400.svg" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-regular-400.ttf" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-regular-400.woff" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-regular-400.woff2" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-solid-900.eot" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-solid-900.svg" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-solid-900.ttf" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-solid-900.woff" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\@fortawesome\fontawesome-free\webfonts\fa-solid-900.woff2" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\core\abp.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\core\abp.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\jquery\abp.jquery.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\luxon\abp.luxon.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\utils\abp-utils.umd.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\utils\abp-utils.umd.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\utils\abp-utils.umd.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\abp\utils\abp-utils.umd.min.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\bootstrap-datepicker.css.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\bootstrap-datepicker.min.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\bootstrap-datepicker.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker-en-CA.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ar-tn.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ar.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.az.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.bg.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.bm.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.bn.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.br.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.bs.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ca.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.cs.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.cy.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.da.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.de.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.el.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.en-AU.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.en-CA.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.en-GB.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.en-IE.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.en-NZ.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.en-ZA.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.eo.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.es.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.et.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.eu.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.fa.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.fi.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.fo.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.fr-CH.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.fr.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.gl.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.he.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.hi.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.hr.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.hu.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.hy.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.id.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.is.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.it-CH.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.it.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ja.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ka.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.kh.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.kk.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.km.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ko.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.kr.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.lt.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.lv.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.me.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.mk.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.mn.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ms.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.nl-BE.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.nl.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.no.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.oc.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.pl.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.pt-BR.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.pt.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ro.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.rs-latin.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.rs.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ru.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.si.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.sk.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.sl.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.sq.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.sr-latin.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.sr.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.sv.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.sw.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.ta.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.tg.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.th.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.tk.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.tr.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.uk.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.uz-cyrl.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.uz-latn.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.vi.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.zh-CN.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap-datepicker\locales\bootstrap-datepicker.zh-TW.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap-rtl.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap-rtl.css.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap-rtl.min.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap-rtl.min.css.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap.css.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap.min.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\css\bootstrap.min.css.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\js\bootstrap.bundle.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\js\bootstrap.bundle.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\js\bootstrap.bundle.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\bootstrap\js\bootstrap.bundle.min.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\datatables.net-bs4\css\dataTables.bootstrap4.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\datatables.net-bs4\js\dataTables.bootstrap4.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\datatables.net\js\jquery.dataTables.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-form\jquery.form.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-form\jquery.form.min.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation-unobtrusive\jquery.validate.unobtrusive.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\jquery.validate.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ar.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_az.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_bg.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_bn_BD.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ca.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_cs.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_da.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_de.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_el.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_es.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_es_AR.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_es_PE.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_et.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_eu.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_fa.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_fi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_fr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ge.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_gl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_he.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_hr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_hu.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_hy_AM.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_id.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_is.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_it.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ja.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ka.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_kk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ko.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_lt.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_lv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_mk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_my.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_nl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_no.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_pl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_pt_BR.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_pt_PT.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ro.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ru.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_sd.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_si.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_sk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_sl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_sr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_sr_lat.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_sv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_th.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_tj.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_tr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_uk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_ur.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_vi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_zh.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\messages_zh_TW.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\methods_de.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\methods_es_CL.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\methods_fi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\methods_nl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery-validation\localization\methods_pt.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\jquery\jquery.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\lodash\lodash.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\luxon\luxon.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\luxon\luxon.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\luxon\luxon.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\luxon\luxon.min.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\malihu-custom-scrollbar-plugin\jquery.mCustomScrollbar.concat.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\malihu-custom-scrollbar-plugin\jquery.mCustomScrollbar.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\malihu-custom-scrollbar-plugin\jquery.mCustomScrollbar.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\malihu-custom-scrollbar-plugin\mCSB_buttons.png" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\malihu-custom-scrollbar-plugin\package.json" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\malihu-custom-scrollbar-plugin\readme.md" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\css\select2.min.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\af.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ar.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\az.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\bg.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\bn.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\bs.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ca.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\cs.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\da.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\de.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\dsb.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\el.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\en.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\es.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\et.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\eu.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\fa.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\fi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\fr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\gl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\he.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\hi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\hr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\hsb.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\hu.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\hy.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\id.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\is.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\it.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ja.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ka.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\km.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ko.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\lt.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\lv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\mk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ms.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\nb.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ne.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\nl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\pl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ps.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\pt-BR.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\pt.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ro.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\ru.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\sk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\sl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\sq.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\sr-Cyrl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\sr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\sv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\th.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\tk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\tr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\uk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\vi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\zh-CN.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\i18n\zh-TW.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\select2-bootstrap-modal-patch.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\select2.full.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\select2\js\select2.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\sweetalert\sweetalert.min.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\jquery.timeago.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.af.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.am.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ar.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.az-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.az.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.be.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.bg.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.bs.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ca.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.cs.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.cy.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.da.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.de-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.de.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.dv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.el.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.en-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.en.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.es-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.es.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.et.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.eu.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.fa-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.fa.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.fi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.fr-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.fr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.gl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.he.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.hr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.hu.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.hy.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.id.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.is.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.it-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.it.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ja.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.jv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ko.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ky.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.lt.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.lv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.mk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.nl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.no.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.pl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.pt-br-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.pt-br.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.pt-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.pt.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ro.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.rs.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ru.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.rw.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.si.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.sk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.sl.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.sq.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.sr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.sv.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.th.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.tr-short.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.tr.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.uk.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.ur.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.uz.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.vi.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.zh-CN.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\jquery.timeago.zh-TW.js" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\timeago\locales\README.md" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\toastr\toastr.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\toastr\toastr.js.map" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\toastr\toastr.min.css" /> + <_ContentIncludedByDefault Remove="wwwroot\libs\toastr\toastr.min.js" /> + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs new file mode 100644 index 00000000..517f0b21 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs @@ -0,0 +1,75 @@ +using EShopOnAbp.IdentityService.DbMigrations; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using EShopOnAbp.IdentityService.EntityFrameworkCore; +using EShopOnAbp.Shared.Hosting.Microservices; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(EShopOnAbpSharedHostingMicroservicesModule), + typeof(IdentityServiceHttpApiModule), + typeof(IdentityServiceApplicationModule), + typeof(IdentityServiceEntityFrameworkCoreModule) + )] + public class IdentityServiceHttpApiHostModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + JwtBearerConfigurationHelper.Configure(context, "IdentityService"); + SwaggerConfigurationHelper.Configure(context, "Identity Service API"); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseCorrelationId(); + app.UseAbpRequestLocalization(); + app.UseStaticFiles(); + app.UseRouting(); + // app.UseHttpMetrics(); + app.UseAuthentication(); + app.UseAbpClaimsMap(); + app.UseMultiTenancy(); + app.UseAuthorization(); + app.UseSwagger(); + app.UseSwaggerUI(options => + { + options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API"); + }); + app.UseAbpSerilogEnrichers(); + app.UseAuditing(); + app.UseUnitOfWork(); + app.UseConfiguredEndpoints(endpoints => + { + // endpoints.MapMetrics(); + }); + } + + public override void OnPostApplicationInitialization(ApplicationInitializationContext context) + { + using (var scope = context.ServiceProvider.CreateScope()) + { + AsyncHelper.RunSync( + () => scope.ServiceProvider + .GetRequiredService() + .CheckAsync() + ); + } + } + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Program.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Program.cs new file mode 100644 index 00000000..35d543f4 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Program.cs @@ -0,0 +1,47 @@ +using System; +using System.Threading.Tasks; +using EShopOnAbp.Shared.Hosting.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace EShopOnAbp.IdentityService +{ + public class Program + { + public static async Task Main(string[] args) + { + var assemblyName = typeof(Program).Assembly.GetName().Name; + + SerilogConfigurationHelper.Configure(assemblyName); + + try + { + Log.Information($"Starting {assemblyName}."); + await CreateHostBuilder(args).Build().RunAsync(); + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } + + internal static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureAppConfiguration(build => + { + build.AddJsonFile("appsettings.secrets.json", optional: true); + }) + .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }) + .UseAutofac() + .UseSerilog(); + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Properties/launchSettings.json b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 00000000..b2784d2c --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44351", + "sslPort": 44351 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "EShopOnAbp.IdentityService.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44351", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Startup.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Startup.cs new file mode 100644 index 00000000..b70578d5 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Startup.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace EShopOnAbp.IdentityService +{ + public class Startup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + app.InitializeApplication(); + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.Development.json b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.Development.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json new file mode 100644 index 00000000..86c613ed --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json @@ -0,0 +1,59 @@ +{ + "App": { + "SelfUrl": "https://localhost:44351" + }, + "AuthServer": { + "Authority": "https://localhost:44330", + "RequireHttpsMetadata": "true" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "IdentityService": "Server=localhost,1434;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw0rd", + "AdministrationService": "Server=localhost,1434;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw0rd", + "SaasService": "Server=localhost,1434;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw0rd" + }, + "StringEncryption": { + "DefaultPassPhrase": "gsKnGZ041HLL4IM8" + }, + "Redis": { + "Configuration": "localhost:6379" + }, + "RabbitMQ": { + "Connections": { + "Default": { + "HostName": "localhost" + } + }, + "EventBus": { + "ClientName": "EShopOnAbp_IdentityService", + "ExchangeName": "EShopOnAbp" + } + }, + "ElasticSearch": { + "Url": "http://localhost:9200" + }, + "IdentityServerClients":{ + "EShopOnAbp_Angular": { + "RootUrl": "http://localhost:4200" + }, + "EShopOnAbp_PublicWeb": { + "RootUrl": "https://localhost:44335/" + }, + "InternalGateway": { + "RootUrl": "https://localhost:44302" + }, + "WebGateway": { + "RootUrl": "https://localhost:44325" + }, + "PublicWebGateway": { + "RootUrl": "https://localhost:44353" + } + } +} diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/tempkey.jwk b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/tempkey.jwk new file mode 100644 index 00000000..de06df16 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/tempkey.jwk @@ -0,0 +1 @@ +{"AdditionalData":{},"Alg":"RS256","Crv":null,"D":"IzuLrZFLSUN64jZJeu9yDcNeK9--r_4-FHBxytp0JoGPPEodp_s7DQoGntnuuAZmTpLtBZwyyJVpK1G8rO1WGoJFEjfIUzoLjaK-rRpiNoM2q-lF31mVlHPwgVTmFAE5rdl17YmWHVaTv4pixNXvRSrb4oOVvuj5EsIQ2QyDIewW4GE7nlitV6nm9VsRCgvwztrmatEDrpL_KQFORuT7961jNF4PT_NLBt6pn7O9V_07E5bNi4m8CP79xjw3YiZcjaAKESXfQYAJHvfPgeD9Tyy3udzRjsMYXlz7ttP396y5cWCFJoa-SQ4r2Crd4q5g3jc3nc6vd72sDU8F3PkUSQ","DP":"bOHLOAtVJbawgWAQcCVGfJkxfekLDyni_JYjEjUgMQityaxdVhzMSA-s84vaMMbeX4HI2OsnUGr5sDM0iKqSaCGlBGC7_zRarfEYT07r7O1EVP8DGG8YmkZgLxaS3plB43wjQQzlOJb5dNicvc2KoccytnVCp4Xoj8E6wGHzulk","DQ":"M-xdkU4u1DQ3Stl7sZy4TzXEGjje-OKfQcYObfrz254l5MJOe4BNKW8VGNvWOg_CGfstkWExIMW509CeDb63CTLbXaGm60t_zgXUSTxLH7ekMcOhJ1wsBjvlUF6TP3GQmAdWpxTUIPea0jsKydweTsW5Djm6LqasnDHKED7KgYE","E":"AQAB","K":null,"KeyId":"8E326BF5420CBC8ABF92FA5BA0AAE11F","Kid":"8E326BF5420CBC8ABF92FA5BA0AAE11F","Kty":"RSA","N":"xf8vklnYR5-A-ycF9CqbnqdbnAfIgCFS_f3xDraHJ8Ueup5boNZQhkekhlste5y98mrDjpSqRillNow6GT6g8i287S8p_mI6j1nJ_uG8UiFkebLbcTbxg0KfTxnCHcBKFqKc42iGq_C-2aGonYpXb4RkN6hf8ISWaB6ixh8WZnXFBCFtIlZxoCMu5TY48sMoGJwcITr0PKp9KNctDQm2Uo5XwX231sOQojqq2QfnLo0X5U7pz3aFNjA8B6owt_a_-OiuTNovaVaEQZE0FyZK4V1rghOs1bi2ircoxuo2mSRmHNPI_GiVrZ22hsYnDsL_cLBoiTrAWmfCwjZ8UoCL3Q","Oth":null,"P":"56bYOV1Jxg6co465j58ew8uYE6JUtBUG71rZRoJDiIiu3_BeKcUuR9Yn-_N7ZrHXCCVNC5GBCye-AcTvLaJqMuUERZdKGM1BJBly_SsCZGbt1c9VdjHwUiq0JyY2OmhzqBcxV3ZLo43t0J0M6wsBwZX-c4zshsT-0S0hfRBbL78","Q":"2s7GBO8lcD9mLIXm5hB-FuHENrtpHYYxD1z5e2noJB2F15NHmg3WjA2r2dN5g0JOpVq5n1I20HEpgcCOuNXwU-p6eigbmqQAa4yuEzxib7dffxNGPQ8RbB0pSc8SZ1Jv1CWkDmlFXOalj6K3Y6tT7q8Cb3QF7qGiSTEXNd_IK2M","QI":"szEGtChCJ1i9rGqCBjc1HwCHwWVvHlafBJNx93D14R4XHHj5j7yNnRoKNmPkftOv29weGLSYo03Mq9KuuudozZAFuXYsBHyvB6H6D5OTkEPJcspYj2fMNTRek7Cut0VZZ1IpYpPbZzFhhdP65sIa3NVadw1Fo7rutn1KQ68mQbw","Use":null,"X":null,"X5t":null,"X5tS256":null,"X5u":null,"Y":null,"KeySize":2048,"HasPrivateKey":true,"CryptoProviderFactory":{"CryptoProviderCache":{},"CustomCryptoProvider":null,"CacheSignatureProviders":true}} \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi/EShopOnAbp.IdentityService.HttpApi.csproj b/services/identity/src/EShopOnAbp.IdentityService.HttpApi/EShopOnAbp.IdentityService.HttpApi.csproj new file mode 100644 index 00000000..935ce0f1 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi/EShopOnAbp.IdentityService.HttpApi.csproj @@ -0,0 +1,17 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi/IdentityServiceHttpApiModule.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi/IdentityServiceHttpApiModule.cs new file mode 100644 index 00000000..f110a300 --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi/IdentityServiceHttpApiModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Account; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(IdentityServiceApplicationContractsModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityHttpApiModule) + )] + public class IdentityServiceHttpApiModule : AbpModule + { + } +} \ No newline at end of file diff --git a/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/EShopOnAbp.IdentityService.Application.Tests.csproj b/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/EShopOnAbp.IdentityService.Application.Tests.csproj new file mode 100644 index 00000000..f9055813 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/EShopOnAbp.IdentityService.Application.Tests.csproj @@ -0,0 +1,17 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + diff --git a/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/IdentityServiceApplicationTestBase.cs b/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/IdentityServiceApplicationTestBase.cs new file mode 100644 index 00000000..8ec6dd95 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/IdentityServiceApplicationTestBase.cs @@ -0,0 +1,7 @@ +namespace EShopOnAbp.IdentityService +{ + public abstract class IdentityServiceApplicationTestBase : IdentityServiceTestBase + { + + } +} diff --git a/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/IdentityServiceApplicationTestModule.cs b/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/IdentityServiceApplicationTestModule.cs new file mode 100644 index 00000000..aeee8401 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.Application.Tests/IdentityServiceApplicationTestModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(IdentityServiceApplicationModule), + typeof(IdentityServiceDomainTestModule) + )] + public class IdentityServiceApplicationTestModule : AbpModule + { + + } +} \ No newline at end of file diff --git a/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/EShopOnAbp.IdentityService.Domain.Tests.csproj b/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/EShopOnAbp.IdentityService.Domain.Tests.csproj new file mode 100644 index 00000000..113fff35 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/EShopOnAbp.IdentityService.Domain.Tests.csproj @@ -0,0 +1,16 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + + + + + + + diff --git a/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/IdentityServiceDomainTestBase.cs b/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/IdentityServiceDomainTestBase.cs new file mode 100644 index 00000000..39bbae4c --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/IdentityServiceDomainTestBase.cs @@ -0,0 +1,7 @@ +namespace EShopOnAbp.IdentityService +{ + public abstract class IdentityServiceDomainTestBase : IdentityServiceTestBase + { + + } +} diff --git a/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/IdentityServiceDomainTestModule.cs b/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/IdentityServiceDomainTestModule.cs new file mode 100644 index 00000000..c07e2655 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.Domain.Tests/IdentityServiceDomainTestModule.cs @@ -0,0 +1,13 @@ +using EShopOnAbp.IdentityService.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(IdentityServiceEntityFrameworkCoreTestModule) + )] + public class IdentityServiceDomainTestModule : AbpModule + { + + } +} \ No newline at end of file diff --git a/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests.csproj b/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests.csproj new file mode 100644 index 00000000..0e442c41 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,18 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + + diff --git a/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreTestBase.cs b/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreTestBase.cs new file mode 100644 index 00000000..fa9cb505 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreTestBase.cs @@ -0,0 +1,9 @@ +using Volo.Abp; + +namespace EShopOnAbp.IdentityService.EntityFrameworkCore +{ + public abstract class IdentityServiceEntityFrameworkCoreTestBase : IdentityServiceTestBase + { + + } +} diff --git a/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreTestModule.cs b/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreTestModule.cs new file mode 100644 index 00000000..0a14f780 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreTestModule.cs @@ -0,0 +1,62 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.Modularity; + +namespace EShopOnAbp.IdentityService.EntityFrameworkCore +{ + [DependsOn( + typeof(IdentityServiceEntityFrameworkCoreModule), + typeof(IdentityServiceTestBaseModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] + public class IdentityServiceEntityFrameworkCoreTestModule : AbpModule + { + private SqliteConnection _sqliteConnection; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureInMemorySqlite(context.Services); + } + + private void ConfigureInMemorySqlite(IServiceCollection services) + { + _sqliteConnection = CreateDatabaseAndGetConnection(); + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection); + }); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _sqliteConnection.Dispose(); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + using (var context = new IdentityServiceDbContext(options)) + { + context.GetService().CreateTables(); + } + + return connection; + } + } +} diff --git a/services/identity/test/EShopOnAbp.IdentityService.TestBase/EShopOnAbp.IdentityService.TestBase.csproj b/services/identity/test/EShopOnAbp.IdentityService.TestBase/EShopOnAbp.IdentityService.TestBase.csproj new file mode 100644 index 00000000..0ea3d3fd --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.TestBase/EShopOnAbp.IdentityService.TestBase.csproj @@ -0,0 +1,24 @@ + + + + net5.0 + EShopOnAbp.IdentityService + + + + + + + + + + + + + + + + + + + diff --git a/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestBase.cs b/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestBase.cs new file mode 100644 index 00000000..e759246b --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestBase.cs @@ -0,0 +1,61 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace EShopOnAbp.IdentityService +{ + /* All test classes are derived from this class, directly or indirectly. + */ + public abstract class IdentityServiceTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule + { + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } + } +} diff --git a/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestBaseModule.cs b/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestBaseModule.cs new file mode 100644 index 00000000..0c33d3d2 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestBaseModule.cs @@ -0,0 +1,42 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace EShopOnAbp.IdentityService +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(IdentityServiceDomainModule) + )] + public class IdentityServiceTestBaseModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } + } +} \ No newline at end of file diff --git a/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestDataSeedContributor.cs b/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestDataSeedContributor.cs new file mode 100644 index 00000000..1b733259 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.TestBase/IdentityServiceTestDataSeedContributor.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace EShopOnAbp.IdentityService +{ + public class IdentityServiceTestDataSeedContributor : IDataSeedContributor, ITransientDependency + { + public Task SeedAsync(DataSeedContext context) + { + /* Seed additional test data... */ + + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/services/identity/test/EShopOnAbp.IdentityService.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/services/identity/test/EShopOnAbp.IdentityService.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 00000000..04bfde76 --- /dev/null +++ b/services/identity/test/EShopOnAbp.IdentityService.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace EShopOnAbp.IdentityService.Security +{ + [Dependency(ReplaceServices = true)] + public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor + { + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal _principal; + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName,"admin"), + new Claim(AbpClaimTypes.Email,"admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } + } +} diff --git a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json index 804b2c19..3757c456 100644 --- a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json +++ b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json @@ -16,7 +16,7 @@ "AllowedHosts": "*", "ConnectionStrings": { "SaasService": "Server=localhost,1434;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true", - "AdministrationService": "Server=localhost,1434;Database=MyProjectName_Administration;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true" + "AdministrationService": "Server=localhost,1434;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true" }, "StringEncryption": { "DefaultPassPhrase": "gsKnGZ041HLL4IM8" diff --git a/shared/EShopOnAbp.Shared.Hosting/EShopOnAbpSharedHostingModule.cs b/shared/EShopOnAbp.Shared.Hosting/EShopOnAbpSharedHostingModule.cs index 6b724f08..094b72bf 100644 --- a/shared/EShopOnAbp.Shared.Hosting/EShopOnAbpSharedHostingModule.cs +++ b/shared/EShopOnAbp.Shared.Hosting/EShopOnAbpSharedHostingModule.cs @@ -32,12 +32,12 @@ namespace EShopOnAbp.Shared.Hosting database.MappedConnections.Add("AbpFeatureManagement"); database.MappedConnections.Add("AbpBlobStoring"); }); - // - // options.Databases.Configure("IdentityService", database => - // { - // database.MappedConnections.Add("AbpIdentity"); - // database.MappedConnections.Add("AbpIdentityServer"); - // }); + + options.Databases.Configure("IdentityService", database => + { + database.MappedConnections.Add("AbpIdentity"); + database.MappedConnections.Add("AbpIdentityServer"); + }); // // options.Databases.Configure("ProductService", database => // {