diff --git a/.gitignore b/.gitignore index 455fa020f..5989a3cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ bin Logs appsettings.json appsettings.*.json +tempkey.jwk .vs /tests/e2e/videos/ diff --git a/aspnet-core/LINGYUN.MicroService.ApiGateway.sln b/aspnet-core/LINGYUN.MicroService.ApiGateway.sln index 82cf7d3ce..68b066655 100644 --- a/aspnet-core/LINGYUN.MicroService.ApiGateway.sln +++ b/aspnet-core/LINGYUN.MicroService.ApiGateway.sln @@ -31,10 +31,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{D6629D EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.EventBus.CAP", "modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj", "{1DA1835B-9EA4-4095-A8CF-10E2778206D3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.ApiGateWay.Admin.Domain.Shared", "modules\apigateway\LINGYUN.ApiGateWay.Admin.Domain.Shared\LINGYUN.ApiGateWay.Admin.Domain.Shared.csproj", "{1CC3B44E-213A-4853-8128-9935F2A4C5D4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.ApiGateWay.Admin.Domain", "modules\apigateway\LINGYUN.ApiGateWay.Admin.Domain\LINGYUN.ApiGateWay.Admin.Domain.csproj", "{1D548FA0-2A8F-455F-8814-F152751FB738}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -81,14 +77,6 @@ Global {1DA1835B-9EA4-4095-A8CF-10E2778206D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {1DA1835B-9EA4-4095-A8CF-10E2778206D3}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DA1835B-9EA4-4095-A8CF-10E2778206D3}.Release|Any CPU.Build.0 = Release|Any CPU - {1CC3B44E-213A-4853-8128-9935F2A4C5D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1CC3B44E-213A-4853-8128-9935F2A4C5D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1CC3B44E-213A-4853-8128-9935F2A4C5D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1CC3B44E-213A-4853-8128-9935F2A4C5D4}.Release|Any CPU.Build.0 = Release|Any CPU - {1D548FA0-2A8F-455F-8814-F152751FB738}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D548FA0-2A8F-455F-8814-F152751FB738}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D548FA0-2A8F-455F-8814-F152751FB738}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D548FA0-2A8F-455F-8814-F152751FB738}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -106,8 +94,6 @@ Global {4757C7D9-6AE9-477D-9829-55D9906AC3E6} = {AD93DD04-989C-40BE-A3F4-25DABF290423} {D6629DD3-BA0F-44B5-A97F-3B992ECAB85D} = {630FB448-8C5C-438F-930D-B0209407DE6A} {1DA1835B-9EA4-4095-A8CF-10E2778206D3} = {D6629DD3-BA0F-44B5-A97F-3B992ECAB85D} - {1CC3B44E-213A-4853-8128-9935F2A4C5D4} = {AD93DD04-989C-40BE-A3F4-25DABF290423} - {1D548FA0-2A8F-455F-8814-F152751FB738} = {AD93DD04-989C-40BE-A3F4-25DABF290423} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B327C65A-BD15-480D-825E-9D5A870C521A} diff --git a/aspnet-core/common.props b/aspnet-core/common.props index bb4a0f908..4583a40fe 100644 --- a/aspnet-core/common.props +++ b/aspnet-core/common.props @@ -1,7 +1,7 @@ latest - 3.3.0 + 4.0.0 LINGYUN $(NoWarn);CS1591;CS0436 https://github.com/colinin/abp-vue-admin-element-typescript/ diff --git a/aspnet-core/configuration/account/AuthServer.Host/appsettings.Development.json b/aspnet-core/configuration/account/AuthServer.Host/appsettings.Development.json index de75a6e93..0b36d2d19 100644 --- a/aspnet-core/configuration/account/AuthServer.Host/appsettings.Development.json +++ b/aspnet-core/configuration/account/AuthServer.Host/appsettings.Development.json @@ -62,7 +62,7 @@ }, "AuthServer": { "Authority": "http://localhost:44385/", - "ApiName": "auth-service" + "ApiName": "lingyun-abp-application" }, "WeChat": { "Auth": { diff --git a/aspnet-core/configuration/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/appsettings.Development.json b/aspnet-core/configuration/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/appsettings.Development.json index 275a624bc..3440b6601 100644 --- a/aspnet-core/configuration/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/appsettings.Development.json +++ b/aspnet-core/configuration/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/appsettings.Development.json @@ -88,7 +88,7 @@ }, "AuthServer": { "Authority": "http://localhost:44385/", - "ApiName": "auth-service" + "ApiName": "lingyun-abp-application" }, "Serilog": { "MinimumLevel": { diff --git a/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.Host/appsettings.Development.json b/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.Host/appsettings.Development.json index 5fa543474..2c0b4a5a2 100644 --- a/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.Host/appsettings.Development.json +++ b/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.Host/appsettings.Development.json @@ -9,20 +9,18 @@ }, "RemoteServices": { "ApiGateway": { - "BaseUrl": "http://localhost:30001/",//Ocelot Api代理地址,参见Volo.Abp.HttpClient - "IdentityClient": "apigateway-host-client" + "BaseUrl": "http://localhost:30001/", + "IdentityClient": "ApigatewayHostClient" } }, - "IdentityClients": {//这里是用于Ocelot主机去API服务器获取参数授权用的,参见Volo.Abp.HttpClient.IdentityModel - "apigateway-host-client": { + "IdentityClients": { + "ApigatewayHostClient": { "Authority": "http://localhost:44385", "RequireHttps": false, "GrantType": "client_credentials", - "ClientId": "apigateway-host-client", - "Scope": "apigateway-service", + "ClientId": "ApigatewayHostClient", "ClientSecret": "1q2w3e*", - "UserName": "ocelotHost", - "UserPassword": "Ocelot1." + "Scope": "lingyun-abp-application" } }, "EnabledDynamicOcelot": true, @@ -43,9 +41,8 @@ } }, "AuthServer": { - "Authority": "http://localhost:44385/",//填写你的IdentityServer服务器地址 - "ApiName": "apigateway-service",//填写你的IdentityServer服务器注册的ApiName - "ApiSecret": "defj98734htgrb90365D23"//填写你的IdentityServer服务器注册的ApiSecret + "Authority": "http://localhost:44385/", + "ApiName": "lingyun-abp-application" }, "Serilog": { "MinimumLevel": { diff --git a/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.HttpApi.Host/appsettings.Development.json b/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.HttpApi.Host/appsettings.Development.json index 169d08a49..c7cadad11 100644 --- a/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.HttpApi.Host/appsettings.Development.json +++ b/aspnet-core/configuration/apigateway/LINGYUN.ApiGateway.HttpApi.Host/appsettings.Development.json @@ -39,8 +39,7 @@ }, "AuthServer": { "Authority": "http://localhost:44385/", - "ApiName": "apigateway-service", - "ApiSecret": "defj98734htgrb90365D23" + "ApiName": "lingyun-abp-application" }, "Serilog": { "MinimumLevel": { diff --git a/aspnet-core/configuration/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/appsettings.Development.json b/aspnet-core/configuration/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/appsettings.Development.json index 6b860626b..09e593f60 100644 --- a/aspnet-core/configuration/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/appsettings.Development.json +++ b/aspnet-core/configuration/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/appsettings.Development.json @@ -74,7 +74,7 @@ }, "AuthServer": { "Authority": "http://localhost:44385/", - "ApiName": "auth-service" + "ApiName": "lingyun-abp-application" }, "Serilog": { "MinimumLevel": { diff --git a/aspnet-core/configuration/messages/LINGYUN.Abp.MessageService.HttpApi.Host/appsettings.Development.json b/aspnet-core/configuration/messages/LINGYUN.Abp.MessageService.HttpApi.Host/appsettings.Development.json index e910c3b27..a1902937e 100644 --- a/aspnet-core/configuration/messages/LINGYUN.Abp.MessageService.HttpApi.Host/appsettings.Development.json +++ b/aspnet-core/configuration/messages/LINGYUN.Abp.MessageService.HttpApi.Host/appsettings.Development.json @@ -22,7 +22,7 @@ }, "AuthServer": { "Authority": "http://localhost:44385/", - "ApiName": "auth-service" + "ApiName": "lingyun-abp-application" }, "Hangfire": { "MySql": { diff --git a/aspnet-core/configuration/platform/LINGYUN.Platform.HttpApi.Host/appsettings.Development.json b/aspnet-core/configuration/platform/LINGYUN.Platform.HttpApi.Host/appsettings.Development.json index ef05ee973..9b8ee492e 100644 --- a/aspnet-core/configuration/platform/LINGYUN.Platform.HttpApi.Host/appsettings.Development.json +++ b/aspnet-core/configuration/platform/LINGYUN.Platform.HttpApi.Host/appsettings.Development.json @@ -31,6 +31,22 @@ "VirtualHost": "Name of your RabbitMQ server VirtualHost" } }, + "RemoteServices": { + "AbpIdentity": { + "BaseUrl": "http://localhost:30015/", + "IdentityClient": "internal-service-client" + } + }, + "IdentityClients": { + "internal-service-client": { + "Authority": "http://localhost:44385", + "RequireHttps": false, + "GrantType": "client_credentials", + "Scope": "lingyun-abp-application", + "ClientId": "internal-service-client", + "ClientSecret": "1q2w3e*" + } + }, "Redis": { "Configuration": "127.0.0.1", "InstanceName": "LINGYUN.AbpApplication", @@ -38,7 +54,7 @@ }, "AuthServer": { "Authority": "http://localhost:44385/", - "ApiName": "auth-service" + "ApiName": "lingyun-abp-application" }, "Serilog": { "MinimumLevel": { diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj index e2ec82337..b2704d330 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj index 3e595fe0f..42a1b17a1 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj index df3312e51..d7b60e1a2 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN.ApiGateWay.Admin.Domain.Shared.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN.ApiGateWay.Admin.Domain.Shared.csproj deleted file mode 100644 index 7ceb12aac..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN.ApiGateWay.Admin.Domain.Shared.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - - - - - - - - - - - - - diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/ApiGateWayAdminDomainSharedModule.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/ApiGateWayAdminDomainSharedModule.cs deleted file mode 100644 index 4d63fbcee..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/ApiGateWayAdminDomainSharedModule.cs +++ /dev/null @@ -1,32 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Localization; -using Volo.Abp.Localization; -using Volo.Abp.Localization.ExceptionHandling; -using Volo.Abp.Modularity; -using Volo.Abp.VirtualFileSystem; - -namespace LINGYUN.ApiGateWay.Admin -{ - [DependsOn(typeof(AbpLocalizationModule))] - public class ApiGateWayAdminDomainSharedModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); - - Configure(options => - { - options.Resources - .Add("zh-Hans") - .AddVirtualJson("/LINGYUN/ApiGateWay/Admin/Localization/Resources"); - }); - - Configure(options => - { - options.MapCodeNamespace("ApiGateWayAdmin", typeof(ApiGateWayAdminResource)); - }); - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/HostAndPortConsts.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/HostAndPortConsts.cs deleted file mode 100644 index 3dee1c02d..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/HostAndPortConsts.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LINGYUN.ApiGateWay.Admin -{ - public class HostAndPortConsts - { - // 计算机名最大长度 - public const int MaxHostLength = 255; - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Http/HttpDelegatingHandlerConsts.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Http/HttpDelegatingHandlerConsts.cs deleted file mode 100644 index 9b710ade9..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Http/HttpDelegatingHandlerConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public class HttpDelegatingHandlerConsts - { - public const int MaxNameLength = 256; - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/ApiGateWayAdminResource.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/ApiGateWayAdminResource.cs deleted file mode 100644 index 3293ea60e..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/ApiGateWayAdminResource.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Volo.Abp.Localization; - -namespace LINGYUN.ApiGateWay.Admin.Localization -{ - [LocalizationResourceName("ApiGatewayAdmin")] - public class ApiGateWayAdminResource - { - - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/Resources/en.json b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/Resources/en.json deleted file mode 100644 index a9c8dcc3f..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/Resources/en.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "culture": "en", - "texts": { - } -} \ No newline at end of file diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/Resources/zh-Hans.json b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/Resources/zh-Hans.json deleted file mode 100644 index 50324cb8c..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/Localization/Resources/zh-Hans.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "zh-Hans", - "texts": { - - } -} \ No newline at end of file diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/RouteGroupAppKey.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/RouteGroupAppKey.cs deleted file mode 100644 index 24dced636..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain.Shared/LINGYUN/ApiGateWay/Admin/RouteGroupAppKey.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace LINGYUN.ApiGateWay.Admin -{ - public class RouteGroupAppKey - { - public string AppId { get; } - public string AppName { get; } - public RouteGroupAppKey(string appId, string appName) - { - AppId = appId; - AppName = appName; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN.ApiGateWay.Admin.Domain.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN.ApiGateWay.Admin.Domain.csproj deleted file mode 100644 index dfb938689..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN.ApiGateWay.Admin.Domain.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - - - - diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/ApiGateWayAdminDomainModule.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/ApiGateWayAdminDomainModule.cs deleted file mode 100644 index a0f73e2a7..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/ApiGateWayAdminDomainModule.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp.Domain; -using Volo.Abp.Modularity; - -namespace LINGYUN.ApiGateWay.Admin -{ - [DependsOn( - typeof(ApiGateWayAdminDomainSharedModule), - typeof(AbpDddDomainModule))] - public class ApiGateWayAdminDomainModule : AbpModule - { - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Globals/Global.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Globals/Global.cs deleted file mode 100644 index c317fba3e..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Globals/Global.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Volo.Abp.Domain.Entities.Auditing; - -namespace LINGYUN.ApiGateWay.Admin.Globals -{ - public class Global : FullAuditedAggregateRoot - { - - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/HostAndPort.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/HostAndPort.cs deleted file mode 100644 index 883643b3d..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/HostAndPort.cs +++ /dev/null @@ -1,62 +0,0 @@ -using JetBrains.Annotations; -using System; -using Volo.Abp; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin -{ - public class HostAndPort : Entity - { - public virtual string Host { get; protected set; } - public virtual int? Port { get; protected set; } - protected HostAndPort() - { - - } - - public HostAndPort(Guid id, [NotNull] string host, int? port = null) - { - Id = id; - BindHost(host, port); - } - - public void BindHost([NotNull] string host, int? port = null) - { - Check.NotNullOrWhiteSpace(host, nameof(host), HostAndPortConsts.MaxHostLength); - Host = host; - Port = port; - } - - public override int GetHashCode() - { - if (!Host.IsNullOrWhiteSpace()) - { - if (Port.HasValue) - { - return Host.GetHashCode() & Port.Value; - } - return Host.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Host.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is HostAndPort hostAndPort) - { - if (Port.HasValue) - { - return hostAndPort.Host.Equals(Host) && - Port.Equals(hostAndPort.Port); - } - return hostAndPort.Host.Equals(Host); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/DownstreamHttpMethod.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/DownstreamHttpMethod.cs deleted file mode 100644 index 480f50e03..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/DownstreamHttpMethod.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public class DownstreamHttpMethod : HttpMethod - { - public DownstreamHttpMethod(Guid id, string method) - : base(id, method) - { - - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpDelegatingHandler.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpDelegatingHandler.cs deleted file mode 100644 index d7cc305db..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpDelegatingHandler.cs +++ /dev/null @@ -1,45 +0,0 @@ -using JetBrains.Annotations; -using System; -using Volo.Abp; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public class HttpDelegatingHandler : Entity - { - public virtual string Name { get; protected set; } - protected HttpDelegatingHandler() - { - - } - - public HttpDelegatingHandler(Guid id, [NotNull] string name) - { - Id = id; - Name = Check.NotNullOrWhiteSpace(name, nameof(name), HttpDelegatingHandlerConsts.MaxNameLength); - } - - public override int GetHashCode() - { - if (!Name.IsNullOrWhiteSpace()) - { - return Name.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Name.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is HttpDelegatingHandler handler) - { - return Name.Equals(handler.Name, StringComparison.CurrentCultureIgnoreCase); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpHandler.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpHandler.cs deleted file mode 100644 index 80802452d..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpHandler.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public class HttpHandler : Entity - { - /// - /// 每台服务器最大连接数 - /// - public virtual int? MaxConnectionsPerServer { get; protected set; } - /// - /// 允许自动重定向 - /// - public virtual bool AllowAutoRedirect { get; set; } - /// - /// 使用Cookie容器 - /// - public virtual bool UseCookieContainer { get; set; } - /// - /// 启用跟踪 - /// - public virtual bool UseTracing { get; set; } - /// - /// 启用代理 - /// - public virtual bool UseProxy { get; set; } - protected HttpHandler() - { - - } - - public HttpHandler(Guid id) - { - Id = id; - } - - public void ChangeMaxConnection(int? maxConnection = 1000) - { - MaxConnectionsPerServer = maxConnection; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpHeader.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpHeader.cs deleted file mode 100644 index b0407ccdf..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpHeader.cs +++ /dev/null @@ -1,51 +0,0 @@ -using JetBrains.Annotations; -using System; -using Volo.Abp; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public abstract class HttpHeader : Entity - { - public virtual string Key { get; protected set; } - public virtual string Value { get; protected set; } - - protected HttpHeader() - { - - } - - protected HttpHeader(Guid id, [NotNull] string key, [NotNull] string value) - { - Id = id; - Key = Check.NotNullOrWhiteSpace(key, nameof(key)); - Value = Check.NotNullOrWhiteSpace(value, nameof(value)); - } - - public override int GetHashCode() - { - if (!Key.IsNullOrWhiteSpace() && - !Value.IsNullOrWhiteSpace()) - { - return Key.GetHashCode() & Value.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Key.IsNullOrWhiteSpace() || - Value.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is HttpHeader httpHeader) - { - return httpHeader.Key.Equals(Key, StringComparison.CurrentCultureIgnoreCase) && - httpHeader.Value.Equals(Value, StringComparison.CurrentCultureIgnoreCase); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpMethod.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpMethod.cs deleted file mode 100644 index 9a5acaadf..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpMethod.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public abstract class HttpMethod : Entity - { - /// - /// Http调用方法 - /// - public virtual string Method { get; protected set; } - protected HttpMethod() - { - - } - protected HttpMethod(Guid id, string method) - { - Id = id; - Method = method; - } - - public override int GetHashCode() - { - if (!Method.IsNullOrWhiteSpace()) - { - return Method.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Method.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is HttpMethod httpMethod) - { - return httpMethod.Method.Equals(Method); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpQuery.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpQuery.cs deleted file mode 100644 index 91a344383..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/HttpQuery.cs +++ /dev/null @@ -1,51 +0,0 @@ -using JetBrains.Annotations; -using System; -using Volo.Abp; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public class HttpQuery : Entity - { - public virtual string Key { get; protected set; } - public virtual string Value { get; protected set; } - - protected HttpQuery() - { - - } - - protected HttpQuery(Guid id, [NotNull] string key, [NotNull] string value) - { - Id = id; - Key = Check.NotNullOrWhiteSpace(key, nameof(key)); - Value = Check.NotNullOrWhiteSpace(value, nameof(value)); - } - - public override int GetHashCode() - { - if (!Key.IsNullOrWhiteSpace() && - !Value.IsNullOrWhiteSpace()) - { - return Key.GetHashCode() & Value.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Key.IsNullOrWhiteSpace() || - Value.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is HttpQuery httpQuery) - { - return Key.Equals(httpQuery.Key, StringComparison.CurrentCultureIgnoreCase) && - Value.Equals(httpQuery.Value, StringComparison.CurrentCultureIgnoreCase); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/UpstreamHttpMethod.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/UpstreamHttpMethod.cs deleted file mode 100644 index d9ffe0dae..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Http/UpstreamHttpMethod.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace LINGYUN.ApiGateWay.Admin.Http -{ - public class UpstreamHttpMethod : HttpMethod - { - public UpstreamHttpMethod(Guid id, string method) - : base(id, method) - { - - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/LoadBalancer.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/LoadBalancer.cs deleted file mode 100644 index bab6275ef..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/LoadBalancer.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin -{ - public class LoadBalancer : Entity - { - /// - /// 负载均衡类型 - /// - public virtual string Type { get; private set; } - /// - /// 用于Cookie会话密钥 - /// - public virtual string Key { get; private set; } - /// - /// 会话阻断时间 - /// - public virtual int? Expiry { get; private set; } - protected LoadBalancer() - { - - } - public LoadBalancer(Guid id, string type, string key, int? expiry = null) - { - Id = id; - ApplyPolicy(type, key, expiry); - } - - public void ApplyPolicy(string type, string key, int? expiry = null) - { - Type = type; - Key = key; - Expiry = expiry; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/QoS.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/QoS.cs deleted file mode 100644 index 1fac583e0..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/QoS.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin -{ - public class QoS : Entity - { - public virtual int? ExceptionsAllowedBeforeBreaking { get; private set; } - - public virtual int? DurationOfBreak { get; private set; } - - public virtual int? TimeoutValue { get; private set; } - - protected QoS() - { - - } - - public QoS(Guid id, int? exceptionsAllowdBeforeBreaking = null, int? durationOfBreak = null, int? timeOut = null) - { - Id = id; - ApplyPolicy(exceptionsAllowdBeforeBreaking, durationOfBreak, timeOut); - } - - public void ApplyPolicy(int? exceptionsAllowdBeforeBreaking = null, int? durationOfBreak = null, int? timeOut = null) - { - ExceptionsAllowedBeforeBreaking = exceptionsAllowdBeforeBreaking; - DurationOfBreak = durationOfBreak; - TimeoutValue = timeOut; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/RateLimitRule.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/RateLimitRule.cs deleted file mode 100644 index 868301386..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/RateLimitRule.cs +++ /dev/null @@ -1,57 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Security; -using System; -using System.Collections.Generic; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin -{ - public class RateLimitRule : Entity - { - /// - /// 客户端白名单列表,多个以分号分隔 - /// - public virtual ICollection ClientWhiteList { get; private set; } - /// - /// 是否启用流量现值 - /// - public virtual bool EnableRateLimiting { get; private set; } - /// - /// 限速时段 - /// - public virtual string Period { get; private set; } - /// - /// 速率极限周期 - /// - public virtual double? PeriodTimespan { get; private set; } - /// - /// 客户端在定义的时间内可以发出的最大请求数 - /// - public virtual long? Limit { get; private set; } - - protected RateLimitRule() - { - ClientWhiteList = new List(); - } - - public RateLimitRule(Guid id, string period = "", double? periodTimespan = null, - long? limit = null, bool enabled = true) - { - Id = id; - ChangeRateLimitState(enabled); - ApplyPolicy(period, periodTimespan, limit); - } - - public void ChangeRateLimitState(bool enabled = true) - { - EnableRateLimiting = enabled; - } - - public void ApplyPolicy(string period = "", double? periodTimespan = null, - long? limit = null) - { - Period = period; - PeriodTimespan = periodTimespan; - Limit = limit; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/Route.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/Route.cs deleted file mode 100644 index 7bac3ce3e..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/Route.cs +++ /dev/null @@ -1,348 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Security; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.Guids; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class Route : FullAuditedAggregateRoot - { - /// - /// 应用标识 - /// - public virtual string AppId { get; protected set; } - /// - /// 路由名称 - /// - public virtual string Name { get; protected set; } - /// - /// 请求标识 - /// - public virtual string RequestIdKey { get; set; } - /// - /// 是否区分大小写 - /// - public virtual bool RouteIsCaseSensitive { get; set; } - /// - /// 服务名称 - /// - public virtual string ServiceName { get; protected set; } - /// - /// 服务命名空间 - /// - public virtual string ServiceNamespace { get; protected set; } - /// - /// 下游协议 - /// - public virtual string DownstreamScheme { get; set; } - /// - /// 下游路由路径 - /// - public virtual string DownstreamPathTemplate { get; protected set; } - /// - /// 上游路由路径 - /// - public virtual string UpstreamPathTemplate { get; protected set; } - /// - /// 变更下游路径 - /// - public virtual string ChangeDownstreamPathTemplate { get; protected set; } - /// - /// 上游主机 - /// - public virtual string UpstreamHost { get; set; } - /// - /// 聚合标识 - /// - public virtual string Key { get; set; } - /// - /// 优先级 - /// - public virtual int? Priority { get; set; } - /// - /// 超时时间 - /// - public virtual int? Timeout { get; set; } - /// - /// 忽略SSL警告 - /// - public virtual bool DangerousAcceptAnyServerCertificateValidator { get; set; } - /// - /// 下游版本号 - /// - public virtual string DownstreamHttpVersion { get; set; } - /// - /// 下游Http方法列表 - /// - public virtual ICollection UpstreamHttpMethods { get; protected set; } - /// - /// 上游Http方法列表 - /// - public virtual ICollection DownstreamHttpMethods { get; protected set; } - /// - /// 添加请求头参数 - /// - public virtual ICollection AddHeadersToRequest { get; protected set; } - /// - /// 下游请求头转换 - /// - public virtual ICollection UpstreamHeaderTransform { get; protected set; } - /// - /// 上游请求头转换 - /// - public virtual ICollection DownstreamHeaderTransform { get; protected set; } - /// - /// 请求声明转换 - /// - public virtual ICollection AddClaimsToRequest { get; protected set; } - /// - /// 请求必须的声明 - /// - public virtual ICollection RouteClaimsRequirement { get; protected set; } - /// - /// 用户声明到请求头转换 - /// - public virtual ICollection AddQueriesToRequest { get; protected set; } - /// - /// 下游主机列表 - /// - public virtual ICollection DownstreamHostAndPorts { get; protected set; } - /// - /// 授权处理器列表 - /// - public virtual ICollection DelegatingHandlers { get; protected set; } - /// - /// Http选项 - /// - public virtual RouteHttpHandler HttpHandler { get; protected set; } - /// - /// 授权 - /// - public virtual RouteAuthentication Authentication { get; protected set; } - /// - /// 速率限制 - /// - public virtual RouteRateLimitRule RouteRateLimitRule { get; protected set; } - /// - /// 负债均衡 - /// - public virtual RouteLoadBalancer LoadBalancer { get; protected set; } - /// - /// 服务质量 - /// - public virtual RouteQos QoS { get; protected set; } - /// - /// 文件缓存 - /// - public virtual RouteCache Cache { get; protected set; } - /// - /// 安全策略 - /// - public virtual RouteSecurity Security { get; protected set; } - - protected Route() - { - UpstreamHttpMethods = new Collection(); - DownstreamHttpMethods = new Collection(); - AddHeadersToRequest = new Collection(); - UpstreamHeaderTransform = new Collection(); - DownstreamHeaderTransform = new Collection(); - AddClaimsToRequest = new Collection(); - RouteClaimsRequirement = new Collection(); - AddQueriesToRequest = new Collection(); - DownstreamHostAndPorts = new Collection(); - DelegatingHandlers = new Collection(); - } - - public void AddDownstreamHttpMethod(IGuidGenerator generator, string method) - { - DownstreamHttpMethods.AddIfNotContains(new RouteDownstreamHttpMethod(Id, generator.Create(), method)); ; - } - - public void RemoveDownstreamHttpMethod(string method) - { - DownstreamHttpMethods.RemoveAll(x => x.Method.Equals(method, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllDownstreamHttpMethod() - { - DownstreamHttpMethods.Clear(); - } - - public void AddUpstreamHttpMethod(IGuidGenerator generator, string method) - { - UpstreamHttpMethods.AddIfNotContains(new RouteUpstreamHttpMethod(Id, generator.Create(), method)); - } - - public void RemoveUpstreamHttpMethod(string method) - { - UpstreamHttpMethods.RemoveAll(x => x.Method.Equals(method, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllUpstreamHttpMethod() - { - UpstreamHttpMethods.Clear(); - } - - public void AddRequestHeader(IGuidGenerator generator, string key, string value) - { - AddHeadersToRequest.AddIfNotContains(new RouteAddRequestHttpHeader(Id, generator.Create(), key, value)); - } - - public void RemoveRequestHeader(string key, string value) - { - AddHeadersToRequest.RemoveAll(x => x.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase) - && x.Value.Equals(value, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllRequestHeader() - { - AddHeadersToRequest.Clear(); - } - - public void AddUpstreamHeaderTransform(IGuidGenerator generator, string key, string value) - { - UpstreamHeaderTransform.AddIfNotContains(new RouteUpstreamTransformHttpHeader(Id, generator.Create(), key, value)); - } - - public void RemoveUpstreamHeaderTransform(string key, string value) - { - UpstreamHeaderTransform.RemoveAll(x => x.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase) - && x.Value.Equals(value, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllUpstreamHeaderTransform() - { - UpstreamHeaderTransform.Clear(); - } - - public void AddDownstreamHeaderTransform(IGuidGenerator generator, string key, string value) - { - DownstreamHeaderTransform.AddIfNotContains(new RouteDownstreamTransformHttpHeader(Id, generator.Create(), key, value)); - } - - public void RemoveDownstreamHeaderTransform(string key, string value) - { - DownstreamHeaderTransform.RemoveAll(x => x.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase) - && x.Value.Equals(value, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllDownstreamHeaderTransform() - { - DownstreamHeaderTransform.Clear(); - } - - public void AddRequestClaim(IGuidGenerator generator, string key, string value) - { - AddClaimsToRequest.AddIfNotContains(new RouteAddToRequestClaim(Id, generator.Create(), key, value)); - } - - public void RemoveRequestClaim(string key, string value) - { - AddClaimsToRequest.RemoveAll(x => x.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase) - && x.Value.Equals(value, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllRequestClaim() - { - AddClaimsToRequest.Clear(); - } - - public void AddRequirementClaim(IGuidGenerator generator, string key, string value) - { - RouteClaimsRequirement.AddIfNotContains(new RouteRequirementClaim(Id, generator.Create(), key, value)); - } - - public void RemoveRequirementClaim(string key, string value) - { - RouteClaimsRequirement.RemoveAll(x => x.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase) - && x.Value.Equals(value, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllRequirementClaim() - { - RouteClaimsRequirement.Clear(); - } - - public void AddRequestQuery(IGuidGenerator generator, string key, string value) - { - AddQueriesToRequest.AddIfNotContains(new RouteAddToRequestHttpQuery(Id, generator.Create(), key, value)); - } - - public void RemoveRequestQuery(string key, string value) - { - AddQueriesToRequest.RemoveAll(x => x.Key.Equals(key, StringComparison.CurrentCultureIgnoreCase) - && x.Value.Equals(value, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllRequestQuery() - { - AddQueriesToRequest.Clear(); - } - - public void AddDownstreamHost(IGuidGenerator generator, string host, int? port) - { - DownstreamHostAndPorts.AddIfNotContains(new RouteDownstreamHostAndPort(Id, generator.Create(), host, port)); - } - - public void RemoveDownstreamHost(string host, int? port) - { - DownstreamHostAndPorts.RemoveAll(x => x.Host.Equals(host, StringComparison.CurrentCultureIgnoreCase) - && x.Port.Equals(port)); - } - - public void RemoveAllDownstreamHost() - { - DownstreamHostAndPorts.Clear(); - } - - public void AddDelegatingHandler(IGuidGenerator generator, string name) - { - DelegatingHandlers.AddIfNotContains(new RouteHttpDelegatingHandler(Id, generator.Create(), name)); - } - - public void RemoveDelegatingHandler(string name) - { - DelegatingHandlers.RemoveAll(x => x.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllDelegatingHandler() - { - DelegatingHandlers.Clear(); - } - - public void BindService(string serviceName, string @namespace) - { - ServiceName = serviceName; - ServiceNamespace = @namespace; - } - - public void UseHttpHandler(IGuidGenerator generator, bool autoRedirect = false, bool useCookie = false, - bool useTracking = false, bool useProxy = false, int? maxConnection = 1000) - { - if (HttpHandler == null) - { - HttpHandler = new RouteHttpHandler(generator.Create(), Id); - } - HttpHandler.UseProxy = useProxy; - HttpHandler.UseTracing = useTracking; - HttpHandler.UseCookieContainer = useCookie; - HttpHandler.AllowAutoRedirect = autoRedirect; - HttpHandler.ChangeMaxConnection(maxConnection); - } - - public void UseAuthentication(IGuidGenerator generator, string provider, IEnumerable allowScope) - { - if (Authentication == null) - { - Authentication = new RouteAuthentication(generator.Create(), Id, provider); - } - Authentication.AddScopes(allowScope); - } - - - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddRequestHttpHeader.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddRequestHttpHeader.cs deleted file mode 100644 index e6156a66a..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddRequestHttpHeader.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteAddRequestHttpHeader : HttpHeader - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteAddRequestHttpHeader() - { - - } - public RouteAddRequestHttpHeader(Guid routeId, Guid httpHeaderId, string key, string value) - : base(httpHeaderId, key, value) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddToRequestClaim.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddToRequestClaim.cs deleted file mode 100644 index 8748da69e..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddToRequestClaim.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Security; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteAddToRequestClaim : Claim - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteAddToRequestClaim() - { - - } - public RouteAddToRequestClaim(Guid routeId, Guid claimId, string key, string value) - : base(claimId, key, value) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddToRequestHttpQuery.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddToRequestHttpQuery.cs deleted file mode 100644 index b20073e45..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAddToRequestHttpQuery.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteAddToRequestHttpQuery : HttpQuery - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteAddToRequestHttpQuery() - { - - } - public RouteAddToRequestHttpQuery(Guid routeId, Guid httpQueryId, string key, string value) - : base(httpQueryId, key, value) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAllowedScope.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAllowedScope.cs deleted file mode 100644 index d2913ec8f..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAllowedScope.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteAllowedScope : Entity - { - public virtual string Scope { get; protected set; } - public virtual Guid AuthenticationId { get; protected set; } - public virtual RouteAuthentication Authentication { get; protected set; } - protected RouteAllowedScope() - { - - } - - public RouteAllowedScope(Guid authenticationId, string scope) - { - AuthenticationId = authenticationId; - Scope = scope; - } - - public override int GetHashCode() - { - if (!Scope.IsNullOrWhiteSpace()) - { - return Scope.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Scope.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is RouteAllowedScope allowedScope) - { - return allowedScope.Scope.Equals(Scope); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAuthentication.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAuthentication.cs deleted file mode 100644 index c67ce7f3c..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteAuthentication.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteAuthentication : Entity - { - public virtual string AuthenticationProviderKey { get; private set; } - public virtual ICollection AllowedScopes { get; set; } - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteAuthentication() - { - AllowedScopes = new List(); - } - - public RouteAuthentication(Guid id, Guid routeId, string providerKey) - { - Id = id; - RouteId = routeId; - ChangeProvider(providerKey); - } - - public void ChangeProvider(string providerKey) - { - AuthenticationProviderKey = providerKey; - } - - public void AddScope(string scope) - { - AllowedScopes.AddIfNotContains(new RouteAllowedScope(Id, scope)); - } - - public void AddScopes(IEnumerable scope) - { - foreach(var scop in scope) - { - AddScope(scop); - } - } - - public void RemoveScope(string scope) - { - AllowedScopes.RemoveAll(x => x.Scope.Equals(scope, StringComparison.CurrentCultureIgnoreCase)); - } - - public void RemoveAllScope() - { - AllowedScopes.Clear(); - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteCache.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteCache.cs deleted file mode 100644 index 082176d35..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteCache.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteCache : Entity - { - public virtual int? TtlSeconds { get; private set; } - public virtual string Region { get; private set; } - public virtual Guid RouteId { get; private set; } - public virtual Route Route { get; private set; } - protected RouteCache() - { - } - public RouteCache(Guid routeId, string region = "", int? ttlSeconds = null) - { - RouteId = routeId; - Region = region; - TtlSeconds = ttlSeconds; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamHostAndPort.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamHostAndPort.cs deleted file mode 100644 index a34016a3f..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamHostAndPort.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteDownstreamHostAndPort : HostAndPort - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteDownstreamHostAndPort() - { - - } - public RouteDownstreamHostAndPort(Guid routeId, Guid hostId, string key, int? port) - : base(hostId, key, port) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamHttpMethod.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamHttpMethod.cs deleted file mode 100644 index c17811551..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamHttpMethod.cs +++ /dev/null @@ -1,21 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteDownstreamHttpMethod : HttpMethod - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteDownstreamHttpMethod() - { - - } - - public RouteDownstreamHttpMethod(Guid routeId, Guid httpMethodId, string method) - : base(httpMethodId, method) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamTransformHttpHeader.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamTransformHttpHeader.cs deleted file mode 100644 index 288e50fb3..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteDownstreamTransformHttpHeader.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteDownstreamTransformHttpHeader : HttpHeader - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteDownstreamTransformHttpHeader() - { - - } - public RouteDownstreamTransformHttpHeader(Guid routeId, Guid httpHeaderId, string key, string value) - : base(httpHeaderId, key, value) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpDelegatingHandler.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpDelegatingHandler.cs deleted file mode 100644 index 473f9627f..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpDelegatingHandler.cs +++ /dev/null @@ -1,21 +0,0 @@ -using JetBrains.Annotations; -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteHttpDelegatingHandler : HttpDelegatingHandler - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteHttpDelegatingHandler() - { - - } - public RouteHttpDelegatingHandler(Guid routeId, Guid httpHandlerId, [NotNull] string name) - : base(httpHandlerId, name) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpHandler.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpHandler.cs deleted file mode 100644 index dc07f731c..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpHandler.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteHttpHandler : HttpHandler - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteHttpHandler() - { - - } - public RouteHttpHandler(Guid id, Guid routeId) - { - Id = id; - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpMethod.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpMethod.cs deleted file mode 100644 index d4c099387..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteHttpMethod.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteHttpMethod - { - - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteLoadBalancer.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteLoadBalancer.cs deleted file mode 100644 index 65d38b155..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteLoadBalancer.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteLoadBalancer : Entity - { - public virtual Guid LoadBalancerId { get; private set; } - public virtual LoadBalancer LoadBalancer { get; private set; } - public virtual Guid RouteId { get; private set; } - public virtual Route Route { get; private set; } - protected RouteLoadBalancer() - { - - } - - public RouteLoadBalancer(Guid routeId, Guid loadBalancerId) - { - RouteId = routeId; - LoadBalancerId = loadBalancerId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteQos.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteQos.cs deleted file mode 100644 index c9a4ef23d..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteQos.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteQos : Entity - { - public virtual Guid QoSId { get; protected set; } - public virtual QoS QoS { get; protected set; } - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteQos() - { - - } - public RouteQos(Guid routeId, Guid qosId) - { - RouteId = routeId; - QoSId = qosId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteRateLimitRule.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteRateLimitRule.cs deleted file mode 100644 index 716076e14..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteRateLimitRule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteRateLimitRule : Entity - { - public virtual Guid RateLimitRuleId { get; protected set; } - public virtual RateLimitRule RateLimitRule { get; protected set; } - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteRateLimitRule() - { - - } - - public RouteRateLimitRule(Guid routeId, Guid rateLimitRuleId) - { - RouteId = routeId; - RateLimitRuleId = rateLimitRuleId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteRequirementClaim.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteRequirementClaim.cs deleted file mode 100644 index 4168e78af..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteRequirementClaim.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Security; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteRequirementClaim : Claim - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteRequirementClaim() - { - - } - public RouteRequirementClaim(Guid routeId, Guid claimId, string key, string value) - : base(claimId, key, value) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteUpstreamHttpMethod.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteUpstreamHttpMethod.cs deleted file mode 100644 index 654e3496b..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteUpstreamHttpMethod.cs +++ /dev/null @@ -1,21 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteUpstreamHttpMethod : HttpMethod - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteUpstreamHttpMethod() - { - - } - - public RouteUpstreamHttpMethod(Guid routeId, Guid httpMethodId, string method) - : base(httpMethodId, method) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteUpstreamTransformHttpHeader.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteUpstreamTransformHttpHeader.cs deleted file mode 100644 index 0c8bf5573..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Routes/RouteUpstreamTransformHttpHeader.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Http; -using System; - -namespace LINGYUN.ApiGateWay.Admin.Routes -{ - public class RouteUpstreamTransformHttpHeader : HttpHeader - { - public virtual Guid RouteId { get; protected set; } - public virtual Route Route { get; protected set; } - protected RouteUpstreamTransformHttpHeader() - { - - } - public RouteUpstreamTransformHttpHeader(Guid routeId, Guid httpHeaderId, string key, string value) - : base(httpHeaderId, key, value) - { - RouteId = routeId; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/Claim.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/Claim.cs deleted file mode 100644 index e2667027c..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/Claim.cs +++ /dev/null @@ -1,50 +0,0 @@ -using JetBrains.Annotations; -using System; -using Volo.Abp; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Security -{ - public class Claim : Entity - { - public virtual string Key { get; protected set; } - public virtual string Value { get; protected set; } - protected Claim() - { - - } - - protected Claim(Guid id, [NotNull] string key, [NotNull] string value) - { - Id = id; - Key = Check.NotNullOrWhiteSpace(key, nameof(key)); - Value = Check.NotNullOrWhiteSpace(value, nameof(value)); - } - - public override int GetHashCode() - { - if (!Key.IsNullOrWhiteSpace() && - !Value.IsNullOrWhiteSpace()) - { - return Key.GetHashCode() & Value.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Key.IsNullOrWhiteSpace() || - Value.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is Claim claim) - { - return claim.Key.Equals(Key, StringComparison.CurrentCultureIgnoreCase) && - claim.Value.Equals(Value, StringComparison.CurrentCultureIgnoreCase); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteClientWhite.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteClientWhite.cs deleted file mode 100644 index fec50cf4f..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteClientWhite.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Security -{ - public class RouteClientWhite : Entity - { - public virtual string ClientId { get; private set; } - public virtual Guid RateLimitRuleId { get; private set; } - public virtual RateLimitRule RateLimitRule { get; private set; } - public override int GetHashCode() - { - if (!ClientId.IsNullOrWhiteSpace()) - { - return ClientId.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - ClientId.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is RouteClientWhite clientWhite) - { - return clientWhite.ClientId.Equals(ClientId); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteIPBlock.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteIPBlock.cs deleted file mode 100644 index 38f2fecae..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteIPBlock.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Security -{ - public class RouteIPBlock : Entity - { - public virtual string Address { get; private set; } - public virtual Guid SecurityId { get; private set; } - public virtual RouteSecurity Security { get; private set; } - protected RouteIPBlock() { } - public RouteIPBlock(Guid securityId, string address) - { - SecurityId = securityId; - Address = address; - } - public override int GetHashCode() - { - if (!Address.IsNullOrWhiteSpace()) - { - return Address.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if (obj == null || - Address.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is RouteIPBlock iPBlock) - { - return iPBlock.Address.Equals(Address); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteIPWhite.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteIPWhite.cs deleted file mode 100644 index 55e0a80d6..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteIPWhite.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Security -{ - public class RouteIPWhite : Entity - { - public virtual string Address { get; private set; } - public virtual Guid SecurityId { get; private set; } - public virtual RouteSecurity Security { get; private set; } - - protected RouteIPWhite() { } - public RouteIPWhite(Guid securityId, string address) - { - SecurityId = securityId; - Address = address; - } - public override int GetHashCode() - { - if (!Address.IsNullOrWhiteSpace()) - { - return Address.GetHashCode(); - } - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - if(obj == null || - Address.IsNullOrWhiteSpace()) - { - return false; - } - if (obj is RouteIPWhite iPWhite) - { - return iPWhite.Address.Equals(Address); - } - return false; - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteSecurity.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteSecurity.cs deleted file mode 100644 index 535823329..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateWay.Admin.Domain/LINGYUN/ApiGateWay/Admin/Security/RouteSecurity.cs +++ /dev/null @@ -1,56 +0,0 @@ -using LINGYUN.ApiGateWay.Admin.Routes; -using System; -using System.Collections.Generic; -using Volo.Abp.Domain.Entities; - -namespace LINGYUN.ApiGateWay.Admin.Security -{ - public class RouteSecurity : Entity - { - public virtual ICollection IPAllowedList { get; private set; } - public virtual ICollection IPBlockedList { get; private set; } - public virtual Guid RouteId { get; private set; } - public virtual Route Route { get; private set; } - protected RouteSecurity() - { - IPAllowedList = new List(); - IPBlockedList = new List(); - } - - public RouteSecurity(Guid id, Guid routeId) : this() - { - Id = id; - RouteId = routeId; - } - - public void AddIpWhite(string address) - { - IPAllowedList.AddIfNotContains(new RouteIPWhite(Id, address)); - } - - public void RemoveIpWhite(string address) - { - IPAllowedList.RemoveAll(ip => ip.Address.Equals(address)); - } - - public void RemoveAllIpWhite() - { - IPAllowedList.Clear(); - } - - public void AddIpBlock(string address) - { - IPBlockedList.AddIfNotContains(new RouteIPBlock(Id, address)); - } - - public void RemoveIpBlock(string address) - { - IPBlockedList.RemoveAll(ip => ip.Address.Equals(address)); - } - - public void RemoveAllIpBlock() - { - IPBlockedList.Clear(); - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj index 587d5806c..9fd61c6f3 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/AggregateReRouteDto.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/AggregateReRouteDto.cs index 816c6b154..5f2d351b6 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/AggregateReRouteDto.cs +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/AggregateReRouteDto.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; namespace LINGYUN.ApiGateway.Ocelot @@ -9,8 +8,7 @@ namespace LINGYUN.ApiGateway.Ocelot { public string AppId { get; set; } - [JsonConverter(typeof(HexLongConverter))] - public long ReRouteId { get; set; } + public string ReRouteId { get; set; } public string Name { get; set; } diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/DynamicReRouteDto.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/DynamicReRouteDto.cs index cd025b9c6..ebdb12bf3 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/DynamicReRouteDto.cs +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/DynamicReRouteDto.cs @@ -1,12 +1,10 @@ -using Newtonsoft.Json; -using System; +using System; namespace LINGYUN.ApiGateway.Ocelot { [Serializable] public class DynamicReRouteDto : DynamicReRouteDtoBase { - [JsonConverter(typeof(HexLongConverter))] - public virtual long DynamicReRouteId { get; set; } + public virtual string DynamicReRouteId { get; set; } } } diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/GlobalConfigurationDto.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/GlobalConfigurationDto.cs index cb4ccf613..59485d2d8 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/GlobalConfigurationDto.cs +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/GlobalConfigurationDto.cs @@ -1,13 +1,11 @@ -using Newtonsoft.Json; -using System; +using System; namespace LINGYUN.ApiGateway.Ocelot { [Serializable] public class GlobalConfigurationDto : GlobalConfigurationDtoBase { - [JsonConverter(typeof(HexLongConverter))] - public long ItemId { get; set; } + public string ItemId { get; set; } public string AppId { get; set; } public GlobalConfigurationDto() diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/ReRouteDto.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/ReRouteDto.cs index 822f173c2..9079761d6 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/ReRouteDto.cs +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN/ApiGateway/Ocelot/Dto/Result/ReRouteDto.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json; -using System; +using System; namespace LINGYUN.ApiGateway.Ocelot { @@ -7,9 +6,7 @@ namespace LINGYUN.ApiGateway.Ocelot public class ReRouteDto : ReRouteDtoBase { public int Id { get; set; } - - [JsonConverter(typeof(HexLongConverter))] - public long ReRouteId { get; set; } + public string ReRouteId { get; set; } public string ConcurrencyStamp { get; set; } public string ReRouteName { get; set; } public string AppId { get; set; } diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj index 494902122..d4425d1dd 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj index eb07e0bcb..caf28380e 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/Newtonsoft/Json/HexLongConverter.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/Newtonsoft/Json/HexLongConverter.cs deleted file mode 100644 index e28c43cda..000000000 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/Newtonsoft/Json/HexLongConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace Newtonsoft.Json -{ - public class HexLongConverter : JsonConverter - { - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - long v = value is ulong ? (long)(ulong)value : (long)value; - writer.WriteValue(v.ToString()); - } - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - string value = reader.Value as string; - long lValue = long.Parse(value); - return typeof(ulong) == objectType ? (object)(ulong)lValue : lValue; - } - public override bool CanConvert(Type objectType) - { - switch (objectType.FullName) - { - case "System.Int64": - case "System.UInt64": - return true; - default: - return false; - } - } - } -} diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj index 97370b034..68875e6f7 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj index 7267f9dda..faad44954 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj @@ -1,14 +1,14 @@ - + - netstandard2.0 + netstandard2.1 - + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj index 3ed2c40ab..01c7eff04 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj index 52b9d8688..c69b969ce 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationController.cs b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationController.cs index c6ae0ddbf..4f86b2ed1 100644 --- a/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationController.cs +++ b/aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationController.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Clients; namespace LINGYUN.ApiGateway.Ocelot { @@ -26,6 +27,8 @@ namespace LINGYUN.ApiGateway.Ocelot [Route("By-AppId/{AppId}")] public async Task GetAsync(GlobalGetByAppIdInputDto input) { + ICurrentClient client = null; + var currentClient = LazyGetRequiredService(ref client); return await GlobalConfigurationAppService.GetAsync(input); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj index 6dadbf1ae..9d6502749 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj index 4421849f8..3ffbd3049 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj index 000ee369b..94e70ec14 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj b/aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj index 41a5c695f..5d2cbd277 100644 --- a/aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj +++ b/aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/aspnet-core/modules/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj b/aspnet-core/modules/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj index 39e6c005c..025f5ee9f 100644 --- a/aspnet-core/modules/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj +++ b/aspnet-core/modules/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj @@ -19,9 +19,9 @@ - - - + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Aliyun.Authorization/LINGYUN.Abp.Aliyun.Authorization.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Aliyun.Authorization/LINGYUN.Abp.Aliyun.Authorization.csproj index e81f4130b..7a6571adc 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Aliyun.Authorization/LINGYUN.Abp.Aliyun.Authorization.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Aliyun.Authorization/LINGYUN.Abp.Aliyun.Authorization.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj index e30079e1e..762b185fd 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj @@ -1,15 +1,15 @@ - + - netcoreapp3.1 + net5.0 - - + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj index 42a4015e3..a06804ba1 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj b/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj index 95aae0a6d..37543e2f7 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs/LINGYUN.Abp.BackgroundJobs.csproj b/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs/LINGYUN.Abp.BackgroundJobs.csproj index 28bbeeb88..5ff11a7c5 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs/LINGYUN.Abp.BackgroundJobs.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs/LINGYUN.Abp.BackgroundJobs.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj b/aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj index fa6958408..57986325a 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj @@ -10,7 +10,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock.Redis/LINGYUN.Abp.DistributedLock.Redis.csproj b/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock.Redis/LINGYUN.Abp.DistributedLock.Redis.csproj index 55649492f..95bc73267 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock.Redis/LINGYUN.Abp.DistributedLock.Redis.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.DistributedLock.Redis/LINGYUN.Abp.DistributedLock.Redis.csproj @@ -9,10 +9,10 @@ - - + + - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj index 033060116..f4334065d 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj index 24e3a55dc..efa8c1a3a 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj @@ -22,7 +22,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj index 11304ba1d..6d85dadf6 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj index 3b5ab8e3d..2aa80afba 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj index 4ba653624..723c41953 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj @@ -9,9 +9,9 @@ - + - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj index 66ab7ed96..c51b73d5f 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj index 2bdd74089..c0b0ad31d 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj @@ -1,4 +1,4 @@ - + @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs index f7a056012..e6cc4da13 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs @@ -1,7 +1,8 @@ using Hangfire; -using Hangfire.MySql.Core; +using Hangfire.MySql; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; using Volo.Abp.Hangfire; using Volo.Abp.Modularity; @@ -34,5 +35,10 @@ namespace LINGYUN.Abp.Hangfire.Storage.MySql config.UseStorage(_jobStorage); }); } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _jobStorage?.Dispose(); + } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj index 1d436d159..91a197239 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj @@ -9,7 +9,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj index 676d66357..dc3e63f12 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj @@ -3,13 +3,13 @@ - netcoreapp3.1 + net5.0 - - + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj index 9f5c6051b..007550af9 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj index 5ab1c3110..9ebb9f8bf 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj @@ -19,10 +19,10 @@ - - - - + + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj index d8d6835e4..73542ea7d 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj @@ -19,10 +19,10 @@ - - - - + + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj index 58380425b..8bff694d0 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj @@ -9,7 +9,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj index ba845b624..b96845a73 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj @@ -3,13 +3,13 @@ - netcoreapp3.1 + net5.0 - - + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj index 7ec06c74a..e5b154386 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj index 2cc80b3c6..0908a7071 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN.Abp.RealTime.SignalR.csproj b/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN.Abp.RealTime.SignalR.csproj index 6acd58a00..ae8a0c3bc 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN.Abp.RealTime.SignalR.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN.Abp.RealTime.SignalR.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj index e81f4130b..7a6571adc 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj index 5e76ffadb..e65ba5ad4 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj index 79bf2fca4..3a7814355 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj index 31504daf5..1feccd899 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj @@ -20,9 +20,9 @@ - - - + + + diff --git a/aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj b/aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj index ec41a5f5f..333486ec9 100644 --- a/aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj +++ b/aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/aspnet-core/modules/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj b/aspnet-core/modules/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj index e1fdc9871..923421134 100644 --- a/aspnet-core/modules/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj +++ b/aspnet-core/modules/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN.Abp.FileManagement.Application.Contracts.csproj b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN.Abp.FileManagement.Application.Contracts.csproj index a6204eed5..750671ed2 100644 --- a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN.Abp.FileManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN.Abp.FileManagement.Application.Contracts.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain.Shared/LINGYUN.Abp.FileManagement.Domain.Shared.csproj b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain.Shared/LINGYUN.Abp.FileManagement.Domain.Shared.csproj index 034707f30..d351dd5f5 100644 --- a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain.Shared/LINGYUN.Abp.FileManagement.Domain.Shared.csproj +++ b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain.Shared/LINGYUN.Abp.FileManagement.Domain.Shared.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain/LINGYUN.Abp.FileManagement.Domain.csproj b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain/LINGYUN.Abp.FileManagement.Domain.csproj index 29260b76d..38baeb1b5 100644 --- a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain/LINGYUN.Abp.FileManagement.Domain.csproj +++ b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain/LINGYUN.Abp.FileManagement.Domain.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.HttpApi/LINGYUN.Abp.FileManagement.HttpApi.csproj b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.HttpApi/LINGYUN.Abp.FileManagement.HttpApi.csproj index 726583689..3478614b1 100644 --- a/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.HttpApi/LINGYUN.Abp.FileManagement.HttpApi.csproj +++ b/aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.HttpApi/LINGYUN.Abp.FileManagement.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj index cb8da47c5..2eca9cc26 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj index 92b8149ef..b2115a5cc 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj index bed1350ca..b6c3e8197 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj index 42a7d33a4..c1cb7b7a8 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj index c0e43f0c3..df8db6fa0 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj @@ -3,12 +3,12 @@ - netstandard2.0 + netstandard2.1 - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj index b02fc95d8..0bbe4c93d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj index 413521dc2..4b5ee5211 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.PermissionManagement.Domain.Identity/LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.PermissionManagement.Domain.Identity/LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj index 25fd67c09..f01e5e817 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.PermissionManagement.Domain.Identity/LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.PermissionManagement.Domain.Identity/LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj index 26ae280fc..aa447b014 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj @@ -1,9 +1,9 @@ - + - netcoreapp3.1 + net5.0 @@ -18,8 +18,9 @@ - - + + + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs index ad437cbce..d4fa229be 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs @@ -1,4 +1,5 @@ using Volo.Abp.Application; +using Volo.Abp.Authorization; using Volo.Abp.IdentityServer; using Volo.Abp.IdentityServer.Localization; using Volo.Abp.Localization; @@ -7,8 +8,10 @@ using Volo.Abp.VirtualFileSystem; namespace LINGYUN.Abp.IdentityServer { - [DependsOn(new[] { typeof(AbpDddApplicationModule) })] - [DependsOn(new[] { typeof(AbpIdentityServerDomainSharedModule) })] + [DependsOn( + typeof(AbpAuthorizationModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpIdentityServerDomainSharedModule))] public class AbpIdentityServerApplicationContractsModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs index d766260f1..6c107be83 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs @@ -12,6 +12,11 @@ /// public const string ApiResourceNameExisted = "ApiResourceNameExisted"; + /// + /// Api范围已经存在 + /// + public const string ApiScopeNameExisted = "ApiScopeNameExisted"; + /// /// 身份资源已经存在 /// diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs index 8466f840c..a179d35f1 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs @@ -41,8 +41,16 @@ namespace LINGYUN.Abp.IdentityServer apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.Delete, L("Permissions:Delete"), MultiTenancySides.Host); apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageSecrets, L("Permissions:ManageSecrets"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageScopes, L("Permissions:ManageScopes"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); + + // Api范围权限 + var apiScopePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.ApiScopes.Default, L("Permissions:ApiScopes"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Create, L("Permissions:Create"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Update, L("Permissions:Update"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Delete, L("Permissions:Delete"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); // 身份资源权限 var identityResourcePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.IdentityResources.Default, L("Permissions:IdentityResources"), MultiTenancySides.Host); @@ -51,6 +59,10 @@ namespace LINGYUN.Abp.IdentityServer identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.Delete, L("Permissions:Delete"), MultiTenancySides.Host); identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); + + // 持久授权 + var persistedGrantPermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.Grants.Default, L("Permissions:Grants"), MultiTenancySides.Host); + persistedGrantPermissions.AddChild(AbpIdentityServerPermissions.Grants.Delete, L("Permissions:Delete"), MultiTenancySides.Host); } protected virtual LocalizableString L(string name) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs index 8e8a5e284..a8a677af4 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs @@ -23,9 +23,19 @@ public const string Create = Default + ".Create"; public const string Update = Default + ".Update"; public const string Delete = Default + ".Delete"; - public const string ManageScopes = Default + ".ManageScopes"; public const string ManageClaims = Default + ".ManageClaims"; public const string ManageSecrets = Default + ".ManageSecrets"; + public const string ManageScopes = Default + ".ManageScopes"; + public const string ManageProperties = Default + ".ManageProperties"; + } + + public static class ApiScopes + { + public const string Default = GroupName + ".ApiScopes"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManageClaims = Default + ".ManageClaims"; public const string ManageProperties = Default + ".ManageProperties"; } @@ -38,5 +48,11 @@ public const string ManageClaims = Default + ".ManageClaims"; public const string ManageProperties = Default + ".ManageProperties"; } + + public static class Grants + { + public const string Default = GroupName + ".Grants"; + public const string Delete = Default + ".Delete"; + } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceClaimDto.cs new file mode 100644 index 000000000..551333d0e --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceClaimDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.ApiResources +{ + public class ApiResourceClaimDto : UserClaimDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs index 07350361d..419a0fc92 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs @@ -1,12 +1,13 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.Validation; namespace LINGYUN.Abp.IdentityServer.ApiResources { public class ApiResourceCreateDto : ApiResourceCreateOrUpdateDto { [Required] - [StringLength(ApiResourceConsts.NameMaxLength)] + [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.NameMaxLength))] public string Name { get; set; } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs index d2a98b567..5aee330c1 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs @@ -1,33 +1,37 @@ using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.Validation; namespace LINGYUN.Abp.IdentityServer.ApiResources { public class ApiResourceCreateOrUpdateDto { - [StringLength(ApiResourceConsts.DisplayNameMaxLength)] + [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DisplayNameMaxLength))] public string DisplayName { get; set; } - [StringLength(ApiResourceConsts.DescriptionMaxLength)] + [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DescriptionMaxLength))] public string Description { get; set; } public bool Enabled { get; set; } - public List UserClaims { get; set; } + public string AllowedAccessTokenSigningAlgorithms { get; set; } - public List Scopes { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List Secrets { get; set; } + public List Secrets { get; set; } - public Dictionary Properties { get; set; } + public List Scopes { get; set; } + + public List UserClaims { get; set; } + + public List Properties { get; set; } protected ApiResourceCreateOrUpdateDto() { - UserClaims = new List(); - Scopes = new List(); - Secrets = new List(); - Properties = new Dictionary(); + UserClaims = new List(); + Scopes = new List(); + Secrets = new List(); + Properties = new List(); } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs index 71d4e6335..806cd6ff1 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.IdentityServer.ApiResources { - public class ApiResourceDto : ExtensibleFullAuditedEntityDto + public class ApiResourceDto : ExtensibleAuditedEntityDto { public string Name { get; set; } @@ -14,20 +14,24 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources public bool Enabled { get; set; } - public List Secrets { get; set; } + public string AllowedAccessTokenSigningAlgorithms { get; set; } - public List Scopes { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List Secrets { get; set; } - public Dictionary Properties { get; set; } + public List Scopes { get; set; } + + public List UserClaims { get; set; } + + public List Properties { get; set; } public ApiResourceDto() { - UserClaims = new List(); - Scopes = new List(); - Secrets = new List(); - Properties = new Dictionary(); + UserClaims = new List(); + Scopes = new List(); + Secrets = new List(); + Properties = new List(); } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourcePropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourcePropertyDto.cs new file mode 100644 index 000000000..0df343528 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourcePropertyDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.ApiResources +{ + public class ApiResourcePropertyDto : PropertyDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiScopeCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs similarity index 59% rename from aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiScopeCreateDto.cs rename to aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs index 831cbdec1..03e617120 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiScopeCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs @@ -1,23 +1,24 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.IdentityServer.ApiScopes; +using Volo.Abp.Validation; namespace LINGYUN.Abp.IdentityServer.ApiResources { - public class ApiScopeCreateDto + public class ApiResourceScopeCreateDto { [Required] public Guid ApiResourceId { get; set; } [Required] - [StringLength(ApiScopeConsts.NameMaxLength)] + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.NameMaxLength))] public string Name { get; set; } - [StringLength(ApiScopeConsts.DisplayNameMaxLength)] + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DisplayNameMaxLength))] public string DisplayName { get; set; } - [StringLength(ApiScopeConsts.DescriptionMaxLength)] + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DescriptionMaxLength))] public string Description { get; set; } public bool Required { get; set; } @@ -28,7 +29,7 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources public List UserClaims { get; set; } - public ApiScopeCreateDto() + public ApiResourceScopeCreateDto() { UserClaims = new List(); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs new file mode 100644 index 000000000..23438c1b1 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer.ApiResources +{ + public class ApiResourceScopeDto + { + public string Scope { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiSecretCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretCreateOrUpdateDto.cs similarity index 64% rename from aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiSecretCreateOrUpdateDto.cs rename to aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretCreateOrUpdateDto.cs index fc8e21ac6..f4bd29504 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiSecretCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretCreateOrUpdateDto.cs @@ -1,6 +1,6 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources { - public class ApiSecretCreateOrUpdateDto : SecretBaseDto + public class ApiResourceSecretCreateOrUpdateDto : SecretDto { public HashType HashType { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiSecretDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretDto.cs similarity index 57% rename from aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiSecretDto.cs rename to aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretDto.cs index 86293223a..f0abcf862 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiSecretDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretDto.cs @@ -1,6 +1,6 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources { - public class ApiSecretDto : SecretBaseDto + public class ApiResourceSecretDto : SecretDto { } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiScopeDto.cs deleted file mode 100644 index b38b638a7..000000000 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiScopeDto.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; - -namespace LINGYUN.Abp.IdentityServer.ApiResources -{ - public class ApiScopeDto - { - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string Description { get; set; } - - public bool Required { get; set; } - - public bool Emphasize { get; set; } - - public bool ShowInDiscoveryDocument { get; set; } - - public List UserClaims { get; set; } - - public ApiScopeDto() - { - UserClaims = new List(); - } - } -} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeClaimDto.cs new file mode 100644 index 000000000..40856b369 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeClaimDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public class ApiScopeClaimDto : UserClaimDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs new file mode 100644 index 000000000..eede72554 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public class ApiScopeCreateDto : ApiScopeCreateOrUpdateDto + { + public string Name { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs new file mode 100644 index 000000000..bd0945d03 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public class ApiScopeCreateOrUpdateDto + { + public bool Enabled { get; set; } + + public string DisplayName { get; set; } + + public string Description { get; set; } + + public bool Required { get; set; } + + public bool Emphasize { get; set; } + + public bool ShowInDiscoveryDocument { get; set; } + + public List UserClaims { get; set; } + + public List Properties { get; set; } + + public ApiScopeCreateOrUpdateDto() + { + UserClaims = new List(); + Properties = new List(); + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs new file mode 100644 index 000000000..8dcac419e --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public class ApiScopeDto : ExtensibleAuditedEntityDto + { + public bool Enabled { get; set; } + + public string Name { get; set; } + + public string DisplayName { get; set; } + + public string Description { get; set; } + + public bool Required { get; set; } + + public bool Emphasize { get; set; } + + public bool ShowInDiscoveryDocument { get; set; } + + public List UserClaims { get; set; } + + public List Properties { get; set; } + + public ApiScopeDto() + { + UserClaims = new List(); + Properties = new List(); + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs new file mode 100644 index 000000000..ace198500 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public class ApiScopePropertyDto : EntityDto + { + public string Key { get; set; } + + public string Value { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeUpdateDto.cs new file mode 100644 index 000000000..837f117c3 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeUpdateDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public class ApiScopeUpdateDto : ApiScopeCreateOrUpdateDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs new file mode 100644 index 000000000..68e7ead07 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public class GetApiScopeInput : PagedAndSortedResultRequestDto + { + public string Filter { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeAppService.cs new file mode 100644 index 000000000..03bdd02e2 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeAppService.cs @@ -0,0 +1,15 @@ +using System; +using Volo.Abp.Application.Services; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public interface IApiScopeAppService : + ICrudAppService< + ApiScopeDto, + Guid, + GetApiScopeInput, + ApiScopeCreateDto, + ApiScopeUpdateDto> + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs index 9139018cb..d152779e3 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.IdentityServer.Clients; +using Volo.Abp.Validation; namespace LINGYUN.Abp.IdentityServer.Clients { @@ -9,18 +10,18 @@ namespace LINGYUN.Abp.IdentityServer.Clients /// 客户端标识 /// [Required] - [StringLength(ClientConsts.ClientIdMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] public string ClientId { get; set; } /// /// 客户端名称 /// [Required] - [StringLength(ClientConsts.ClientNameMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] public string ClientName { get; set; } /// /// 说明 /// - [StringLength(ClientConsts.DescriptionMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] public string Description { get; set; } /// /// 复制客户端授权类型 diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs new file mode 100644 index 000000000..68e485d0a --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer.Clients +{ + public class ClientCorsOriginDto + { + public string Origin { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs index 009faf9a5..6526e8bfb 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs @@ -1,27 +1,28 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Volo.Abp.IdentityServer.Clients; +using Volo.Abp.Validation; namespace LINGYUN.Abp.IdentityServer.Clients { public class ClientCreateOrUpdateDto { [Required] - [StringLength(ClientConsts.ClientIdMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] public string ClientId { get; set; } [Required] - [StringLength(ClientConsts.ClientNameMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] public string ClientName { get; set; } - [StringLength(ClientConsts.DescriptionMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] public string Description { get; set; } - public List AllowedGrantTypes { get; set; } + public List AllowedGrantTypes { get; set; } protected ClientCreateOrUpdateDto() { - AllowedGrantTypes = new List(); + AllowedGrantTypes = new List(); } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs index 0e9e3bedc..ea418b33e 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs @@ -26,6 +26,10 @@ namespace LINGYUN.Abp.IdentityServer.Clients public bool AllowRememberConsent { get; set; } + public bool RequireRequestObject { get; set; } + + public string AllowedIdentityTokenSigningAlgorithms { get; set; } + public bool AlwaysIncludeUserClaimsInIdToken { get; set; } public bool RequirePkce { get; set; } @@ -82,34 +86,34 @@ namespace LINGYUN.Abp.IdentityServer.Clients public string ConcurrencyStamp { get; set; } - public List AllowedScopes { get; set; } + public List AllowedScopes { get; set; } public List ClientSecrets { get; set; } - public List AllowedGrantTypes { get; set; } + public List AllowedGrantTypes { get; set; } - public List AllowedCorsOrigins { get; set; } + public List AllowedCorsOrigins { get; set; } - public List RedirectUris { get; set; } + public List RedirectUris { get; set; } - public List PostLogoutRedirectUris { get; set; } + public List PostLogoutRedirectUris { get; set; } - public List IdentityProviderRestrictions { get; set; } + public List IdentityProviderRestrictions { get; set; } public List Claims { get; set; } - public Dictionary Properties { get; set; } + public List Properties { get; set; } public ClientDto() { Claims = new List(); - Properties = new Dictionary(); - AllowedScopes = new List(); + Properties = new List(); + AllowedScopes = new List(); ClientSecrets = new List(); - RedirectUris = new List(); - AllowedGrantTypes = new List(); - AllowedCorsOrigins = new List(); - PostLogoutRedirectUris = new List(); - IdentityProviderRestrictions = new List(); + RedirectUris = new List(); + AllowedGrantTypes = new List(); + AllowedCorsOrigins = new List(); + PostLogoutRedirectUris = new List(); + IdentityProviderRestrictions = new List(); } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs new file mode 100644 index 000000000..23184cf93 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer.Clients +{ + public class ClientGrantTypeDto + { + public string GrantType { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs new file mode 100644 index 000000000..195c6a670 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer.Clients +{ + public class ClientIdPRestrictionDto + { + public string Provider { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs new file mode 100644 index 000000000..dac89dc0a --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer.Clients +{ + public class ClientPostLogoutRedirectUriDto + { + public string PostLogoutRedirectUri { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPropertyDto.cs new file mode 100644 index 000000000..5b7a44ba8 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPropertyDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.Clients +{ + public class ClientPropertyDto : PropertyDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs new file mode 100644 index 000000000..12e669182 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer.Clients +{ + public class ClientRedirectUriDto + { + public string RedirectUri { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientScopeDto.cs new file mode 100644 index 000000000..f5d54f170 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientScopeDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.Clients +{ + public class ClientScopeDto : ScopeDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs index c32612b87..c43de47ea 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs @@ -1,6 +1,6 @@ namespace LINGYUN.Abp.IdentityServer.Clients { - public class ClientSecretDto : SecretBaseDto + public class ClientSecretDto : SecretDto { } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs index dad7d749c..0f0523a86 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs @@ -1,43 +1,48 @@ using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Volo.Abp.IdentityServer.Clients; +using Volo.Abp.Validation; namespace LINGYUN.Abp.IdentityServer.Clients { public class ClientUpdateDto : ClientCreateOrUpdateDto { - [StringLength(ClientConsts.ClientUriMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientUriMaxLength))] public string ClientUri { get; set; } - [StringLength(ClientConsts.LogoUriMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.LogoUriMaxLength))] public string LogoUri { get; set; } public bool Enabled { get; set; } - [StringLength(ClientConsts.ProtocolTypeMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ProtocolTypeMaxLength))] public string ProtocolType { get; set; } public bool RequireClientSecret { get; set; } - public bool RequireConsent { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.AllowedIdentityTokenSigningAlgorithms))] + public string AllowedIdentityTokenSigningAlgorithms { get; set; } + + public bool RequireConsent { get; set; } = false; + + public bool RequireRequestObject { get; set; } public bool AllowRememberConsent { get; set; } public bool AlwaysIncludeUserClaimsInIdToken { get; set; } - public bool RequirePkce { get; set; } + public bool RequirePkce { get; set; } = true; public bool AllowPlainTextPkce { get; set; } public bool AllowAccessTokensViaBrowser { get; set; } - [StringLength(ClientConsts.FrontChannelLogoutUriMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.FrontChannelLogoutUriMaxLength))] public string FrontChannelLogoutUri { get; set; } public bool FrontChannelLogoutSessionRequired { get; set; } - [StringLength(ClientConsts.BackChannelLogoutUriMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.BackChannelLogoutUriMaxLength))] public string BackChannelLogoutUri { get; set; } public bool BackChannelLogoutSessionRequired { get; set; } @@ -70,46 +75,32 @@ namespace LINGYUN.Abp.IdentityServer.Clients public bool AlwaysSendClientClaims { get; set; } - [StringLength(ClientConsts.ClientClaimsPrefixMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientClaimsPrefixMaxLength))] public string ClientClaimsPrefix { get; set; } - [StringLength(ClientConsts.PairWiseSubjectSaltMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.PairWiseSubjectSaltMaxLength))] public string PairWiseSubjectSalt { get; set; } public int? UserSsoLifetime { get; set; } - [StringLength(ClientConsts.UserCodeTypeMaxLength)] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.UserCodeTypeMaxLength))] public string UserCodeType { get; set; } public int DeviceCodeLifetime { get; set; } - /// - /// 允许的作用域 - /// - public List AllowedScopes { get; set; } - /// - /// 允许同源 - /// - public List AllowedCorsOrigins { get; set; } - /// - /// 重定向uri - /// - public List RedirectUris { get; set; } - /// - /// 登出重定向uri - /// - public List PostLogoutRedirectUris { get; set; } - /// - /// 限制提供商 - /// - public List IdentityProviderRestrictions { get; set; } - /// - /// 属性 - /// - public Dictionary Properties { get; set; } - /// - /// 密钥 - /// - public List Secrets { get; set; } + + public List AllowedScopes { get; set; } + + public List ClientSecrets { get; set; } + + public List AllowedCorsOrigins { get; set; } + + public List RedirectUris { get; set; } + + public List PostLogoutRedirectUris { get; set; } + + public List IdentityProviderRestrictions { get; set; } + + public List Properties { get; set; } /// /// 声明 /// @@ -119,13 +110,13 @@ namespace LINGYUN.Abp.IdentityServer.Clients { Enabled = true; DeviceCodeLifetime = 300; - AllowedScopes = new List(); - RedirectUris = new List(); - AllowedCorsOrigins = new List(); - PostLogoutRedirectUris = new List(); - IdentityProviderRestrictions = new List(); - Properties = new Dictionary(); - Secrets = new List(); + AllowedScopes = new List(); + RedirectUris = new List(); + AllowedCorsOrigins = new List(); + PostLogoutRedirectUris = new List(); + IdentityProviderRestrictions = new List(); + Properties = new List(); + ClientSecrets = new List(); Claims = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs index 13d7dee25..3afda584f 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs @@ -1,6 +1,6 @@ namespace LINGYUN.Abp.IdentityServer.Clients { - public class SecretCreateOrUpdateDto : SecretBaseDto + public class SecretCreateOrUpdateDto : SecretDto { public HashType HashType { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs new file mode 100644 index 000000000..b62f2ef46 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs @@ -0,0 +1,24 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.IdentityServer.Devices +{ + public class DeviceFlowCodesDto : ExtensibleCreationAuditedEntityDto + { + public string DeviceCode { get; set; } + + public string UserCode { get; set; } + + public string SubjectId { get; set; } + + public string SessionId { get; set; } + + public string ClientId { get; set; } + + public string Description { get; set; } + + public DateTime? Expiration { get; set; } + + public string Data { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantGetPagedDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs similarity index 70% rename from aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantGetPagedDto.cs rename to aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs index d5117306b..a473f9770 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantGetPagedDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs @@ -2,7 +2,7 @@ namespace LINGYUN.Abp.IdentityServer.Grants { - public class PersistedGrantGetPagedDto : PagedAndSortedResultRequestDto + public class GetPersistedGrantInput : PagedAndSortedResultRequestDto { public string Filter { get; set; } public string SubjectId { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs index 8d1382e41..9b1352044 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs @@ -11,6 +11,12 @@ namespace LINGYUN.Abp.IdentityServer.Grants public string SubjectId { get; set; } + public string SessionId { get; set; } + + public string Description { get; set; } + + public DateTime? ConsumedTime { get; set; } + public string ClientId { get; set; } public DateTime CreationTime { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/IPersistedGrantAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/IPersistedGrantAppService.cs new file mode 100644 index 000000000..6343f9f61 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/IPersistedGrantAppService.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Application.Services; + +namespace LINGYUN.Abp.IdentityServer.Grants +{ + public interface IPersistedGrantAppService : + IReadOnlyAppService, + IDeleteAppService + { + + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceClaimDto.cs new file mode 100644 index 000000000..1f37d1b91 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceClaimDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.IdentityResources +{ + public class IdentityResourceClaimDto : UserClaimDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs index a517e3eed..a53c7840b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs @@ -25,14 +25,14 @@ namespace LINGYUN.Abp.IdentityServer.IdentityResources public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public Dictionary Properties { get; set; } + public List Properties { get; set; } public IdentityResourceCreateOrUpdateDto() { - UserClaims = new List(); - Properties = new Dictionary(); + UserClaims = new List(); + Properties = new List(); Enabled = true; Required = false; diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs index 49649a370..9b079e262 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.IdentityServer.IdentityResources { - public class IdentityResourceDto : ExtensibleFullAuditedEntityDto + public class IdentityResourceDto : ExtensibleAuditedEntityDto { public string Name { get; set; } @@ -20,14 +20,14 @@ namespace LINGYUN.Abp.IdentityServer.IdentityResources public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public Dictionary Properties { get; set; } + public List Properties { get; set; } public IdentityResourceDto() { - UserClaims = new List(); - Properties = new Dictionary(); + UserClaims = new List(); + Properties = new List(); } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourcePropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourcePropertyDto.cs new file mode 100644 index 000000000..142610026 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourcePropertyDto.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.IdentityServer.IdentityResources +{ + public class IdentityResourcePropertyDto : PropertyDto + { + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/en.json b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/en.json index 5a7f49b35..5b2d76ec8 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/en.json +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/en.json @@ -1,4 +1,4 @@ -{ +{ "culture": "en", "texts": { "Permissions:IdentityServer": "IdentityServer", @@ -12,10 +12,12 @@ "Permissions:ManageProperties": "Properties", "Permissions:ManagePermissions": "Permissions", "Permissions:Clients": "Clients", - "Permissions:ApiResources": "ApiResources", - "Permissions:IdentityResources": "IdentityResources", + "Permissions:ApiResources": "Api Resources", + "Permissions:ApiScopes": "Api Scopes", + "Permissions:IdentityResources": "Identity Resources", "ClientIdExisted": "Client id: {0} already exists!", "ApiResourceNameExisted": "Api resource name: {0} already exists!", + "ApiScopeNameExisted": "Api scope: {0} already exists!", "IdentityResourceNameExisted": "Identity resource name: {0} already exists!", "IdentityResourcePropertyExisted": "Identity resource property: {0} already exists!", "ClientClaimNotFound": "Client claim: {0} not found!", @@ -23,6 +25,7 @@ "ClientPropertyNotFound": "Client property: {0} not found!", "IdentityResourcePropertyNotFound": "Identity resource property: {0} not found!", "EncryptionNotImplemented": "Encryption type: {0} not implemented!", + "AddNew": "Add New", "Basics": "Basics", "Authentication": "Authentication", "Token": "Token", @@ -48,6 +51,9 @@ "Required": "Required", "Emphasize": "Emphasize", "ShowInDiscoveryDocument": "Show In Discovery Document", + "AllowedAccessTokenSigningAlgorithms": "Allowed AccessToken Signing Algorithms", + "Assigned": "Assigned", + "Available": "Available", "Expiration": "Expiration", "Scope:New": "Add New", "Scope:Delete": "Delete", @@ -74,6 +80,12 @@ "Clone:CopyProperties": "Copy the Client Properties", "Clone:CopyIdentityProviderRestriction": "Copy the Client Identity Provider Restriction", "Client:ProtocolType": "Protocol Type", + "Client:ApplicationUrls": "Application Urls", + "Client:CallbackUrl": "Callback Url", + "Client:RequireRequestObject": "Require Request Object", + "Client:AllowedIdentityTokenSigningAlgorithms": "Allowed Identity Token Signing Algorithms", + "Client:PostLogoutRedirectUri": "Post Logout Redirect Uri", + "Client:Resources": "Resources", "Client:RequiredClientSecret": "Require Client Secret", "Client:RequiredPkce": "Required Pkce", "Client:AllowedPlainTextPkce": "Allowed Plain Text Pkce", @@ -116,6 +128,7 @@ "Claims:Delete": "Delete", "Claims:Type": "Type", "Claims:Value": "Value", + "Claims:DuplicateValue": "Claim already exists and cannot add duplicates!", "Propertites": "Propertites", "Propertites:New": "Add New", "Propertites:Key": "Key", diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/zh-Hans.json b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/zh-Hans.json index 6a0b008f0..92227ae46 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Localization/Resources/zh-Hans.json @@ -1,4 +1,4 @@ -{ +{ "culture": "zh-Hans", "texts": { "Permissions:IdentityServer": "IdentityServer管理", @@ -13,9 +13,11 @@ "Permissions:ManagePermissions": "更改权限", "Permissions:Clients": "客户端管理", "Permissions:ApiResources": "Api资源管理", + "Permissions:ApiScopes": "Api授权范围管理", "Permissions:IdentityResources": "身份资源管理", "ClientIdExisted": "客户端标识: {0} 已经存在!", "ApiResourceNameExisted": "Api资源: {0} 已经存在!", + "ApiScopeNameExisted": "Api授权范围: {0} 已经存在!", "IdentityResourceNameExisted": "身份资源: {0} 已经存在!", "IdentityResourcePropertyExisted": "身份资源属性: {0} 已经存在!", "ClientClaimNotFound": "客户端声明: {0} 不存在!", @@ -23,6 +25,7 @@ "ClientPropertyNotFound": "客户端属性: {0} 不存在!", "IdentityResourcePropertyNotFound": "身份资源属性: {0} 不存在!", "EncryptionNotImplemented": "加密类型: {0} 未实现!", + "AddNew": "添加一个新的", "Basics": "基本信息", "Authentication": "认证/注销", "Token": "令牌", @@ -48,6 +51,9 @@ "Required": "必要", "Emphasize": "强调", "ShowInDiscoveryDocument": "在发现文档中显示", + "AllowedAccessTokenSigningAlgorithms": "允许访问令牌签名算法", + "Assigned": "可分配的", + "Available": "已拥有的", "Expiration": "过期", "Scope:New": "添加新作用域", "Scope:Delete": "删除作用域", @@ -73,6 +79,12 @@ "Clone:CopyPostLogoutRedirectUri": "复制客户端注销重定向 Uri", "Clone:CopyProperties": "复制客户端属性", "Clone:CopyIdentityProviderRestriction": "复制身份提供程序限制", + "Client:PostLogoutRedirectUri": "注销重定向地址", + "Client:ApplicationUrls": "应用程序Urls", + "Client:CallbackUrl": "回调地址", + "Client:RequireRequestObject": "需要请求对象", + "Client:AllowedIdentityTokenSigningAlgorithms": "允许身份令牌签名算法", + "Client:Resources": "资源", "Client:ProtocolType": "协议类型", "Client:RequiredClientSecret": "需要客户端密钥", "Client:RequiredPkce": "需要 Pkce", @@ -116,12 +128,15 @@ "Claims:Delete": "删除声明", "Claims:Type": "声明类型", "Claims:Value": "值", + "Claims:DuplicateValue": "声明类型已存在,不能添加重复值!", "Propertites": "属性", "Propertites:New": "添加新属性", "Propertites:Key": "属性名称", "Propertites:Value": "值", "Propertites:Delete": "删除属性", "Propertites:DuplicateKey": "属性已经存在,不能添加重复项!", - "Permissions": "权限" + "Permissions": "权限", + "ApiScopes:Edit": "编辑范围", + "ApiScopes:Delete": "删除范围" } } \ No newline at end of file diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs new file mode 100644 index 000000000..cbcae7426 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs @@ -0,0 +1,9 @@ +namespace LINGYUN.Abp.IdentityServer +{ + public class PropertyDto + { + public string Key { get; set; } + + public string Value { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs new file mode 100644 index 000000000..e90e000b7 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer +{ + public class ScopeDto + { + public string Scope { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretBaseDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs similarity index 80% rename from aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretBaseDto.cs rename to aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs index e0fee6baf..999213855 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretBaseDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs @@ -1,8 +1,9 @@ using System; +using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.IdentityServer { - public class SecretBaseDto + public class SecretDto { public string Type { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs new file mode 100644 index 000000000..c94b5b012 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.IdentityServer +{ + public class UserClaimDto + { + public string Type { get; set; } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj index cbeb3c76c..f6229284c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj @@ -1,12 +1,16 @@ - + - netcoreapp3.1 + net5.0 + + + + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs index d29bb4994..2b920d423 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs @@ -1,11 +1,13 @@ -using Volo.Abp.AutoMapper; +using Volo.Abp.Application; +using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; namespace LINGYUN.Abp.IdentityServer { [DependsOn( - typeof(AbpIdentityServerDomainModule), typeof(AbpIdentityServerApplicationContractsModule), + typeof(AbpIdentityServerDomainModule), + typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule) )] public class AbpIdentityServerApplicationModule : AbpModule diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs index 6c2f7ae91..14e411be6 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs @@ -1,10 +1,10 @@ using AutoMapper; using LINGYUN.Abp.IdentityServer.ApiResources; +using LINGYUN.Abp.IdentityServer.ApiScopes; using LINGYUN.Abp.IdentityServer.Clients; using LINGYUN.Abp.IdentityServer.IdentityResources; -using System.Collections.Generic; -using System.Linq; using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.IdentityResources; @@ -15,33 +15,37 @@ namespace LINGYUN.Abp.IdentityServer public AbpIdentityServerAutoMapperProfile() { CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); - CreateMap, Dictionary>() - .ConstructUsing((props, ctx) => - { - var properties = new Dictionary(); - foreach (var prop in props) - { - properties.Add(prop.Key, prop.Value); - } - return properties; - }); - CreateMap() - .ForMember(dto => dto.AllowedCorsOrigins, map => map.MapFrom(client => client.AllowedCorsOrigins.Select(origin => origin.Origin).ToList())) - .ForMember(dto => dto.AllowedGrantTypes, map => map.MapFrom(client => client.AllowedGrantTypes.Select(grantType => grantType.GrantType).ToList())) - .ForMember(dto => dto.AllowedScopes, map => map.MapFrom(client => client.AllowedScopes.Select(scope => scope.Scope).ToList())) - .ForMember(dto => dto.IdentityProviderRestrictions, map => map.MapFrom(client => client.IdentityProviderRestrictions.Select(provider => provider.Provider).ToList())) - .ForMember(dto => dto.PostLogoutRedirectUris, map => map.MapFrom(client => client.PostLogoutRedirectUris.Select(uri => uri.PostLogoutRedirectUri).ToList())) - .ForMember(dto => dto.RedirectUris, map => map.MapFrom(client => client.RedirectUris.Select(uri => uri.RedirectUri).ToList())); + CreateMap(); + CreateMap(); + //.ForMember(dto => dto.AllowedCorsOrigins, map => map.MapFrom(client => client.AllowedCorsOrigins.Select(origin => origin.Origin).ToList())) + //.ForMember(dto => dto.AllowedGrantTypes, map => map.MapFrom(client => client.AllowedGrantTypes.Select(grantType => grantType.GrantType).ToList())) + //.ForMember(dto => dto.AllowedScopes, map => map.MapFrom(client => client.AllowedScopes.Select(scope => scope.Scope).ToList())) + //.ForMember(dto => dto.IdentityProviderRestrictions, map => map.MapFrom(client => client.IdentityProviderRestrictions.Select(provider => provider.Provider).ToList())) + //.ForMember(dto => dto.PostLogoutRedirectUris, map => map.MapFrom(client => client.PostLogoutRedirectUris.Select(uri => uri.PostLogoutRedirectUri).ToList())) + //.ForMember(dto => dto.RedirectUris, map => map.MapFrom(client => client.RedirectUris.Select(uri => uri.RedirectUri).ToList())); - CreateMap(); + // CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); CreateMap() - .ForMember(dto => dto.UserClaims, map => map.MapFrom(src => src.UserClaims.Select(claim => claim.Type).ToList())) .MapExtraProperties(); + CreateMap(); + CreateMap(); CreateMap() - .ForMember(dto => dto.UserClaims, map => map.MapFrom(src => src.UserClaims.Select(claim => claim.Type).ToList())) .MapExtraProperties(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs index c9c9e540d..300be5e0b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs @@ -49,11 +49,12 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources { throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ApiResourceNameExisted, input.Name]); } - var apiResource = new ApiResource(GuidGenerator.Create(), input.Name, - input.DisplayName, input.Description) - { - Enabled = input.Enabled - }; + var apiResource = new ApiResource( + GuidGenerator.Create(), + input.Name, + input.DisplayName, + input.Description); + await UpdateApiResourceByInputAsync(apiResource, input); apiResource = await ApiResourceRepository.InsertAsync(apiResource); @@ -67,9 +68,6 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources public virtual async Task UpdateAsync(Guid id, ApiResourceUpdateDto input) { var apiResource = await ApiResourceRepository.GetAsync(id); - apiResource.DisplayName = input.DisplayName ?? apiResource.DisplayName; - apiResource.Description = input.Description ?? apiResource.Description; - apiResource.Enabled = input.Enabled; await UpdateApiResourceByInputAsync(apiResource, input); @@ -91,16 +89,33 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources protected virtual async Task UpdateApiResourceByInputAsync(ApiResource apiResource, ApiResourceCreateOrUpdateDto input) { + apiResource.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; + apiResource.Enabled = input.Enabled; + + if (!string.Equals(apiResource.AllowedAccessTokenSigningAlgorithms, input.AllowedAccessTokenSigningAlgorithms, StringComparison.InvariantCultureIgnoreCase)) + { + apiResource.AllowedAccessTokenSigningAlgorithms = input.AllowedAccessTokenSigningAlgorithms; + } + if (!string.Equals(apiResource.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + apiResource.DisplayName = input.DisplayName; + } + if (apiResource.Description?.Equals(input.Description, StringComparison.InvariantCultureIgnoreCase) + == false) + { + apiResource.Description = input.Description; + } + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageClaims)) { // 删除不存在的UserClaim - apiResource.UserClaims.RemoveAll(claim => !input.UserClaims.Contains(claim.Type)); + apiResource.UserClaims.RemoveAll(claim => !input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); foreach (var inputClaim in input.UserClaims) { - var userClaim = apiResource.FindClaim(inputClaim); + var userClaim = apiResource.FindClaim(inputClaim.Type); if (userClaim == null) { - apiResource.AddUserClaim(inputClaim); + apiResource.AddUserClaim(inputClaim.Type); } } } @@ -108,34 +123,13 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageScopes)) { // 删除不存在的Scope - apiResource.Scopes.RemoveAll(scope => !input.Scopes.Any(inputScope => scope.Name == inputScope.Name)); + apiResource.Scopes.RemoveAll(scope => !input.Scopes.Any(inputScope => scope.Scope == inputScope.Scope)); foreach (var inputScope in input.Scopes) { - var scope = apiResource.FindScope(inputScope.Name); + var scope = apiResource.FindScope(inputScope.Scope); if (scope == null) { - scope = apiResource.AddScope( - inputScope.Name, inputScope.DisplayName, inputScope.Description, - inputScope.Required, inputScope.Emphasize, inputScope.ShowInDiscoveryDocument); - } - else - { - scope.Required = inputScope.Required; - scope.Emphasize = inputScope.Emphasize; - scope.Description = inputScope.Description; - scope.DisplayName = inputScope.DisplayName; - scope.ShowInDiscoveryDocument = inputScope.ShowInDiscoveryDocument; - // 删除不存在的ScopeUserClaim - scope.UserClaims.RemoveAll(claim => !inputScope.UserClaims.Contains(claim.Type)); - } - - foreach (var inputScopeClaim in inputScope.UserClaims) - { - var scopeUserClaim = scope.FindClaim(inputScopeClaim); - if (scopeUserClaim == null) - { - scope.AddUserClaim(inputScopeClaim); - } + apiResource.AddScope(inputScope.Scope); } } } @@ -174,10 +168,18 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageProperties)) { // 删除不存在的属性 - apiResource.Properties.RemoveAll(scope => !input.Properties.ContainsKey(scope.Key)); - foreach (var property in input.Properties) + apiResource.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); + foreach (var inputProp in input.Properties) { - apiResource.Properties[property.Key] = property.Value; + var apiResourceProperty = apiResource.FindProperty(inputProp.Key); + if (apiResourceProperty == null) + { + apiResource.AddProperty(inputProp.Key, inputProp.Value); + } + else + { + apiResourceProperty.Value = inputProp.Value; + } } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs new file mode 100644 index 000000000..103ddd131 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs @@ -0,0 +1,142 @@ +using Microsoft.AspNetCore.Authorization; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.IdentityServer.ApiScopes; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + [Authorize(AbpIdentityServerPermissions.ApiScopes.Default)] + public class ApiScopeAppService : AbpIdentityServerAppServiceBase, IApiScopeAppService + { + protected IApiScopeRepository ApiScopeRepository { get; } + + public ApiScopeAppService( + IApiScopeRepository apiScopeRepository) + { + ApiScopeRepository = apiScopeRepository; + } + + [Authorize(AbpIdentityServerPermissions.ApiScopes.Create)] + public virtual async Task CreateAsync(ApiScopeCreateDto input) + { + if (await ApiScopeRepository.CheckNameExistAsync(input.Name)) + { + throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ApiScopeNameExisted, input.Name]); + } + var apiScope = new ApiScope( + GuidGenerator.Create(), + input.Name, + input.DisplayName, + input.Description, + input.Enabled, + input.Required, + input.Emphasize, + input.ShowInDiscoveryDocument); + + await UpdateApiScopeByInputAsync(apiScope, input); + + await CurrentUnitOfWork.SaveChangesAsync(); + + apiScope = await ApiScopeRepository.InsertAsync(apiScope); + + return ObjectMapper.Map(apiScope); + } + + [Authorize(AbpIdentityServerPermissions.ApiScopes.Delete)] + public virtual async Task DeleteAsync(Guid id) + { + var apiScope = await ApiScopeRepository.GetAsync(id); + + await ApiScopeRepository.DeleteAsync(apiScope); + + await CurrentUnitOfWork.SaveChangesAsync(); + } + + public virtual async Task GetAsync(Guid id) + { + var apiScope = await ApiScopeRepository.GetAsync(id); + + return ObjectMapper.Map(apiScope); + } + + public virtual async Task> GetListAsync(GetApiScopeInput input) + { + var totalCount = await ApiScopeRepository + .GetCountAsync(input.Filter); + + var apiScopes = await ApiScopeRepository + .GetListAsync( + input.Sorting, + input.SkipCount, input.MaxResultCount, + input.Filter); + + return new PagedResultDto(totalCount, + ObjectMapper.Map, List>(apiScopes)); + } + + [Authorize(AbpIdentityServerPermissions.ApiScopes.Update)] + public virtual async Task UpdateAsync(Guid id, ApiScopeUpdateDto input) + { + var apiScope = await ApiScopeRepository.GetAsync(id); + + await UpdateApiScopeByInputAsync(apiScope, input); + apiScope = await ApiScopeRepository.UpdateAsync(apiScope); + + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(apiScope); + } + + protected virtual async Task UpdateApiScopeByInputAsync(ApiScope apiScope, ApiScopeCreateOrUpdateDto input) + { + if (!string.Equals(apiScope.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) + { + apiScope.Description = input.Description; + } + if (!string.Equals(apiScope.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + apiScope.DisplayName = input.DisplayName; + } + apiScope.Emphasize = input.Emphasize; + apiScope.Enabled = input.Enabled; + apiScope.Required = input.Required; + apiScope.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; + + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiScopes.ManageClaims)) + { + // 删除不存在的UserClaim + apiScope.UserClaims.RemoveAll(claim => !input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); + foreach (var inputClaim in input.UserClaims) + { + var userClaim = apiScope.FindClaim(inputClaim.Type); + if (userClaim == null) + { + apiScope.AddUserClaim(inputClaim.Type); + } + } + } + + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiScopes.ManageProperties)) + { + // 删除不存在的Property + apiScope.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); + foreach (var inputProp in input.Properties) + { + var identityResourceProperty = apiScope.FindProperty(inputProp.Key); + if (identityResourceProperty == null) + { + apiScope.AddProperty(inputProp.Key, inputProp.Value); + } + else + { + identityResourceProperty.Value = inputProp.Value; + } + } + } + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs index 0f2515610..eaae1c508 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs @@ -44,9 +44,9 @@ namespace LINGYUN.Abp.IdentityServer.Clients ClientName = clientCreate.ClientName, Description = clientCreate.Description }; - foreach (var grantType in clientCreate.AllowedGrantTypes) + foreach (var inputGrantType in clientCreate.AllowedGrantTypes) { - client.AddGrantType(grantType); + client.AddGrantType(inputGrantType.GrantType); } client = await ClientRepository.InsertAsync(client); @@ -134,6 +134,11 @@ namespace LINGYUN.Abp.IdentityServer.Clients { client.ProtocolType = input.ProtocolType; } + if (!string.Equals(client.AllowedIdentityTokenSigningAlgorithms, input.AllowedIdentityTokenSigningAlgorithms, StringComparison.InvariantCultureIgnoreCase)) + { + client.AllowedIdentityTokenSigningAlgorithms = input.AllowedIdentityTokenSigningAlgorithms; + } + client.AbsoluteRefreshTokenLifetime = input.AbsoluteRefreshTokenLifetime; client.AccessTokenLifetime = input.AccessTokenLifetime; client.AccessTokenType = input.AccessTokenType; @@ -148,6 +153,7 @@ namespace LINGYUN.Abp.IdentityServer.Clients client.DeviceCodeLifetime = input.DeviceCodeLifetime; client.ConsentLifetime = input.ConsentLifetime ?? client.ConsentLifetime; client.Enabled = input.Enabled; + client.RequireRequestObject = input.RequireRequestObject; client.EnableLocalLogin = input.EnableLocalLogin; client.FrontChannelLogoutSessionRequired = input.FrontChannelLogoutSessionRequired; client.IdentityTokenLifetime = input.IdentityTokenLifetime; @@ -164,12 +170,12 @@ namespace LINGYUN.Abp.IdentityServer.Clients #region AllowScope // 删除未在身份资源和Api资源中的作用域 - client.AllowedScopes.RemoveAll(scope => !input.AllowedScopes.Contains(scope.Scope)); - foreach (var scope in input.AllowedScopes) + client.AllowedScopes.RemoveAll(scope => !input.AllowedScopes.Any(inputScope => scope.Scope == inputScope.Scope)); + foreach (var inputScope in input.AllowedScopes) { - if (client.FindScope(scope) == null) + if (client.FindScope(inputScope.Scope) == null) { - client.AddScope(scope); + client.AddScope(inputScope.Scope); } } @@ -177,12 +183,12 @@ namespace LINGYUN.Abp.IdentityServer.Clients #region RedirectUris // 删除不存在的uri - client.RedirectUris.RemoveAll(uri => !input.RedirectUris.Contains(uri.RedirectUri)); - foreach (var redirect in input.RedirectUris) + client.RedirectUris.RemoveAll(uri => !input.RedirectUris.Any(inputRedirectUri => uri.RedirectUri == inputRedirectUri.RedirectUri)); + foreach (var inputRedirectUri in input.RedirectUris) { - if (client.FindRedirectUri(redirect) == null) + if (client.FindRedirectUri(inputRedirectUri.RedirectUri) == null) { - client.AddRedirectUri(redirect); + client.AddRedirectUri(inputRedirectUri.RedirectUri); } } @@ -190,12 +196,12 @@ namespace LINGYUN.Abp.IdentityServer.Clients #region AllowedGrantTypes // 删除不存在的验证类型 - client.AllowedGrantTypes.RemoveAll(grantType => !input.AllowedGrantTypes.Contains(grantType.GrantType)); - foreach (var grantType in input.AllowedGrantTypes) + client.AllowedGrantTypes.RemoveAll(grantType => !input.AllowedGrantTypes.Any(inputGrantType => grantType.GrantType == inputGrantType.GrantType)); + foreach (var inputGrantType in input.AllowedGrantTypes) { - if (client.FindGrantType(grantType) == null) + if (client.FindGrantType(inputGrantType.GrantType) == null) { - client.AddGrantType(grantType); + client.AddGrantType(inputGrantType.GrantType); } } @@ -203,12 +209,12 @@ namespace LINGYUN.Abp.IdentityServer.Clients #region AllowedCorsOrigins // 删除不存在的同源域名 - client.AllowedCorsOrigins.RemoveAll(corgOrigin => !input.AllowedCorsOrigins.Contains(corgOrigin.Origin)); - foreach (var corgOrigin in input.AllowedCorsOrigins) + client.AllowedCorsOrigins.RemoveAll(corsOrigin => !input.AllowedCorsOrigins.Any(inputCorsOrigin => corsOrigin.Origin == inputCorsOrigin.Origin)); + foreach (var inputCorsOrigin in input.AllowedCorsOrigins) { - if (client.FindCorsOrigin(corgOrigin) == null) + if (client.FindCorsOrigin(inputCorsOrigin.Origin) == null) { - client.AddCorsOrigin(corgOrigin); + client.AddCorsOrigin(inputCorsOrigin.Origin); } } @@ -217,12 +223,13 @@ namespace LINGYUN.Abp.IdentityServer.Clients #region PostLogoutRedirectUris // 删除不存在的登录重定向域名 - client.PostLogoutRedirectUris.RemoveAll(uri => !input.PostLogoutRedirectUris.Contains(uri.PostLogoutRedirectUri)); - foreach (var logoutRedirectUri in input.PostLogoutRedirectUris) + client.PostLogoutRedirectUris.RemoveAll(uri => + !input.PostLogoutRedirectUris.Any(inputLogoutRedirectUri => uri.PostLogoutRedirectUri == inputLogoutRedirectUri.PostLogoutRedirectUri)); + foreach (var inputLogoutRedirectUri in input.PostLogoutRedirectUris) { - if (client.FindPostLogoutRedirectUri(logoutRedirectUri) == null) + if (client.FindPostLogoutRedirectUri(inputLogoutRedirectUri.PostLogoutRedirectUri) == null) { - client.AddPostLogoutRedirectUri(logoutRedirectUri); + client.AddPostLogoutRedirectUri(inputLogoutRedirectUri.PostLogoutRedirectUri); } } @@ -231,12 +238,13 @@ namespace LINGYUN.Abp.IdentityServer.Clients #region IdentityProviderRestrictions // 删除身份认证限制提供商 - client.IdentityProviderRestrictions.RemoveAll(provider => !input.IdentityProviderRestrictions.Contains(provider.Provider)); - foreach (var provider in input.IdentityProviderRestrictions) + client.IdentityProviderRestrictions.RemoveAll(provider => + !input.IdentityProviderRestrictions.Any(inputProvider => provider.Provider == inputProvider.Provider)); + foreach (var inputProvider in input.IdentityProviderRestrictions) { - if (client.FindIdentityProviderRestriction(provider) == null) + if (client.FindIdentityProviderRestriction(inputProvider.Provider) == null) { - client.AddIdentityProviderRestriction(provider); + client.AddIdentityProviderRestriction(inputProvider.Provider); } } @@ -247,32 +255,15 @@ namespace LINGYUN.Abp.IdentityServer.Clients if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageSecrets)) { // 移除已经不存在的客户端密钥 - client.ClientSecrets.RemoveAll(secret => !input.Secrets.Any(inputSecret => secret.Value == inputSecret.Value && secret.Type == inputSecret.Type)); - foreach (var inputSecret in input.Secrets) + client.ClientSecrets.RemoveAll(secret => !input.ClientSecrets.Any(inputSecret => secret.Value == inputSecret.Value && secret.Type == inputSecret.Type)); + foreach (var inputSecret in input.ClientSecrets) { // 先对加密过的进行过滤 if (client.FindSecret(inputSecret.Value, inputSecret.Type) != null) { continue; } - var inputSecretValue = inputSecret.Value; - // 如果是 SharedSecret 类型的密钥 - // 采用 IdentityServer4 服务器扩展方法加密 - if (IdentityServerConstants.SecretTypes.SharedSecret.Equals(inputSecret.Type)) - { - if (inputSecret.HashType == HashType.Sha256) - { - inputSecretValue = inputSecret.Value.Sha256(); - } - else if (inputSecret.HashType == HashType.Sha512) - { - inputSecretValue = inputSecret.Value.Sha512(); - } - } - else - { - throw new UserFriendlyException(L["EncryptionNotImplemented", inputSecret.Type]); - } + var inputSecretValue = inputSecret.Value.Sha256(); // TODO: 通过可选配置来加密 var clientSecret = client.FindSecret(inputSecretValue, inputSecret.Type); if (clientSecret == null) @@ -289,7 +280,7 @@ namespace LINGYUN.Abp.IdentityServer.Clients if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageProperties)) { // 移除不存在的属性 - client.Properties.RemoveAll(prop => !input.Properties.ContainsKey(prop.Key)); + client.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); foreach (var inputProp in input.Properties) { if (client.FindProperty(inputProp.Key, inputProp.Value) == null) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs index bb7fc10cf..9314db511 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs @@ -1,26 +1,52 @@ -using System.Collections.Generic; +using Microsoft.AspNetCore.Authorization; +using System; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.IdentityServer.Grants; namespace LINGYUN.Abp.IdentityServer.Grants { - public class PersistedGrantAppService : AbpIdentityServerAppServiceBase + [Authorize(AbpIdentityServerPermissions.Grants.Default)] + public class PersistedGrantAppService : AbpIdentityServerAppServiceBase, IPersistedGrantAppService { protected IPersistentGrantRepository PersistentGrantRepository { get; } - public virtual async Task> GetListAsync(PersistedGrantGetPagedDto input) + + public PersistedGrantAppService( + IPersistentGrantRepository persistentGrantRepository) { - var persistenGrantCount = await PersistentGrantRepository.GetCountAsync( - input.SubjectId, input.Filter); + PersistentGrantRepository = persistentGrantRepository; + } - var persistenGrants = await PersistentGrantRepository.GetListAsync( - input.SubjectId, input.Filter, input.Sorting, - input.SkipCount, input.MaxResultCount); + [Authorize(AbpIdentityServerPermissions.Grants.Delete)] + public virtual async Task DeleteAsync(Guid id) + { + var persistedGrant = await PersistentGrantRepository.GetAsync(id); - return new PagedResultDto(persistenGrantCount, - ObjectMapper.Map, List>(persistenGrants)); + await PersistentGrantRepository.DeleteAsync(persistedGrant); + await CurrentUnitOfWork.SaveChangesAsync(); + } + + public virtual async Task GetAsync(Guid id) + { + var persistedGrant = await PersistentGrantRepository.GetAsync(id); + + return ObjectMapper.Map(persistedGrant); } + public virtual async Task> GetListAsync(GetPersistedGrantInput input) + { + var persistenGrantCount = await PersistentGrantRepository + .GetCountAsync( + input.SubjectId, input.Filter); + + var persistenGrants = await PersistentGrantRepository + .GetListAsync( + input.SubjectId, input.Filter, input.Sorting, + input.SkipCount, input.MaxResultCount); + return new PagedResultDto(persistenGrantCount, + ObjectMapper.Map, List>(persistenGrants)); + } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs index 38be28e9a..4dcfec90c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Authorization; using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; @@ -97,13 +98,13 @@ namespace LINGYUN.Abp.IdentityServer.IdentityResources if (await IsGrantAsync(AbpIdentityServerPermissions.IdentityResources.ManageClaims)) { // 删除不存在的UserClaim - identityResource.UserClaims.RemoveAll(claim => input.UserClaims.Contains(claim.Type)); + identityResource.UserClaims.RemoveAll(claim => input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); foreach (var inputClaim in input.UserClaims) { - var userClaim = identityResource.FindUserClaim(inputClaim); + var userClaim = identityResource.FindUserClaim(inputClaim.Type); if (userClaim == null) { - identityResource.AddUserClaim(inputClaim); + identityResource.AddUserClaim(inputClaim.Type); } } } @@ -111,10 +112,18 @@ namespace LINGYUN.Abp.IdentityServer.IdentityResources if (await IsGrantAsync(AbpIdentityServerPermissions.IdentityResources.ManageProperties)) { // 删除不存在的Property - identityResource.Properties.RemoveAll(scope => !input.Properties.ContainsKey(scope.Key)); + identityResource.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); foreach (var inputProp in input.Properties) { - identityResource.Properties[inputProp.Key] = inputProp.Value; + var identityResourceProperty = identityResource.FindProperty(inputProp.Key); + if (identityResourceProperty == null) + { + identityResource.AddProperty(inputProp.Key, inputProp.Value); + } + else + { + identityResourceProperty.Value = inputProp.Value; + } } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj index 6ad7b3869..23620f974 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeRepository.cs new file mode 100644 index 000000000..b62176e12 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeRepository.cs @@ -0,0 +1,13 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + public interface IApiScopeRepository : Volo.Abp.IdentityServer.ApiScopes.IApiScopeRepository + { + Task GetCountAsync( + string filter = null, + CancellationToken cancellationToken = default + ); + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj index fde55c578..fa71d4ffa 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiScopes/EfCoreApiScopeRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiScopes/EfCoreApiScopeRepository.cs new file mode 100644 index 000000000..ec374a637 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiScopes/EfCoreApiScopeRepository.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.IdentityServer.ApiScopes; +using Volo.Abp.IdentityServer.EntityFrameworkCore; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + [Dependency(ServiceLifetime.Transient)] + [ExposeServices( + typeof(IApiScopeRepository), + typeof(ApiScopeRepository), + typeof(Volo.Abp.IdentityServer.ApiScopes.IApiScopeRepository))] + public class EfCoreApiScopeRepository : ApiScopeRepository, IApiScopeRepository + { + public EfCoreApiScopeRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } + + public virtual async Task GetCountAsync( + string filter = null, + CancellationToken cancellationToken = default) + { + return await DbSet + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Name.Contains(filter) || x.DisplayName.Contains(filter) || x.Description.Contains(filter)) + .CountAsync(GetCancellationToken(cancellationToken)); + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj index db7b7f939..9e205c2d9 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeController.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeController.cs new file mode 100644 index 000000000..9452601bf --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeController.cs @@ -0,0 +1,56 @@ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes +{ + [RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] + [Area("identity-server")] + [Route("api/identity-server/api-scopes")] + public class ApiScopeController : AbpController, IApiScopeAppService + { + protected IApiScopeAppService ApiScopeAppService { get; } + + public ApiScopeController( + IApiScopeAppService apiScopeAppService) + { + ApiScopeAppService = apiScopeAppService; + } + + [HttpPost] + public virtual async Task CreateAsync(ApiScopeCreateDto input) + { + return await ApiScopeAppService.CreateAsync(input); + } + + [HttpDelete] + [Route("{id}")] + public virtual async Task DeleteAsync(Guid id) + { + await ApiScopeAppService.DeleteAsync(id); + } + + [HttpGet] + [Route("{id}")] + public virtual async Task GetAsync(Guid id) + { + return await ApiScopeAppService.GetAsync(id); + } + + [HttpGet] + public virtual async Task> GetListAsync(GetApiScopeInput input) + { + return await ApiScopeAppService.GetListAsync(input); + } + + [HttpPut] + [Route("{id}")] + public virtual async Task UpdateAsync(Guid id, ApiScopeUpdateDto input) + { + return await ApiScopeAppService.UpdateAsync(id, input); + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantController.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantController.cs new file mode 100644 index 000000000..7469ec49e --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantController.cs @@ -0,0 +1,43 @@ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; + +namespace LINGYUN.Abp.IdentityServer.Grants +{ + [RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] + [Area("identity-server")] + [Route("api/identity-server/persisted-grants")] + public class PersistedGrantController : AbpController, IPersistedGrantAppService + { + protected IPersistedGrantAppService PersistedGrantAppService { get; } + + public PersistedGrantController( + IPersistedGrantAppService persistedGrantAppService) + { + PersistedGrantAppService = persistedGrantAppService; + } + + [HttpDelete] + [Route("{id}")] + public virtual async Task DeleteAsync(Guid id) + { + await PersistedGrantAppService.DeleteAsync(id); + } + + [HttpGet] + [Route("{id}")] + public virtual async Task GetAsync(Guid id) + { + return await PersistedGrantAppService.GetAsync(id); + } + + [HttpGet] + public virtual async Task> GetListAsync(GetPersistedGrantInput input) + { + return await PersistedGrantAppService.GetListAsync(input); + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj index 21cde5ebb..de5228422 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj @@ -3,7 +3,7 @@ - netcoreapp3.1 + net5.0 @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN.Abp.IdentityServer.WeChat.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN.Abp.IdentityServer.WeChat.csproj index ac41f1cc2..e40515ffe 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN.Abp.IdentityServer.WeChat.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN.Abp.IdentityServer.WeChat.csproj @@ -3,7 +3,7 @@ - netcoreapp3.1 + net5.0 @@ -13,7 +13,7 @@ - + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj index cf02e7d67..ee2e88bd6 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj index 7b0c251d5..7bdf6bc1e 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj index cba2e48f8..33b5f5829 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj index ad1d4975b..7ae1d5c7d 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj @@ -18,11 +18,11 @@ - - - - - + + + + + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj index e4bc7ff40..93d08b2a3 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj @@ -3,12 +3,12 @@ - netstandard2.0 + netstandard2.1 - + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj index ea6d1b755..5cc7fa9a7 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj index a16b2f56e..1f4424fd6 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN.Abp.PermissionManagement.Domain.csproj b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN.Abp.PermissionManagement.Domain.csproj index ca25d5e7b..bd66a71c9 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN.Abp.PermissionManagement.Domain.csproj +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN.Abp.PermissionManagement.Domain.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN/Abp/PermissionManagement/FixClientPermissionValueProvider.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN/Abp/PermissionManagement/FixClientPermissionValueProvider.cs index 997c5d9d5..4dd827220 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN/Abp/PermissionManagement/FixClientPermissionValueProvider.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN/Abp/PermissionManagement/FixClientPermissionValueProvider.cs @@ -14,7 +14,7 @@ namespace LINGYUN.Abp.PermissionManagement protected ICurrentTenant CurrentTenant { get; } public FixClientPermissionValueProvider( IPermissionStore permissionStore, - ICurrentTenant currentTenant) : base(permissionStore) + ICurrentTenant currentTenant) : base(permissionStore, currentTenant) { CurrentTenant = currentTenant; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj index 831393257..38c2185e7 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj index 75b0aa691..b85240c0a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj @@ -18,7 +18,7 @@ - + diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj index a1f41c87a..9d9914c7f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj index 99d4b0169..cba76445e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj @@ -3,12 +3,12 @@ - netstandard2.0 + netstandard2.1 - + diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs index 53a44e2e8..f57290c53 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs @@ -37,7 +37,7 @@ namespace LINGYUN.Platform.EntityFrameworkCore } return queryable - //.AsSplitQuery() + .AsSplitQuery() .Include(x => x.Items); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Versions/EfCoreVersionRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Versions/EfCoreVersionRepository.cs index cb02161f9..16d1831cb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Versions/EfCoreVersionRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Versions/EfCoreVersionRepository.cs @@ -34,9 +34,9 @@ namespace LINGYUN.Platform.Versions .IncludeIf(includeDetails, x => x.Files) .Where(x => (platformType | x.PlatformType) == x.PlatformType) .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Version.Contains(filter) || x.Title.Contains(filter)) - .OrderByDescending(x => x.CreationTime) - .ThenBy(soring ?? nameof(AppVersion.Version)) // TODO: 排序待优化 - .Page(skipCount, maxResultCount) + .OrderBy($"{nameof(AppVersion.CreationTime)} DESC") + .ThenBy(soring ?? nameof(AppVersion.Version)) + .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); } @@ -60,7 +60,8 @@ namespace LINGYUN.Platform.Versions return await DbSet .Include(x => x.Files) .Where(x => (platformType | x.PlatformType) == x.PlatformType) - .OrderByDescending(x => x.CreationTime) + .OrderBy($"{nameof(AppVersion.CreationTime)} DESC") + .ThenBy(nameof(AppVersion.Version)) .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj index 8ab7f6fe5..94e31bd0a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj @@ -3,13 +3,13 @@ - netcoreapp3.1 + net5.0 - - + + diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj index 3f8c62d17..8bc96efef 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj index 7ede35509..26357ff96 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj index 00e36bbe8..2eb39fa64 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN.Abp.MultiTenancy.DbFinder.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN.Abp.MultiTenancy.DbFinder.csproj index 4698a99a4..df8eb2854 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN.Abp.MultiTenancy.DbFinder.csproj +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN.Abp.MultiTenancy.DbFinder.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN.Abp.MultiTenancy.RemoteService.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN.Abp.MultiTenancy.RemoteService.csproj index 7d08e5a7f..51de692af 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN.Abp.MultiTenancy.RemoteService.csproj +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN.Abp.MultiTenancy.RemoteService.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj index fa6c9bd6e..2398ffe64 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN.Abp.TenantManagement.Application.Contracts.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj index ccf3ea883..eaff2bbcf 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN.Abp.TenantManagement.Application.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi.Client/LINGYUN.Abp.TenantManagement.HttpApi.Client.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi.Client/LINGYUN.Abp.TenantManagement.HttpApi.Client.csproj index b12484add..6783b2313 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi.Client/LINGYUN.Abp.TenantManagement.HttpApi.Client.csproj +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi.Client/LINGYUN.Abp.TenantManagement.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj index 0079567d7..c06cfeac4 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN.Abp.TenantManagement.HttpApi.csproj @@ -3,12 +3,12 @@ - netcoreapp3.1 + net5.0 - + diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj index 7276d2b93..1bc2e902a 100644 --- a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj @@ -3,7 +3,7 @@ - netcoreapp3.1 + net5.0 @@ -18,8 +18,8 @@ - - + + diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj index 353a1ecb7..7ff6878f6 100644 --- a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj @@ -18,10 +18,10 @@ - - - - + + + + diff --git a/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj b/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj index 6c7f286ae..3a9e3d969 100644 --- a/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj +++ b/aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 InProcess AuthServer @@ -22,33 +22,33 @@ - - - + + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/aspnet-core/services/account/AuthServer.Host/DataSeeder/IdentityServerDataSeedContributor.cs b/aspnet-core/services/account/AuthServer.Host/DataSeeder/IdentityServerDataSeedContributor.cs index c2c75c5e7..f94c96b0c 100644 --- a/aspnet-core/services/account/AuthServer.Host/DataSeeder/IdentityServerDataSeedContributor.cs +++ b/aspnet-core/services/account/AuthServer.Host/DataSeeder/IdentityServerDataSeedContributor.cs @@ -9,10 +9,11 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Data; 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; @@ -21,27 +22,30 @@ namespace AuthServer.DataSeeder public class IdentityServerDataSeedContributor : IDataSeedContributor, ITransientDependency { private readonly IApiResourceRepository _apiResourceRepository; + private readonly IApiScopeRepository _apiScopeRepository; private readonly IClientRepository _clientRepository; private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; - private readonly IIdentityClaimTypeRepository _identityClaimTypeRepository; - private readonly IPermissionDataSeeder _permissionDataSeeder; private readonly IWeChatResourceDataSeeder _weChatResourceDataSeeder; private readonly IGuidGenerator _guidGenerator; + private readonly IPermissionDataSeeder _permissionDataSeeder; private readonly IConfiguration _configuration; + private readonly ICurrentTenant _currentTenant; public IdentityServerDataSeedContributor( IClientRepository clientRepository, + IApiScopeRepository apiScopeRepository, IPermissionDataSeeder permissionDataSeeder, IApiResourceRepository apiResourceRepository, IWeChatResourceDataSeeder weChatResourceDataSeeder, IIdentityResourceDataSeeder identityResourceDataSeeder, - IIdentityClaimTypeRepository identityClaimTypeRepository, - IGuidGenerator guidGenerator) + IGuidGenerator guidGenerator, + ICurrentTenant currentTenant) { + _currentTenant = currentTenant; _clientRepository = clientRepository; _permissionDataSeeder = permissionDataSeeder; + _apiScopeRepository = apiScopeRepository; _apiResourceRepository = apiResourceRepository; - _identityClaimTypeRepository = identityClaimTypeRepository; _weChatResourceDataSeeder = weChatResourceDataSeeder; _identityResourceDataSeeder = identityResourceDataSeeder; _guidGenerator = guidGenerator; @@ -57,10 +61,14 @@ namespace AuthServer.DataSeeder [UnitOfWork] public virtual async Task SeedAsync(DataSeedContext context) { - await _identityResourceDataSeeder.CreateStandardResourcesAsync(); - await CreateApiResourcesAsync(); - await CreateClientsAsync(); - await CreateWeChatClaimTypeAsync(); + using (_currentTenant.Change(context?.TenantId)) + { + await _identityResourceDataSeeder.CreateStandardResourcesAsync(); + await CreateWeChatClaimTypeAsync(); + await CreateApiResourcesAsync(); + await CreateApiScopesAsync(); + await CreateClientsAsync(); + } } private async Task CreateWeChatClaimTypeAsync() @@ -68,6 +76,11 @@ namespace AuthServer.DataSeeder await _weChatResourceDataSeeder.CreateStandardResourcesAsync(); } + private async Task CreateApiScopesAsync() + { + await CreateApiScopeAsync("lingyun-abp-application"); + } + private async Task CreateApiResourcesAsync() { var commonApiUserClaims = new[] @@ -80,13 +93,7 @@ namespace AuthServer.DataSeeder "role" }; - await CreateApiResourceAsync("auth-service", commonApiUserClaims); - - var apigatewaySecret = new[] - { - "defj98734htgrb90365D23" - }; - await CreateApiResourceAsync("apigateway-service", commonApiUserClaims.Union(new[] { "apigateway-service" }), apigatewaySecret); + await CreateApiResourceAsync("lingyun-abp-application", commonApiUserClaims); } private async Task CreateApiResourceAsync(string name, IEnumerable claims, IEnumerable secrets = null) @@ -125,9 +132,28 @@ namespace AuthServer.DataSeeder 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() { - const string commonSecret = "E5Xd4yMqjP5kjWFKrYgySBju6JVfCzMyFp7n2QmMrME="; + + string commonSecret = IdentityServer4.Models.HashExtensions.Sha256("1q2w3e*"); var commonScopes = new[] { @@ -137,7 +163,8 @@ namespace AuthServer.DataSeeder "role", "phone", "address", - "offline_access" // 加上刷新 + "offline_access" // 加上刷新, + }; var configurationSection = _configuration.GetSection("IdentityServer:Clients"); @@ -149,7 +176,7 @@ namespace AuthServer.DataSeeder var webClientRootUrl = configurationSection["AuthManagement:RootUrl"].EnsureEndsWith('/'); await CreateClientAsync( webClientId, - commonScopes.Union(new[] { "auth-service" }), + commonScopes.Union(new[] { "lingyun-abp-application" }), new[] { "hybrid" }, commonSecret, redirectUri: $"{webClientRootUrl}signin-oidc", @@ -164,7 +191,7 @@ namespace AuthServer.DataSeeder { await CreateClientAsync( consoleClientId, - commonScopes.Union(new[] { "auth-service", "apigateway-service" }), + commonScopes.Union(new[] { "lingyun-abp-application" }), new[] { "password", "client_credentials" }, commonSecret ); @@ -183,7 +210,7 @@ namespace AuthServer.DataSeeder }; await CreateClientAsync( apigatewayClientId, - commonScopes.Union(new[] { "apigateway-service" }), + commonScopes.Union(new[] { "lingyun-abp-application" }), new[] { "client_credentials" }, commonSecret, permissions: apigatewayPermissions @@ -200,7 +227,7 @@ namespace AuthServer.DataSeeder }; await CreateClientAsync( internalServiceClientId, - commonScopes.Union(new[] { "auth-service" }), + commonScopes.Union(new[] { "lingyun-abp-application" }), new[] { "client_credentials" }, commonSecret, permissions: internalServicePermissions @@ -218,7 +245,7 @@ namespace AuthServer.DataSeeder IEnumerable permissions = null, string corsOrigins = null) { - var client = await _clientRepository.FindByCliendIdAsync(name); + var client = await _clientRepository.FindByClientIdAsync(name); if (client == null) { client = await _clientRepository.InsertAsync( diff --git a/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/AuthServerHostMigrationsDbContextFactory.cs b/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/AuthServerHostMigrationsDbContextFactory.cs index 4fee98618..ffe0ce43d 100644 --- a/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/AuthServerHostMigrationsDbContextFactory.cs +++ b/aspnet-core/services/account/AuthServer.Host/EntityFrameworkCore/AuthServerHostMigrationsDbContextFactory.cs @@ -11,9 +11,10 @@ namespace AuthServer.EntityFrameworkCore public AuthServerHostMigrationsDbContext CreateDbContext(string[] args) { var configuration = BuildConfiguration(); + var connectionString = configuration.GetConnectionString("Default"); var builder = new DbContextOptionsBuilder() - .UseMySql(configuration.GetConnectionString("Default")); + .UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); return new AuthServerHostMigrationsDbContext(builder.Options); } @@ -25,7 +26,7 @@ namespace AuthServer.EntityFrameworkCore var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: false); + .AddJsonFile("appsettings.json", optional: true); if (File.Exists(envFile)) { builder.AddJsonFile($"appsettings.{env}.json", optional: false); diff --git a/aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.Designer.cs b/aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.Designer.cs new file mode 100644 index 000000000..456ad8bbb --- /dev/null +++ b/aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.Designer.cs @@ -0,0 +1,1770 @@ +// +using System; +using AuthServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace AuthServer.Host.Migrations +{ + [DbContext(typeof(AuthServerHostMigrationsDbContext))] + [Migration("20201222101851_Upgrade-Abp-4.0.0")] + partial class UpgradeAbp400 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.0"); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512) CHARACTER SET utf8mb4"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128) CHARACTER SET utf8mb4"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024) CHARACTER SET utf8mb4"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96) CHARACTER SET utf8mb4"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96) CHARACTER SET utf8mb4"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512) CHARACTER SET utf8mb4"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96) CHARACTER SET utf8mb4"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16) CHARACTER SET utf8mb4") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .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("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024) CHARACTER SET utf8mb4"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128) CHARACTER SET utf8mb4"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196) CHARACTER SET utf8mb4"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128) CHARACTER SET utf8mb4"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95) CHARACTER SET utf8mb4") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128) CHARACTER SET utf8mb4") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .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("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + + 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("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + 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("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); + + 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") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + 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/aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.cs b/aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.cs new file mode 100644 index 000000000..a13c57080 --- /dev/null +++ b/aspnet-core/services/account/AuthServer.Host/Migrations/20201222101851_Upgrade-Abp-4.0.0.cs @@ -0,0 +1,657 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace AuthServer.Host.Migrations +{ + public partial class UpgradeAbp400 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~", + table: "IdentityServerApiClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~", + table: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerApiSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityClaims"); + + migrationBuilder.DropIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerClientProperties", + table: "IdentityServerClientProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerApiScopes", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerApiScopeClaims", + table: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerApiClaims", + table: "IdentityServerApiClaims"); + + migrationBuilder.DropColumn( + name: "Properties", + table: "IdentityServerIdentityResources"); + + migrationBuilder.DropColumn( + name: "Name", + table: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropColumn( + name: "Properties", + table: "IdentityServerApiResources"); + + migrationBuilder.RenameTable( + name: "IdentityServerApiClaims", + newName: "IdentityServerApiResourceClaims"); + + migrationBuilder.RenameColumn( + name: "ApiResourceId", + table: "IdentityServerApiScopes", + newName: "Id"); + + migrationBuilder.RenameColumn( + name: "ApiResourceId", + table: "IdentityServerApiScopeClaims", + newName: "ApiScopeId"); + + migrationBuilder.AddColumn( + name: "ConsumedTime", + table: "IdentityServerPersistedGrants", + type: "datetime(6)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "IdentityServerPersistedGrants", + type: "varchar(200) CHARACTER SET utf8mb4", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "IdentityServerPersistedGrants", + type: "varchar(100) CHARACTER SET utf8mb4", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "IdentityServerDeviceFlowCodes", + type: "varchar(200) CHARACTER SET utf8mb4", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "IdentityServerDeviceFlowCodes", + type: "varchar(100) CHARACTER SET utf8mb4", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "IdentityServerClients", + type: "varchar(100) CHARACTER SET utf8mb4", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "RequireRequestObject", + table: "IdentityServerClients", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.AlterColumn( + name: "Value", + table: "IdentityServerClientProperties", + type: "varchar(300) CHARACTER SET utf8mb4", + maxLength: 300, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(2000) CHARACTER SET utf8mb4", + oldMaxLength: 2000); + + migrationBuilder.AddColumn( + name: "ConcurrencyStamp", + table: "IdentityServerApiScopes", + type: "varchar(40) CHARACTER SET utf8mb4", + maxLength: 40, + nullable: true); + + migrationBuilder.AddColumn( + name: "CreationTime", + table: "IdentityServerApiScopes", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + name: "CreatorId", + table: "IdentityServerApiScopes", + type: "char(36)", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeleterId", + table: "IdentityServerApiScopes", + type: "char(36)", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeletionTime", + table: "IdentityServerApiScopes", + type: "datetime(6)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Enabled", + table: "IdentityServerApiScopes", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "IdentityServerApiScopes", + type: "longtext CHARACTER SET utf8mb4", + nullable: true); + + migrationBuilder.AddColumn( + name: "IsDeleted", + table: "IdentityServerApiScopes", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "LastModificationTime", + table: "IdentityServerApiScopes", + type: "datetime(6)", + nullable: true); + + migrationBuilder.AddColumn( + name: "LastModifierId", + table: "IdentityServerApiScopes", + type: "char(36)", + nullable: true); + + migrationBuilder.AddColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "IdentityServerApiResources", + type: "varchar(100) CHARACTER SET utf8mb4", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "ShowInDiscoveryDocument", + table: "IdentityServerApiResources", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerClientProperties", + table: "IdentityServerClientProperties", + columns: new[] { "ClientId", "Key", "Value" }); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerApiScopes", + table: "IdentityServerApiScopes", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerApiScopeClaims", + table: "IdentityServerApiScopeClaims", + columns: new[] { "ApiScopeId", "Type" }); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerApiResourceClaims", + table: "IdentityServerApiResourceClaims", + columns: new[] { "ApiResourceId", "Type" }); + + migrationBuilder.CreateTable( + name: "AbpLinkUsers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false), + SourceUserId = table.Column(type: "char(36)", nullable: false), + SourceTenantId = table.Column(type: "char(36)", nullable: true), + TargetUserId = table.Column(type: "char(36)", nullable: false), + TargetTenantId = table.Column(type: "char(36)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceProperties", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false), + Key = table.Column(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false), + Value = table.Column(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceScopes", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false), + Scope = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceSecrets", + columns: table => new + { + Type = table.Column(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false), + Value = table.Column(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false), + ApiResourceId = table.Column(type: "char(36)", nullable: false), + Description = table.Column(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true), + Expiration = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeProperties", + columns: table => new + { + ApiScopeId = table.Column(type: "char(36)", nullable: false), + Key = table.Column(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false), + Value = table.Column(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceClaims", + columns: table => new + { + Type = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false), + IdentityResourceId = table.Column(type: "char(36)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceProperties", + columns: table => new + { + IdentityResourceId = table.Column(type: "char(36)", nullable: false), + Key = table.Column(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false), + Value = table.Column(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode"); + + migrationBuilder.CreateIndex( + name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Target~", + table: "AbpLinkUsers", + columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, + unique: true); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~", + table: "IdentityServerApiResourceClaims", + column: "ApiResourceId", + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~", + table: "IdentityServerApiScopeClaims", + column: "ApiScopeId", + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~", + table: "IdentityServerApiResourceClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~", + table: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropTable( + name: "AbpLinkUsers"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceProperties"); + + migrationBuilder.DropIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", + table: "IdentityServerPersistedGrants"); + + migrationBuilder.DropIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerClientProperties", + table: "IdentityServerClientProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerApiScopes", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerApiScopeClaims", + table: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityServerApiResourceClaims", + table: "IdentityServerApiResourceClaims"); + + migrationBuilder.DropColumn( + name: "ConsumedTime", + table: "IdentityServerPersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "IdentityServerPersistedGrants"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "IdentityServerPersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "IdentityServerClients"); + + migrationBuilder.DropColumn( + name: "RequireRequestObject", + table: "IdentityServerClients"); + + migrationBuilder.DropColumn( + name: "ConcurrencyStamp", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "CreationTime", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "CreatorId", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "DeleterId", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "DeletionTime", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "Enabled", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "IsDeleted", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "LastModificationTime", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "LastModifierId", + table: "IdentityServerApiScopes"); + + migrationBuilder.DropColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "IdentityServerApiResources"); + + migrationBuilder.DropColumn( + name: "ShowInDiscoveryDocument", + table: "IdentityServerApiResources"); + + migrationBuilder.RenameTable( + name: "IdentityServerApiResourceClaims", + newName: "IdentityServerApiClaims"); + + migrationBuilder.RenameColumn( + name: "Id", + table: "IdentityServerApiScopes", + newName: "ApiResourceId"); + + migrationBuilder.RenameColumn( + name: "ApiScopeId", + table: "IdentityServerApiScopeClaims", + newName: "ApiResourceId"); + + migrationBuilder.AddColumn( + name: "Properties", + table: "IdentityServerIdentityResources", + type: "longtext CHARACTER SET utf8mb4", + nullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "IdentityServerClientProperties", + type: "varchar(2000) CHARACTER SET utf8mb4", + maxLength: 2000, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(300) CHARACTER SET utf8mb4", + oldMaxLength: 300); + + migrationBuilder.AddColumn( + name: "Name", + table: "IdentityServerApiScopeClaims", + type: "varchar(200) CHARACTER SET utf8mb4", + maxLength: 200, + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "Properties", + table: "IdentityServerApiResources", + type: "longtext CHARACTER SET utf8mb4", + nullable: true); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerClientProperties", + table: "IdentityServerClientProperties", + columns: new[] { "ClientId", "Key" }); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerApiScopes", + table: "IdentityServerApiScopes", + columns: new[] { "ApiResourceId", "Name" }); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerApiScopeClaims", + table: "IdentityServerApiScopeClaims", + columns: new[] { "ApiResourceId", "Name", "Type" }); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityServerApiClaims", + table: "IdentityServerApiClaims", + columns: new[] { "ApiResourceId", "Type" }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiSecrets", + columns: table => new + { + ApiResourceId = table.Column(type: "char(36)", nullable: false), + Type = table.Column(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false), + Value = table.Column(type: "varchar(300) CHARACTER SET utf8mb4", maxLength: 300, nullable: false), + Description = table.Column(type: "varchar(2000) CHARACTER SET utf8mb4", maxLength: 2000, nullable: true), + Expiration = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResou~", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityClaims", + columns: table => new + { + IdentityResourceId = table.Column(type: "char(36)", nullable: false), + Type = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources~", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~", + table: "IdentityServerApiClaims", + column: "ApiResourceId", + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~", + table: "IdentityServerApiScopeClaims", + columns: new[] { "ApiResourceId", "Name" }, + principalTable: "IdentityServerApiScopes", + principalColumns: new[] { "ApiResourceId", "Name" }, + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~", + table: "IdentityServerApiScopes", + column: "ApiResourceId", + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/aspnet-core/services/account/AuthServer.Host/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs b/aspnet-core/services/account/AuthServer.Host/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs index a6f5fa263..80a83d397 100644 --- a/aspnet-core/services/account/AuthServer.Host/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/services/account/AuthServer.Host/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs @@ -16,8 +16,8 @@ namespace AuthServer.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "3.1.7") - .HasAnnotation("Relational:MaxIdentifierLength", 64); + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.0"); modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { @@ -27,33 +27,33 @@ namespace AuthServer.Migrations b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("Description") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("IsStatic") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); b.Property("Regex") - .HasColumnType("varchar(512) CHARACTER SET utf8mb4") - .HasMaxLength(512); + .HasMaxLength(512) + .HasColumnType("varchar(512) CHARACTER SET utf8mb4"); b.Property("RegexDescription") - .HasColumnType("varchar(128) CHARACTER SET utf8mb4") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("varchar(128) CHARACTER SET utf8mb4"); b.Property("Required") .HasColumnType("tinyint(1)"); @@ -66,6 +66,32 @@ namespace AuthServer.Migrations b.ToTable("AbpClaimTypes"); }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers"); + }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => { b.Property("Id") @@ -74,39 +100,39 @@ namespace AuthServer.Migrations b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("IsDefault") - .HasColumnName("IsDefault") - .HasColumnType("tinyint(1)"); + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); b.Property("IsPublic") - .HasColumnName("IsPublic") - .HasColumnType("tinyint(1)"); + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); b.Property("IsStatic") - .HasColumnName("IsStatic") - .HasColumnType("tinyint(1)"); + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); b.Property("Name") .IsRequired() - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); b.Property("NormalizedName") .IsRequired() - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.HasKey("Id"); @@ -122,19 +148,19 @@ namespace AuthServer.Migrations b.Property("ClaimType") .IsRequired() - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); b.Property("ClaimValue") - .HasColumnType("varchar(1024) CHARACTER SET utf8mb4") - .HasMaxLength(1024); + .HasMaxLength(1024) + .HasColumnType("varchar(1024) CHARACTER SET utf8mb4"); b.Property("RoleId") .HasColumnType("char(36)"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.HasKey("Id"); @@ -150,60 +176,60 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Action") - .HasColumnType("varchar(96) CHARACTER SET utf8mb4") - .HasMaxLength(96); + .HasMaxLength(96) + .HasColumnType("varchar(96) CHARACTER SET utf8mb4"); b.Property("ApplicationName") - .HasColumnType("varchar(96) CHARACTER SET utf8mb4") - .HasMaxLength(96); + .HasMaxLength(96) + .HasColumnType("varchar(96) CHARACTER SET utf8mb4"); b.Property("BrowserInfo") - .HasColumnType("varchar(512) CHARACTER SET utf8mb4") - .HasMaxLength(512); + .HasMaxLength(512) + .HasColumnType("varchar(512) CHARACTER SET utf8mb4"); b.Property("ClientId") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); b.Property("ClientIpAddress") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("CorrelationId") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("Identity") - .HasColumnType("varchar(96) CHARACTER SET utf8mb4") - .HasMaxLength(96); + .HasMaxLength(96) + .HasColumnType("varchar(96) CHARACTER SET utf8mb4"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.Property("TenantName") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); b.Property("UserId") .HasColumnType("char(36)"); b.Property("UserName") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); b.HasKey("Id"); @@ -226,136 +252,136 @@ namespace AuthServer.Migrations b.Property("AccessFailedCount") .ValueGeneratedOnAdd() - .HasColumnName("AccessFailedCount") .HasColumnType("int") - .HasDefaultValue(0); + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("DeleterId") - .HasColumnName("DeleterId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); b.Property("DeletionTime") - .HasColumnName("DeletionTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); b.Property("Email") .IsRequired() - .HasColumnName("Email") + .HasMaxLength(256) .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasColumnName("Email"); b.Property("EmailConfirmed") .ValueGeneratedOnAdd() - .HasColumnName("EmailConfirmed") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("IsDeleted") .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); b.Property("IsExternal") .ValueGeneratedOnAdd() - .HasColumnName("IsExternal") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("IsExternal"); b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); b.Property("LockoutEnabled") .ValueGeneratedOnAdd() - .HasColumnName("LockoutEnabled") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); b.Property("LockoutEnd") .HasColumnType("datetime(6)"); b.Property("Name") - .HasColumnName("Name") + .HasMaxLength(64) .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasColumnName("Name"); b.Property("NormalizedEmail") .IsRequired() - .HasColumnName("NormalizedEmail") + .HasMaxLength(256) .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasColumnName("NormalizedEmail"); b.Property("NormalizedUserName") .IsRequired() - .HasColumnName("NormalizedUserName") + .HasMaxLength(256) .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasColumnName("NormalizedUserName"); b.Property("PasswordHash") - .HasColumnName("PasswordHash") + .HasMaxLength(256) .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasColumnName("PasswordHash"); b.Property("PhoneNumber") - .HasColumnName("PhoneNumber") + .HasMaxLength(16) .HasColumnType("varchar(16) CHARACTER SET utf8mb4") - .HasMaxLength(16); + .HasColumnName("PhoneNumber"); b.Property("PhoneNumberConfirmed") .ValueGeneratedOnAdd() - .HasColumnName("PhoneNumberConfirmed") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); b.Property("SecurityStamp") .IsRequired() - .HasColumnName("SecurityStamp") + .HasMaxLength(256) .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasColumnName("SecurityStamp"); b.Property("Surname") - .HasColumnName("Surname") + .HasMaxLength(64) .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasColumnName("Surname"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.Property("TwoFactorEnabled") .ValueGeneratedOnAdd() - .HasColumnName("TwoFactorEnabled") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); b.Property("UserName") .IsRequired() - .HasColumnName("UserName") + .HasMaxLength(256) .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasColumnName("UserName"); b.HasKey("Id"); @@ -377,16 +403,16 @@ namespace AuthServer.Migrations b.Property("ClaimType") .IsRequired() - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256) CHARACTER SET utf8mb4"); b.Property("ClaimValue") - .HasColumnType("varchar(1024) CHARACTER SET utf8mb4") - .HasMaxLength(1024); + .HasMaxLength(1024) + .HasColumnType("varchar(1024) CHARACTER SET utf8mb4"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.Property("UserId") .HasColumnType("char(36)"); @@ -404,21 +430,21 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("LoginProvider") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); b.Property("ProviderDisplayName") - .HasColumnType("varchar(128) CHARACTER SET utf8mb4") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("varchar(128) CHARACTER SET utf8mb4"); b.Property("ProviderKey") .IsRequired() - .HasColumnType("varchar(196) CHARACTER SET utf8mb4") - .HasMaxLength(196); + .HasMaxLength(196) + .HasColumnType("varchar(196) CHARACTER SET utf8mb4"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.HasKey("UserId", "LoginProvider"); @@ -436,16 +462,16 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.HasKey("OrganizationUnitId", "UserId"); @@ -463,8 +489,8 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.HasKey("UserId", "RoleId"); @@ -479,16 +505,16 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("LoginProvider") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64) CHARACTER SET utf8mb4"); b.Property("Name") - .HasColumnType("varchar(128) CHARACTER SET utf8mb4") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("varchar(128) CHARACTER SET utf8mb4"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.Property("Value") .HasColumnType("longtext CHARACTER SET utf8mb4"); @@ -506,62 +532,62 @@ namespace AuthServer.Migrations b.Property("Code") .IsRequired() - .HasColumnName("Code") + .HasMaxLength(95) .HasColumnType("varchar(95) CHARACTER SET utf8mb4") - .HasMaxLength(95); + .HasColumnName("Code"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("DeleterId") - .HasColumnName("DeleterId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); b.Property("DeletionTime") - .HasColumnName("DeletionTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); b.Property("DisplayName") .IsRequired() - .HasColumnName("DisplayName") + .HasMaxLength(128) .HasColumnType("varchar(128) CHARACTER SET utf8mb4") - .HasMaxLength(128); + .HasColumnName("DisplayName"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("IsDeleted") .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); b.Property("ParentId") .HasColumnType("char(36)"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.HasKey("Id"); @@ -581,16 +607,16 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("TenantId"); b.HasKey("OrganizationUnitId", "RoleId"); @@ -605,64 +631,68 @@ namespace AuthServer.Migrations .ValueGeneratedOnAdd() .HasColumnType("char(36)"); + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("DeleterId") - .HasColumnName("DeleterId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); b.Property("DeletionTime") - .HasColumnName("DeletionTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") - .HasMaxLength(1000); + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); b.Property("DisplayName") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("IsDeleted") .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); b.Property("Name") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); - b.Property("Properties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); b.HasKey("Id"); @@ -675,86 +705,177 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Type") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.HasKey("ApiResourceId", "Type"); - b.ToTable("IdentityServerApiClaims"); + b.ToTable("IdentityServerApiResourceClaims"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => { b.Property("ApiResourceId") .HasColumnType("char(36)"); - b.Property("Name") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") - .HasMaxLength(1000); + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); b.Property("DisplayName") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("Emphasize") .HasColumnType("tinyint(1)"); + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + b.Property("Required") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); - b.HasKey("ApiResourceId", "Name"); + b.HasKey("Id"); b.ToTable("IdentityServerApiScopes"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => { - b.Property("ApiResourceId") + b.Property("ApiScopeId") .HasColumnType("char(36)"); - b.Property("Name") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); - b.Property("Type") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); - b.HasKey("ApiResourceId", "Name", "Type"); + b.HasKey("ApiScopeId", "Type"); b.ToTable("IdentityServerApiScopeClaims"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => { - b.Property("ApiResourceId") + b.Property("ApiScopeId") .HasColumnType("char(36)"); - b.Property("Type") - .HasColumnType("varchar(250) CHARACTER SET utf8mb4") - .HasMaxLength(250); + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); b.Property("Value") - .HasColumnType("varchar(300) CHARACTER SET utf8mb4") - .HasMaxLength(300); - - b.Property("Description") - .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") - .HasMaxLength(2000); - - b.Property("Expiration") - .HasColumnType("datetime(6)"); + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); - b.HasKey("ApiResourceId", "Type", "Value"); + b.HasKey("ApiScopeId", "Key", "Value"); - b.ToTable("IdentityServerApiSecrets"); + b.ToTable("IdentityServerApiScopeProperties"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => @@ -784,6 +905,10 @@ namespace AuthServer.Migrations b.Property("AllowRememberConsent") .HasColumnType("tinyint(1)"); + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("tinyint(1)"); @@ -797,54 +922,54 @@ namespace AuthServer.Migrations .HasColumnType("tinyint(1)"); b.Property("BackChannelLogoutUri") - .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") - .HasMaxLength(2000); + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); b.Property("ClientClaimsPrefix") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("ClientId") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("ClientName") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("ClientUri") - .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") - .HasMaxLength(2000); + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("ConsentLifetime") .HasColumnType("int"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("DeleterId") - .HasColumnName("DeleterId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); b.Property("DeletionTime") - .HasColumnName("DeletionTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") - .HasMaxLength(1000); + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); b.Property("DeviceCodeLifetime") .HasColumnType("int"); @@ -856,15 +981,15 @@ namespace AuthServer.Migrations .HasColumnType("tinyint(1)"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("FrontChannelLogoutSessionRequired") .HasColumnType("tinyint(1)"); b.Property("FrontChannelLogoutUri") - .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") - .HasMaxLength(2000); + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); b.Property("IdentityTokenLifetime") .HasColumnType("int"); @@ -874,30 +999,30 @@ namespace AuthServer.Migrations b.Property("IsDeleted") .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); b.Property("LogoUri") - .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") - .HasMaxLength(2000); + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); b.Property("PairWiseSubjectSalt") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("ProtocolType") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("RefreshTokenExpiration") .HasColumnType("int"); @@ -914,6 +1039,9 @@ namespace AuthServer.Migrations b.Property("RequirePkce") .HasColumnType("tinyint(1)"); + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); @@ -921,8 +1049,8 @@ namespace AuthServer.Migrations .HasColumnType("tinyint(1)"); b.Property("UserCodeType") - .HasColumnType("varchar(100) CHARACTER SET utf8mb4") - .HasMaxLength(100); + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); b.Property("UserSsoLifetime") .HasColumnType("int"); @@ -940,12 +1068,12 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Type") - .HasColumnType("varchar(250) CHARACTER SET utf8mb4") - .HasMaxLength(250); + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); b.Property("Value") - .HasColumnType("varchar(250) CHARACTER SET utf8mb4") - .HasMaxLength(250); + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); b.HasKey("ClientId", "Type", "Value"); @@ -958,8 +1086,8 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Origin") - .HasColumnType("varchar(150) CHARACTER SET utf8mb4") - .HasMaxLength(150); + .HasMaxLength(150) + .HasColumnType("varchar(150) CHARACTER SET utf8mb4"); b.HasKey("ClientId", "Origin"); @@ -972,8 +1100,8 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("GrantType") - .HasColumnType("varchar(250) CHARACTER SET utf8mb4") - .HasMaxLength(250); + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); b.HasKey("ClientId", "GrantType"); @@ -986,8 +1114,8 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Provider") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.HasKey("ClientId", "Provider"); @@ -1000,8 +1128,8 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("PostLogoutRedirectUri") - .HasColumnType("varchar(300) CHARACTER SET utf8mb4") - .HasMaxLength(300); + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); b.HasKey("ClientId", "PostLogoutRedirectUri"); @@ -1014,15 +1142,14 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Key") - .HasColumnType("varchar(250) CHARACTER SET utf8mb4") - .HasMaxLength(250); + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); b.Property("Value") - .IsRequired() - .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") - .HasMaxLength(2000); + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); - b.HasKey("ClientId", "Key"); + b.HasKey("ClientId", "Key", "Value"); b.ToTable("IdentityServerClientProperties"); }); @@ -1033,8 +1160,8 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("RedirectUri") - .HasColumnType("varchar(300) CHARACTER SET utf8mb4") - .HasMaxLength(300); + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); b.HasKey("ClientId", "RedirectUri"); @@ -1047,8 +1174,8 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Scope") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.HasKey("ClientId", "Scope"); @@ -1061,16 +1188,16 @@ namespace AuthServer.Migrations .HasColumnType("char(36)"); b.Property("Type") - .HasColumnType("varchar(250) CHARACTER SET utf8mb4") - .HasMaxLength(250); + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); b.Property("Value") - .HasColumnType("varchar(300) CHARACTER SET utf8mb4") - .HasMaxLength(300); + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); b.Property("Description") - .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") - .HasMaxLength(2000); + .HasMaxLength(2000) + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4"); b.Property("Expiration") .HasColumnType("datetime(6)"); @@ -1088,49 +1215,57 @@ namespace AuthServer.Migrations b.Property("ClientId") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(50000); + .HasMaxLength(10000) + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("DeviceCode") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("Expiration") .IsRequired() .HasColumnType("datetime(6)"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); b.Property("SubjectId") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("UserCode") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.HasKey("Id"); @@ -1139,8 +1274,7 @@ namespace AuthServer.Migrations b.HasIndex("Expiration"); - b.HasIndex("UserCode") - .IsUnique(); + b.HasIndex("UserCode"); b.ToTable("IdentityServerDeviceFlowCodes"); }); @@ -1148,46 +1282,57 @@ namespace AuthServer.Migrations modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("ClientId") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); + .HasMaxLength(10000) + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("Id") .HasColumnType("char(36)"); + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100) CHARACTER SET utf8mb4"); + b.Property("SubjectId") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("Type") .IsRequired() - .HasColumnType("varchar(50) CHARACTER SET utf8mb4") - .HasMaxLength(50); + .HasMaxLength(50) + .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); b.HasKey("Key"); @@ -1195,21 +1340,9 @@ namespace AuthServer.Migrations b.HasIndex("SubjectId", "ClientId", "Type"); - b.ToTable("IdentityServerPersistedGrants"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("IdentityResourceId") - .HasColumnType("char(36)"); - - b.Property("Type") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); - - b.HasKey("IdentityResourceId", "Type"); + b.HasIndex("SubjectId", "SessionId", "Type"); - b.ToTable("IdentityServerIdentityClaims"); + b.ToTable("IdentityServerPersistedGrants"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => @@ -1220,33 +1353,33 @@ namespace AuthServer.Migrations b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") + .HasMaxLength(40) .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); b.Property("DeleterId") - .HasColumnName("DeleterId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); b.Property("DeletionTime") - .HasColumnName("DeletionTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") - .HasMaxLength(1000); + .HasMaxLength(1000) + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4"); b.Property("DisplayName") - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("Emphasize") .HasColumnType("tinyint(1)"); @@ -1255,30 +1388,27 @@ namespace AuthServer.Migrations .HasColumnType("tinyint(1)"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasColumnName("ExtraProperties"); b.Property("IsDeleted") .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") .HasColumnType("tinyint(1)") - .HasDefaultValue(false); + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime(6)"); + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("char(36)"); + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); b.Property("Name") .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); - - b.Property("Properties") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); b.Property("Required") .HasColumnType("tinyint(1)"); @@ -1291,6 +1421,38 @@ namespace AuthServer.Migrations b.ToTable("IdentityServerIdentityResources"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200) CHARACTER SET utf8mb4"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250) CHARACTER SET utf8mb4"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300) CHARACTER SET utf8mb4"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties"); + }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => { b.HasOne("Volo.Abp.Identity.IdentityRole", null) @@ -1388,25 +1550,25 @@ namespace AuthServer.Migrations .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => { b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("Scopes") + .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => { b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) .WithMany("Secrets") @@ -1415,6 +1577,24 @@ namespace AuthServer.Migrations .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) @@ -1496,7 +1676,7 @@ namespace AuthServer.Migrations .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => { b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) .WithMany("UserClaims") @@ -1504,6 +1684,84 @@ namespace AuthServer.Migrations .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/aspnet-core/services/account/AuthServer.Host/Pages/Account/TwoFactorSupportedLoginModel.cs b/aspnet-core/services/account/AuthServer.Host/Pages/Account/TwoFactorSupportedLoginModel.cs index 38f823243..ce2c483b3 100644 --- a/aspnet-core/services/account/AuthServer.Host/Pages/Account/TwoFactorSupportedLoginModel.cs +++ b/aspnet-core/services/account/AuthServer.Host/Pages/Account/TwoFactorSupportedLoginModel.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Volo.Abp.Account.Web; using Volo.Abp.Account.Web.Pages.Account; using Volo.Abp.DependencyInjection; +using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions; namespace AuthServer.Host.Pages.Account { @@ -20,10 +21,11 @@ namespace AuthServer.Host.Pages.Account public TwoFactorSupportedLoginModel( IAuthenticationSchemeProvider schemeProvider, IOptions accountOptions, + IOptions identityOptions, IIdentityServerInteractionService interaction, IClientStore clientStore, IEventService identityServerEvents) - : base(schemeProvider, accountOptions, interaction, clientStore, identityServerEvents) + : base(schemeProvider, accountOptions, interaction, clientStore, identityServerEvents, identityOptions) { } diff --git a/aspnet-core/services/account/AuthServer.Host/identity-server-upgrate-4.1.sql b/aspnet-core/services/account/AuthServer.Host/identity-server-upgrate-4.1.sql new file mode 100644 index 000000000..036e085aa --- /dev/null +++ b/aspnet-core/services/account/AuthServer.Host/identity-server-upgrate-4.1.sql @@ -0,0 +1,314 @@ +START TRANSACTION; + +/* + + Description: IdentityServer 4.1 升级脚本 + Author: colin.in@foxmail.com + CreateTime: 2020-12-23 09:00 + Remarks: 升级需谨慎,数据无价,请提前备份,涉及到多个表的重建 + Reference: https://docs.abp.io/en/abp/latest/Migration-Guides/Abp-4_0 +*/ + +DROP PROCEDURE IF EXISTS `PROC_DROP_COLUMN`; +DELIMITER // +CREATE PROCEDURE PROC_DROP_COLUMN(IN `TABLE_NAME_ARGUMENT` VARCHAR(255), IN `COLUMN_NAME_ARGUMENT` VARCHAR(255)) +BEGIN + IF EXISTS( + SELECT * FROM information_schema.columns + WHERE + table_schema = DATABASE() AND + table_name = TABLE_NAME_ARGUMENT AND + column_name = COLUMN_NAME_ARGUMENT) + THEN + SET @query = CONCAT('ALTER TABLE ', TABLE_NAME_ARGUMENT, ' DROP COLUMN ', COLUMN_NAME_ARGUMENT, ';'); + PREPARE stmt FROM @query; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + END IF; +END // +DELIMITER ; + +DROP PROCEDURE IF EXISTS `PROC_DROP_FOREIGN_KEY`; +DELIMITER // +CREATE PROCEDURE PROC_DROP_FOREIGN_KEY(IN `TABLE_NAME_ARGUMENT` VARCHAR(255), IN `COLUMN_NAME_ARGUMENT` VARCHAR(255)) +BEGIN + IF EXISTS( + SELECT * FROM information_schema.table_constraints + WHERE + table_schema = DATABASE() AND + table_name = TABLE_NAME_ARGUMENT AND + constraint_name = COLUMN_NAME_ARGUMENT AND + constraint_type = 'FOREIGN KEY') + THEN + SET @query = CONCAT('ALTER TABLE ', TABLE_NAME_ARGUMENT, ' DROP FOREIGN KEY ', COLUMN_NAME_ARGUMENT, ';'); + PREPARE stmt FROM @query; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + END IF; +END // +DELIMITER ; + +DROP PROCEDURE IF EXISTS `PROC_DROP_INDEX`; +DELIMITER // +CREATE PROCEDURE PROC_DROP_INDEX(IN `TABLE_NAME_ARGUMENT` VARCHAR(255), IN `COLUMN_NAME_ARGUMENT` VARCHAR(255)) +BEGIN + IF EXISTS( + SELECT * FROM information_schema.statistics + WHERE + table_schema = DATABASE() AND + table_name = TABLE_NAME_ARGUMENT AND + index_name = COLUMN_NAME_ARGUMENT) + THEN + SET @query = CONCAT('ALTER TABLE ', TABLE_NAME_ARGUMENT, ' DROP INDEX ', COLUMN_NAME_ARGUMENT, ';'); + PREPARE stmt FROM @query; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + END IF; +END // +DELIMITER ; + + +DROP PROCEDURE IF EXISTS `POMELO_BEFORE_DROP_PRIMARY_KEY`; +DELIMITER // +CREATE PROCEDURE `POMELO_BEFORE_DROP_PRIMARY_KEY`(IN `SCHEMA_NAME_ARGUMENT` VARCHAR(255), IN `TABLE_NAME_ARGUMENT` VARCHAR(255)) +BEGIN + DECLARE HAS_AUTO_INCREMENT_ID TINYINT(1); + DECLARE PRIMARY_KEY_COLUMN_NAME VARCHAR(255); + DECLARE PRIMARY_KEY_TYPE VARCHAR(255); + DECLARE SQL_EXP VARCHAR(1000); + SELECT COUNT(*) + INTO HAS_AUTO_INCREMENT_ID + FROM `information_schema`.`COLUMNS` + WHERE `TABLE_SCHEMA` = (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())) + AND `TABLE_NAME` = TABLE_NAME_ARGUMENT + AND `Extra` = 'auto_increment' + AND `COLUMN_KEY` = 'PRI' + LIMIT 1; + IF HAS_AUTO_INCREMENT_ID THEN + SELECT `COLUMN_TYPE` + INTO PRIMARY_KEY_TYPE + FROM `information_schema`.`COLUMNS` + WHERE `TABLE_SCHEMA` = (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())) + AND `TABLE_NAME` = TABLE_NAME_ARGUMENT + AND `COLUMN_KEY` = 'PRI' + LIMIT 1; + SELECT `COLUMN_NAME` + INTO PRIMARY_KEY_COLUMN_NAME + FROM `information_schema`.`COLUMNS` + WHERE `TABLE_SCHEMA` = (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())) + AND `TABLE_NAME` = TABLE_NAME_ARGUMENT + AND `COLUMN_KEY` = 'PRI' + LIMIT 1; + SET SQL_EXP = CONCAT('ALTER TABLE `', (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())), '`.`', TABLE_NAME_ARGUMENT, '` MODIFY COLUMN `', PRIMARY_KEY_COLUMN_NAME, '` ', PRIMARY_KEY_TYPE, ' NOT NULL;'); + SET @SQL_EXP = SQL_EXP; + PREPARE SQL_EXP_EXECUTE FROM @SQL_EXP; + EXECUTE SQL_EXP_EXECUTE; + DEALLOCATE PREPARE SQL_EXP_EXECUTE; + END IF; +END // +DELIMITER ; + +DROP PROCEDURE IF EXISTS `POMELO_AFTER_ADD_PRIMARY_KEY`; +DELIMITER // +CREATE PROCEDURE `POMELO_AFTER_ADD_PRIMARY_KEY`(IN `SCHEMA_NAME_ARGUMENT` VARCHAR(255), IN `TABLE_NAME_ARGUMENT` VARCHAR(255), IN `COLUMN_NAME_ARGUMENT` VARCHAR(255)) +BEGIN + DECLARE HAS_AUTO_INCREMENT_ID INT(11); + DECLARE PRIMARY_KEY_COLUMN_NAME VARCHAR(255); + DECLARE PRIMARY_KEY_TYPE VARCHAR(255); + DECLARE SQL_EXP VARCHAR(1000); + SELECT COUNT(*) + INTO HAS_AUTO_INCREMENT_ID + FROM `information_schema`.`COLUMNS` + WHERE `TABLE_SCHEMA` = (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())) + AND `TABLE_NAME` = TABLE_NAME_ARGUMENT + AND `COLUMN_NAME` = COLUMN_NAME_ARGUMENT + AND `COLUMN_TYPE` LIKE '%int%' + AND `COLUMN_KEY` = 'PRI'; + IF HAS_AUTO_INCREMENT_ID THEN + SELECT `COLUMN_TYPE` + INTO PRIMARY_KEY_TYPE + FROM `information_schema`.`COLUMNS` + WHERE `TABLE_SCHEMA` = (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())) + AND `TABLE_NAME` = TABLE_NAME_ARGUMENT + AND `COLUMN_NAME` = COLUMN_NAME_ARGUMENT + AND `COLUMN_TYPE` LIKE '%int%' + AND `COLUMN_KEY` = 'PRI'; + SELECT `COLUMN_NAME` + INTO PRIMARY_KEY_COLUMN_NAME + FROM `information_schema`.`COLUMNS` + WHERE `TABLE_SCHEMA` = (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())) + AND `TABLE_NAME` = TABLE_NAME_ARGUMENT + AND `COLUMN_NAME` = COLUMN_NAME_ARGUMENT + AND `COLUMN_TYPE` LIKE '%int%' + AND `COLUMN_KEY` = 'PRI'; + SET SQL_EXP = CONCAT('ALTER TABLE `', (SELECT IFNULL(SCHEMA_NAME_ARGUMENT, SCHEMA())), '`.`', TABLE_NAME_ARGUMENT, '` MODIFY COLUMN `', PRIMARY_KEY_COLUMN_NAME, '` ', PRIMARY_KEY_TYPE, ' NOT NULL AUTO_INCREMENT;'); + SET @SQL_EXP = SQL_EXP; + PREPARE SQL_EXP_EXECUTE FROM @SQL_EXP; + EXECUTE SQL_EXP_EXECUTE; + DEALLOCATE PREPARE SQL_EXP_EXECUTE; + END IF; +END // +DELIMITER ; + +ALTER TABLE `IdentityServerApiClaims` DROP FOREIGN KEY `FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~`; +-- CALL PROC_DROP_FOREIGN_KEY('IdentityServerApiClaims', 'FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~'); + +ALTER TABLE `IdentityServerApiScopes` DROP FOREIGN KEY `FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~`; +-- CALL PROC_DROP_FOREIGN_KEY('IdentityServerApiScopes', 'FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~'); + +DROP TABLE IF EXISTS `IdentityServerApiSecrets`; + +DROP TABLE IF EXISTS `IdentityServerIdentityClaims`; + +CALL PROC_DROP_INDEX('IdentityServerDeviceFlowCodes', 'IX_IdentityServerDeviceFlowCodes_UserCode'); + +ALTER TABLE `IdentityServerClientProperties` DROP FOREIGN KEY `FK_IdentityServerClientProperties_IdentityServerClients_ClientId`; +-- CALL PROC_DROP_FOREIGN_KEY('IdentityServerClientProperties', 'FK_IdentityServerClientProperties_IdentityServerClients_ClientId'); + +CALL POMELO_BEFORE_DROP_PRIMARY_KEY(NULL, 'IdentityServerClientProperties'); +ALTER TABLE `IdentityServerClientProperties` DROP PRIMARY KEY; + +ALTER TABLE `IdentityServerClientProperties` ADD CONSTRAINT `FK_IdentityServerClientProperties_IdentityServerClients_ClientId` FOREIGN KEY (`ClientId`) REFERENCES `IdentityServerClients` (`Id`) ON DELETE CASCADE; + + +CALL PROC_DROP_COLUMN('IdentityServerIdentityResources', 'Properties'); + +CALL PROC_DROP_COLUMN('IdentityServerApiResources', 'Properties'); + +ALTER TABLE `IdentityServerApiClaims` RENAME `IdentityServerApiResourceClaims`; + +ALTER TABLE `IdentityServerApiScopes` RENAME COLUMN `ApiResourceId` TO `Id`; + +ALTER TABLE `IdentityServerApiScopeClaims` RENAME COLUMN `ApiResourceId` TO `ApiScopeId`; + +-- 将要删除此表的所有数据,请注意 +TRUNCATE TABLE `IdentityServerApiScopeClaims`; +-- 删除列之前需要重建外键约束 +ALTER TABLE `IdentityServerApiScopeClaims` DROP FOREIGN KEY `FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~`; +ALTER TABLE `IdentityServerApiScopeClaims` ADD CONSTRAINT `FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~` FOREIGN KEY (`ApiScopeId`) REFERENCES `IdentityServerApiScopes` (`Id`) ON DELETE CASCADE; +CALL PROC_DROP_COLUMN('IdentityServerApiScopeClaims', 'Name'); + +ALTER TABLE `IdentityServerPersistedGrants` ADD `ConsumedTime` datetime(6) NULL; + +ALTER TABLE `IdentityServerPersistedGrants` ADD `Description` varchar(200) CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerPersistedGrants` ADD `SessionId` varchar(100) CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerDeviceFlowCodes` ADD `Description` varchar(200) CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerDeviceFlowCodes` ADD `SessionId` varchar(100) CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerClients` ADD `AllowedIdentityTokenSigningAlgorithms` varchar(100) CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerClients` ADD `RequireRequestObject` tinyint(1) NOT NULL DEFAULT FALSE; + +ALTER TABLE `IdentityServerClientProperties` MODIFY COLUMN `Value` varchar(300) CHARACTER SET utf8mb4 NOT NULL; + +ALTER TABLE `IdentityServerApiScopes` ADD `ConcurrencyStamp` varchar(40) CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerApiScopes` ADD `CreationTime` datetime(6) NOT NULL DEFAULT '0001-01-01 00:00:00'; + +ALTER TABLE `IdentityServerApiScopes` ADD `CreatorId` char(36) NULL; + +ALTER TABLE `IdentityServerApiScopes` ADD `DeleterId` char(36) NULL; + +ALTER TABLE `IdentityServerApiScopes` ADD `DeletionTime` datetime(6) NULL; + +ALTER TABLE `IdentityServerApiScopes` ADD `Enabled` tinyint(1) NOT NULL DEFAULT FALSE; + +ALTER TABLE `IdentityServerApiScopes` ADD `ExtraProperties` longtext CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerApiScopes` ADD `IsDeleted` tinyint(1) NOT NULL DEFAULT FALSE; + +ALTER TABLE `IdentityServerApiScopes` ADD `LastModificationTime` datetime(6) NULL; + +ALTER TABLE `IdentityServerApiScopes` ADD `LastModifierId` char(36) NULL; + +ALTER TABLE `IdentityServerApiResources` ADD `AllowedAccessTokenSigningAlgorithms` varchar(100) CHARACTER SET utf8mb4 NULL; + +ALTER TABLE `IdentityServerApiResources` ADD `ShowInDiscoveryDocument` tinyint(1) NOT NULL DEFAULT FALSE; + +ALTER TABLE `IdentityServerClientProperties` ADD CONSTRAINT `PK_IdentityServerClientProperties` PRIMARY KEY (`ClientId`, `Key`, `Value`); + +CREATE TABLE `AbpLinkUsers` ( + `Id` char(36) NOT NULL, + `SourceUserId` char(36) NOT NULL, + `SourceTenantId` char(36) NULL, + `TargetUserId` char(36) NOT NULL, + `TargetTenantId` char(36) NULL, + CONSTRAINT `PK_AbpLinkUsers` PRIMARY KEY (`Id`) +); + +CREATE TABLE `IdentityServerApiResourceProperties` ( + `ApiResourceId` char(36) NOT NULL, + `Key` varchar(250) CHARACTER SET utf8mb4 NOT NULL, + `Value` varchar(300) CHARACTER SET utf8mb4 NOT NULL, + CONSTRAINT `PK_IdentityServerApiResourceProperties` PRIMARY KEY (`ApiResourceId`, `Key`, `Value`), + CONSTRAINT `FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~` FOREIGN KEY (`ApiResourceId`) REFERENCES `IdentityServerApiResources` (`Id`) ON DELETE CASCADE +); + +CREATE TABLE `IdentityServerApiResourceScopes` ( + `ApiResourceId` char(36) NOT NULL, + `Scope` varchar(200) CHARACTER SET utf8mb4 NOT NULL, + CONSTRAINT `PK_IdentityServerApiResourceScopes` PRIMARY KEY (`ApiResourceId`, `Scope`), + CONSTRAINT `FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~` FOREIGN KEY (`ApiResourceId`) REFERENCES `IdentityServerApiResources` (`Id`) ON DELETE CASCADE +); + +CREATE TABLE `IdentityServerApiResourceSecrets` ( + `Type` varchar(250) CHARACTER SET utf8mb4 NOT NULL, + `Value` varchar(300) CHARACTER SET utf8mb4 NOT NULL, + `ApiResourceId` char(36) NOT NULL, + `Description` varchar(1000) CHARACTER SET utf8mb4 NULL, + `Expiration` datetime(6) NULL, + CONSTRAINT `PK_IdentityServerApiResourceSecrets` PRIMARY KEY (`ApiResourceId`, `Type`, `Value`), + CONSTRAINT `FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~` FOREIGN KEY (`ApiResourceId`) REFERENCES `IdentityServerApiResources` (`Id`) ON DELETE CASCADE +); + +CREATE TABLE `IdentityServerApiScopeProperties` ( + `ApiScopeId` char(36) NOT NULL, + `Key` varchar(250) CHARACTER SET utf8mb4 NOT NULL, + `Value` varchar(300) CHARACTER SET utf8mb4 NOT NULL, + CONSTRAINT `PK_IdentityServerApiScopeProperties` PRIMARY KEY (`ApiScopeId`, `Key`, `Value`), + CONSTRAINT `FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~` FOREIGN KEY (`ApiScopeId`) REFERENCES `IdentityServerApiScopes` (`Id`) ON DELETE CASCADE +); + +CREATE TABLE `IdentityServerIdentityResourceClaims` ( + `Type` varchar(200) CHARACTER SET utf8mb4 NOT NULL, + `IdentityResourceId` char(36) NOT NULL, + CONSTRAINT `PK_IdentityServerIdentityResourceClaims` PRIMARY KEY (`IdentityResourceId`, `Type`), + CONSTRAINT `FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~` FOREIGN KEY (`IdentityResourceId`) REFERENCES `IdentityServerIdentityResources` (`Id`) ON DELETE CASCADE +); + +CREATE TABLE `IdentityServerIdentityResourceProperties` ( + `IdentityResourceId` char(36) NOT NULL, + `Key` varchar(250) CHARACTER SET utf8mb4 NOT NULL, + `Value` varchar(300) CHARACTER SET utf8mb4 NOT NULL, + CONSTRAINT `PK_IdentityServerIdentityResourceProperties` PRIMARY KEY (`IdentityResourceId`, `Key`, `Value`), + CONSTRAINT `FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~` FOREIGN KEY (`IdentityResourceId`) REFERENCES `IdentityServerIdentityResources` (`Id`) ON DELETE CASCADE +); + +CREATE INDEX `IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type` ON `IdentityServerPersistedGrants` (`SubjectId`, `SessionId`, `Type`); + +CREATE INDEX `IX_IdentityServerDeviceFlowCodes_UserCode` ON `IdentityServerDeviceFlowCodes` (`UserCode`); + +CREATE UNIQUE INDEX `IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Target~` ON `AbpLinkUsers` (`SourceUserId`, `SourceTenantId`, `TargetUserId`, `TargetTenantId`); + +ALTER TABLE `IdentityServerApiResourceClaims` ADD CONSTRAINT `FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~` FOREIGN KEY (`ApiResourceId`) REFERENCES `IdentityServerApiResources` (`Id`) ON DELETE CASCADE; + +ALTER TABLE `IdentityServerApiScopeClaims` ADD CONSTRAINT `FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~` FOREIGN KEY (`ApiScopeId`) REFERENCES `IdentityServerApiScopes` (`Id`) ON DELETE CASCADE; + +INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`) +VALUES ('20201222101851_Upgrade-Abp-4.0.0', '5.0.0'); + +DROP PROCEDURE `POMELO_BEFORE_DROP_PRIMARY_KEY`; + +DROP PROCEDURE `POMELO_AFTER_ADD_PRIMARY_KEY`; + +DROP PROCEDURE `PROC_DROP_FOREIGN_KEY`; + +DROP PROCEDURE `PROC_DROP_INDEX`; + +DROP PROCEDURE `PROC_DROP_COLUMN`; + +COMMIT; + diff --git a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs index b5e91a622..8cdc73240 100644 --- a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs +++ b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs @@ -179,7 +179,8 @@ namespace LINGYUN.Abp.BackendAdmin // 是否发送堆栈信息 options.SendStackTrace = true; // 未指定异常接收者的默认接收邮件 - options.DefaultReceiveEmail = "colin.in@foxmail.com"; + // 请指定自己的邮件地址 + // options.DefaultReceiveEmail = "colin.in@foxmail.com"; }); diff --git a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EntityFrameworkCore/BackendAdminHostMigrationsDbContextFactory.cs b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EntityFrameworkCore/BackendAdminHostMigrationsDbContextFactory.cs index 2f2a5ac31..9a443ec20 100644 --- a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EntityFrameworkCore/BackendAdminHostMigrationsDbContextFactory.cs +++ b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EntityFrameworkCore/BackendAdminHostMigrationsDbContextFactory.cs @@ -11,8 +11,10 @@ namespace LINGYUN.Abp.BackendAdmin.EntityFrameworkCore { var configuration = BuildConfiguration(); + var connectionString = configuration.GetConnectionString("Default"); + var builder = new DbContextOptionsBuilder() - .UseMySql(configuration.GetConnectionString("Default")); + .UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); return new BackendAdminHostMigrationsDbContext(builder.Options); } diff --git a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj index 5966ca733..a54a1e509 100644 --- a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj +++ b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 LINGYUN.Abp.BackendAdmin @@ -23,39 +23,39 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj index 6336bae4d..84a8512fd 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0 @@ -11,10 +11,10 @@ - - - - + + + + @@ -22,13 +22,13 @@ - - - - - - - + + + + + + + diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db index 56ad120b1..1d42f323c 100644 Binary files a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db and b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db differ diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs index 4a95c6bf6..7e11039d6 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs @@ -185,7 +185,8 @@ namespace LINGYUN.ApiGateway options.Maps.TryAdd("name", () => AbpClaimTypes.UserName); }); - context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + context.Services + .AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.Authority = configuration["AuthServer:Authority"]; @@ -226,6 +227,8 @@ namespace LINGYUN.ApiGateway // app.UseMultiTenancy(); // 本地化 app.UseAbpRequestLocalization(); + // 认证 + app.UseAuthorization(); // Swagger app.UseSwagger(); // Swagger可视化界面 diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/DataSeeder/ApiGatewayAdminDataSeedContributor.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/DataSeeder/ApiGatewayAdminDataSeedContributor.cs index b98cf98e7..eb4f14194 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/DataSeeder/ApiGatewayAdminDataSeedContributor.cs +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/DataSeeder/ApiGatewayAdminDataSeedContributor.cs @@ -1,5 +1,5 @@ using Microsoft.Extensions.Configuration; -using MySql.Data.MySqlClient; +using MySqlConnector; using System; using System.IO; using System.Threading.Tasks; diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/EntityFrameworkCore/HttpApiHostMigrationsDbContextFactory.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/EntityFrameworkCore/HttpApiHostMigrationsDbContextFactory.cs index 3bfbedea6..5a13a959f 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/EntityFrameworkCore/HttpApiHostMigrationsDbContextFactory.cs +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/EntityFrameworkCore/HttpApiHostMigrationsDbContextFactory.cs @@ -10,9 +10,10 @@ namespace LINGYUN.ApiGateway.EntityFrameworkCore public HttpApiHostMigrationsDbContext CreateDbContext(string[] args) { var configuration = BuildConfiguration(); + var connectionString = configuration.GetConnectionString("Default"); var builder = new DbContextOptionsBuilder() - .UseMySql(configuration.GetConnectionString("Default")); + .UseMySql(configuration.GetConnectionString("Default"), ServerVersion.AutoDetect(connectionString)); return new HttpApiHostMigrationsDbContext(builder.Options); } diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj index 100b5a8e5..54fb2e563 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0 @@ -11,29 +11,29 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + + - - - - - - - - - + + + + + + + + diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs index 7ef36ade5..1b549039a 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Security.Principal; @@ -36,7 +37,7 @@ namespace Volo.Abp.Authorization.Permissions } public virtual async Task IsGrantedAsync( - ClaimsPrincipal claimsPrincipal, + ClaimsPrincipal claimsPrincipal, string name) { Check.NotNull(name, nameof(name)); @@ -65,8 +66,7 @@ namespace Volo.Abp.Authorization.Permissions { continue; } - // ClaimTypes.Role; - // ClaimTypes.NameIdentifier; + var result = await provider.CheckAsync(context); if (result == PermissionGrantResult.Granted) @@ -81,5 +81,59 @@ namespace Volo.Abp.Authorization.Permissions return isGranted; } + + public async Task IsGrantedAsync(string[] names) + { + return await IsGrantedAsync(PrincipalAccessor.Principal, names); + } + + public async Task IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string[] names) + { + Check.NotNull(names, nameof(names)); + + var multiTenancySide = claimsPrincipal?.GetMultiTenancySide() ?? CurrentTenant.GetMultiTenancySide(); + + var result = new MultiplePermissionGrantResult(); + if (!names.Any()) + { + return result; + } + + var permissionDefinitions = new List(); + foreach (var name in names) + { + var permission = PermissionDefinitionManager.Get(name); + + result.Result.Add(name, PermissionGrantResult.Undefined); + + if (permission.IsEnabled && permission.MultiTenancySide.HasFlag(multiTenancySide)) + { + permissionDefinitions.Add(permission); + } + } + + foreach (var provider in PermissionValueProviderManager.ValueProviders) + { + var context = new PermissionValuesCheckContext( + permissionDefinitions.Where(x => !x.Providers.Any() || x.Providers.Contains(provider.Name)).ToList(), + claimsPrincipal); + + var multipleResult = await provider.CheckAsync(context); + foreach (var grantResult in multipleResult.Result.Where(grantResult => + result.Result.ContainsKey(grantResult.Key) && + result.Result[grantResult.Key] == PermissionGrantResult.Undefined && + grantResult.Value != PermissionGrantResult.Undefined)) + { + result.Result[grantResult.Key] = grantResult.Value; + permissionDefinitions.RemoveAll(x => x.Name == grantResult.Key); + } + + if (result.AllGranted || result.AllProhibited) + { + break; + } + } + return result; + } } } \ No newline at end of file diff --git a/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/LINGYUN.Abp.IdentityServer4.HttpApi.Host.csproj b/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/LINGYUN.Abp.IdentityServer4.HttpApi.Host.csproj index 7b13bf676..0405907d3 100644 --- a/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/LINGYUN.Abp.IdentityServer4.HttpApi.Host.csproj +++ b/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/LINGYUN.Abp.IdentityServer4.HttpApi.Host.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0 LINGYUN.Abp.IdentityServer4 @@ -21,34 +21,34 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContextFactory.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContextFactory.cs index dc0072ba9..6b214bc3b 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContextFactory.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContextFactory.cs @@ -10,9 +10,10 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore public MessageServiceHostMigrationsDbContext CreateDbContext(string[] args) { var configuration = BuildConfiguration(); + var connectionString = configuration.GetConnectionString("Default"); var builder = new DbContextOptionsBuilder() - .UseMySql(configuration.GetConnectionString("Default")); + .UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); return new MessageServiceHostMigrationsDbContext(builder.Options); } diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj index 6fad74a61..20f9b86e7 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0 LINGYUN.Abp.MessageService @@ -16,29 +16,29 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - - - - - - + + + + + + + + + diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs index 658dddbef..263f7b990 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs @@ -163,7 +163,8 @@ namespace LINGYUN.Platform // 是否发送堆栈信息 options.SendStackTrace = true; // 未指定异常接收者的默认接收邮件 - options.DefaultReceiveEmail = "colin.in@foxmail.com"; + // 指定自己的邮件地址 + // options.DefaultReceiveEmail = "colin.in@foxmail.com"; }); Configure(options => diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs index 9dd641cfd..4e5d2f1f5 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs @@ -10,9 +10,10 @@ namespace LINGYUN.Platform.EntityFrameworkCore public PlatformHttpApiHostMigrationsDbContext CreateDbContext(string[] args) { var configuration = BuildConfiguration(); + var connectionString = configuration.GetConnectionString("Default"); var builder = new DbContextOptionsBuilder() - .UseMySql(configuration.GetConnectionString("Default")); + .UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); return new PlatformHttpApiHostMigrationsDbContext(builder.Options); } diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj index b67f3cc3e..9063ae65e 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0 LINGYUN.Platform @@ -20,34 +20,34 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/aspnet-core/tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj b/aspnet-core/tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj index acf12d3c1..5c7c5f750 100644 --- a/aspnet-core/tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj +++ b/aspnet-core/tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 false diff --git a/aspnet-core/tests/LINGYUN.Abp.EntityFrameworkCore.Tests/LINGYUN.Abp.EntityFrameworkCore.Tests.csproj b/aspnet-core/tests/LINGYUN.Abp.EntityFrameworkCore.Tests/LINGYUN.Abp.EntityFrameworkCore.Tests.csproj index fccfeaac3..156ba738a 100644 --- a/aspnet-core/tests/LINGYUN.Abp.EntityFrameworkCore.Tests/LINGYUN.Abp.EntityFrameworkCore.Tests.csproj +++ b/aspnet-core/tests/LINGYUN.Abp.EntityFrameworkCore.Tests/LINGYUN.Abp.EntityFrameworkCore.Tests.csproj @@ -1,13 +1,13 @@ - netcoreapp3.1 + net5.0 - - + + diff --git a/aspnet-core/tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests.csproj b/aspnet-core/tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests.csproj index a8e41193f..ee71bc46e 100644 --- a/aspnet-core/tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests.csproj +++ b/aspnet-core/tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 false diff --git a/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests.csproj b/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests.csproj index 69d35b514..c25fe9185 100644 --- a/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests.csproj +++ b/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 false diff --git a/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Tests/LINGYUN.Abp.Features.LimitValidation.Tests.csproj b/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Tests/LINGYUN.Abp.Features.LimitValidation.Tests.csproj index bce9ca44e..3b0dad961 100644 --- a/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Tests/LINGYUN.Abp.Features.LimitValidation.Tests.csproj +++ b/aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Tests/LINGYUN.Abp.Features.LimitValidation.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 false diff --git a/aspnet-core/tests/LINGYUN.Abp.TestBase/LINGYUN.Abp.TestsBase.csproj b/aspnet-core/tests/LINGYUN.Abp.TestBase/LINGYUN.Abp.TestsBase.csproj index 365fe369b..dd39039b8 100644 --- a/aspnet-core/tests/LINGYUN.Abp.TestBase/LINGYUN.Abp.TestsBase.csproj +++ b/aspnet-core/tests/LINGYUN.Abp.TestBase/LINGYUN.Abp.TestsBase.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 false @@ -13,10 +13,10 @@ - - - - + + + + diff --git a/vueJs/debug.log b/vueJs/debug.log index 9fd001a32..b2f7937ce 100644 --- a/vueJs/debug.log +++ b/vueJs/debug.log @@ -4,3 +4,5 @@ [1219/155359.779:ERROR:directory_reader_win.cc(43)] FindFirstFile: ϵͳҲָ· (0x3) [1220/155401.094:ERROR:directory_reader_win.cc(43)] FindFirstFile: ϵͳҲָ· (0x3) [1221/155401.113:ERROR:directory_reader_win.cc(43)] FindFirstFile: ϵͳҲָ· (0x3) +[1222/155401.133:ERROR:directory_reader_win.cc(43)] FindFirstFile: ϵͳҲָ· (0x3) +[1223/145638.708:ERROR:filesystem_win.cc(148)] DeleteFile C:\Users\iVarKey\AppData\Local\Google\Chrome\User Data\Crashpad\reports\0106539b-a680-4c00-8e38-5a7a621345b9.dmp: һʹôļ޷ʡ (0x20) diff --git a/vueJs/src/api/api-resources.ts b/vueJs/src/api/api-resources.ts index 4a5e3966f..9556b86f8 100644 --- a/vueJs/src/api/api-resources.ts +++ b/vueJs/src/api/api-resources.ts @@ -1,5 +1,6 @@ import ApiService from './serviceBase' -import { FullAuditedEntityDto, PagedAndSortedResultRequestDto, PagedResultDto, SecretBase } from './types' +import { Secret, Scope, UserClaim, Property } from './identity-server4' +import { AuditedEntityDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types' const sourceUrl = '/api/identity-server/api-resources' const serviceUrl = process.env.VUE_APP_BASE_API @@ -9,7 +10,7 @@ export default class ApiResourceService { * 获取Api资源 * @param id Api资源标识 */ - public static getApiResourceById(id: string) { + public static get(id: string) { const _url = sourceUrl + '/' + id return ApiService.Get(_url, serviceUrl) } @@ -18,7 +19,7 @@ export default class ApiResourceService { * 获取Api资源列表 * @param payload 查询参数 */ - public static getApiResources(payload: ApiResourceGetByPaged) { + public static getList(payload: ApiResourceGetByPaged) { let _url = sourceUrl + '?filter=' + payload.filter _url += '&sorting=' + payload.sorting _url += '&skipCount=' + payload.skipCount @@ -30,7 +31,7 @@ export default class ApiResourceService { * 创建Api资源 * @param payload api资源参数 */ - public static createApiResource(payload: ApiResourceCreate) { + public static create(payload: ApiResourceCreate) { return ApiService.Post(sourceUrl, payload, serviceUrl) } @@ -38,7 +39,7 @@ export default class ApiResourceService { * 变更Api资源 * @param payload api资源参数 */ - public static updateApiResource(id: string, payload: ApiResourceUpdate) { + public static update(id: string, payload: ApiResourceUpdate) { const _url = sourceUrl + '/' + id return ApiService.Put(_url, payload, serviceUrl) } @@ -47,7 +48,7 @@ export default class ApiResourceService { * 删除Api资源 * @param id Api资源标识 */ - public static deleteApiResource(id: string) { + public static delete(id: string) { const _url = sourceUrl + '/' + id return ApiService.Delete(_url, serviceUrl) } @@ -58,30 +59,44 @@ export enum HashType { Sha512 } -export class ApiScope { - name = '' - displayName?: string = '' - description?: string = '' - required = false - emphasize = false - showInDiscoveryDocument = true - userClaims = new Array() +export class ApiResourceSecret extends Secret {} + +export class ApiResourceSecretCreateOrUpdate extends Secret { + hashType = HashType.Sha256 } -export class ApiSecret extends SecretBase {} +export class ApiResourceScope extends Scope {} -export class ApiSecretCreateOrUpdate extends SecretBase { - hashType = HashType.Sha256 +export class ApiResourceClaim extends UserClaim {} + +export class ApiResourceProperty extends Property {} + +export class ApiResource extends AuditedEntityDto { + id!: string + name!: string + displayName?: string + description?: string + enabled!: boolean + userClaims = new Array() + scopes = new Array() + secrets = new Array() + properties = new Array() + /** 允许访问令牌签名算法 */ + allowedAccessTokenSigningAlgorithms?: string + /** 在发现文档中显示 */ + showInDiscoveryDocument!: boolean } export class ApiResourceCreateOrUpdate { + enabled = true displayName?: string = '' description?: string = '' - enabled = true - userClaims = new Array() - scopes = new Array() - secrets = new Array() - properties: {[key: string]: string} = {} + showInDiscoveryDocument = false + allowedAccessTokenSigningAlgorithms?: string = '' + userClaims = new Array() + scopes = new Array() + secrets = new Array() + properties = new Array() } export class ApiResourceCreate extends ApiResourceCreateOrUpdate { @@ -90,18 +105,6 @@ export class ApiResourceCreate extends ApiResourceCreateOrUpdate { export class ApiResourceUpdate extends ApiResourceCreateOrUpdate {} -export class ApiResource extends FullAuditedEntityDto { - id!: string - name!: string - displayName?: string - description?: string - enabled!: boolean - userClaims = new Array() - scopes = new Array() - secrets = new Array() - properties: {[key: string]: string} = {} -} - export class ApiResourceGetByPaged extends PagedAndSortedResultRequestDto { filter = '' } diff --git a/vueJs/src/api/api-scopes.ts b/vueJs/src/api/api-scopes.ts new file mode 100644 index 000000000..a07a777ca --- /dev/null +++ b/vueJs/src/api/api-scopes.ts @@ -0,0 +1,92 @@ +import ApiService from './serviceBase' +import { UserClaim, Property } from './identity-server4' +import { ExtensibleAuditedEntity, PagedAndSortedResultRequestDto, PagedResultDto } from './types' + +const sourceUrl = '/api/identity-server/api-scopes' +const serviceUrl = process.env.VUE_APP_BASE_API + +export default class ApiScopeService { + /** + * 获取Api范围 + * @param id Api资源标识 + */ + public static get(id: string) { + const _url = sourceUrl + '/' + id + return ApiService.Get(_url, serviceUrl) + } + + /** + * 获取Api范围列表 + * @param payload 查询参数 + */ + public static getPagedList(payload: ApiScopeGetByPaged) { + let _url = sourceUrl + '?filter=' + payload.filter + _url += '&sorting=' + payload.sorting + _url += '&skipCount=' + payload.skipCount + _url += '&maxResultCount=' + payload.maxResultCount + return ApiService.Get>(_url, serviceUrl) + } + + /** + * 创建Api范围 + * @param payload + */ + public static create(payload: ApiScopeCreate) { + return ApiService.Post(sourceUrl, payload, serviceUrl) + } + + /** + * 变更Api范围 + * @param payload + */ + public static update(id: string, payload: ApiScopeUpdate) { + const _url = sourceUrl + '/' + id + return ApiService.Put(_url, payload, serviceUrl) + } + + /** + * 删除Api范围 + * @param id + */ + public static delete(id: string) { + const _url = sourceUrl + '/' + id + return ApiService.Delete(_url, serviceUrl) + } +} + +export class ApiScopeClaim extends UserClaim {} + +export class ApiScopeProperty extends Property {} + +export class ApiScope extends ExtensibleAuditedEntity { + name!: string + displayName?: string + description?: string + enabled!: boolean + required!: boolean + emphasize!: boolean + showInDiscoveryDocument!: boolean + userClaims = new Array() + properties = new Array() +} + +export class ApiScopeCreateOrUpdate { + enabled = true + displayName?: string = '' + description?: string = '' + required = false + emphasize = false + showInDiscoveryDocument = true + userClaims = new Array() + properties = new Array() +} + +export class ApiScopeUpdate extends ApiScopeCreateOrUpdate {} + +export class ApiScopeCreate extends ApiScopeCreateOrUpdate { + name = '' +} + +export class ApiScopeGetByPaged extends PagedAndSortedResultRequestDto { + filter = '' +} diff --git a/vueJs/src/api/clients.ts b/vueJs/src/api/clients.ts index f867b9d37..984a088dd 100644 --- a/vueJs/src/api/clients.ts +++ b/vueJs/src/api/clients.ts @@ -1,16 +1,17 @@ import ApiService from './serviceBase' +import { Secret, Scope, Property } from './identity-server4' import { FullAuditedEntityDto, PagedAndSortedResultRequestDto, ListResultDto, PagedResultDto, SecretBase, Claim, HashType } from './types' const sourceUrl = '/api/identity-server/clients' const serviceUrl = process.env.VUE_APP_BASE_API export default class ClientService { - public static getClientById(id: string) { + public static get(id: string) { const _url = sourceUrl + '/' + id return ApiService.Get(_url, serviceUrl) } - public static getClients(payload: ClientGetByPaged) { + public static getList(payload: ClientGetByPaged) { let _url = sourceUrl + '?filter=' + payload.filter _url += '&sorting=' + payload.sorting _url += '&skipCount=' + payload.skipCount @@ -18,21 +19,21 @@ export default class ClientService { return ApiService.Get>(_url, serviceUrl) } - public static createClient(payload: ClientCreate) { + public static create(payload: ClientCreate) { return ApiService.Post(sourceUrl, payload, serviceUrl) } - public static cloneClient(id: string, payload: ClientClone) { + public static clone(id: string, payload: ClientClone) { const _url = sourceUrl + '/' + id + '/clone' return ApiService.Post(_url, payload, serviceUrl) } - public static updateClient(id: string, payload: ClientUpdate) { + public static update(id: string, payload: ClientUpdate) { const _url = sourceUrl + '/' + id return ApiService.Put(_url, payload, serviceUrl) } - public static deleteClient(id: string) { + public static delete(id: string) { const _url = sourceUrl + '/' + id return ApiService.Delete(_url, serviceUrl) } @@ -61,9 +62,33 @@ export class ClientGetByPaged extends PagedAndSortedResultRequestDto { filter = '' } +export class ClientProperty extends Property {} + export class ClientClaim extends Claim {} -export class ClientSecret extends SecretCreateOrUpdate {} +export class ClientIdPRestriction { + provider = '' +} + +export class ClientPostLogoutRedirectUri { + postLogoutRedirectUri = '' +} + +export class ClientRedirectUri { + redirectUri = '' +} + +export class ClientCorsOrigin { + origin = '' +} + +export class ClientGrantType { + grantType = '' +} + +export class ClientSecret extends Secret {} + +export class ClientScope extends Scope {} export class ClientClone { sourceClientId = '' @@ -95,11 +120,13 @@ export class Client extends FullAuditedEntityDto { logoUri?: string enabled!: boolean protocolType!: string + allowedIdentityTokenSigningAlgorithms?: string requireClientSecret!: boolean requireConsent!: boolean allowRememberConsent!: boolean alwaysIncludeUserClaimsInIdToken!: boolean requirePkce!: boolean + requireRequestObject!: boolean allowPlainTextPkce!: boolean allowAccessTokensViaBrowser!: boolean frontChannelLogoutUri?: string @@ -125,22 +152,22 @@ export class Client extends FullAuditedEntityDto { userSsoLifetime!: number userCodeType?: string deviceCodeLifetime!: number - allowedScopes = new Array() + allowedScopes = new Array() clientSecrets = new Array() - allowedGrantTypes = new Array() - allowedCorsOrigins = new Array() - redirectUris = new Array() - postLogoutRedirectUris = new Array() - identityProviderRestrictions = new Array() + allowedGrantTypes = new Array() + allowedCorsOrigins = new Array() + redirectUris = new Array() + postLogoutRedirectUris = new Array() + identityProviderRestrictions = new Array() claims = new Array() - properties: {[key: string]: string} = {} + properties = new Array() } export class ClientCreateOrUpdate { clientId = '' clientName = '' description?: string = '' - allowedGrantTypes = new Array() + allowedGrantTypes = new Array() } export class ClientCreate extends ClientCreateOrUpdate {} @@ -150,11 +177,13 @@ export class ClientUpdate extends ClientCreateOrUpdate { logoUri? = '' enabled = true protocolType = 'oidc' + requireRequestObject = false + allowedIdentityTokenSigningAlgorithms = '' requireClientSecret = true - requireConsent = true + requireConsent = false allowRememberConsent = true alwaysIncludeUserClaimsInIdToken = false - requirePkce = false + requirePkce = true allowPlainTextPkce = false allowAccessTokensViaBrowser = false frontChannelLogoutUri? = '' @@ -180,14 +209,14 @@ export class ClientUpdate extends ClientCreateOrUpdate { userSsoLifetime!: number userCodeType? = '' deviceCodeLifetime = 300 - allowedScopes = new Array() - allowedCorsOrigins = new Array() - redirectUris = new Array() - postLogoutRedirectUris = new Array() - identityProviderRestrictions = new Array() - properties: {[key: string]: string} = {} - secrets = new Array() + allowedScopes = new Array() + clientSecrets = new Array() + allowedCorsOrigins = new Array() + redirectUris = new Array() + postLogoutRedirectUris = new Array() + identityProviderRestrictions = new Array() claims = new Array() + properties = new Array() public updateByClient(client: Client) { this.clientUri = client.clientUri diff --git a/vueJs/src/api/data-dictionary.ts b/vueJs/src/api/data-dictionary.ts index 45134ce7f..808272af4 100644 --- a/vueJs/src/api/data-dictionary.ts +++ b/vueJs/src/api/data-dictionary.ts @@ -24,12 +24,12 @@ export default class DataDictionaryService { } public static create(payload: DataCreate) { - return ApiService.Post(sourceUrl, payload, serviceUrl) + return ApiService.Post(sourceUrl, payload, serviceUrl) } public static update(id: string, payload: DataUpdate) { const _url = sourceUrl + '/' + id - return ApiService.Put(_url, payload, serviceUrl) + return ApiService.Put(_url, payload, serviceUrl) } public static delete(id: string) { @@ -39,17 +39,17 @@ export default class DataDictionaryService { public static appendItem(id: string, payload: DataItemCreate) { const _url = sourceUrl + '/' + id + '/items' - return ApiService.Post(_url, payload, serviceUrl) + return ApiService.Post(_url, payload, serviceUrl) } public static updateItem(id: string, name: string, payload: DataItemUpdate) { const _url = sourceUrl + '/' + id + '/items/' + name - return ApiService.Put(_url, payload, serviceUrl) + return ApiService.Put(_url, payload, serviceUrl) } public static removeItem(id: string, name: string) { const _url = sourceUrl + '/' + id + '/items/' + name - return ApiService.Delete(_url, serviceUrl) + return ApiService.Delete(_url, serviceUrl) } } diff --git a/vueJs/src/api/identity-resources.ts b/vueJs/src/api/identity-resources.ts index 3928d82c2..8b05a643e 100644 --- a/vueJs/src/api/identity-resources.ts +++ b/vueJs/src/api/identity-resources.ts @@ -1,5 +1,6 @@ import ApiService from './serviceBase' -import { FullAuditedEntityDto, PagedResultDto, PagedAndSortedResultRequestDto } from './types' +import { Property, UserClaim } from './identity-server4' +import { ExtensibleAuditedEntity, PagedResultDto, PagedAndSortedResultRequestDto } from './types' const sourceUrl = '/api/identity-server/identity-resources' /** 远程服务地址 */ @@ -12,7 +13,7 @@ export default class IdentityResourceService { * @param id 身份资源标识 * @returns 返回类型为 IdentityResource 的对象 */ - public static getIdentityResourceById(id: string) { + public static get(id: string) { const _url = sourceUrl + '/' + id return ApiService.Get(_url, serviceUrl) } @@ -22,7 +23,7 @@ export default class IdentityResourceService { * @param payload 分页查询过滤对象 * @returns 返回类型为 IdentityResource 的对象列表 */ - public static getIdentityResources(payload: IdentityResourceGetByPaged) { + public static getList(payload: IdentityResourceGetByPaged) { let _url = sourceUrl + '?filter=' + payload.filter _url += '&sorting=' + payload.sorting _url += '&skipCount=' + payload.skipCount @@ -35,7 +36,7 @@ export default class IdentityResourceService { * @param payload 类型为 IdentityResourceCreate 的对象 * @returns 返回类型为 IdentityResource 的对象 */ - public static createIdentityResource(payload: IdentityResourceCreateOrUpdate) { + public static create(payload: IdentityResourceCreateOrUpdate) { return ApiService.Post(sourceUrl, payload, serviceUrl) } @@ -44,7 +45,7 @@ export default class IdentityResourceService { * @param payload 类型为 IdentityResourceUpdate 的对象 * @returns 返回类型为 IdentityResource 的对象 */ - public static updateIdentityResource(id: string, payload: IdentityResourceCreateOrUpdate) { + public static update(id: string, payload: IdentityResourceCreateOrUpdate) { const _url = sourceUrl + '/' + id return ApiService.Put(_url, payload, serviceUrl) } @@ -53,14 +54,17 @@ export default class IdentityResourceService { * 删除身份资源 * @param id 身份资源标识 */ - public static deleteIdentityResource(id: string) { + public static delete(id: string) { const _url = sourceUrl + '/' + id return ApiService.Delete(_url, serviceUrl) } } -export class IdentityResource extends FullAuditedEntityDto { - id!: string +export class IdentityUserClaim extends UserClaim {} + +export class IdentityResourceProperty extends Property {} + +export class IdentityResource extends ExtensibleAuditedEntity { name = '' displayName?: string = '' description?: string = '' @@ -68,8 +72,8 @@ export class IdentityResource extends FullAuditedEntityDto { required = false emphasize = false showInDiscoveryDocument = true - userClaims = new Array() - properties: {[key: string]: string} = {} + userClaims = new Array() + properties = new Array() } export class IdentityResourceGetByPaged extends PagedAndSortedResultRequestDto { @@ -84,6 +88,6 @@ export class IdentityResourceCreateOrUpdate { required = false emphasize = false showInDiscoveryDocument = true - userClaims = new Array() - properties: {[key: string]: string} = {} + userClaims = new Array() + properties = new Array() } diff --git a/vueJs/src/api/identity-server4.ts b/vueJs/src/api/identity-server4.ts index c3b15daea..023ef5625 100644 --- a/vueJs/src/api/identity-server4.ts +++ b/vueJs/src/api/identity-server4.ts @@ -34,3 +34,29 @@ export class OpenIdConfiguration { code_challenge_methods_supported = new Array() request_parameter_supported!: boolean } + +export class Secret { + type!: string + value!: string + description?: string + expiration?: Date +} + +export class Scope { + scope!: string +} + +export class Property { + key!: string + value!: string +} + +export class UserClaim { + type!: string + + constructor( + type: string + ) { + this.type = type + } +} diff --git a/vueJs/src/api/layout.ts b/vueJs/src/api/layout.ts index af8cc757a..a4031bf45 100644 --- a/vueJs/src/api/layout.ts +++ b/vueJs/src/api/layout.ts @@ -24,12 +24,12 @@ export default class LayoutService { } public static create(payload: LayoutCreate) { - return ApiService.Post(sourceUrl, payload, serviceUrl) + return ApiService.Post(sourceUrl, payload, serviceUrl) } public static update(id: string, payload: LayoutUpdate) { const _url = sourceUrl + '/' + id - return ApiService.Put(_url, payload, serviceUrl) + return ApiService.Put(_url, payload, serviceUrl) } public static delete(id: string) { @@ -98,7 +98,7 @@ export class LayoutCreate extends LayoutCreateOrUpdate { dataId!: string } -export class LayoutUpdate extends LayoutCreateOrUpdate { +export class LayoutUpdate extends LayoutCreateOrUpdate { } diff --git a/vueJs/src/api/menu.ts b/vueJs/src/api/menu.ts index 3ef8ecb01..765781c1e 100644 --- a/vueJs/src/api/menu.ts +++ b/vueJs/src/api/menu.ts @@ -40,12 +40,12 @@ export default class MenuService { } public static create(payload: MenuCreate) { - return ApiService.Post(sourceUrl, payload, serviceUrl) + return ApiService.Post(sourceUrl, payload, serviceUrl) } public static update(id: string, payload: MenuUpdate) { const _url = sourceUrl + '/' + id - return ApiService.Put(_url, payload, serviceUrl) + return ApiService.Put(_url, payload, serviceUrl) } public static delete(id: string) { @@ -55,12 +55,12 @@ export default class MenuService { public static setRoleMenu(payload: RoleMenu) { const _url = sourceUrl + '/by-role' - return ApiService.Put(_url, payload,serviceUrl) + return ApiService.Put(_url, payload, serviceUrl) } public static setUserMenu(payload: UserMenu) { const _url = sourceUrl + '/by-user' - return ApiService.Put(_url, payload,serviceUrl) + return ApiService.Put(_url, payload, serviceUrl) } } @@ -81,7 +81,7 @@ export class MenuCreate extends MenuCreateOrUpdate { parentId?: string } -export class MenuUpdate extends MenuCreateOrUpdate { +export class MenuUpdate extends MenuCreateOrUpdate { } diff --git a/vueJs/src/api/types.ts b/vueJs/src/api/types.ts index a1e873cd4..b97ced1ca 100644 --- a/vueJs/src/api/types.ts +++ b/vueJs/src/api/types.ts @@ -146,6 +146,16 @@ export class ExtensibleEntity extends ExtensibleObject { id!: TKey } +export class ExtensibleCreationAuditedEntity extends ExtensibleEntity { + creationTime!: Date + creatorId?: string +} + +export class ExtensibleAuditedEntity extends ExtensibleCreationAuditedEntity { + lastModificationTime?: Date + lastModifierId?: string +} + export interface IHasExtraProperties { extraProperties: {[key: string]: any} } diff --git a/vueJs/src/permission.ts b/vueJs/src/permission.ts index 87f17e146..44077d6bb 100644 --- a/vueJs/src/permission.ts +++ b/vueJs/src/permission.ts @@ -73,7 +73,7 @@ router.afterEach((to: Route) => { NProgress.done() // set page title - //document.title = getPageTitle(to.meta.title) + // document.title = getPageTitle(to.meta.title) if (to.meta.displayName) { document.title = to.meta.displayName } else { diff --git a/vueJs/src/store/modules/permission.ts b/vueJs/src/store/modules/permission.ts index 6b16518a1..71c05abf3 100644 --- a/vueJs/src/store/modules/permission.ts +++ b/vueJs/src/store/modules/permission.ts @@ -1,6 +1,6 @@ import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators' import { RouteConfig } from 'vue-router' -//eslint-disable-next-line +// eslint-disable-next-line import { asyncRoutes, constantRoutes } from '@/router' import store from '@/store' import { AbpModule } from '@/store/modules/abp' @@ -8,6 +8,14 @@ import MenuService, { Menu } from '@/api/menu' import { PlatformType } from '@/api/layout' import { generateTree } from '@/utils' +const mapMetaBoolean = (key: string, meta: any) => { + return typeof meta[key] === 'boolean' ? meta[key] : meta[key] === 'true' +} + +const mapMetaArray = (key: string, meta: any) => { + return Array.isArray(meta[key]) ? meta[key] : String(meta[key]).split(',') +} + const hasPermission = (roles: string[], route: RouteConfig) => { if (route.meta && route.meta.roles) { return roles.some(role => route.meta.roles.includes(role)) @@ -32,7 +40,7 @@ export const filterAsyncRoutes = (routes: RouteConfig[], roles: string[]) => { const filterDynamicRoutes = (menus: Menu[]) => { const res: RouteConfig[] = [] - + menus.forEach(menu => { const r: RouteConfig = { path: menu.path, @@ -40,14 +48,14 @@ const filterDynamicRoutes = (menus: Menu[]) => { redirect: menu.redirect, // meta自行转换 meta: { - activeMenu: menu.meta['activeMenu'], + activeMenu: menu.meta.activeMenu, affix: mapMetaBoolean('affix', menu.meta), // 需要转换为正确的bool类型 noCache: mapMetaBoolean('noCache', menu.meta), breadcrumb: mapMetaBoolean('breadcrumb', menu.meta), alwaysShow: mapMetaBoolean('alwaysShow', menu.meta), hidden: mapMetaBoolean('hidden', menu.meta), - icon: menu.meta['icon'], - title: menu.meta['title'], + icon: menu.meta.icon, + title: menu.meta.title, displayName: menu.displayName, roles: mapMetaArray('roles', menu.meta) // 需要转换为正确的array类型 } @@ -61,14 +69,6 @@ const filterDynamicRoutes = (menus: Menu[]) => { return res } -const mapMetaBoolean = (key: string, meta: any) => { - return typeof meta[key] === 'boolean' ? meta[key] : meta[key] === 'true' -} - -const mapMetaArray = (key: string, meta: any) => { - return Array.isArray(meta[key]) ? meta[key] : String(meta[key]).split(',') -} - export interface IPermissionState { routes: RouteConfig[] dynamicRoutes: RouteConfig[] diff --git a/vueJs/src/utils/index.ts b/vueJs/src/utils/index.ts index 0e9521efb..6ac8cfeef 100644 --- a/vueJs/src/utils/index.ts +++ b/vueJs/src/utils/index.ts @@ -1,4 +1,4 @@ -/** +/** * 递归生成树结构 * @param array 参与计算的对象数组 * @param id 当前层级的父节点标识 @@ -7,7 +7,7 @@ export function generateTree(array: any, id = null, parentIdKey = 'parentId') { return array .filter((item: any) => item[parentIdKey] === id) - .map((item: any) => ({...item, children: generateTree(array, item.id)})) + .map((item: any) => ({ ...item, children: generateTree(array, item.id) })) } export function urlStringify(payload: any) { diff --git a/vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceCreateOrEditForm.vue b/vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceCreateOrEditForm.vue index 46bca0f1e..114a8ce34 100644 --- a/vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceCreateOrEditForm.vue +++ b/vueJs/src/views/admin/identityServer/api-resources/components/ApiResourceCreateOrEditForm.vue @@ -13,12 +13,13 @@
+ + + + + + + + + - - - {{ $t('AbpIdentityServer.Scope') }} - - + {{ $t('AbpIdentityServer.Secret') }} - + {{ $t('AbpIdentityServer.Propertites') }} @@ -146,28 +160,30 @@ - - diff --git a/vueJs/src/views/admin/identityServer/api-resources/index.vue b/vueJs/src/views/admin/identityServer/api-resources/index.vue index dd29adb51..2e0fc8bf3 100644 --- a/vueJs/src/views/admin/identityServer/api-resources/index.vue +++ b/vueJs/src/views/admin/identityServer/api-resources/index.vue @@ -23,7 +23,7 @@ class="filter-item" type="primary" :disabled="!checkPermission(['AbpIdentityServer.ApiResources.Create'])" - @click="handleShowEditApiResourceForm('')" + @click="onShowEditForm('')" > {{ $t('AbpIdentityServer.Resource:New') }} @@ -76,42 +76,39 @@ {{ $t('AbpIdentityServer.Resource:Edit') }} @@ -132,7 +129,7 @@ :disabled="!checkPermission(['AbpIdentityServer.ApiResources.Delete'])" size="mini" type="danger" - @click="handleDeleteApiResource(row.id, row.name)" + @click="onDelete(row.id, row.name)" > {{ $t('AbpIdentityServer.Resource:Delete') }} @@ -150,10 +147,9 @@ />
@@ -193,12 +189,8 @@ import ApiResourceService, { ApiResourceGetByPaged } from '@/api/api-resources' } }) export default class extends mixins(DataListMiXin) { - private editApiResourceId ='' - private editApiResourceTitle = '' - - private showEditApiScopeDialog = false - private showEditApiSecretDialog = false - private showEditApiResourceDialog = false + private selectId ='' + private showEditDialog = false public dataFilter = new ApiResourceGetByPaged() @@ -211,46 +203,31 @@ export default class extends mixins(DataListMiXin) { } protected getPagedList(filter: any) { - return ApiResourceService.getApiResources(filter) - } - - private handleShowEditApiResourceForm(id: string, name: string) { - this.editApiResourceId = id - this.editApiResourceTitle = this.l('AbpIdentityServer.Resource:New') - this.showEditApiResourceDialog = true - if (name) { - this.editApiResourceTitle = this.l('AbpIdentityServer.Resource:Name', { 0: name }) - } - } - - private handleApiResourceEditFormClosed(changed: boolean) { - this.editApiResourceTitle = '' - this.showEditApiResourceDialog = false - if (changed) { - this.refreshPagedData() - } + return ApiResourceService.getList(filter) } - private handleApiSecretEditFormClosed() { - this.showEditApiSecretDialog = false + private onShowEditForm(id: string) { + this.selectId = id + this.showEditDialog = true } - private handleApiScopeEditFormClosed(changed: boolean) { - this.showEditApiScopeDialog = false + private onEditFormClosed(changed: boolean) { + this.showEditDialog = false if (changed) { this.refreshPagedData() } } - private handleDeleteApiResource(id: string) { + private onDelete(id: string) { this.$confirm(this.l('AbpIdentityServer.Resource:Delete'), this.l('AbpUi.AreYouSure'), { callback: (action) => { if (action === 'confirm') { - ApiResourceService.deleteApiResource(id).then(() => { - this.$message.success(this.l('global.successful')) - this.refreshPagedData() - }) + ApiResourceService + .delete(id).then(() => { + this.$message.success(this.l('global.successful')) + this.refreshPagedData() + }) } } }) diff --git a/vueJs/src/views/admin/identityServer/api-scopes/components/ApiScopeCreateOrEditForm.vue b/vueJs/src/views/admin/identityServer/api-scopes/components/ApiScopeCreateOrEditForm.vue new file mode 100644 index 000000000..9cafafec2 --- /dev/null +++ b/vueJs/src/views/admin/identityServer/api-scopes/components/ApiScopeCreateOrEditForm.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/vueJs/src/views/admin/identityServer/api-scopes/index.vue b/vueJs/src/views/admin/identityServer/api-scopes/index.vue new file mode 100644 index 000000000..852d9a0cc --- /dev/null +++ b/vueJs/src/views/admin/identityServer/api-scopes/index.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/vueJs/src/views/admin/identityServer/client/components/ClientClaimEditForm.vue b/vueJs/src/views/admin/identityServer/client/components/ClientClaimEditForm.vue index 2aaf67caf..23f96fd7f 100644 --- a/vueJs/src/views/admin/identityServer/client/components/ClientClaimEditForm.vue +++ b/vueJs/src/views/admin/identityServer/client/components/ClientClaimEditForm.vue @@ -1,5 +1,27 @@ + + diff --git a/vueJs/src/views/admin/identityServer/components/UserClaimEditForm.vue b/vueJs/src/views/admin/identityServer/components/UserClaimEditForm.vue new file mode 100644 index 000000000..2fc049a6b --- /dev/null +++ b/vueJs/src/views/admin/identityServer/components/UserClaimEditForm.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue b/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue index 9325a0f96..1df4088fc 100644 --- a/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue +++ b/vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue @@ -92,15 +92,8 @@ name="claims" :label="$t('AbpIdentityServer.UserClaim')" > - @@ -146,15 +137,17 @@ import { checkPermission } from '@/utils/permission' import { Form } from 'element-ui' import { Component, Prop, Vue, Watch } from 'vue-property-decorator' -import { Claim } from '@/api/types' -import ClaimTypeApiService from '@/api/cliam-type' - import PropertiesEditForm from '../../components/PropertiesEditForm.vue' -import IdentityResourceService, { IdentityResource, IdentityResourceCreateOrUpdate } from '@/api/identity-resources' +import UserClaimEditForm from '../../components/UserClaimEditForm.vue' +import IdentityResourceService, { + IdentityResource, + IdentityResourceCreateOrUpdate +} from '@/api/identity-resources' @Component({ name: 'IdentityResourceCreateOrEditForm', components: { + UserClaimEditForm, PropertiesEditForm }, methods: { @@ -163,97 +156,85 @@ import IdentityResourceService, { IdentityResource, IdentityResourceCreateOrUpda }) export default class extends Vue { @Prop({ default: false }) - private showDialog!: boolean - - @Prop({ default: '' }) - private title!: string + private showDialog!: ConstrainBoolean @Prop({ default: '' }) - private identityResourceId!: string + private id!: string private activeTable = 'basics' - private identityClaims = new Array() private identityResource = new IdentityResource() get isEdit() { - if (this.identityResource.id) { + if (this.id) { return true } return false } + get title() { + if (this.isEdit) { + return '编辑资源 - ' + this.identityResource.displayName || this.identityResource.name + } + return '新增资源' + } + @Watch('showDialog', { immediate: true }) private onShowDialogChanged() { this.handleGetIdentityResource() } - mounted() { - this.handleGetClaimTypes() - } - - private handleGetClaimTypes() { - ClaimTypeApiService.getActivedClaimTypes().then(res => { - res.items.map(claim => { - const identityClaim = new Claim(claim.name, claim.name) - this.identityClaims.push(identityClaim) - }) - }) - } - private handleGetIdentityResource() { this.activeTable = 'basics' - if (this.showDialog && this.identityResourceId) { - IdentityResourceService.getIdentityResourceById(this.identityResourceId).then(resource => { - this.identityResource = resource - }) + if (this.showDialog && this.id) { + IdentityResourceService + .get(this.id) + .then(resource => { + this.identityResource = resource + }) } else { this.identityResource = new IdentityResource() } } - private onPropertyCreated(key: string, value: string) { - this.$set(this.identityResource.properties, key, value) - } - - private onPropertyDeleted(key: string) { - this.$delete(this.identityResource.properties, key) - } - private onSave() { const frmIdentityResource = this.$refs.formIdentityResource as any frmIdentityResource.validate((valid: boolean) => { if (valid) { - const editIdentityResource = new IdentityResourceCreateOrUpdate() - this.updateIdentityResourceByInput(editIdentityResource) + const input = new IdentityResourceCreateOrUpdate() + this.updateByInput(input) if (this.isEdit) { - IdentityResourceService.updateIdentityResource(this.identityResourceId, editIdentityResource).then(resource => { - this.identityResource = resource - const successMessage = this.l('global.successful') - this.$message.success(successMessage) - this.onFormClosed(true) - }) + IdentityResourceService + .update(this.id, input) + .then(resource => { + this.identityResource = resource + const successMessage = this.l('global.successful') + this.$message.success(successMessage) + this.onFormClosed(true) + }) } else { - IdentityResourceService.createIdentityResource(editIdentityResource).then(resource => { - this.identityResource = resource - const successMessage = this.l('global.successful') - this.$message.success(successMessage) - this.onFormClosed(true) - }) + IdentityResourceService + .create(input) + .then(resource => { + this.identityResource = resource + const successMessage = this.l('global.successful') + this.$message.success(successMessage) + this.onFormClosed(true) + }) } } }) } - private updateIdentityResourceByInput(identityResource: IdentityResourceCreateOrUpdate) { - identityResource.name = this.identityResource.name - identityResource.displayName = this.identityResource.displayName - identityResource.description = this.identityResource.description - identityResource.enabled = this.identityResource.enabled - identityResource.required = this.identityResource.required - identityResource.emphasize = this.identityResource.emphasize - identityResource.showInDiscoveryDocument = this.identityResource.showInDiscoveryDocument - identityResource.userClaims = this.identityResource.userClaims - identityResource.properties = this.identityResource.properties + private updateByInput(input: IdentityResourceCreateOrUpdate) { + input.name = this.identityResource.name + input.displayName = this.identityResource.displayName + input.description = this.identityResource.description + input.enabled = this.identityResource.enabled + input.required = this.identityResource.required + input.emphasize = this.identityResource.emphasize + input.showInDiscoveryDocument = this.identityResource.showInDiscoveryDocument + input.userClaims = this.identityResource.userClaims + input.properties = this.identityResource.properties } private onFormClosed(changed: boolean) { diff --git a/vueJs/src/views/admin/identityServer/identity-resources/index.vue b/vueJs/src/views/admin/identityServer/identity-resources/index.vue index 938f1fdac..bbcd97036 100644 --- a/vueJs/src/views/admin/identityServer/identity-resources/index.vue +++ b/vueJs/src/views/admin/identityServer/identity-resources/index.vue @@ -23,7 +23,7 @@ class="filter-item" type="primary" :disabled="!checkPermission(['AbpIdentityServer.IdentityResources.Create'])" - @click="handleShowEditIdentityResourceForm()" + @click="onShowEditForm('')" > {{ $t('AbpIdentityServer.Resource:New') }} @@ -124,7 +124,7 @@ :disabled="!checkPermission(['AbpIdentityServer.IdentityResources.Update'])" size="mini" type="primary" - @click="handleShowEditIdentityResourceForm(row)" + @click="onShowEditForm(row.id)" > {{ $t('AbpIdentityServer.Resource:Edit') }} @@ -132,7 +132,7 @@ :disabled="!checkPermission(['AbpIdentityServer.IdentityResources.Delete'])" size="mini" type="danger" - @click="handleDeleteIdentityResource(row)" + @click="onDeleted(row)" > {{ $t('AbpIdentityServer.Resource:Delete') }} @@ -150,10 +150,9 @@ /> @@ -191,10 +190,8 @@ import IdentityResourceCreateOrEditForm from './components/IdentityResourceCreat } }) export default class extends mixins(DataListMiXin) { - private editIdentityResourceId = '' - private editIdentityResourceTitle = '' - - private showEditIdentityResourceDialog = false + private selectId = '' + private showEditDialog = false public dataFilter = new IdentityResourceGetByPaged() @@ -207,35 +204,32 @@ export default class extends mixins(DataListMiXin) { } protected getPagedList(filter: any) { - return IdentityResourceService.getIdentityResources(filter) + return IdentityResourceService.getList(filter) } - private handleShowEditIdentityResourceForm(resource: IdentityResource) { - if (resource) { - this.editIdentityResourceId = resource.id - this.editIdentityResourceTitle = this.l('AbpIdentityServer.Resource:Name', { 0: resource.name }) - } else { - this.editIdentityResourceTitle = this.l('AbpIdentityServer.Resource:New') - } - this.showEditIdentityResourceDialog = true + private onShowEditForm(id: string) { + this.selectId = id + this.showEditDialog = true } - private handleDeleteIdentityResource(resource: IdentityResource) { + private onDeleted(resource: IdentityResource) { this.$confirm(this.l('AbpIdentityServer.Resource:WillDelete', { 0: resource.name }), this.l('AbpUi.AreYouSure'), { callback: (action) => { if (action === 'confirm') { - IdentityResourceService.deleteIdentityResource(resource.id).then(() => { - this.$message.success(this.l('global.successful')) - this.refreshPagedData() - }) + IdentityResourceService + .delete(resource.id) + .then(() => { + this.$message.success(this.l('global.successful')) + this.refreshPagedData() + }) } } }) } - private onIdentityResourceEditFormClosed(changed: boolean) { - this.showEditIdentityResourceDialog = false + private onEditFormClosed(changed: boolean) { + this.showEditDialog = false if (changed) { this.refreshPagedData() }