diff --git a/Volo.Abp.sln b/Volo.Abp.sln index 82d3796336..b7a602335d 100644 --- a/Volo.Abp.sln +++ b/Volo.Abp.sln @@ -9,18 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{447C8A77-E5F0-4538-8687-7383196D04EA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{4C753F64-0C93-4D65-96C2-A40893AFC1E8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{37087D1B-3693-4E96-983D-A69F210BDE53}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AbpDesk", "AbpDesk", "{1187F469-0063-4065-9419-A1D956C80145}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AbpDesk", "AbpDesk", "{61708AC8-CE70-4351-9B31-13EA8213D208}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.Identity", "Abp.Identity", "{1895A5C9-50D4-4568-9A3A-14657E615A5E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.Identity", "Abp.Identity", "{146F561E-C7B8-4166-9383-47E1BC1A2E62}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker-files", "docker-files", "{0BEA55D6-E0B8-40DD-A256-B34C4DD990A5}" ProjectSection(SolutionItems) = preProject docker\docker-compose.yml = docker\docker-compose.yml @@ -50,52 +38,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.TestBas EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.EntityFrameworkCore", "src\Volo.Abp.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj", "{A1AE63E9-0CF4-4AFB-A584-65D826DEA3CB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.Domain", "src\AbpDesk\AbpDesk.Domain\AbpDesk.Domain.csproj", "{2DBA20A3-8B1C-49F0-90F6-EB09DB78B1B8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.Application.Contracts", "src\AbpDesk\AbpDesk.Application.Contracts\AbpDesk.Application.Contracts.csproj", "{E45B2BA3-7917-4236-99CD-B0A25285A652}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.Application", "src\AbpDesk\AbpDesk.Application\AbpDesk.Application.csproj", "{B6E622CE-0AEE-45DA-81AB-C244196CB583}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.EntityFrameworkCore", "src\AbpDesk\AbpDesk.EntityFrameworkCore\AbpDesk.EntityFrameworkCore.csproj", "{35624E7C-6501-4B42-9AA7-70555666A8B3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.ConsoleDemo", "src\AbpDesk\AbpDesk.ConsoleDemo\AbpDesk.ConsoleDemo.csproj", "{1A1575D7-E57E-4A40-8113-FD01BB1753D5}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc", "src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj", "{3FB342CA-23B6-4795-91EF-C664527C07B7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.Application.Tests", "test\AbpDesk\AbpDesk.Application.Tests\AbpDesk.Application.Tests.csproj", "{E6E2467C-184A-4A0A-929F-932D5097953E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TestBase", "src\Volo.Abp.TestBase\Volo.Abp.TestBase.csproj", "{8CECCEAF-F0D8-4257-96BA-EACF4763AF42}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.Web.Mvc", "src\AbpDesk\AbpDesk.Web.Mvc\AbpDesk.Web.Mvc.csproj", "{12E14D95-4ABA-4290-AB1D-CCF5EB158411}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.EntityFrameworkCore", "src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj", "{439DFC0F-1BA2-464F-900E-EA7E18C08975}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Tests", "test\Volo.Abp.Identity.Tests\Volo.Abp.Identity.Tests.csproj", "{4AB91077-82DC-4335-9274-BCE017BD9C8B}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MongoDB", "src\Volo.Abp.MongoDB\Volo.Abp.MongoDB.csproj", "{B31FFAE3-5DAC-4E51-BD17-F7446B741A36}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.MongoBlog", "src\AbpDesk\AbpDesk.MongoBlog\AbpDesk.MongoBlog.csproj", "{63244DC7-34BE-44E1-BF6F-F2672E59AF36}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.SamplePlugInModule", "src\AbpDesk\AbpDesk.SamplePlugInModule\AbpDesk.SamplePlugInModule.csproj", "{ADFAF85B-B785-41EA-B57D-422775989FA6}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI", "src\Volo.Abp.AspNetCore.Mvc.UI\Volo.Abp.AspNetCore.Mvc.UI.csproj", "{BF9AB22C-F48D-4DDE-A894-BC28EB37166B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.EmbeddedFiles", "src\Volo.Abp.AspNetCore.EmbeddedFiles\Volo.Abp.AspNetCore.EmbeddedFiles.csproj", "{B6182BF1-9EC6-403D-A42C-D6441CF7B390}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.Bootstrap", "src\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj", "{C761A3F7-787D-4C7E-A41C-5FAB07F6B774}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Application.Contracts", "src\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj", "{C714A3AB-8402-4DC2-B120-ACCB2E29BD8F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Application", "src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj", "{54592671-9CB6-48AE-9AE0-84CD016E87FF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.HttpApi", "src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj", "{57FCA6CB-9D99-411E-8ABF-20ACFBD61D61}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.HttpApi.Host", "src\Volo.Abp.Identity.HttpApi.Host\Volo.Abp.Identity.HttpApi.Host.csproj", "{EB902D57-C047-4CDF-828B-FDC204AC7398}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Web", "src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj", "{17B14A48-5248-4F4C-A8E6-6926AA94EB7C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.HttpApi.Client", "src\Volo.Abp.Identity.HttpApi.Client\Volo.Abp.Identity.HttpApi.Client.csproj", "{00B240B6-EC44-461A-9578-EF4F1BE9C688}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Autofac", "src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj", "{CECE1288-B5A1-4A6B-BEE0-331861F94983}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Castle.Core", "src\Volo.Abp.Castle.Core\Volo.Abp.Castle.Core.csproj", "{053F7446-0545-482E-9F29-9C96B926966C}" @@ -124,12 +78,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Http.Client", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Http.Client.Tests", "test\Volo.Abp.Http.Client.Tests\Volo.Abp.Http.Client.Tests.csproj", "{703BD43C-02B9-413F-854C-9CBA0C963196}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Application.Tests", "test\Volo.Abp.Identity.Application.Tests\Volo.Abp.Identity.Application.Tests.csproj", "{40E21A35-1C66-4E89-A16E-0475011F7EFD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Domain", "src\Volo.Abp.Identity.Domain\Volo.Abp.Identity.Domain.csproj", "{43D4005C-4F04-4128-937B-52BEAC5A113B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Domain.Shared", "src\Volo.Abp.Identity.Domain.Shared\Volo.Abp.Identity.Domain.Shared.csproj", "{DF676F73-3FC9-46CE-909A-2D75E19982AD}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.EntityFrameworkCore.Tests", "test\Volo.Abp.EntityFrameworkCore.Tests\Volo.Abp.EntityFrameworkCore.Tests.csproj", "{3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleConsoleDemo", "test\SimpleConsoleDemo\SimpleConsoleDemo.csproj", "{2B48CF90-DBDB-469F-941C-5B5AECEEACE0}" @@ -138,10 +86,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.EntityFrameworkCor EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.Versioning.Tests", "test\Volo.Abp.AspNetCore.Mvc.Versioning.Tests\Volo.Abp.AspNetCore.Mvc.Versioning.Tests.csproj", "{A8C8B76D-0869-4C11-AC55-DB9DD115788E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.Account", "Abp.Account", "{DB012309-74FD-4D5A-B843-DD77BF053BF4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Account.Web", "src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj", "{F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.VirtualFileSystem", "src\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj", "{6E6A7554-3488-45AB-BC0E-9BDE1F19789D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.VirtualFileSystem.Tests", "test\Volo.Abp.VirtualFileSystem.Tests\Volo.Abp.VirtualFileSystem.Tests.csproj", "{F79B6D80-C79B-4C13-9221-CA2345983743}" @@ -190,76 +134,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.UI.Navigation", "s EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.UI.Navigation.Tests", "test\Volo.Abp.UI.Navigation.Tests\Volo.Abp.UI.Navigation.Tests.csproj", "{975056D6-0B2D-43BA-9BF8-0E937581F873}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.IdentityServer", "Abp.IdentityServer", "{324B920F-5BBA-46D8-BDC6-E1FA5EFE3733}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.IdentityServer.Domain", "src\Volo.Abp.IdentityServer.Domain\Volo.Abp.IdentityServer.Domain.csproj", "{210B1A21-CBC8-423D-9C69-3E63569F2C43}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.IdentityServer.EntityFrameworkCore", "src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj", "{8D891D68-7859-477D-BE78-99258B8B1E86}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.IdentityServer", "Abp.IdentityServer", "{3DF5C4E8-51E7-4931-B4F4-EA390AB8FCC9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Abp.IdentityServer.EntityFrameworkCore.Tests", "test\Abp.IdentityServer.EntityFrameworkCore.Tests\Abp.IdentityServer.EntityFrameworkCore.Tests.csproj", "{0C73A439-7CD2-4105-8B70-30B896C15C72}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.IdentityServer.Application.Contracts", "src\Volo.Abp.IdentityServer.Application.Contracts\Volo.Abp.IdentityServer.Application.Contracts.csproj", "{253C20C0-1F46-410A-ACFE-2F375491E6D2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.IdentityServer.Domain.Shared", "src\Volo.Abp.IdentityServer.Domain.Shared\Volo.Abp.IdentityServer.Domain.Shared.csproj", "{C386A083-4190-4567-B4E3-95D1C800A298}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.IdentityServer.Application", "src\Volo.Abp.IdentityServer.Application\Volo.Abp.IdentityServer.Application.csproj", "{2794C2A5-C633-41E3-8B47-0659E72D8C9B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AbpDesk.ConsoleClient", "src\AbpDesk\AbpDesk.ConsoleClient\AbpDesk.ConsoleClient.csproj", "{93B574B5-2827-4E0A-86FB-B07EF40BB39F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{3B481ACC-5BB3-4189-880C-5F7A27EAEB70}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{282A5684-F573-47BB-B044-10F3F710E22A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.MultiTenancy", "Abp.MultiTenancy", "{CA154803-3589-47B3-B7CB-B18F94FE1EB6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.EntityFrameworkCore", "src\Volo.Abp.MultiTenancy.EntityFrameworkCore\Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj", "{9D7C2C19-1EE4-40BB-A1A4-27B175F1BFDD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Domain", "src\Volo.Abp.MultiTenancy.Domain\Volo.Abp.MultiTenancy.Domain.csproj", "{3FA1F4A4-BF5A-4CE3-B76F-2147FE31AB43}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Domain.Shared", "src\Volo.Abp.MultiTenancy.Domain.Shared\Volo.Abp.MultiTenancy.Domain.Shared.csproj", "{4605A64C-B4E0-4A04-9BF2-501027375258}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Application.Contracts", "src\Volo.Abp.MultiTenancy.Application.Contracts\Volo.Abp.MultiTenancy.Application.Contracts.csproj", "{6A99C679-EA3B-4324-8D6B-89DB8C7D3DA0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Application", "src\Volo.Abp.MultiTenancy.Application\Volo.Abp.MultiTenancy.Application.csproj", "{FCEC7C9D-067F-452B-98C9-1878F7EA02EB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.MultiTenancy", "Abp.MultiTenancy", "{3CE22CAC-4B27-4EEC-A35E-C01219ED6E99}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Application.Tests", "test\Volo.Abp.MultiTenancy.Application.Tests\Volo.Abp.MultiTenancy.Application.Tests.csproj", "{B65973F1-9EE0-4914-B6F2-D88F753E1D21}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Web", "src\Volo.Abp.MultiTenancy.Web\Volo.Abp.MultiTenancy.Web.csproj", "{0808036D-065B-4525-BF30-CBCEA062F8E9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.HttpApi", "src\Volo.Abp.MultiTenancy.HttpApi\Volo.Abp.MultiTenancy.HttpApi.csproj", "{06423FAC-67E2-4B7C-B29F-39578F460C4F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Settings", "src\Volo.Abp.Settings\Volo.Abp.Settings.csproj", "{CB6FD800-B6C5-4C2A-8920-B8A29C74AEF6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Settings.EntityFrameworkCore", "src\Volo.Abp.Settings.EntityFrameworkCore\Volo.Abp.Settings.EntityFrameworkCore.csproj", "{1DCD9600-215A-4A94-AEFD-577568D62633}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Settings.Domain", "src\Volo.Abp.Settings.Domain\Volo.Abp.Settings.Domain.csproj", "{837BC537-3AEC-4F6D-9D64-9704F64D0E1E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Settings.Tests", "test\Volo.Abp.Settings.Tests\Volo.Abp.Settings.Tests.csproj", "{61422EC8-8FFB-48EA-B4B5-527E29077930}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Settings.Domain.Shared", "src\Volo.Abp.Settings.Domain.Shared\Volo.Abp.Settings.Domain.Shared.csproj", "{27F990E2-6820-4159-B54A-59C8ADED8D28}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.Settings", "Abp.Settings", "{D62B8D43-B8D9-4FC6-97E2-DC54CD765915}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.Permissions", "Abp.Permissions", "{055F4AC0-46C4-4E99-89CD-0F30D4A97382}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Permissions.Domain", "src\Volo.Abp.Permissions.Domain\Volo.Abp.Permissions.Domain.csproj", "{D77E0662-8404-43C5-9C46-6289EA207A40}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Permissions.Domain.Shared", "src\Volo.Abp.Permissions.Domain.Shared\Volo.Abp.Permissions.Domain.Shared.csproj", "{E4D0326C-515D-46FA-AF7E-1AC32155BD03}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Permissions.EntityFrameworkCore", "src\Volo.Abp.Permissions.EntityFrameworkCore\Volo.Abp.Permissions.EntityFrameworkCore.csproj", "{2300E155-2621-4FCF-BD44-B61BA5A92B82}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Permissions.Tests", "test\Volo.Abp.Permissions.Tests\Volo.Abp.Permissions.Tests.csproj", "{7B4D2BEB-DE3E-4533-8CD4-7BBB30414647}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Permissions.Web", "src\Volo.Abp.Permissions.Web\Volo.Abp.Permissions.Web.csproj", "{8859CFE4-BC7F-4F29-B6B5-A9457435CC32}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Permissions.Application.Contracts", "src\Volo.Abp.Permissions.Application.Contracts\Volo.Abp.Permissions.Application.Contracts.csproj", "{837ABFF5-66EE-486A-8023-8DD3EE7D7D96}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Permissions.Application", "src\Volo.Abp.Permissions.Application\Volo.Abp.Permissions.Application.csproj", "{90197499-CBB6-4C8C-90E6-8718CD755C04}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Caching", "src\Volo.Abp.Caching\Volo.Abp.Caching.csproj", "{A5B650AB-A67F-4A4C-9F81-7B5471CA1331}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.EventBus", "src\Volo.Abp.EventBus\Volo.Abp.EventBus.csproj", "{D9455AE7-2E0C-4647-9880-F5831BCEE3D8}" @@ -274,20 +150,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Serialization.Test EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Authorization.Tests", "test\Volo.Abp.Authorization.Tests\Volo.Abp.Authorization.Tests.csproj", "{B10E37A1-43A1-4042-BAAA-F589302958D5}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MicroserviceDemo", "MicroserviceDemo", "{3510E248-DC9F-4A07-8134-02E7F5CC5783}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroserviceDemo.Web", "src\MicroserviceDemo\MicroserviceDemo.Web\MicroserviceDemo.Web.csproj", "{258B4E36-BF5B-484D-B10E-7D5AF868FA44}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroserviceDemo.TenancyService", "src\MicroserviceDemo\MicroserviceDemo.TenancyService\MicroserviceDemo.TenancyService.csproj", "{067627C7-6891-453A-A219-35141733D776}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.HttpApi.Client", "src\Volo.Abp.MultiTenancy.HttpApi.Client\Volo.Abp.MultiTenancy.HttpApi.Client.csproj", "{76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroserviceDemo.AuthServer", "src\MicroserviceDemo\MicroserviceDemo.AuthServer\MicroserviceDemo.AuthServer.csproj", "{A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Account.Web.IdentityServer", "src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj", "{E4AB8A4F-BB59-4BDB-B915-877CE97D8113}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroserviceDemo.ConsoleClient", "src\MicroserviceDemo\MicroserviceDemo.ConsoleClient\MicroserviceDemo.ConsoleClient.csproj", "{CD4E755D-D47C-45B1-AFB3-3444FF2E2E39}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Authentication.OAuth", "src\Volo.Abp.AspNetCore.Authentication.OAuth\Volo.Abp.AspNetCore.Authentication.OAuth.csproj", "{A1C792B7-0DBF-460D-9158-A1A68A2D9C1A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Authentication.OAuth.Tests", "test\Volo.Abp.AspNetCore.Authentication.OAuth.Tests\Volo.Abp.AspNetCore.Authentication.OAuth.Tests.csproj", "{627B88DB-BDCF-4D92-8454-EFE95F4AFB7A}" @@ -300,15 +162,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ddd.Domain", "src\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ddd.Application", "src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj", "{5AB7E368-1CC8-401D-9952-6CA6779305E7}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{EBD87D3A-8130-4FBB-9A47-4A81717BB915}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{F33F751F-1260-40C0-8F76-E3D680605662}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Users", "src\Volo.Abp.Users\Volo.Abp.Users.csproj", "{DAE9088E-6E30-4D5D-9DF8-2188E8D386FE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Users", "src\Volo.Abp.Users\Volo.Abp.Users.csproj", "{DAE9088E-6E30-4D5D-9DF8-2188E8D386FE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Auditing", "src\Volo.Abp.Auditing\Volo.Abp.Auditing.csproj", "{03F51721-DA51-4BAE-9909-3FC88FAB7774}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Auditing", "src\Volo.Abp.Auditing\Volo.Abp.Auditing.csproj", "{03F51721-DA51-4BAE-9909-3FC88FAB7774}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Auditing.Tests", "test\Volo.Abp.Auditing.Tests\Volo.Abp.Auditing.Tests.csproj", "{D5733D90-8C3D-4026-85E2-41DED26C4938}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Auditing.Tests", "test\Volo.Abp.Auditing.Tests\Volo.Abp.Auditing.Tests.csproj", "{D5733D90-8C3D-4026-85E2-41DED26C4938}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -348,62 +206,18 @@ Global {A1AE63E9-0CF4-4AFB-A584-65D826DEA3CB}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1AE63E9-0CF4-4AFB-A584-65D826DEA3CB}.Release|Any CPU.ActiveCfg = Release|Any CPU {A1AE63E9-0CF4-4AFB-A584-65D826DEA3CB}.Release|Any CPU.Build.0 = Release|Any CPU - {2DBA20A3-8B1C-49F0-90F6-EB09DB78B1B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2DBA20A3-8B1C-49F0-90F6-EB09DB78B1B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2DBA20A3-8B1C-49F0-90F6-EB09DB78B1B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2DBA20A3-8B1C-49F0-90F6-EB09DB78B1B8}.Release|Any CPU.Build.0 = Release|Any CPU - {E45B2BA3-7917-4236-99CD-B0A25285A652}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E45B2BA3-7917-4236-99CD-B0A25285A652}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E45B2BA3-7917-4236-99CD-B0A25285A652}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E45B2BA3-7917-4236-99CD-B0A25285A652}.Release|Any CPU.Build.0 = Release|Any CPU - {B6E622CE-0AEE-45DA-81AB-C244196CB583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B6E622CE-0AEE-45DA-81AB-C244196CB583}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B6E622CE-0AEE-45DA-81AB-C244196CB583}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B6E622CE-0AEE-45DA-81AB-C244196CB583}.Release|Any CPU.Build.0 = Release|Any CPU - {35624E7C-6501-4B42-9AA7-70555666A8B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {35624E7C-6501-4B42-9AA7-70555666A8B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {35624E7C-6501-4B42-9AA7-70555666A8B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {35624E7C-6501-4B42-9AA7-70555666A8B3}.Release|Any CPU.Build.0 = Release|Any CPU - {1A1575D7-E57E-4A40-8113-FD01BB1753D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A1575D7-E57E-4A40-8113-FD01BB1753D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A1575D7-E57E-4A40-8113-FD01BB1753D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A1575D7-E57E-4A40-8113-FD01BB1753D5}.Release|Any CPU.Build.0 = Release|Any CPU {3FB342CA-23B6-4795-91EF-C664527C07B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3FB342CA-23B6-4795-91EF-C664527C07B7}.Debug|Any CPU.Build.0 = Debug|Any CPU {3FB342CA-23B6-4795-91EF-C664527C07B7}.Release|Any CPU.ActiveCfg = Release|Any CPU {3FB342CA-23B6-4795-91EF-C664527C07B7}.Release|Any CPU.Build.0 = Release|Any CPU - {E6E2467C-184A-4A0A-929F-932D5097953E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6E2467C-184A-4A0A-929F-932D5097953E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6E2467C-184A-4A0A-929F-932D5097953E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6E2467C-184A-4A0A-929F-932D5097953E}.Release|Any CPU.Build.0 = Release|Any CPU {8CECCEAF-F0D8-4257-96BA-EACF4763AF42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8CECCEAF-F0D8-4257-96BA-EACF4763AF42}.Debug|Any CPU.Build.0 = Debug|Any CPU {8CECCEAF-F0D8-4257-96BA-EACF4763AF42}.Release|Any CPU.ActiveCfg = Release|Any CPU {8CECCEAF-F0D8-4257-96BA-EACF4763AF42}.Release|Any CPU.Build.0 = Release|Any CPU - {12E14D95-4ABA-4290-AB1D-CCF5EB158411}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {12E14D95-4ABA-4290-AB1D-CCF5EB158411}.Debug|Any CPU.Build.0 = Debug|Any CPU - {12E14D95-4ABA-4290-AB1D-CCF5EB158411}.Release|Any CPU.ActiveCfg = Release|Any CPU - {12E14D95-4ABA-4290-AB1D-CCF5EB158411}.Release|Any CPU.Build.0 = Release|Any CPU - {439DFC0F-1BA2-464F-900E-EA7E18C08975}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {439DFC0F-1BA2-464F-900E-EA7E18C08975}.Debug|Any CPU.Build.0 = Debug|Any CPU - {439DFC0F-1BA2-464F-900E-EA7E18C08975}.Release|Any CPU.ActiveCfg = Release|Any CPU - {439DFC0F-1BA2-464F-900E-EA7E18C08975}.Release|Any CPU.Build.0 = Release|Any CPU - {4AB91077-82DC-4335-9274-BCE017BD9C8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4AB91077-82DC-4335-9274-BCE017BD9C8B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4AB91077-82DC-4335-9274-BCE017BD9C8B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4AB91077-82DC-4335-9274-BCE017BD9C8B}.Release|Any CPU.Build.0 = Release|Any CPU {B31FFAE3-5DAC-4E51-BD17-F7446B741A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B31FFAE3-5DAC-4E51-BD17-F7446B741A36}.Debug|Any CPU.Build.0 = Debug|Any CPU {B31FFAE3-5DAC-4E51-BD17-F7446B741A36}.Release|Any CPU.ActiveCfg = Release|Any CPU {B31FFAE3-5DAC-4E51-BD17-F7446B741A36}.Release|Any CPU.Build.0 = Release|Any CPU - {63244DC7-34BE-44E1-BF6F-F2672E59AF36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63244DC7-34BE-44E1-BF6F-F2672E59AF36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63244DC7-34BE-44E1-BF6F-F2672E59AF36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63244DC7-34BE-44E1-BF6F-F2672E59AF36}.Release|Any CPU.Build.0 = Release|Any CPU - {ADFAF85B-B785-41EA-B57D-422775989FA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADFAF85B-B785-41EA-B57D-422775989FA6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADFAF85B-B785-41EA-B57D-422775989FA6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADFAF85B-B785-41EA-B57D-422775989FA6}.Release|Any CPU.Build.0 = Release|Any CPU {BF9AB22C-F48D-4DDE-A894-BC28EB37166B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BF9AB22C-F48D-4DDE-A894-BC28EB37166B}.Debug|Any CPU.Build.0 = Debug|Any CPU {BF9AB22C-F48D-4DDE-A894-BC28EB37166B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -416,30 +230,6 @@ Global {C761A3F7-787D-4C7E-A41C-5FAB07F6B774}.Debug|Any CPU.Build.0 = Debug|Any CPU {C761A3F7-787D-4C7E-A41C-5FAB07F6B774}.Release|Any CPU.ActiveCfg = Release|Any CPU {C761A3F7-787D-4C7E-A41C-5FAB07F6B774}.Release|Any CPU.Build.0 = Release|Any CPU - {C714A3AB-8402-4DC2-B120-ACCB2E29BD8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C714A3AB-8402-4DC2-B120-ACCB2E29BD8F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C714A3AB-8402-4DC2-B120-ACCB2E29BD8F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C714A3AB-8402-4DC2-B120-ACCB2E29BD8F}.Release|Any CPU.Build.0 = Release|Any CPU - {54592671-9CB6-48AE-9AE0-84CD016E87FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54592671-9CB6-48AE-9AE0-84CD016E87FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54592671-9CB6-48AE-9AE0-84CD016E87FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54592671-9CB6-48AE-9AE0-84CD016E87FF}.Release|Any CPU.Build.0 = Release|Any CPU - {57FCA6CB-9D99-411E-8ABF-20ACFBD61D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {57FCA6CB-9D99-411E-8ABF-20ACFBD61D61}.Debug|Any CPU.Build.0 = Debug|Any CPU - {57FCA6CB-9D99-411E-8ABF-20ACFBD61D61}.Release|Any CPU.ActiveCfg = Release|Any CPU - {57FCA6CB-9D99-411E-8ABF-20ACFBD61D61}.Release|Any CPU.Build.0 = Release|Any CPU - {EB902D57-C047-4CDF-828B-FDC204AC7398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EB902D57-C047-4CDF-828B-FDC204AC7398}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EB902D57-C047-4CDF-828B-FDC204AC7398}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EB902D57-C047-4CDF-828B-FDC204AC7398}.Release|Any CPU.Build.0 = Release|Any CPU - {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17B14A48-5248-4F4C-A8E6-6926AA94EB7C}.Release|Any CPU.Build.0 = Release|Any CPU - {00B240B6-EC44-461A-9578-EF4F1BE9C688}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {00B240B6-EC44-461A-9578-EF4F1BE9C688}.Debug|Any CPU.Build.0 = Debug|Any CPU - {00B240B6-EC44-461A-9578-EF4F1BE9C688}.Release|Any CPU.ActiveCfg = Release|Any CPU - {00B240B6-EC44-461A-9578-EF4F1BE9C688}.Release|Any CPU.Build.0 = Release|Any CPU {CECE1288-B5A1-4A6B-BEE0-331861F94983}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CECE1288-B5A1-4A6B-BEE0-331861F94983}.Debug|Any CPU.Build.0 = Debug|Any CPU {CECE1288-B5A1-4A6B-BEE0-331861F94983}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -496,18 +286,6 @@ Global {703BD43C-02B9-413F-854C-9CBA0C963196}.Debug|Any CPU.Build.0 = Debug|Any CPU {703BD43C-02B9-413F-854C-9CBA0C963196}.Release|Any CPU.ActiveCfg = Release|Any CPU {703BD43C-02B9-413F-854C-9CBA0C963196}.Release|Any CPU.Build.0 = Release|Any CPU - {40E21A35-1C66-4E89-A16E-0475011F7EFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40E21A35-1C66-4E89-A16E-0475011F7EFD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40E21A35-1C66-4E89-A16E-0475011F7EFD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40E21A35-1C66-4E89-A16E-0475011F7EFD}.Release|Any CPU.Build.0 = Release|Any CPU - {43D4005C-4F04-4128-937B-52BEAC5A113B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43D4005C-4F04-4128-937B-52BEAC5A113B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43D4005C-4F04-4128-937B-52BEAC5A113B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43D4005C-4F04-4128-937B-52BEAC5A113B}.Release|Any CPU.Build.0 = Release|Any CPU - {DF676F73-3FC9-46CE-909A-2D75E19982AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF676F73-3FC9-46CE-909A-2D75E19982AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF676F73-3FC9-46CE-909A-2D75E19982AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF676F73-3FC9-46CE-909A-2D75E19982AD}.Release|Any CPU.Build.0 = Release|Any CPU {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}.Debug|Any CPU.Build.0 = Debug|Any CPU {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -524,10 +302,6 @@ Global {A8C8B76D-0869-4C11-AC55-DB9DD115788E}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8C8B76D-0869-4C11-AC55-DB9DD115788E}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8C8B76D-0869-4C11-AC55-DB9DD115788E}.Release|Any CPU.Build.0 = Release|Any CPU - {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B}.Release|Any CPU.Build.0 = Release|Any CPU {6E6A7554-3488-45AB-BC0E-9BDE1F19789D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6E6A7554-3488-45AB-BC0E-9BDE1F19789D}.Debug|Any CPU.Build.0 = Debug|Any CPU {6E6A7554-3488-45AB-BC0E-9BDE1F19789D}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -624,114 +398,10 @@ Global {975056D6-0B2D-43BA-9BF8-0E937581F873}.Debug|Any CPU.Build.0 = Debug|Any CPU {975056D6-0B2D-43BA-9BF8-0E937581F873}.Release|Any CPU.ActiveCfg = Release|Any CPU {975056D6-0B2D-43BA-9BF8-0E937581F873}.Release|Any CPU.Build.0 = Release|Any CPU - {210B1A21-CBC8-423D-9C69-3E63569F2C43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {210B1A21-CBC8-423D-9C69-3E63569F2C43}.Debug|Any CPU.Build.0 = Debug|Any CPU - {210B1A21-CBC8-423D-9C69-3E63569F2C43}.Release|Any CPU.ActiveCfg = Release|Any CPU - {210B1A21-CBC8-423D-9C69-3E63569F2C43}.Release|Any CPU.Build.0 = Release|Any CPU - {8D891D68-7859-477D-BE78-99258B8B1E86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D891D68-7859-477D-BE78-99258B8B1E86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D891D68-7859-477D-BE78-99258B8B1E86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D891D68-7859-477D-BE78-99258B8B1E86}.Release|Any CPU.Build.0 = Release|Any CPU - {0C73A439-7CD2-4105-8B70-30B896C15C72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C73A439-7CD2-4105-8B70-30B896C15C72}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C73A439-7CD2-4105-8B70-30B896C15C72}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C73A439-7CD2-4105-8B70-30B896C15C72}.Release|Any CPU.Build.0 = Release|Any CPU - {253C20C0-1F46-410A-ACFE-2F375491E6D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {253C20C0-1F46-410A-ACFE-2F375491E6D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {253C20C0-1F46-410A-ACFE-2F375491E6D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {253C20C0-1F46-410A-ACFE-2F375491E6D2}.Release|Any CPU.Build.0 = Release|Any CPU - {C386A083-4190-4567-B4E3-95D1C800A298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C386A083-4190-4567-B4E3-95D1C800A298}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C386A083-4190-4567-B4E3-95D1C800A298}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C386A083-4190-4567-B4E3-95D1C800A298}.Release|Any CPU.Build.0 = Release|Any CPU - {2794C2A5-C633-41E3-8B47-0659E72D8C9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2794C2A5-C633-41E3-8B47-0659E72D8C9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2794C2A5-C633-41E3-8B47-0659E72D8C9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2794C2A5-C633-41E3-8B47-0659E72D8C9B}.Release|Any CPU.Build.0 = Release|Any CPU - {93B574B5-2827-4E0A-86FB-B07EF40BB39F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {93B574B5-2827-4E0A-86FB-B07EF40BB39F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {93B574B5-2827-4E0A-86FB-B07EF40BB39F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {93B574B5-2827-4E0A-86FB-B07EF40BB39F}.Release|Any CPU.Build.0 = Release|Any CPU - {9D7C2C19-1EE4-40BB-A1A4-27B175F1BFDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D7C2C19-1EE4-40BB-A1A4-27B175F1BFDD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D7C2C19-1EE4-40BB-A1A4-27B175F1BFDD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D7C2C19-1EE4-40BB-A1A4-27B175F1BFDD}.Release|Any CPU.Build.0 = Release|Any CPU - {3FA1F4A4-BF5A-4CE3-B76F-2147FE31AB43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3FA1F4A4-BF5A-4CE3-B76F-2147FE31AB43}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3FA1F4A4-BF5A-4CE3-B76F-2147FE31AB43}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3FA1F4A4-BF5A-4CE3-B76F-2147FE31AB43}.Release|Any CPU.Build.0 = Release|Any CPU - {4605A64C-B4E0-4A04-9BF2-501027375258}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4605A64C-B4E0-4A04-9BF2-501027375258}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4605A64C-B4E0-4A04-9BF2-501027375258}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4605A64C-B4E0-4A04-9BF2-501027375258}.Release|Any CPU.Build.0 = Release|Any CPU - {6A99C679-EA3B-4324-8D6B-89DB8C7D3DA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A99C679-EA3B-4324-8D6B-89DB8C7D3DA0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A99C679-EA3B-4324-8D6B-89DB8C7D3DA0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A99C679-EA3B-4324-8D6B-89DB8C7D3DA0}.Release|Any CPU.Build.0 = Release|Any CPU - {FCEC7C9D-067F-452B-98C9-1878F7EA02EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FCEC7C9D-067F-452B-98C9-1878F7EA02EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FCEC7C9D-067F-452B-98C9-1878F7EA02EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FCEC7C9D-067F-452B-98C9-1878F7EA02EB}.Release|Any CPU.Build.0 = Release|Any CPU - {B65973F1-9EE0-4914-B6F2-D88F753E1D21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B65973F1-9EE0-4914-B6F2-D88F753E1D21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B65973F1-9EE0-4914-B6F2-D88F753E1D21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B65973F1-9EE0-4914-B6F2-D88F753E1D21}.Release|Any CPU.Build.0 = Release|Any CPU - {0808036D-065B-4525-BF30-CBCEA062F8E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0808036D-065B-4525-BF30-CBCEA062F8E9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0808036D-065B-4525-BF30-CBCEA062F8E9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0808036D-065B-4525-BF30-CBCEA062F8E9}.Release|Any CPU.Build.0 = Release|Any CPU - {06423FAC-67E2-4B7C-B29F-39578F460C4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06423FAC-67E2-4B7C-B29F-39578F460C4F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06423FAC-67E2-4B7C-B29F-39578F460C4F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06423FAC-67E2-4B7C-B29F-39578F460C4F}.Release|Any CPU.Build.0 = Release|Any CPU {CB6FD800-B6C5-4C2A-8920-B8A29C74AEF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CB6FD800-B6C5-4C2A-8920-B8A29C74AEF6}.Debug|Any CPU.Build.0 = Debug|Any CPU {CB6FD800-B6C5-4C2A-8920-B8A29C74AEF6}.Release|Any CPU.ActiveCfg = Release|Any CPU {CB6FD800-B6C5-4C2A-8920-B8A29C74AEF6}.Release|Any CPU.Build.0 = Release|Any CPU - {1DCD9600-215A-4A94-AEFD-577568D62633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1DCD9600-215A-4A94-AEFD-577568D62633}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1DCD9600-215A-4A94-AEFD-577568D62633}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1DCD9600-215A-4A94-AEFD-577568D62633}.Release|Any CPU.Build.0 = Release|Any CPU - {837BC537-3AEC-4F6D-9D64-9704F64D0E1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {837BC537-3AEC-4F6D-9D64-9704F64D0E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {837BC537-3AEC-4F6D-9D64-9704F64D0E1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {837BC537-3AEC-4F6D-9D64-9704F64D0E1E}.Release|Any CPU.Build.0 = Release|Any CPU - {61422EC8-8FFB-48EA-B4B5-527E29077930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61422EC8-8FFB-48EA-B4B5-527E29077930}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61422EC8-8FFB-48EA-B4B5-527E29077930}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61422EC8-8FFB-48EA-B4B5-527E29077930}.Release|Any CPU.Build.0 = Release|Any CPU - {27F990E2-6820-4159-B54A-59C8ADED8D28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {27F990E2-6820-4159-B54A-59C8ADED8D28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {27F990E2-6820-4159-B54A-59C8ADED8D28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {27F990E2-6820-4159-B54A-59C8ADED8D28}.Release|Any CPU.Build.0 = Release|Any CPU - {D77E0662-8404-43C5-9C46-6289EA207A40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D77E0662-8404-43C5-9C46-6289EA207A40}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D77E0662-8404-43C5-9C46-6289EA207A40}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D77E0662-8404-43C5-9C46-6289EA207A40}.Release|Any CPU.Build.0 = Release|Any CPU - {E4D0326C-515D-46FA-AF7E-1AC32155BD03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E4D0326C-515D-46FA-AF7E-1AC32155BD03}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E4D0326C-515D-46FA-AF7E-1AC32155BD03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E4D0326C-515D-46FA-AF7E-1AC32155BD03}.Release|Any CPU.Build.0 = Release|Any CPU - {2300E155-2621-4FCF-BD44-B61BA5A92B82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2300E155-2621-4FCF-BD44-B61BA5A92B82}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2300E155-2621-4FCF-BD44-B61BA5A92B82}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2300E155-2621-4FCF-BD44-B61BA5A92B82}.Release|Any CPU.Build.0 = Release|Any CPU - {7B4D2BEB-DE3E-4533-8CD4-7BBB30414647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B4D2BEB-DE3E-4533-8CD4-7BBB30414647}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B4D2BEB-DE3E-4533-8CD4-7BBB30414647}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B4D2BEB-DE3E-4533-8CD4-7BBB30414647}.Release|Any CPU.Build.0 = Release|Any CPU - {8859CFE4-BC7F-4F29-B6B5-A9457435CC32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8859CFE4-BC7F-4F29-B6B5-A9457435CC32}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8859CFE4-BC7F-4F29-B6B5-A9457435CC32}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8859CFE4-BC7F-4F29-B6B5-A9457435CC32}.Release|Any CPU.Build.0 = Release|Any CPU - {837ABFF5-66EE-486A-8023-8DD3EE7D7D96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {837ABFF5-66EE-486A-8023-8DD3EE7D7D96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {837ABFF5-66EE-486A-8023-8DD3EE7D7D96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {837ABFF5-66EE-486A-8023-8DD3EE7D7D96}.Release|Any CPU.Build.0 = Release|Any CPU - {90197499-CBB6-4C8C-90E6-8718CD755C04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90197499-CBB6-4C8C-90E6-8718CD755C04}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90197499-CBB6-4C8C-90E6-8718CD755C04}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90197499-CBB6-4C8C-90E6-8718CD755C04}.Release|Any CPU.Build.0 = Release|Any CPU {A5B650AB-A67F-4A4C-9F81-7B5471CA1331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A5B650AB-A67F-4A4C-9F81-7B5471CA1331}.Debug|Any CPU.Build.0 = Debug|Any CPU {A5B650AB-A67F-4A4C-9F81-7B5471CA1331}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -760,30 +430,6 @@ Global {B10E37A1-43A1-4042-BAAA-F589302958D5}.Debug|Any CPU.Build.0 = Debug|Any CPU {B10E37A1-43A1-4042-BAAA-F589302958D5}.Release|Any CPU.ActiveCfg = Release|Any CPU {B10E37A1-43A1-4042-BAAA-F589302958D5}.Release|Any CPU.Build.0 = Release|Any CPU - {258B4E36-BF5B-484D-B10E-7D5AF868FA44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {258B4E36-BF5B-484D-B10E-7D5AF868FA44}.Debug|Any CPU.Build.0 = Debug|Any CPU - {258B4E36-BF5B-484D-B10E-7D5AF868FA44}.Release|Any CPU.ActiveCfg = Release|Any CPU - {258B4E36-BF5B-484D-B10E-7D5AF868FA44}.Release|Any CPU.Build.0 = Release|Any CPU - {067627C7-6891-453A-A219-35141733D776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {067627C7-6891-453A-A219-35141733D776}.Debug|Any CPU.Build.0 = Debug|Any CPU - {067627C7-6891-453A-A219-35141733D776}.Release|Any CPU.ActiveCfg = Release|Any CPU - {067627C7-6891-453A-A219-35141733D776}.Release|Any CPU.Build.0 = Release|Any CPU - {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39}.Release|Any CPU.Build.0 = Release|Any CPU - {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A}.Release|Any CPU.Build.0 = Release|Any CPU - {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E4AB8A4F-BB59-4BDB-B915-877CE97D8113}.Release|Any CPU.Build.0 = Release|Any CPU - {CD4E755D-D47C-45B1-AFB3-3444FF2E2E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD4E755D-D47C-45B1-AFB3-3444FF2E2E39}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD4E755D-D47C-45B1-AFB3-3444FF2E2E39}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD4E755D-D47C-45B1-AFB3-3444FF2E2E39}.Release|Any CPU.Build.0 = Release|Any CPU {A1C792B7-0DBF-460D-9158-A1A68A2D9C1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A1C792B7-0DBF-460D-9158-A1A68A2D9C1A}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1C792B7-0DBF-460D-9158-A1A68A2D9C1A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -825,152 +471,81 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {4C753F64-0C93-4D65-96C2-A40893AFC1E8} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} - {37087D1B-3693-4E96-983D-A69F210BDE53} = {447C8A77-E5F0-4538-8687-7383196D04EA} - {1187F469-0063-4065-9419-A1D956C80145} = {282A5684-F573-47BB-B044-10F3F710E22A} - {61708AC8-CE70-4351-9B31-13EA8213D208} = {F33F751F-1260-40C0-8F76-E3D680605662} - {1895A5C9-50D4-4568-9A3A-14657E615A5E} = {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} - {146F561E-C7B8-4166-9383-47E1BC1A2E62} = {EBD87D3A-8130-4FBB-9A47-4A81717BB915} {0BEA55D6-E0B8-40DD-A256-B34C4DD990A5} = {CBCC288A-53C3-402F-99F7-E468738560F5} {6D893E48-0739-401A-9AD1-286BCB6E5517} = {CBCC288A-53C3-402F-99F7-E468738560F5} {1020F5FD-6A97-40C2-AFCA-EBDF641DF111} = {447C8A77-E5F0-4538-8687-7383196D04EA} - {02BE03BA-3411-448C-AB61-CB36407CC49A} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {B1D860BB-6EC6-4BAE-ADAA-C2AEC2FFB510} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {05271341-7A15-484C-9FD6-802A4193F4DE} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {7CC7946B-E026-4F66-8D4F-4F78F4801D43} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {2C282467-2CD5-4750-BE1F-CA8BD8ECC6EA} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {DDEC5D74-212F-41BD-974C-4B4E88E574E1} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {A1AE63E9-0CF4-4AFB-A584-65D826DEA3CB} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {2DBA20A3-8B1C-49F0-90F6-EB09DB78B1B8} = {1187F469-0063-4065-9419-A1D956C80145} - {E45B2BA3-7917-4236-99CD-B0A25285A652} = {1187F469-0063-4065-9419-A1D956C80145} - {B6E622CE-0AEE-45DA-81AB-C244196CB583} = {1187F469-0063-4065-9419-A1D956C80145} - {35624E7C-6501-4B42-9AA7-70555666A8B3} = {1187F469-0063-4065-9419-A1D956C80145} - {1A1575D7-E57E-4A40-8113-FD01BB1753D5} = {1187F469-0063-4065-9419-A1D956C80145} - {3FB342CA-23B6-4795-91EF-C664527C07B7} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {E6E2467C-184A-4A0A-929F-932D5097953E} = {61708AC8-CE70-4351-9B31-13EA8213D208} - {8CECCEAF-F0D8-4257-96BA-EACF4763AF42} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {12E14D95-4ABA-4290-AB1D-CCF5EB158411} = {1187F469-0063-4065-9419-A1D956C80145} - {439DFC0F-1BA2-464F-900E-EA7E18C08975} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {4AB91077-82DC-4335-9274-BCE017BD9C8B} = {146F561E-C7B8-4166-9383-47E1BC1A2E62} - {B31FFAE3-5DAC-4E51-BD17-F7446B741A36} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {63244DC7-34BE-44E1-BF6F-F2672E59AF36} = {1187F469-0063-4065-9419-A1D956C80145} - {ADFAF85B-B785-41EA-B57D-422775989FA6} = {1187F469-0063-4065-9419-A1D956C80145} - {BF9AB22C-F48D-4DDE-A894-BC28EB37166B} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {B6182BF1-9EC6-403D-A42C-D6441CF7B390} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {C761A3F7-787D-4C7E-A41C-5FAB07F6B774} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {C714A3AB-8402-4DC2-B120-ACCB2E29BD8F} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {54592671-9CB6-48AE-9AE0-84CD016E87FF} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {57FCA6CB-9D99-411E-8ABF-20ACFBD61D61} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {EB902D57-C047-4CDF-828B-FDC204AC7398} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {17B14A48-5248-4F4C-A8E6-6926AA94EB7C} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {00B240B6-EC44-461A-9578-EF4F1BE9C688} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {CECE1288-B5A1-4A6B-BEE0-331861F94983} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {053F7446-0545-482E-9F29-9C96B926966C} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {D8BE64D2-BD83-40F5-9783-D7FDDF668C45} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {CE12E5C2-7B3E-4637-B6A3-274BB5C3DE16} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {D2F3594F-E2B9-4338-A022-F00C4E9A14C3} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {8343BE23-6A7B-4C58-BF0D-95188B11B180} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {27D76546-6091-4AEE-9079-1FE3991C81BC} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {DE160F1A-92FB-44BA-87E2-B8AD7A938AC7} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {CF564447-8E0B-4A07-B0D2-396E00A8E437} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {D0279C94-E9A3-4A1B-968B-D3BBF3E06FD8} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {4C2F7B03-C598-4432-A43A-B065D9D0712F} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {01A70034-D353-4BF9-821D-F2B6F7641532} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {D5E2FB37-0194-480A-B952-5FFECC1200EB} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {703BD43C-02B9-413F-854C-9CBA0C963196} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {40E21A35-1C66-4E89-A16E-0475011F7EFD} = {146F561E-C7B8-4166-9383-47E1BC1A2E62} - {43D4005C-4F04-4128-937B-52BEAC5A113B} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {DF676F73-3FC9-46CE-909A-2D75E19982AD} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} - {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {2B48CF90-DBDB-469F-941C-5B5AECEEACE0} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {127FC2BF-DC40-4370-B845-16088328264C} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {A8C8B76D-0869-4C11-AC55-DB9DD115788E} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {DB012309-74FD-4D5A-B843-DD77BF053BF4} = {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} - {F7DDF25E-58B1-4F68-AEDA-4F2FB4F4467B} = {DB012309-74FD-4D5A-B843-DD77BF053BF4} - {6E6A7554-3488-45AB-BC0E-9BDE1F19789D} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {F79B6D80-C79B-4C13-9221-CA2345983743} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {A7A97BFD-48FA-45D1-8423-031BA30BEAA1} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {166E89F7-A505-45F2-B4CD-F345DE39030E} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {6E50143F-0982-4BCB-9D0E-FF5451AE8123} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {3622B544-1345-4230-ABC2-4902328DE971} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {BC55B87F-D2BD-428D-8F78-A95EE7BDFDFA} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {5E7381EE-54BC-4BFD-883A-8C6578C2CAD7} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {5D2275B7-0745-420A-AF1C-32C563DAB5C8} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {10EB789E-C993-4BE8-BA43-C419936C7233} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {8D22063D-88DE-4F7A-A917-C81AB4ACE601} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {5BECBCEF-459F-424B-A15A-0558D291842A} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {87117AFB-4C87-40CB-889E-F1D97C504906} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {D43CC2C9-449A-4619-B5C6-CBC72BCA0512} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {75C24B75-7B8A-4FC5-9DE4-91BF6168BCC0} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {B17BAA37-27E8-4421-A18B-DDF6D146EA06} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {C6CE997A-DE6F-4669-822F-5654BA72C0B0} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {BA4E3D59-2929-4797-A5F0-7565D76F4076} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {74ECE2F5-A7FB-4363-BDD3-EDAF13F845C8} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {89E49906-6606-4126-AB3C-1605E17A1F68} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {46EF4B32-327C-4AFF-B39D-8202580847DB} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {4AFAFAF8-06FB-48D4-AFA6-B32215584E96} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {6F80DD0F-D91C-4A69-A20E-BB687036EFA8} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {975056D6-0B2D-43BA-9BF8-0E937581F873} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {324B920F-5BBA-46D8-BDC6-E1FA5EFE3733} = {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} - {210B1A21-CBC8-423D-9C69-3E63569F2C43} = {324B920F-5BBA-46D8-BDC6-E1FA5EFE3733} - {8D891D68-7859-477D-BE78-99258B8B1E86} = {324B920F-5BBA-46D8-BDC6-E1FA5EFE3733} - {3DF5C4E8-51E7-4931-B4F4-EA390AB8FCC9} = {EBD87D3A-8130-4FBB-9A47-4A81717BB915} - {0C73A439-7CD2-4105-8B70-30B896C15C72} = {3DF5C4E8-51E7-4931-B4F4-EA390AB8FCC9} - {253C20C0-1F46-410A-ACFE-2F375491E6D2} = {324B920F-5BBA-46D8-BDC6-E1FA5EFE3733} - {C386A083-4190-4567-B4E3-95D1C800A298} = {324B920F-5BBA-46D8-BDC6-E1FA5EFE3733} - {2794C2A5-C633-41E3-8B47-0659E72D8C9B} = {324B920F-5BBA-46D8-BDC6-E1FA5EFE3733} - {93B574B5-2827-4E0A-86FB-B07EF40BB39F} = {1187F469-0063-4065-9419-A1D956C80145} - {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} - {282A5684-F573-47BB-B044-10F3F710E22A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} - {CA154803-3589-47B3-B7CB-B18F94FE1EB6} = {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} - {9D7C2C19-1EE4-40BB-A1A4-27B175F1BFDD} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {3FA1F4A4-BF5A-4CE3-B76F-2147FE31AB43} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {4605A64C-B4E0-4A04-9BF2-501027375258} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {6A99C679-EA3B-4324-8D6B-89DB8C7D3DA0} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {FCEC7C9D-067F-452B-98C9-1878F7EA02EB} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {3CE22CAC-4B27-4EEC-A35E-C01219ED6E99} = {EBD87D3A-8130-4FBB-9A47-4A81717BB915} - {B65973F1-9EE0-4914-B6F2-D88F753E1D21} = {3CE22CAC-4B27-4EEC-A35E-C01219ED6E99} - {0808036D-065B-4525-BF30-CBCEA062F8E9} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {06423FAC-67E2-4B7C-B29F-39578F460C4F} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {CB6FD800-B6C5-4C2A-8920-B8A29C74AEF6} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {1DCD9600-215A-4A94-AEFD-577568D62633} = {D62B8D43-B8D9-4FC6-97E2-DC54CD765915} - {837BC537-3AEC-4F6D-9D64-9704F64D0E1E} = {D62B8D43-B8D9-4FC6-97E2-DC54CD765915} - {61422EC8-8FFB-48EA-B4B5-527E29077930} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {27F990E2-6820-4159-B54A-59C8ADED8D28} = {D62B8D43-B8D9-4FC6-97E2-DC54CD765915} - {D62B8D43-B8D9-4FC6-97E2-DC54CD765915} = {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} - {055F4AC0-46C4-4E99-89CD-0F30D4A97382} = {3B481ACC-5BB3-4189-880C-5F7A27EAEB70} - {D77E0662-8404-43C5-9C46-6289EA207A40} = {055F4AC0-46C4-4E99-89CD-0F30D4A97382} - {E4D0326C-515D-46FA-AF7E-1AC32155BD03} = {055F4AC0-46C4-4E99-89CD-0F30D4A97382} - {2300E155-2621-4FCF-BD44-B61BA5A92B82} = {055F4AC0-46C4-4E99-89CD-0F30D4A97382} - {7B4D2BEB-DE3E-4533-8CD4-7BBB30414647} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {8859CFE4-BC7F-4F29-B6B5-A9457435CC32} = {055F4AC0-46C4-4E99-89CD-0F30D4A97382} - {837ABFF5-66EE-486A-8023-8DD3EE7D7D96} = {055F4AC0-46C4-4E99-89CD-0F30D4A97382} - {90197499-CBB6-4C8C-90E6-8718CD755C04} = {055F4AC0-46C4-4E99-89CD-0F30D4A97382} - {A5B650AB-A67F-4A4C-9F81-7B5471CA1331} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {D9455AE7-2E0C-4647-9880-F5831BCEE3D8} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {8C327AA0-BBED-4F8B-A88E-1DD97B04E58F} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {B417D97C-330A-42CE-BDC6-93355B0A959A} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {38EF3EC8-9915-4216-B646-4BEE07006943} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {65FB5893-7CB6-4694-A692-7E666E347D29} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {B10E37A1-43A1-4042-BAAA-F589302958D5} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {3510E248-DC9F-4A07-8134-02E7F5CC5783} = {282A5684-F573-47BB-B044-10F3F710E22A} - {258B4E36-BF5B-484D-B10E-7D5AF868FA44} = {3510E248-DC9F-4A07-8134-02E7F5CC5783} - {067627C7-6891-453A-A219-35141733D776} = {3510E248-DC9F-4A07-8134-02E7F5CC5783} - {76D24E2C-8DB0-48B7-9FC4-02231B8B9F39} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6} - {A177B8B7-ACAD-4F75-B6D4-B72F7BC2E40A} = {3510E248-DC9F-4A07-8134-02E7F5CC5783} - {E4AB8A4F-BB59-4BDB-B915-877CE97D8113} = {DB012309-74FD-4D5A-B843-DD77BF053BF4} - {CD4E755D-D47C-45B1-AFB3-3444FF2E2E39} = {3510E248-DC9F-4A07-8134-02E7F5CC5783} - {A1C792B7-0DBF-460D-9158-A1A68A2D9C1A} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {627B88DB-BDCF-4D92-8454-EFE95F4AFB7A} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {23C5849D-4C09-4588-AE32-E31F03B7ED63} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {9FC49D82-04E5-4170-8618-682BD3350910} = {37087D1B-3693-4E96-983D-A69F210BDE53} - {D1318094-7907-4826-B5F3-CFFC741F235F} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {5AB7E368-1CC8-401D-9952-6CA6779305E7} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {EBD87D3A-8130-4FBB-9A47-4A81717BB915} = {447C8A77-E5F0-4538-8687-7383196D04EA} - {F33F751F-1260-40C0-8F76-E3D680605662} = {447C8A77-E5F0-4538-8687-7383196D04EA} - {DAE9088E-6E30-4D5D-9DF8-2188E8D386FE} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {03F51721-DA51-4BAE-9909-3FC88FAB7774} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8} - {D5733D90-8C3D-4026-85E2-41DED26C4938} = {37087D1B-3693-4E96-983D-A69F210BDE53} + {02BE03BA-3411-448C-AB61-CB36407CC49A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {B1D860BB-6EC6-4BAE-ADAA-C2AEC2FFB510} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {05271341-7A15-484C-9FD6-802A4193F4DE} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {7CC7946B-E026-4F66-8D4F-4F78F4801D43} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {2C282467-2CD5-4750-BE1F-CA8BD8ECC6EA} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {DDEC5D74-212F-41BD-974C-4B4E88E574E1} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {A1AE63E9-0CF4-4AFB-A584-65D826DEA3CB} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {3FB342CA-23B6-4795-91EF-C664527C07B7} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {8CECCEAF-F0D8-4257-96BA-EACF4763AF42} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {B31FFAE3-5DAC-4E51-BD17-F7446B741A36} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {BF9AB22C-F48D-4DDE-A894-BC28EB37166B} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {B6182BF1-9EC6-403D-A42C-D6441CF7B390} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {C761A3F7-787D-4C7E-A41C-5FAB07F6B774} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {CECE1288-B5A1-4A6B-BEE0-331861F94983} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {053F7446-0545-482E-9F29-9C96B926966C} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {D8BE64D2-BD83-40F5-9783-D7FDDF668C45} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {CE12E5C2-7B3E-4637-B6A3-274BB5C3DE16} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {D2F3594F-E2B9-4338-A022-F00C4E9A14C3} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {8343BE23-6A7B-4C58-BF0D-95188B11B180} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {27D76546-6091-4AEE-9079-1FE3991C81BC} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {DE160F1A-92FB-44BA-87E2-B8AD7A938AC7} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {CF564447-8E0B-4A07-B0D2-396E00A8E437} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {D0279C94-E9A3-4A1B-968B-D3BBF3E06FD8} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {4C2F7B03-C598-4432-A43A-B065D9D0712F} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {01A70034-D353-4BF9-821D-F2B6F7641532} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {D5E2FB37-0194-480A-B952-5FFECC1200EB} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {703BD43C-02B9-413F-854C-9CBA0C963196} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {2B48CF90-DBDB-469F-941C-5B5AECEEACE0} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {127FC2BF-DC40-4370-B845-16088328264C} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {A8C8B76D-0869-4C11-AC55-DB9DD115788E} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {6E6A7554-3488-45AB-BC0E-9BDE1F19789D} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {F79B6D80-C79B-4C13-9221-CA2345983743} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {A7A97BFD-48FA-45D1-8423-031BA30BEAA1} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {166E89F7-A505-45F2-B4CD-F345DE39030E} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {6E50143F-0982-4BCB-9D0E-FF5451AE8123} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {3622B544-1345-4230-ABC2-4902328DE971} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {BC55B87F-D2BD-428D-8F78-A95EE7BDFDFA} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {5E7381EE-54BC-4BFD-883A-8C6578C2CAD7} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {5D2275B7-0745-420A-AF1C-32C563DAB5C8} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {10EB789E-C993-4BE8-BA43-C419936C7233} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {8D22063D-88DE-4F7A-A917-C81AB4ACE601} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {5BECBCEF-459F-424B-A15A-0558D291842A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {87117AFB-4C87-40CB-889E-F1D97C504906} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {D43CC2C9-449A-4619-B5C6-CBC72BCA0512} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {75C24B75-7B8A-4FC5-9DE4-91BF6168BCC0} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {B17BAA37-27E8-4421-A18B-DDF6D146EA06} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {C6CE997A-DE6F-4669-822F-5654BA72C0B0} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {BA4E3D59-2929-4797-A5F0-7565D76F4076} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {74ECE2F5-A7FB-4363-BDD3-EDAF13F845C8} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {89E49906-6606-4126-AB3C-1605E17A1F68} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {46EF4B32-327C-4AFF-B39D-8202580847DB} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {4AFAFAF8-06FB-48D4-AFA6-B32215584E96} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {6F80DD0F-D91C-4A69-A20E-BB687036EFA8} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {975056D6-0B2D-43BA-9BF8-0E937581F873} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {CB6FD800-B6C5-4C2A-8920-B8A29C74AEF6} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {A5B650AB-A67F-4A4C-9F81-7B5471CA1331} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {D9455AE7-2E0C-4647-9880-F5831BCEE3D8} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {8C327AA0-BBED-4F8B-A88E-1DD97B04E58F} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {B417D97C-330A-42CE-BDC6-93355B0A959A} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {38EF3EC8-9915-4216-B646-4BEE07006943} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {65FB5893-7CB6-4694-A692-7E666E347D29} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {B10E37A1-43A1-4042-BAAA-F589302958D5} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {A1C792B7-0DBF-460D-9158-A1A68A2D9C1A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {627B88DB-BDCF-4D92-8454-EFE95F4AFB7A} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {23C5849D-4C09-4588-AE32-E31F03B7ED63} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {9FC49D82-04E5-4170-8618-682BD3350910} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {D1318094-7907-4826-B5F3-CFFC741F235F} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {5AB7E368-1CC8-401D-9952-6CA6779305E7} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {DAE9088E-6E30-4D5D-9DF8-2188E8D386FE} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {03F51721-DA51-4BAE-9909-3FC88FAB7774} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {D5733D90-8C3D-4026-85E2-41DED26C4938} = {447C8A77-E5F0-4538-8687-7383196D04EA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/Volo.Abp.Account.Web.nuspec b/nupkg/Volo.Abp.Account.Web.0.2.0/Volo.Abp.Account.Web.nuspec deleted file mode 100644 index 2bf0bd8c58..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/Volo.Abp.Account.Web.nuspec +++ /dev/null @@ -1,27 +0,0 @@ - - - - Volo.Abp.Account.Web - 0.2.0 - Volo.Abp.Account.Web - Volo.Abp.Account.Web - false - https://github.com/aspnetzero/abp/blob/master/LICENSE - http://abp.io/ - http://www.aspnetboilerplate.com/images/abp_nupkg.png - Package Description - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/[Content_Types].xml b/nupkg/Volo.Abp.Account.Web.0.2.0/[Content_Types].xml deleted file mode 100644 index d394e3b02f..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/[Content_Types].xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/_rels/.rels b/nupkg/Volo.Abp.Account.Web.0.2.0/_rels/.rels deleted file mode 100644 index e5d1dd8eb3..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/_rels/.rels +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/content/Pages/Account/Login.cshtml b/nupkg/Volo.Abp.Account.Web.0.2.0/content/Pages/Account/Login.cshtml deleted file mode 100644 index de098fa3f9..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/content/Pages/Account/Login.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@page -@model Volo.Abp.Account.Web.Pages.Account.LoginModel -
-
-
-
-
- - -
-
- - -
-
- -
- -
- -
- Register -
-
-
- - @if (Model.ExternalLogins.Any()) - { -
-

Use another service to log in.

-
-
- @foreach (var provider in Model.ExternalLogins) - { - - } -
-
-
- } - -
\ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/content/Pages/Account/Register.cshtml b/nupkg/Volo.Abp.Account.Web.0.2.0/content/Pages/Account/Register.cshtml deleted file mode 100644 index b072302928..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/content/Pages/Account/Register.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@page -@model Volo.Abp.Account.Web.Pages.Account.RegisterModel -
-
-
-
- - -
-
- - -
-
- - -
- -
-
-
\ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/content/Properties/launchSettings.json b/nupkg/Volo.Abp.Account.Web.0.2.0/content/Properties/launchSettings.json deleted file mode 100644 index 6ea8ca0918..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/content/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:53098/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.Account.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:53099/" - } - } -} \ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Pages/Account/Login.cshtml b/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Pages/Account/Login.cshtml deleted file mode 100644 index de098fa3f9..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Pages/Account/Login.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@page -@model Volo.Abp.Account.Web.Pages.Account.LoginModel -
-
-
-
-
- - -
-
- - -
-
- -
- -
- -
- Register -
-
-
- - @if (Model.ExternalLogins.Any()) - { -
-

Use another service to log in.

-
-
- @foreach (var provider in Model.ExternalLogins) - { - - } -
-
-
- } - -
\ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Pages/Account/Register.cshtml b/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Pages/Account/Register.cshtml deleted file mode 100644 index b072302928..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Pages/Account/Register.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@page -@model Volo.Abp.Account.Web.Pages.Account.RegisterModel -
-
-
-
- - -
-
- - -
-
- - -
- -
-
-
\ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Properties/launchSettings.json b/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Properties/launchSettings.json deleted file mode 100644 index 6ea8ca0918..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/contentFiles/any/netstandard2.0/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:53098/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.Account.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:53099/" - } - } -} \ No newline at end of file diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/lib/netstandard2.0/Volo.Abp.Account.Web.dll b/nupkg/Volo.Abp.Account.Web.0.2.0/lib/netstandard2.0/Volo.Abp.Account.Web.dll deleted file mode 100644 index 1f4ff9a1b5..0000000000 Binary files a/nupkg/Volo.Abp.Account.Web.0.2.0/lib/netstandard2.0/Volo.Abp.Account.Web.dll and /dev/null differ diff --git a/nupkg/Volo.Abp.Account.Web.0.2.0/package/services/metadata/core-properties/d0b9dbb571f046678dd82d6354463c78.psmdcp b/nupkg/Volo.Abp.Account.Web.0.2.0/package/services/metadata/core-properties/d0b9dbb571f046678dd82d6354463c78.psmdcp deleted file mode 100644 index 66e33aa45f..0000000000 --- a/nupkg/Volo.Abp.Account.Web.0.2.0/package/services/metadata/core-properties/d0b9dbb571f046678dd82d6354463c78.psmdcp +++ /dev/null @@ -1,9 +0,0 @@ - - - Volo.Abp.Account.Web - Package Description - Volo.Abp.Account.Web - 0.2.0 - - NuGet.Build.Tasks.Pack, Version=4.5.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35; - \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk.Application.Contracts.csproj b/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk.Application.Contracts.csproj deleted file mode 100644 index e8776b6775..0000000000 --- a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk.Application.Contracts.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netstandard2.0 - AbpDesk.Application.Contracts - AbpDesk.Application.Contracts - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - diff --git a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/AbpDeskApplicationContractsModule.cs b/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/AbpDeskApplicationContractsModule.cs deleted file mode 100644 index 895d6627ec..0000000000 --- a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/AbpDeskApplicationContractsModule.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Volo.Abp.Application; -using Volo.Abp.Modularity; - -namespace AbpDesk -{ - [DependsOn(typeof(AbpDddApplicationModule))] - public class AbpDeskApplicationContractsModule : AbpModule - { - - } -} diff --git a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/Dtos/GetAllTicketsInput.cs b/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/Dtos/GetAllTicketsInput.cs deleted file mode 100644 index 6407fe39b7..0000000000 --- a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/Dtos/GetAllTicketsInput.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace AbpDesk.Tickets.Dtos -{ - public class GetAllTicketsInput - { - public string Filter { get; set; } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/Dtos/TicketDto.cs b/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/Dtos/TicketDto.cs deleted file mode 100644 index 112b313e31..0000000000 --- a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/Dtos/TicketDto.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Volo.Abp.Application.Dtos; - -namespace AbpDesk.Tickets.Dtos -{ - public class TicketDto : EntityDto - { - public string Title { get; set; } - - public string Body { get; set; } - - public override string ToString() - { - return $"{base.ToString()}, Title = {Title}, Body = {Body}"; - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/ITicketAppService.cs b/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/ITicketAppService.cs deleted file mode 100644 index ddb47cfa60..0000000000 --- a/src/AbpDesk/AbpDesk.Application.Contracts/AbpDesk/Tickets/ITicketAppService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Threading.Tasks; -using AbpDesk.Tickets.Dtos; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace AbpDesk.Tickets -{ - public interface ITicketAppService : IApplicationService - { - Task> GetAll(GetAllTicketsInput input); - - ListResultDto GetAll2(GetAllTicketsInput input); - } -} diff --git a/src/AbpDesk/AbpDesk.Application.Contracts/Properties/AssemblyInfo.cs b/src/AbpDesk/AbpDesk.Application.Contracts/Properties/AssemblyInfo.cs deleted file mode 100644 index eaae4e228d..0000000000 --- a/src/AbpDesk/AbpDesk.Application.Contracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.Application.Contracts")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e45b2ba3-7917-4236-99cd-b0a25285a652")] diff --git a/src/AbpDesk/AbpDesk.Application/AbpDesk.Application.csproj b/src/AbpDesk/AbpDesk.Application/AbpDesk.Application.csproj deleted file mode 100644 index 7575fb273a..0000000000 --- a/src/AbpDesk/AbpDesk.Application/AbpDesk.Application.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netstandard2.0 - AbpDesk.Application - AbpDesk.Application - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - diff --git a/src/AbpDesk/AbpDesk.Application/AbpDesk/AbpDeskApplicationModule.cs b/src/AbpDesk/AbpDesk.Application/AbpDesk/AbpDeskApplicationModule.cs deleted file mode 100644 index eae5693f53..0000000000 --- a/src/AbpDesk/AbpDesk.Application/AbpDesk/AbpDeskApplicationModule.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; - -namespace AbpDesk -{ - [DependsOn( - typeof(AbpDeskDomainModule), - typeof(AbpDeskApplicationContractsModule), - typeof(AbpAutoMapperModule) - )] - public class AbpDeskApplicationModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - - services.Configure(options => - { - options.Configurators.Add(context => - { - context.MapperConfiguration.AddProfile(); - }); - }); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Application/AbpDesk/AbpDeskApplicationModuleAutoMapperProfile.cs b/src/AbpDesk/AbpDesk.Application/AbpDesk/AbpDeskApplicationModuleAutoMapperProfile.cs deleted file mode 100644 index acb99dee2e..0000000000 --- a/src/AbpDesk/AbpDesk.Application/AbpDesk/AbpDeskApplicationModuleAutoMapperProfile.cs +++ /dev/null @@ -1,14 +0,0 @@ -using AbpDesk.Tickets; -using AbpDesk.Tickets.Dtos; -using AutoMapper; - -namespace AbpDesk -{ - public class AbpDeskApplicationModuleAutoMapperProfile : Profile - { - public AbpDeskApplicationModuleAutoMapperProfile() - { - CreateMap(); - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Application/AbpDesk/Tickets/TicketAppService.cs b/src/AbpDesk/AbpDesk.Application/AbpDesk/Tickets/TicketAppService.cs deleted file mode 100644 index 3767772a21..0000000000 --- a/src/AbpDesk/AbpDesk.Application/AbpDesk/Tickets/TicketAppService.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using AbpDesk.Tickets.Dtos; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Linq; - -namespace AbpDesk.Tickets -{ - public class TicketAppService : ApplicationService, ITicketAppService - { - private readonly IRepository _ticketRepository; - private readonly IAsyncQueryableExecuter _asyncQueryableExecuter; - - public TicketAppService( - IRepository ticketRepository, - IAsyncQueryableExecuter asyncQueryableExecuter) - { - _ticketRepository = ticketRepository; - _asyncQueryableExecuter = asyncQueryableExecuter; - } - - //TODO: No need to virtual once we implement UOW filter for AspNet Core! - public virtual async Task> GetAll(GetAllTicketsInput input) - { - var tickets = await _asyncQueryableExecuter.ToListAsync(_ticketRepository - .WhereIf( - !input.Filter.IsNullOrWhiteSpace(), - t => t.Title.Contains(input.Filter) || t.Body.Contains(input.Filter) - ) - ); - - return new ListResultDto( - ObjectMapper.Map, List>(tickets) - ); - } - - public ListResultDto GetAll2(GetAllTicketsInput input) - { - var tickets = _ticketRepository - .WhereIf( - !input.Filter.IsNullOrWhiteSpace(), - t => t.Title.Contains(input.Filter) || t.Body.Contains(input.Filter) - ) - .ToList(); - - return new ListResultDto( - ObjectMapper.Map, List>(tickets) - ); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Application/Properties/AssemblyInfo.cs b/src/AbpDesk/AbpDesk.Application/Properties/AssemblyInfo.cs deleted file mode 100644 index d42908f9e7..0000000000 --- a/src/AbpDesk/AbpDesk.Application/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.Application")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b6e622ce-0aee-45da-81ab-c244196cb583")] diff --git a/src/AbpDesk/AbpDesk.ConsoleClient/AbpDesk.ConsoleClient.csproj b/src/AbpDesk/AbpDesk.ConsoleClient/AbpDesk.ConsoleClient.csproj deleted file mode 100644 index d6d5480e4d..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleClient/AbpDesk.ConsoleClient.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - netcoreapp2.0 - - - - - - - diff --git a/src/AbpDesk/AbpDesk.ConsoleClient/Program.cs b/src/AbpDesk/AbpDesk.ConsoleClient/Program.cs deleted file mode 100644 index a4c86aa2b3..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleClient/Program.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using IdentityModel.Client; - -namespace AbpDesk.ConsoleClient -{ - class Program - { - static void Main(string[] args) - { - RunDemo().Wait(); - Console.ReadLine(); - } - - private static async Task RunDemo() - { - // discover endpoints from metadata - var disco = await DiscoveryClient.GetAsync("http://localhost:59980"); - if (disco.IsError) - { - Console.WriteLine(disco.Error); - return; - } - - // request token - var tokenClient = new TokenClient(disco.TokenEndpoint, "client", "secret"); - var tokenResponse = await tokenClient.RequestClientCredentialsAsync("api1"); - - if (tokenResponse.IsError) - { - Console.WriteLine(tokenResponse.Error); - return; - } - - Console.WriteLine(tokenResponse.Json); - - // call api - var client = new HttpClient(); - client.SetBearerToken(tokenResponse.AccessToken); - - var response = await client.GetAsync("http://localhost:59980/identity-test"); - if (!response.IsSuccessStatusCode) - { - Console.WriteLine(response.StatusCode); - } - else - { - var content = await response.Content.ReadAsStringAsync(); - Console.WriteLine(content); - } - } - } -} diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk.ConsoleDemo.csproj b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk.ConsoleDemo.csproj deleted file mode 100644 index 131f3fda7a..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk.ConsoleDemo.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - netcoreapp2.0 - AbpDesk.ConsoleDemo - Exe - AbpDesk.ConsoleDemo - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - PreserveNewest - - - - - - - - - - - - - - - - All - - - - - - - - - diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/AbpDeskConsoleDemoModule.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/AbpDeskConsoleDemoModule.cs deleted file mode 100644 index d8f17cf721..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/AbpDeskConsoleDemoModule.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.IO; -using AbpDesk.Blogging; -using AbpDesk.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Autofac; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace AbpDesk.ConsoleDemo -{ - [DependsOn( - typeof(AbpDeskApplicationModule), - typeof(AbpDeskEntityFrameworkCoreModule), - typeof(AbpIdentityEntityFrameworkCoreModule), - typeof(AbpDeskMongoBlogModule), - typeof(AbpAutofacModule))] - public class AbpDeskConsoleDemoModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - var configuration = BuildConfiguration(Directory.GetCurrentDirectory()); - - AbpDeskDbConfigurer.Configure(services, configuration); - - services.AddAssemblyOf(); - } - - private static IConfigurationRoot BuildConfiguration(string basePath) - { - var builder = new ConfigurationBuilder() - .SetBasePath(basePath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); - - return builder.Build(); - } - } -} diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs deleted file mode 100644 index a7be728c40..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using AbpDesk.Blogging; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Guids; -using Volo.Abp.Uow; -using Volo.Abp.DependencyInjection; - -namespace AbpDesk.ConsoleDemo -{ - public class BlogPostLister : ITransientDependency - { - private readonly IRepository _blogPostRepository; - private readonly IGuidGenerator _guidGenerator; - - public BlogPostLister( - IRepository blogPostRepository, - IGuidGenerator guidGenerator) - { - _blogPostRepository = blogPostRepository; - _guidGenerator = guidGenerator; - } - - [UnitOfWork] - public virtual void List() - { - Console.WriteLine(); - Console.WriteLine("List of blog posts:"); - - //var blog = _blogPostRepository.FirstOrDefault(b => b.Title.StartsWith("Hello World 3!")); - //blog.SetTitle(blog.Title + "'"); - //blog.Comments.Add(new BlogPostComment("@john", "good post! " + DateTime.Now.ToString(CultureInfo.InvariantCulture), star: (byte)RandomHelper.GetRandom(1, 6))); - //_blogPostRepository.Update(blog); - - //_blogPostRepository.Insert(new BlogPost(_guidGenerator.Create(), "Hello World 1!", DateTime.Now.ToString(CultureInfo.InvariantCulture))); - - foreach (var blogPost in _blogPostRepository) - { - Console.WriteLine("# " + blogPost); - - foreach (var comment in blogPost.Comments) - { - Console.WriteLine(" - " + comment); - } - } - } - } -} diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/Program.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/Program.cs deleted file mode 100644 index c5be1cd0a7..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/Program.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.IO; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.Modularity.PlugIns; - -namespace AbpDesk.ConsoleDemo -{ - public class Program - { - public static void Main(string[] args) - { - try - { - RunDemo(); - } - catch (Exception ex) - { - Console.WriteLine("ERROR: " + ex.Message); - Console.ReadLine(); - } - } - - private static void RunDemo() - { - using (var application = AbpApplicationFactory.Create(options => - { - options.UseAutofac(); - AddPlugIns(options); - })) - { - application.Initialize(); - - RunListers(application); - - Console.WriteLine("Press ENTER to exit..."); - Console.ReadLine(); - - application.Shutdown(); - } - } - - private static void RunListers(IAbpApplication application) - { - application - .ServiceProvider - .GetRequiredService() - .List(); - - application - .ServiceProvider - .GetRequiredService() - .List(); - - application - .ServiceProvider - .GetRequiredService() - .List(); - } - - private static void AddPlugIns(AbpApplicationCreationOptions options) - { - options.PlugInSources.Add( - new FolderPlugInSource( - Path.Combine( - Directory.GetCurrentDirectory(), - @"..\AbpDesk.SamplePlugInModule\bin\Debug\netstandard1.6\" - ) - ) - { - Filter = filePath => filePath.EndsWith("AbpDesk.SamplePlugInModule.dll") - } - ); - } - } -} diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/TicketLister.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/TicketLister.cs deleted file mode 100644 index ab581b337a..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/TicketLister.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using AbpDesk.Tickets; -using AbpDesk.Tickets.Dtos; -using Volo.Abp.Threading; -using Volo.Abp.DependencyInjection; - -namespace AbpDesk.ConsoleDemo -{ - public class TicketLister : ITransientDependency - { - private readonly ITicketAppService _ticketAppService; - - public TicketLister(ITicketAppService ticketAppService) - { - _ticketAppService = ticketAppService; - } - - public void List() - { - Console.WriteLine(); - Console.WriteLine("List of tickets:"); - - var result = AsyncHelper.RunSync(() => _ticketAppService.GetAll(new GetAllTicketsInput())); - - foreach (var ticket in result.Items) - { - Console.WriteLine(ticket); - } - } - } - - //Uses TicketAppService instead of ITicketAppService. - public class TicketLister2 : ITransientDependency - { - private readonly TicketAppService _ticketAppService; - - public TicketLister2(TicketAppService ticketAppService) - { - _ticketAppService = ticketAppService; - } - - public void List() - { - Console.WriteLine(); - Console.WriteLine("List of tickets:"); - - var result = AsyncHelper.RunSync(() => _ticketAppService.GetAll(new GetAllTicketsInput())); - - foreach (var ticket in result.Items) - { - Console.WriteLine(ticket); - } - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs deleted file mode 100644 index 2aa8f30245..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Linq; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Identity; -using Volo.Abp.Threading; -using Volo.Abp.Uow; - -namespace AbpDesk.ConsoleDemo -{ - public class UserLister : ITransientDependency - { - private readonly IdentityUserManager _userManager; - private readonly IRepository _userRepository; - - public UserLister( - IdentityUserManager userManager, - IRepository userRepository) - { - _userManager = userManager; - _userRepository = userRepository; - } - - [UnitOfWork] - public virtual void List() - { - Console.WriteLine(); - Console.WriteLine("List of users:"); - - foreach (var user in _userRepository.ToList()) - { - Console.WriteLine("# " + user); - - foreach (var roleName in AsyncHelper.RunSync(() => _userManager.GetRolesAsync(user))) - { - Console.WriteLine(" - " + roleName); - } - } - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/Properties/AssemblyInfo.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/Properties/AssemblyInfo.cs deleted file mode 100644 index 94d91d5856..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.ConsoleDemo")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1a1575d7-e57e-4a40-8113-fd01bb1753d5")] diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/appsettings.json b/src/AbpDesk/AbpDesk.ConsoleDemo/appsettings.json deleted file mode 100644 index 9f2ec0892b..0000000000 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/appsettings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=localhost;Database=AbpDesk;Trusted_Connection=True;", - "AbpDeskMongoBlog": "mongodb://127.0.0.1:27017|AbpDeskBlog" - }, - //Example tenant configuration, not used! - "Tenants": [ - { - "Id": "2D8BF07D-50F4-4A70-805E-C7618F008043", - "Name": "Acme", - "ConnectionStrings": { - "Default": "...", - "AbpDeskMongoBlog": "..." - } - }, - { - "Id": "33A01BA1-4106-41DA-AF34-28028FB9BD1D", - "Name": "Vlsft", - "ConnectionStrings": { - "Default": "...", - "AbpDeskMongoBlog": "..." - } - } - ] -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Domain/AbpDesk.Domain.csproj b/src/AbpDesk/AbpDesk.Domain/AbpDesk.Domain.csproj deleted file mode 100644 index a9a72fb2ea..0000000000 --- a/src/AbpDesk/AbpDesk.Domain/AbpDesk.Domain.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - netstandard2.0 - AbpDesk.Domain - AbpDesk.Domain - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - diff --git a/src/AbpDesk/AbpDesk.Domain/AbpDesk/AbpDeskDomainModule.cs b/src/AbpDesk/AbpDesk.Domain/AbpDesk/AbpDeskDomainModule.cs deleted file mode 100644 index fa6ac907b4..0000000000 --- a/src/AbpDesk/AbpDesk.Domain/AbpDesk/AbpDeskDomainModule.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Domain; -using Volo.Abp.Modularity; - -namespace AbpDesk -{ - [DependsOn(typeof(AbpDddDomainModule))] - public class AbpDeskDomainModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Domain/AbpDesk/Tickets/Ticket.cs b/src/AbpDesk/AbpDesk.Domain/AbpDesk/Tickets/Ticket.cs deleted file mode 100644 index 63c4bf0995..0000000000 --- a/src/AbpDesk/AbpDesk.Domain/AbpDesk/Tickets/Ticket.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp; -using Volo.Abp.Domain.Entities; - -namespace AbpDesk.Tickets -{ - public class Ticket : AggregateRoot, IHasConcurrencyStamp - { - public const int MaxTitleLength = 256; - - public const int MaxBodyLength = 64 * 1024; //64K - - [NotNull] - public string Title { get; protected set; } - - [CanBeNull] - public string Body { get; protected set; } - - public string ConcurrencyStamp { get; set; } - - protected Ticket() - { - - } - - public Ticket([NotNull] string title, [CanBeNull] string body = null) - { - Check.NotNull(title, nameof(title)); - - Title = title; - Body = body; - ConcurrencyStamp = Guid.NewGuid().ToString(); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Domain/Properties/AssemblyInfo.cs b/src/AbpDesk/AbpDesk.Domain/Properties/AssemblyInfo.cs deleted file mode 100644 index 1baa6ae248..0000000000 --- a/src/AbpDesk/AbpDesk.Domain/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.Domain")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2dba20a3-8b1c-49f0-90f6-eb09db78b1b8")] diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk.EntityFrameworkCore.csproj b/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk.EntityFrameworkCore.csproj deleted file mode 100644 index 7447d9e8fd..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk.EntityFrameworkCore.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - netstandard2.0 - AbpDesk.EntityFrameworkCore - AbpDesk.EntityFrameworkCore - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - - All - - - - - - - - diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbConfigurer.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbConfigurer.cs deleted file mode 100644 index ec24dc1ecf..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbConfigurer.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace AbpDesk.EntityFrameworkCore -{ - public static class AbpDeskDbConfigurer - { - public static void Configure(IServiceCollection services, IConfigurationRoot configuration) - { - //Configure DbConnectionOptions by configuration file (appsettings.json) - services.Configure(configuration); //TODO: Move to the application. No proper to be in EF Core package. - - services.Configure(options => - { - //Configures all dbcontextes to use Sql Server with calculated connection string - options.Configure(context => - { - //TODO: Create an extension method to AbpDbContextConfigurationContext to use SqlServer in single line call! Example: - /* context.UseSqlServer(opional action to configure sqlserver) - * This internally makes the if below! - */ - if (context.ExistingConnection != null) - { - context.DbContextOptions.UseSqlServer(context.ExistingConnection); - } - else - { - context.DbContextOptions.UseSqlServer(context.ConnectionString); - } - }); - }); - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbContext.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbContext.cs deleted file mode 100644 index 6468a2a7ab..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDbContext.cs +++ /dev/null @@ -1,46 +0,0 @@ -using AbpDesk.Tickets; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.MultiTenancy; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; -using Volo.Abp.Permissions; -using Volo.Abp.Permissions.EntityFrameworkCore; - -namespace AbpDesk.EntityFrameworkCore -{ - [ConnectionStringName(ConnectionStrings.DefaultConnectionStringName)] //Explicitly declares this module always uses the default connection string - public class AbpDeskDbContext : AbpDbContext, IMultiTenancyDbContext, IAbpPermissionsDbContext - { - public DbSet Tickets { get; set; } - - public DbSet Tenants { get; set; } - - public DbSet TenantConnectionStrings { get; set; } - - public DbSet PermissionGrants { get; set; } - - public AbpDeskDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.ConfigureMultiTenancy(); - modelBuilder.ConfigureAbpPermissions(); - - //Use different classes to map each entity type, as a better practice? - modelBuilder.Entity(b => - { - b.ToTable("DskTickets"); - - b.Property(t => t.Title).HasMaxLength(Ticket.MaxTitleLength).IsRequired(); - b.Property(t => t.Body).HasMaxLength(Ticket.MaxBodyLength); - }); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDefaultDbContextFactory.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDefaultDbContextFactory.cs deleted file mode 100644 index 396e17a3d7..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskDefaultDbContextFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace AbpDesk.EntityFrameworkCore -{ - /* This class is needed for EF Core command line tooling */ - - public class AbpDeskDefaultDbContextFactory : IDesignTimeDbContextFactory - { - public AbpDeskDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=AbpDesk;Trusted_Connection=True;"); - return new AbpDeskDbContext(builder.Options); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskEntityFrameworkCoreModule.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskEntityFrameworkCoreModule.cs deleted file mode 100644 index 72961cec0d..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/AbpDesk/EntityFrameworkCore/AbpDeskEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; -using Volo.Abp.Permissions.EntityFrameworkCore; - -namespace AbpDesk.EntityFrameworkCore -{ - [DependsOn( - typeof(AbpDeskDomainModule), - typeof(AbpEntityFrameworkCoreModule), - typeof(AbpMultiTenancyEntityFrameworkCoreModule), - typeof(AbpPermissionsEntityFrameworkCoreModule) - )] - public class AbpDeskEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); - options.ReplaceDbContext(); - options.ReplaceDbContext(); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20170123122207_AbpDesk_Initial.Designer.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20170123122207_AbpDesk_Initial.Designer.cs deleted file mode 100644 index 908a2dec30..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20170123122207_AbpDesk_Initial.Designer.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using AbpDesk.EntityFrameworkCore; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(AbpDeskDbContext))] - [Migration("20170123122207_AbpDesk_Initial")] - partial class AbpDesk_Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Body") - .HasMaxLength(65536); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.ToTable("DskTickets"); - }); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20170123122207_AbpDesk_Initial.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20170123122207_AbpDesk_Initial.cs deleted file mode 100644 index 3beb34c224..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20170123122207_AbpDesk_Initial.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Metadata; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - public partial class AbpDesk_Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "DskTickets", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - Body = table.Column(maxLength: 65536, nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - Title = table.Column(maxLength: 256, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DskTickets", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "DskTickets"); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180105184326_MultiTenancyModuleAdded.Designer.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180105184326_MultiTenancyModuleAdded.Designer.cs deleted file mode 100644 index 087141c5f3..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180105184326_MultiTenancyModuleAdded.Designer.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -using AbpDesk.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(AbpDeskDbContext))] - [Migration("20180105184326_MultiTenancyModuleAdded")] - partial class MultiTenancyModuleAdded - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Body") - .HasMaxLength(65536); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.ToTable("DskTickets"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("MtTenants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("MtTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.MultiTenancy.Tenant") - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180105184326_MultiTenancyModuleAdded.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180105184326_MultiTenancyModuleAdded.cs deleted file mode 100644 index 100f3a0cfb..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180105184326_MultiTenancyModuleAdded.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - public partial class MultiTenancyModuleAdded : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "MtTenants", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MtTenants", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MtTenantConnectionStrings", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: false), - Value = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MtTenantConnectionStrings", x => x.Id); - table.ForeignKey( - name: "FK_MtTenantConnectionStrings_MtTenants_TenantId", - column: x => x.TenantId, - principalTable: "MtTenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_MtTenantConnectionStrings_TenantId", - table: "MtTenantConnectionStrings", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_MtTenants_Name", - table: "MtTenants", - column: "Name"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MtTenantConnectionStrings"); - - migrationBuilder.DropTable( - name: "MtTenants"); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180215073249_Added_PermissionGrant_Entity.Designer.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180215073249_Added_PermissionGrant_Entity.Designer.cs deleted file mode 100644 index 11f8167b8b..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180215073249_Added_PermissionGrant_Entity.Designer.cs +++ /dev/null @@ -1,111 +0,0 @@ -// -using AbpDesk.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(AbpDeskDbContext))] - [Migration("20180215073249_Added_PermissionGrant_Entity")] - partial class Added_PermissionGrant_Entity - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Body") - .HasMaxLength(65536); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.ToTable("DskTickets"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("MtTenants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.Property("TenantId"); - - b.Property("Name") - .HasMaxLength(128); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("MtTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.MultiTenancy.Tenant") - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180215073249_Added_PermissionGrant_Entity.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180215073249_Added_PermissionGrant_Entity.cs deleted file mode 100644 index aac6ef438a..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180215073249_Added_PermissionGrant_Entity.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - public partial class Added_PermissionGrant_Entity : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_MtTenants_Name", - table: "MtTenants"); - - migrationBuilder.DropPrimaryKey( - name: "PK_MtTenantConnectionStrings", - table: "MtTenantConnectionStrings"); - - migrationBuilder.DropIndex( - name: "IX_MtTenantConnectionStrings_TenantId", - table: "MtTenantConnectionStrings"); - - migrationBuilder.DropColumn( - name: "Id", - table: "MtTenantConnectionStrings"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "MtTenantConnectionStrings", - maxLength: 128, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 256); - - migrationBuilder.AddPrimaryKey( - name: "PK_MtTenantConnectionStrings", - table: "MtTenantConnectionStrings", - columns: new[] { "TenantId", "Name" }); - - migrationBuilder.CreateTable( - name: "AbpPermissionGrants", - columns: table => new - { - Id = table.Column(nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - ProviderKey = table.Column(maxLength: 64, nullable: false), - ProviderName = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_MtTenants_Name", - table: "MtTenants", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", - table: "AbpPermissionGrants", - columns: new[] { "Name", "ProviderName", "ProviderKey" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AbpPermissionGrants"); - - migrationBuilder.DropIndex( - name: "IX_MtTenants_Name", - table: "MtTenants"); - - migrationBuilder.DropPrimaryKey( - name: "PK_MtTenantConnectionStrings", - table: "MtTenantConnectionStrings"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "MtTenantConnectionStrings", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 128); - - migrationBuilder.AddColumn( - name: "Id", - table: "MtTenantConnectionStrings", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddPrimaryKey( - name: "PK_MtTenantConnectionStrings", - table: "MtTenantConnectionStrings", - column: "Id"); - - migrationBuilder.CreateIndex( - name: "IX_MtTenants_Name", - table: "MtTenants", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_MtTenantConnectionStrings_TenantId", - table: "MtTenantConnectionStrings", - column: "TenantId"); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180218143334_Made_Permission_Entity_MultiTenant.Designer.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180218143334_Made_Permission_Entity_MultiTenant.Designer.cs deleted file mode 100644 index 142e1c79d5..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180218143334_Made_Permission_Entity_MultiTenant.Designer.cs +++ /dev/null @@ -1,113 +0,0 @@ -// -using AbpDesk.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(AbpDeskDbContext))] - [Migration("20180218143334_Made_Permission_Entity_MultiTenant")] - partial class Made_Permission_Entity_MultiTenant - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Body") - .HasMaxLength(65536); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.ToTable("DskTickets"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("MtTenants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.Property("TenantId"); - - b.Property("Name") - .HasMaxLength(128); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("MtTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.MultiTenancy.Tenant") - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180218143334_Made_Permission_Entity_MultiTenant.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180218143334_Made_Permission_Entity_MultiTenant.cs deleted file mode 100644 index f93554cc12..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/20180218143334_Made_Permission_Entity_MultiTenant.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - public partial class Made_Permission_Entity_MultiTenant : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "AbpPermissionGrants", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "TenantId", - table: "AbpPermissionGrants"); - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/AbpDeskDbContextModelSnapshot.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/AbpDeskDbContextModelSnapshot.cs deleted file mode 100644 index 26466a312d..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Migrations/AbpDeskDbContextModelSnapshot.cs +++ /dev/null @@ -1,112 +0,0 @@ -// -using AbpDesk.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace AbpDesk.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(AbpDeskDbContext))] - partial class AbpDeskDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Body") - .HasMaxLength(65536); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Title") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.ToTable("DskTickets"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("MtTenants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.Property("TenantId"); - - b.Property("Name") - .HasMaxLength(128); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("MtTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.MultiTenancy.Tenant") - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Properties/AssemblyInfo.cs b/src/AbpDesk/AbpDesk.EntityFrameworkCore/Properties/AssemblyInfo.cs deleted file mode 100644 index f5a4f43c71..0000000000 --- a/src/AbpDesk/AbpDesk.EntityFrameworkCore/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.EntityFrameworkCore")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("35624e7c-6501-4b42-9aa7-70555666a8b3")] diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk.MongoBlog.csproj b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk.MongoBlog.csproj deleted file mode 100644 index c64df8bb26..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk.MongoBlog.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - netstandard2.0 - AbpDesk.MongoBlog - AbpDesk.MongoBlog - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs deleted file mode 100644 index 7636bb19b4..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Linq; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Volo.Abp; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Guids; -using Volo.Abp.Modularity; -using Volo.Abp.MongoDB; -using Volo.Abp.Uow; -using Volo.Abp.VirtualFileSystem; - -namespace AbpDesk.Blogging -{ - //TODO: Make this a plugin - [DependsOn(typeof(AbpMongoDbModule), typeof(AbpAspNetCoreMvcModule))] - public class AbpDeskMongoBlogModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddMongoDbContext(options => - { - options.AddDefaultRepositories(); - }); - - services.Configure(options => - { - options.FileSets.AddEmbedded(); //TODO: Test empty base namespace! - }); - - services.AddAssemblyOf(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - CreateSeedData(context); - } - - private static void CreateSeedData(ApplicationInitializationContext context) - { - using (var scope = context.ServiceProvider.CreateScope()) - { - var logger = context.ServiceProvider.GetRequiredService>(); - - logger.LogInformation("Running seed data for mongo blog module..."); - - using (var uow = scope.ServiceProvider.GetRequiredService().Begin()) - { - var blogPostRepository = scope.ServiceProvider.GetRequiredService>(); - if (blogPostRepository.Any()) - { - logger.LogInformation($"No need to seed database since there are already {blogPostRepository.Count()} blog posts!"); - return; - } - - var guidGenerator = scope.ServiceProvider.GetRequiredService(); - - blogPostRepository.Insert( - new BlogPost( - guidGenerator.Create(), - "Demo blog post title one!", - "Sample body text for the first blog post" - ) - ); - - blogPostRepository.Insert( - new BlogPost( - guidGenerator.Create(), - "Demo blog post title second!", - "Sample body text for the second blog post" - ) - { - Comments = - { - new BlogPostComment("John", "Hi, this is a good post! Thank you :)"), - new BlogPostComment("Adam", "You are adam! :s") - } - } - ); - - logger.LogInformation("Inserted two blog post. completing the unit of work..."); - - uow.Complete(); - - logger.LogInformation("Completed!"); - } - } - } - } -} diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoDbContext.cs b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoDbContext.cs deleted file mode 100644 index 6b270b796e..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoDbContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using Volo.Abp.Data; -using Volo.Abp.MongoDB; - -namespace AbpDesk.Blogging -{ - [ConnectionStringName(ConnectionStringName)] - public class AbpDeskMongoDbContext : AbpMongoDbContext - { - public const string ConnectionStringName = "AbpDeskMongoBlog"; - - private static readonly MongoEntityMapping[] EntityCollectionTypes = { - new MongoEntityMapping(typeof(BlogPost), "BlogPosts") - }; - - public override IReadOnlyList GetMappings() - { - return EntityCollectionTypes; - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPost.cs b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPost.cs deleted file mode 100644 index 004b14843c..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPost.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; -using Volo.Abp; -using Volo.Abp.Domain.Entities; - -namespace AbpDesk.Blogging -{ - public class BlogPost : AggregateRoot - { - public virtual string Title { get; protected set; } - - public virtual string Body { get; protected set; } - - public virtual ICollection Comments { get; protected set; } - - protected BlogPost() - { - - } - - public BlogPost(Guid id, [NotNull] string title, [NotNull] string body) - { - Check.NotNull(title, nameof(title)); - Check.NotNull(body, nameof(body)); - - Id = id; - Title = title; - Body = body; - - Comments = new List(); - } - - public void SetTitle([NotNull] string title) - { - Check.NotNull(title, nameof(title)); - - Title = title; - } - - public override string ToString() - { - return $"{base.ToString()}, Title = {Title}, Body = {Body.TruncateWithPostfix(32)}"; - } - } -} diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPostComment.cs b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPostComment.cs deleted file mode 100644 index b352faa92a..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/BlogPostComment.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace AbpDesk.Blogging -{ - public class BlogPostComment : Entity - { - [NotNull] - public virtual string Name { get; protected set; } - - [CanBeNull] - public virtual string Email { get; protected set; } - - public virtual byte? Star { get; protected set; } - - [NotNull] - public virtual string Message { get; protected set; } - - protected BlogPostComment() - { - - } - - public BlogPostComment(string name, string message, string email = null, byte? star = null) - { - Name = name; - Email = email; - Message = message; - Star = star; - } - - public override string ToString() - { - return $"{base.ToString()}, " + - $"Name = {Name}, " + - $"Email = {Email}, " + - $"Message = {Message}, " + - $"Star = {(Star.HasValue ? Star.Value.ToString() : "none")}"; - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs b/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs deleted file mode 100644 index dcd44efa0f..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Linq; -using AbpDesk.Blogging; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Domain.Repositories; - -namespace Areas.Blog.Controllers -{ - [Area("Blog")] - public class PostsController : AbpController - { - private readonly IRepository _blogPostRepository; - - public PostsController(IRepository blogPostRepository) - { - _blogPostRepository = blogPostRepository; - } - - public ActionResult Index() - { - var posts = _blogPostRepository.ToList(); //TODO: async..? - return View(posts); - } - } -} diff --git a/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Views/Posts/Index.cshtml b/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Views/Posts/Index.cshtml deleted file mode 100644 index 2933a5458c..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Views/Posts/Index.cshtml +++ /dev/null @@ -1,29 +0,0 @@ -@model List - -

Blog Posts

- -@section styles { - -} - -
    - @foreach (var post in Model) - { -

    @post.Title

    -

    @post.Body

    - if (!post.Comments.Any()) - { -

    No comment yet!

    - } - else - { -
    -
    Comments
    - @foreach (var comment in post.Comments) - { -

    @comment.Name: @comment.Message

    - } -
    - } - } -
\ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.MongoBlog/Properties/AssemblyInfo.cs b/src/AbpDesk/AbpDesk.MongoBlog/Properties/AssemblyInfo.cs deleted file mode 100644 index 4eebd095c5..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.MongoBlog")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("63244dc7-34be-44e1-bf6f-f2672e59af36")] diff --git a/src/AbpDesk/AbpDesk.MongoBlog/Properties/launchSettings.json b/src/AbpDesk/AbpDesk.MongoBlog/Properties/launchSettings.json deleted file mode 100644 index d622e3fc0f..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/Properties/launchSettings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:54356/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.MongoBlog/compilerconfig.json b/src/AbpDesk/AbpDesk.MongoBlog/compilerconfig.json deleted file mode 100644 index 4e91f1a415..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/compilerconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "outputFile": "wwwroot/modules/mongoblog/views/posts/index.css", - "inputFile": "wwwroot/modules/mongoblog/views/posts/index.scss" - } -] \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.MongoBlog/compilerconfig.json.defaults b/src/AbpDesk/AbpDesk.MongoBlog/compilerconfig.json.defaults deleted file mode 100644 index c75eb7d519..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/compilerconfig.json.defaults +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilers": { - "less": { - "autoPrefix": "", - "cssComb": "none", - "ieCompat": true, - "strictMath": false, - "strictUnits": false, - "relativeUrls": true, - "rootPath": "", - "sourceMapRoot": "", - "sourceMapBasePath": "", - "sourceMap": false - }, - "sass": { - "includePath": "", - "indentType": "space", - "indentWidth": 2, - "outputStyle": "nested", - "Precision": 5, - "relativeUrls": true, - "sourceMapRoot": "", - "sourceMap": false - }, - "stylus": { - "sourceMap": false - }, - "babel": { - "sourceMap": false - }, - "coffeescript": { - "bare": false, - "runtimeMode": "node", - "sourceMap": false - } - }, - "minifiers": { - "css": { - "enabled": true, - "termSemicolons": true, - "gzip": false - }, - "javascript": { - "enabled": true, - "termSemicolons": true, - "gzip": false - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.css b/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.css deleted file mode 100644 index 4a69c5b5c7..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.css +++ /dev/null @@ -1,7 +0,0 @@ -.blog-post-list .post-comments { - margin-left: 10px; - border-left: 5px solid #ddd; - padding-left: 10px; } - .blog-post-list .post-comments .post-comment { - margin-bottom: 0.2em; } - diff --git a/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.min.css b/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.min.css deleted file mode 100644 index dcfa6d93d9..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.min.css +++ /dev/null @@ -1 +0,0 @@ -.blog-post-list .post-comments{margin-left:10px;border-left:5px solid #ddd;padding-left:10px;}.blog-post-list .post-comments .post-comment{margin-bottom:.2em;} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.scss b/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.scss deleted file mode 100644 index 6f9a3df878..0000000000 --- a/src/AbpDesk/AbpDesk.MongoBlog/wwwroot/modules/mongoblog/views/posts/index.scss +++ /dev/null @@ -1,11 +0,0 @@ -.blog-post-list { - .post-comments { - margin-left: 10px; - border-left: 5px solid #ddd; - padding-left: 10px; - - .post-comment { - margin-bottom: 0.2em; - } - } -} diff --git a/src/AbpDesk/AbpDesk.SamplePlugInModule/AbpDesk.SamplePlugInModule.csproj b/src/AbpDesk/AbpDesk.SamplePlugInModule/AbpDesk.SamplePlugInModule.csproj deleted file mode 100644 index b00d332f34..0000000000 --- a/src/AbpDesk/AbpDesk.SamplePlugInModule/AbpDesk.SamplePlugInModule.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netstandard2.0 - AbpDesk.SamplePlugInModule - AbpDesk.SamplePlugInModule - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - AbpDesk.SamplePlugInModule - - - - - - - diff --git a/src/AbpDesk/AbpDesk.SamplePlugInModule/AbpDeskSamplePlugInModule.cs b/src/AbpDesk/AbpDesk.SamplePlugInModule/AbpDeskSamplePlugInModule.cs deleted file mode 100644 index d87e62144a..0000000000 --- a/src/AbpDesk/AbpDesk.SamplePlugInModule/AbpDeskSamplePlugInModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace AbpDesk.SamplePlugInModule -{ - public class AbpDeskSamplePlugInModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - - } - } -} diff --git a/src/AbpDesk/AbpDesk.SamplePlugInModule/Properties/AssemblyInfo.cs b/src/AbpDesk/AbpDesk.SamplePlugInModule/Properties/AssemblyInfo.cs deleted file mode 100644 index f06adf1cdf..0000000000 --- a/src/AbpDesk/AbpDesk.SamplePlugInModule/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.SamplePlugInModule")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("adfaf85b-b785-41ea-b57d-422775989fa6")] diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDesk.Web.Mvc.csproj b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDesk.Web.Mvc.csproj deleted file mode 100644 index 7920421550..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDesk.Web.Mvc.csproj +++ /dev/null @@ -1,72 +0,0 @@ - - - - netcoreapp2.0 - true - AbpDesk.Web.Mvc - Exe - AbpDesk.Web.Mvc - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - AbpDesk.Web.Mvc - true - true - true - - - - - - - - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - All - - - - - - - - - - diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs deleted file mode 100644 index 1b76be3d79..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using AbpDesk.EntityFrameworkCore; -using AbpDesk.Web.Mvc.Navigation; -using AbpDesk.Web.Mvc.Permissions; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Localization; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.Account.Web; -using Volo.Abp.AspNetCore.EmbeddedFiles; -using Volo.Abp.AspNetCore.Modularity; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.Bundling; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Autofac; -using Volo.Abp.Identity; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Identity.Web; -using Volo.Abp.IdentityServer; -using Volo.Abp.IdentityServer.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.Ui.Navigation; -using Volo.Abp.VirtualFileSystem; -using Volo.Abp.IdentityServer.Jwt; -using Volo.Abp.MultiTenancy; -using Volo.Abp.MultiTenancy.Web; -using Volo.Abp.Permissions; -using Volo.Abp.Permissions.Web; - -namespace AbpDesk.Web.Mvc -{ - [DependsOn( - typeof(AbpAspNetCoreEmbeddedFilesModule), - typeof(AbpAspNetCoreMvcUiBootstrapModule), - typeof(AbpDeskApplicationModule), - typeof(AbpDeskEntityFrameworkCoreModule), - typeof(AbpIdentityApplicationModule), - typeof(AbpIdentityEntityFrameworkCoreModule), - typeof(AbpIdentityWebModule), - typeof(AbpAccountWebModule), - typeof(AbpAutofacModule), - typeof(AbpIdentityServerDomainModule), - typeof(AbpIdentityServerEntityFrameworkCoreModule), - typeof(AbpAspNetCoreMultiTenancyModule), - typeof(AbpMultiTenancyWebModule), - typeof(AbpMultiTenancyApplicationModule), - typeof(AbpPermissionsApplicationModule) - )] - public class AbpDeskWebMvcModule : AbpModule //TODO: Rename to AbpDeskWebModule, change default namespace to AbpDesk.Web - { - public override void PreConfigureServices(IServiceCollection services) - { - services.PreConfigure(builder => - { - builder - .AddRazorPagesOptions(options => - { - options.Conventions.AuthorizeFolder("/App"); - }); - }); - } - - public override void ConfigureServices(IServiceCollection services) - { - var hostingEnvironment = services.GetSingletonInstance(); - var configuration = BuildConfiguration(hostingEnvironment); - - AbpDeskDbConfigurer.Configure(services, configuration); - - services.Configure(options => - { - options.MenuContributors.Add(new MainMenuContributor()); - }); - - services.Configure(options => - { - options.DefinitionProviders.Add(); - }); - - //services.Configure(configuration); //Needed when we use Volo.Abp.Identity.HttpApi.Client - - var authentication = services.AddAuthentication(); - - services.AddAuthorization(options => - { - options.AddPolicy("RequirePhoneNumber", policy => - { - policy.RequireClaim("phone_number"); - }); - }); - - authentication.AddIdentityServerAuthentication("Bearer", options => - { - options.Authority = "http://localhost:59980"; - options.RequireHttpsMetadata = false; - - options.ApiName = "api1"; - }); - - ////Adding Facebook authentication (TODO: Move to Account module as much as possible) - //if (bool.Parse(configuration["Authentication:Facebook:IsEnabled"])) - //{ - // authentication.AddFacebook(options => - // { - // options.AppId = configuration["Authentication:Facebook:AppId"]; - // options.AppSecret = configuration["Authentication:Facebook:AppSecret"]; - - // options.Scope.Add("email"); - // options.Scope.Add("public_profile"); - // }); - //} - - services.AddAssemblyOf(); - - services.Configure(options => - { - //TODO: To the framework! - options.ScriptBundles.Add("GlobalScripts", new[] - { - "/Abp/ApplicationConfigurationScript?_v=" + DateTime.Now.Ticks, - "/Abp/ServiceProxyScript?_v=" + DateTime.Now.Ticks - }); - }); - - services.Configure(options => - { - options.ConventionalControllers.Create(typeof(AbpDeskApplicationModule).Assembly); - }); - - if (hostingEnvironment.IsDevelopment()) - { - services.Configure(options => - { - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.AspNetCore.Mvc.UI")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Account.Web")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Identity.Web")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.MultiTenancy.Web")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Permissions.Web")); - }); - } - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - var app = context.GetApplicationBuilder(); - - if (context.GetEnvironment().IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseStaticFiles(); - app.UseVirtualFiles(); - - app.UseMultiTenancy(); - - app.UseIdentityServer(); - - app.UseAuthentication(); - - app.UseJwtTokenMiddleware("Bearer"); //TODO: It would be better without that, however it requires to use Bearer as default auth schema. - - var cultures = new List - { - new CultureInfo("en"), - new CultureInfo("tr") - }; - - //TODO: Should we add this to the framework, or left it to the application? - //TODO: Should we add this as the first middleware (to support localization in all middlewares too)? - app.UseRequestLocalization(new RequestLocalizationOptions - { - DefaultRequestCulture = new RequestCulture("en"), - SupportedCultures = cultures, - SupportedUICultures = cultures - }); - - app.UseMvc(routes => - { - routes.MapRoute( - name: "defaultWithArea", - template: "{area}/{controller=Home}/{action=Index}/{id?}"); - - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - - private static IConfigurationRoot BuildConfiguration(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - - return builder.Build(); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml deleted file mode 100644 index 38710b38a2..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewImports.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap -@addTagHelper *, AbpDesk.Web.Mvc \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml deleted file mode 100644 index f4d75cd962..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Areas/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "~/Views/Shared/_AppLayout.cshtml"; -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/AuthTestController.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/AuthTestController.cs deleted file mode 100644 index 2a74a627cb..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/AuthTestController.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Linq; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; - -namespace AbpDesk.Web.Mvc.Controllers -{ - public class AuthTestController : AbpController - { - private readonly IAuthorizationService _authorizationService; - - public AuthTestController(IAuthorizationService authorizationService) - { - _authorizationService = authorizationService; - } - - [Authorize(Policy = "RequirePhoneNumber")] - public ContentResult PhoneNumberIsRequired() - { - return Content("OK: " + User.Claims.First(c => c.Type == "phone_number")?.Value); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/IdentityServerTestController.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/IdentityServerTestController.cs deleted file mode 100644 index 04237e095c..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/IdentityServerTestController.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.Clients; -using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; -using Client = Volo.Abp.IdentityServer.Clients.Client; - -namespace AbpDesk.Web.Mvc.Controllers -{ - [Route("identity-server-test")] - public class IdentityServerTestController : AbpController - { - private readonly IClientRepository _clientRepository; - private readonly IApiResourceRepository _apiResourceRepository; - private readonly IResourceStore _resourceStore; - - public IdentityServerTestController( - IClientRepository clientRepository, - IApiResourceRepository apiResourceRepository, - IResourceStore resourceStore) - { - _clientRepository = clientRepository; - _apiResourceRepository = apiResourceRepository; - _resourceStore = resourceStore; - } - - [HttpGet] - public async Task Get() - { - return Content("Resources: " + (await _resourceStore.FindApiResourceAsync("api1")).Name); - } - - [HttpGet] - [Route("create")] - public async Task CreateClient(string clientId) - { - var apiResource = await _apiResourceRepository.FindByNameAsync("api1"); - - if (apiResource == null) - { - apiResource = new ApiResource(GuidGenerator.Create(), "api1"); - await _apiResourceRepository.InsertAsync(apiResource); - } - - var client = new Client(GuidGenerator.Create(), clientId); - - client.AddGrantTypes(GrantTypes.ClientCredentials); - client.AddSecret("secret".Sha256()); - client.AddScope("api1"); - - await _clientRepository.InsertAsync(client); - - return Content("OK: " + client.Id); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/IdentityTestController.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/IdentityTestController.cs deleted file mode 100644 index cdd7f192e5..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/IdentityTestController.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Linq; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; - -namespace AbpDesk.Web.Mvc.Controllers -{ - [Route("identity-test")] - [Authorize] - public class IdentityTestController : AbpController - { - [HttpGet] - public IActionResult Get() - { - return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/MultiTenancyController.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/MultiTenancyController.cs deleted file mode 100644 index 9da448980f..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Controllers/MultiTenancyController.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Ui; - -namespace AbpDesk.Web.Mvc.Controllers -{ - /* TODO: This is temporary solution to switch tenant. - */ - - public class MultiTenancyController : AbpController - { - private readonly ITenantStore _tenantStore; - private readonly AspNetCoreMultiTenancyOptions _options; - - public MultiTenancyController(ITenantStore tenantStore, IOptions options) - { - _tenantStore = tenantStore; - _options = options.Value; - } - - public async Task SwitchTenant(string tenant = "") - { - if (tenant.IsNullOrEmpty()) - { - HttpContext.Response.Cookies.Delete(_options.TenantKey); - } - else - { - var tenantInfo = await FindTenantAsync(tenant); - if (tenantInfo == null) - { - throw new UserFriendlyException("Unknown tenant: " + tenant); - } - - HttpContext.Response.Cookies.Append( - _options.TenantKey, - tenantInfo.Id.ToString(), - new CookieOptions - { - Expires = DateTimeOffset.Now.AddYears(1) - } - ); - } - - return Redirect("/"); - } - - private async Task FindTenantAsync(string tenantIdOrName) - { - if (Guid.TryParse(tenantIdOrName, out var parsedTenantId)) - { - return await _tenantStore.FindAsync(parsedTenantId); - } - else - { - return await _tenantStore.FindAsync(tenantIdOrName); - } - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Dockerfile b/src/AbpDesk/AbpDesk.Web.Mvc/Dockerfile deleted file mode 100644 index de23365b25..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM microsoft/aspnetcore:2.0 - -WORKDIR /app -COPY . . - -RUN mkdir /Web_PlugIns -RUN mv /app/PlugIns/*.* /Web_PlugIns - -ENTRYPOINT ["dotnet", "AbpDesk.Web.Mvc.dll"] \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Navigation/MainMenuContributor.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Navigation/MainMenuContributor.cs deleted file mode 100644 index f3b0ec6098..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Navigation/MainMenuContributor.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Ui.Navigation; - -namespace AbpDesk.Web.Mvc.Navigation -{ - public class MainMenuContributor : IMenuContributor - { - public Task ConfigureMenuAsync(MenuConfigurationContext context) - { - if (context.Menu.Name != StandardMenus.Main) - { - return Task.CompletedTask; - } - - context.Menu.DisplayName = "Main Menu"; - - context.Menu.Items.Insert(0, new ApplicationMenuItem("Home", "Home", url: "/")); - - context.Menu - .AddItem( - new ApplicationMenuItem("TicketManagement", "Ticket Management") - .AddItem( - new ApplicationMenuItem("TicketManagement.Tickets", "Tickets", url: "/App/Tickets") - ) - ).AddItem( - new ApplicationMenuItem("TodoList", "Todo List", url: "/App/Todo") - ); - - //Disabled blog module. This should be inside the module! - //.AddItem( - // new ApplicationMenuItem("Blog", "Blog", url: "/Blog/Posts") - //); - - return Task.CompletedTask; - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Tickets/Index.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Tickets/Index.cshtml deleted file mode 100644 index 6fbe072d76..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Tickets/Index.cshtml +++ /dev/null @@ -1,37 +0,0 @@ -@page -@using AbpDesk.Web.Mvc.Pages.App.Tickets -@using Volo.Abp.Users -@model AbpDesk.Web.Mvc.Pages.App.Tickets.IndexModel -@inject ICurrentUser CurrentUser; - -@section styles - { - -} - -

Tickets

- -
    - @foreach (var ticket in Model.Tickets) - { -
  • -

    @ticket.Title

    -

    @ticket.Body

    -
  • - } -
- -

- Roles: @CurrentUser.Roles.JoinAsString(", ")
- IsInRole Supporter: @User.IsInRole("Supporter")
- IsInRole Supporter: @CurrentUser.IsInRole("Supporter") -

- -

Claims

- -
    - @foreach (var claim in User.Claims) - { -
  • @claim.Type : @claim.Value
  • - } -
\ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Tickets/Index.cshtml.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Tickets/Index.cshtml.cs deleted file mode 100644 index 3953df33fc..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Tickets/Index.cshtml.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using AbpDesk.Tickets; -using AbpDesk.Tickets.Dtos; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace AbpDesk.Web.Mvc.Pages.App.Tickets -{ - public class IndexModel : AbpPageModel - { - public IReadOnlyList Tickets { get; set; } - - private readonly ITicketAppService _ticketAppService; - - public IndexModel(ITicketAppService ticketAppService) - { - _ticketAppService = ticketAppService; - } - - public async Task OnGetAsync(GetAllTicketsInput input) - { - var result = await _ticketAppService.GetAll(input); - Tickets = result.Items; - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Todo/Index.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Todo/Index.cshtml deleted file mode 100644 index f18ff9336b..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Todo/Index.cshtml +++ /dev/null @@ -1,16 +0,0 @@ -@page -@using AbpDesk.Web.Mvc.Pages.App.Todo -@model IndexModel -

TODO application!

- -
-
    -
  1. - {{ todo.text }} -
  2. -
-
- -@section scripts { - -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Todo/Index.cshtml.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Todo/Index.cshtml.cs deleted file mode 100644 index 47651ccd70..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/App/Todo/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace AbpDesk.Web.Mvc.Pages.App.Todo -{ - public class IndexModel : AbpPageModel - { - public void OnGet() - { - - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/Index.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/Index.cshtml deleted file mode 100644 index 44ce94ac5a..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/Index.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@page -@model AbpDesk.Web.Mvc.Pages.IndexModel -

Home page!

\ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/Index.cshtml.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/Index.cshtml.cs deleted file mode 100644 index 8068ab311c..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace AbpDesk.Web.Mvc.Pages -{ - public class IndexModel : AbpPageModel - { - public void OnGet() - { - - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/_ViewImports.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/_ViewImports.cshtml deleted file mode 100644 index 38710b38a2..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/_ViewImports.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap -@addTagHelper *, AbpDesk.Web.Mvc \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/_ViewStart.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Pages/_ViewStart.cshtml deleted file mode 100644 index 395aeca572..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Pages/_ViewStart.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@{ - //TODO: Move this to ~/Pages/Abp/_AppLayout.cshtml..? - Layout = "~/Views/Shared/_AppLayout.cshtml"; -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Permissions/AbpDeskPermissionDefinitionProvider.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Permissions/AbpDeskPermissionDefinitionProvider.cs deleted file mode 100644 index a447f9bfc7..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Permissions/AbpDeskPermissionDefinitionProvider.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Volo.Abp.Authorization.Permissions; - -namespace AbpDesk.Web.Mvc.Permissions -{ - public class AbpDeskPermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var abpDeskGroup = context.AddGroup("AbpDesk"); - - var tickets = abpDeskGroup.AddPermission("AbpDesk.Tickets"); - tickets.AddChild("AbpDesk.Tickets.Reply"); - tickets.AddChild("AbpDesk.Tickets.Close"); - - var customers = abpDeskGroup.AddPermission("AbpDesk.Customers"); - customers.AddChild("AbpDesk.Customers.Create"); - customers.AddChild("AbpDesk.Customers.Delete"); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Program.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Program.cs deleted file mode 100644 index 9034b62f71..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; - -namespace AbpDesk.Web.Mvc -{ - public class Program - { - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Properties/launchSettings.json b/src/AbpDesk/AbpDesk.Web.Mvc/Properties/launchSettings.json deleted file mode 100644 index ffcb2f4ec6..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:59980/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "AbpDesk.Web.Mvc": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "http://localhost:59980", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Startup.cs b/src/AbpDesk/AbpDesk.Web.Mvc/Startup.cs deleted file mode 100644 index 6639825fa2..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Startup.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Serilog; -using Volo.Abp; - -namespace AbpDesk.Web.Mvc -{ - public class Startup - { - private readonly IHostingEnvironment _env; - - public Startup(IHostingEnvironment env) - { - _env = env; - } - - public IServiceProvider ConfigureServices(IServiceCollection services) - { - services.AddApplication(options => - { - options.UseAutofac(); - - /* @halil: I added Abp.MongoDb package as a dependency to the main application in order to use the blog plugin. - * Otherwise, we should add all dependencies (Recursively) into plugin folder - * and load in correct order. We should carefully think on that problem in the future. - * NOTE: Disabled - */ - //options.PlugInSources.AddFolder( - // Path.Combine( - // _env.ContentRootPath, - // @"../Web_PlugIns/") - //); - }); - - //TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory! - return services.BuildServiceProviderFromFactory(); - } - - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime appLifetime) - { - loggerFactory - .AddConsole() - .AddDebug() - .AddSerilog(new LoggerConfiguration() - .Enrich.FromLogContext() - .WriteTo.File("Logs/logs.txt") - .CreateLogger() - ); - - app.InitializeApplication(); - } - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Views/_ViewImports.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Views/_ViewImports.cshtml deleted file mode 100644 index 38710b38a2..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Views/_ViewImports.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap -@addTagHelper *, AbpDesk.Web.Mvc \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/Views/_ViewStart.cshtml b/src/AbpDesk/AbpDesk.Web.Mvc/Views/_ViewStart.cshtml deleted file mode 100644 index f4d75cd962..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "~/Views/Shared/_AppLayout.cshtml"; -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/appsettings.Staging.json b/src/AbpDesk/AbpDesk.Web.Mvc/appsettings.Staging.json deleted file mode 100644 index c84ff7f89f..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/appsettings.Staging.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=10.0.75.1;Database=AbpDesk;User=sa;Password=123qwe;", - "AbpDeskMongoBlog": "mongodb://outputs_mongodb_1:27017|AbpDeskBlog" - }, - "RemoteServices": { - "AbpIdentity": { - "BaseUrl": "http://outputs_abpidentity_httpapihost_1/" - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/appsettings.json b/src/AbpDesk/AbpDesk.Web.Mvc/appsettings.json deleted file mode 100644 index cbf857678a..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/appsettings.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=localhost;Database=AbpDesk;Trusted_Connection=True;", - "AbpDeskMongoBlog": "mongodb://127.0.0.1:27017|AbpDeskBlog" - }, - "RemoteServices": { - "AbpIdentity": { - "BaseUrl": "http://localhost:63290/" - } - }, - "Authentication": { - "Facebook": { - "IsEnabled": "true", - "AppId": "911417875702990", - "AppSecret": "adea0bff222ae340d8fb0ce3e6275d6b" - } - }, - "Tenants": [ - { - "Id": "446a5211-3d72-4339-9adc-845151f8ada0", - "Name": "acme" - }, - { - "Id": "25388015-ef1c-4355-9c18-f6b6ddbaf89d", - "Name": "volosoft" - } - ] -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/compilerconfig.json b/src/AbpDesk/AbpDesk.Web.Mvc/compilerconfig.json deleted file mode 100644 index 9fe9dfdc20..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/compilerconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "outputFile": "wwwroot/global-styles.css", - "inputFile": "wwwroot/global-styles.scss" - } -] \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/compilerconfig.json.defaults b/src/AbpDesk/AbpDesk.Web.Mvc/compilerconfig.json.defaults deleted file mode 100644 index c75eb7d519..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/compilerconfig.json.defaults +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilers": { - "less": { - "autoPrefix": "", - "cssComb": "none", - "ieCompat": true, - "strictMath": false, - "strictUnits": false, - "relativeUrls": true, - "rootPath": "", - "sourceMapRoot": "", - "sourceMapBasePath": "", - "sourceMap": false - }, - "sass": { - "includePath": "", - "indentType": "space", - "indentWidth": 2, - "outputStyle": "nested", - "Precision": 5, - "relativeUrls": true, - "sourceMapRoot": "", - "sourceMap": false - }, - "stylus": { - "sourceMap": false - }, - "babel": { - "sourceMap": false - }, - "coffeescript": { - "bare": false, - "runtimeMode": "node", - "sourceMap": false - } - }, - "minifiers": { - "css": { - "enabled": true, - "termSemicolons": true, - "gzip": false - }, - "javascript": { - "enabled": true, - "termSemicolons": true, - "gzip": false - } - } -} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/tempkey.rsa b/src/AbpDesk/AbpDesk.Web.Mvc/tempkey.rsa deleted file mode 100644 index 5ad3458a9c..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/tempkey.rsa +++ /dev/null @@ -1 +0,0 @@ -{"KeyId":"3b003a0fc7d8278f13f59d44f4620374","Parameters":{"D":"Qravv6bNhcfweciZna68hlflA8ygXVgoycYFC/oSG0Ulxr7iN1WtpJEau80OReBKVuRqqvxepzJcNv9CqMGvs9+bDrymk9DDdH46ybFKZB2MaufaBuwbuiJi5qCsGmaDvjzf1dwPyGS+7OEa28GDw7ibwwkf6sMJcIBWGQrAZ6O+/Ka8ouF8Zdn+6Igv4rK+RVtKQbjYeJ9CvhOZFXSuLl1XVAM01bGwvQSh8BwMC7i1g7gKypvTG31OSlG3ZzIoF7uuoXaC/WWbGvryvPUzFbgCLO8tQu4/Kdy9NsU3C3M/adUtRxLtVNvD29o8dDZT8NM2UTotfgGg3v72ktmnjQ==","DP":"cQ4XqOgPQAOO4dqg3yFH/xFoXQx/5/q4oGtFZYDTSOyrRL/LopZHrr53ys7Uble7+dDa6PPYBgY/C2/SwLBaUF9FpM27Kp7D+3yUKFbKtW8uke+UEM6MgcfjBdwEFVV4CqqHzgD8JvtZ1xhBvx6yUJuHcxxuWKlElXhsTVJKwwE=","DQ":"ktpqqgnwT2Rr9Eb0Kkyg5LZgsO75Pu+0u1q4WhZ7ZzOMJqquCf7hw7ucaWPLq8Ipzn5Hu5CO2gT+URjMGkJNQA+728tFnFkST9wFeqp1hQh5ZxgYsONiH9e/Nw6iauI07i2TYt7pFhIYUOg52/SvHrAzPyEYznCw3BZrR4rEjJk=","Exponent":"AQAB","InverseQ":"hkiDiH926FhARZnVhV5sDnbjxGTdQl8ErZ+qOdBE2vVP6IwNj14dkw+ON4XeIyM/CE3RYmhd8I68JCDNVd6J4hE4NIe4xr+ykmVHYLWQhZ/k4QippwabZ3SK9dkcosQF6BP3lNSgW0UxomdgMKQcsQqccroKEq52Ccr3dUVXICg=","Modulus":"7fgl4D1Emkq+KRAj+u7g7e8hrEhYT19ZRVu1LVdZpx8vDUmuBLVCrNdm6VPIeV5YvrRLELiAknujOMytnIwtY6D1beOtdunEE1z32QsFxizYa9lVaL1rwEURnLQ51sP2bJsxNZnHaJQFGCzOc1i8V551V8eG43asoSbQKFz8Aa6A5UdZaecWSF9WoIkWH/xdi2Ecun69HAS8LiS2S3yKgqyLJivZM72lMUgTWyklh8WMscMb2pRTHspV2oqlIRBo4bRbLgYRJ+6pOMvtge5CgWMupolpy0BTpQrRLPYK9oiZ9iP1/Hdrlu8U0G6XL1rz0kkfqOU10AtlYZe01b0zXQ==","P":"+pWvk2Q5+YN0IikHJkCdpeZMUM3Tkj08FEJETRNU3Rcrpg1wyFQJdqIib28XzWdua5vilBNnAwhbBw4dO978rn1riHq8VQD1JSFh1+vwlzhG76M89KnP7v/DuILbTT4tKU28VWjQsT4RVlI5Rqc3REaUoQDYAmvARCFDGOxCrYs=","Q":"8xyreLJWnAFQoVJjLhK/eNE+GdABidksHz47k1p9imeKAv4xpFx4jfAec4VSiXCvK/KW9+fbPA+S4hEa/5oICKvvALFZavL7A4htnQjflgnEc+QqlR7TjnVgMILyBB3mf4mlNjR7kfwcDwGLRBjMx8mxadj+NlREri4Jw6q4D7c="}} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/web.config b/src/AbpDesk/AbpDesk.Web.Mvc/web.config deleted file mode 100644 index 8700b60c05..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/web.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.css b/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.css deleted file mode 100644 index 9b8b2601c3..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.css +++ /dev/null @@ -1,5 +0,0 @@ -ul.ticket-list { - list-style: none; } - ul.ticket-list li { - border-bottom: 1px solid #d0d0d0; } - diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.min.css b/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.min.css deleted file mode 100644 index e1372bca1c..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.min.css +++ /dev/null @@ -1 +0,0 @@ -ul.ticket-list{list-style:none;}ul.ticket-list li{border-bottom:1px solid #d0d0d0;} \ No newline at end of file diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.scss b/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.scss deleted file mode 100644 index 75fc1c9b23..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/global-styles.scss +++ /dev/null @@ -1,8 +0,0 @@ -ul.ticket-list { - - list-style: none; - - li { - border-bottom: 1px solid #d0d0d0; - } -} diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/pages/app/todo/index.js b/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/pages/app/todo/index.js deleted file mode 100644 index 14570e3853..0000000000 --- a/src/AbpDesk/AbpDesk.Web.Mvc/wwwroot/pages/app/todo/index.js +++ /dev/null @@ -1,14 +0,0 @@ -(function() { - - var app = new Vue({ - el: '#TodoApp', - data: { - todos: [ - { text: 'Learn JavaScript' }, - { text: 'Learn Vue' }, - { text: 'Build something awesome' } - ] - } - }); - -})(); \ No newline at end of file diff --git a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll deleted file mode 100644 index c82217c5bb..0000000000 Binary files a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll and /dev/null differ diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Controllers/MultiTenancyController.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Controllers/MultiTenancyController.cs deleted file mode 100644 index ac5a453177..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Controllers/MultiTenancyController.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Ui; - -namespace MicroserviceDemo.AuthServer.Controllers -{ - /* TODO: This is temporary solution to switch tenant. - */ - - public class MultiTenancyController : AbpController - { - private readonly ITenantStore _tenantStore; - private readonly AspNetCoreMultiTenancyOptions _options; - - public MultiTenancyController(ITenantStore tenantStore, IOptions options) - { - _tenantStore = tenantStore; - _options = options.Value; - } - - public async Task SwitchTenant(string tenant = "") - { - if (tenant.IsNullOrEmpty()) - { - HttpContext.Response.Cookies.Delete(_options.TenantKey); - } - else - { - var tenantInfo = await FindTenantAsync(tenant); - if (tenantInfo == null) - { - throw new UserFriendlyException("Unknown tenant: " + tenant); - } - - HttpContext.Response.Cookies.Append( - _options.TenantKey, - tenantInfo.Id.ToString(), - new CookieOptions - { - Expires = DateTimeOffset.Now.AddYears(1) - } - ); - } - - return Redirect("/"); - } - - private async Task FindTenantAsync(string tenantIdOrName) - { - if (Guid.TryParse(tenantIdOrName, out var parsedTenantId)) - { - return await _tenantStore.FindAsync(parsedTenantId); - } - else - { - return await _tenantStore.FindAsync(tenantIdOrName); - } - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContext.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContext.cs deleted file mode 100644 index 91cc8c9745..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.EntityFrameworkCore; - -namespace MicroserviceDemo.AuthServer.Db -{ - public class MigrationDbContext : AbpDbContext - { - public MigrationDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.ConfigureIdentityServer(); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContextFactory.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContextFactory.cs deleted file mode 100644 index d0dc04aad0..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Db/MigrationDbContextFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace MicroserviceDemo.AuthServer.Db -{ - /* This class is needed for EF Core command line tooling */ - - public class MigrationDbContextFactory : IDesignTimeDbContextFactory - { - public MigrationDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true"); - return new MigrationDbContext(builder.Options); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroserviceDemo.AuthServer.csproj b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroserviceDemo.AuthServer.csproj deleted file mode 100644 index 39cf366b8c..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroserviceDemo.AuthServer.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - netcoreapp2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs deleted file mode 100644 index f40c7ba0df..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/MicroservicesAuthServerModule.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.Account.Web; -using Volo.Abp.AspNetCore.Modularity; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; -using Volo.Abp.Autofac; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.IdentityServer.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; -using Volo.Abp.VirtualFileSystem; - -namespace MicroserviceDemo.AuthServer -{ - [DependsOn(typeof(AbpAutofacModule))] - [DependsOn(typeof(AbpIdentityEntityFrameworkCoreModule))] - [DependsOn(typeof(AbpIdentityServerEntityFrameworkCoreModule))] - [DependsOn(typeof(AbpAccountWebIdentityServerModule))] - [DependsOn(typeof(AbpAspNetCoreMultiTenancyModule))] - [DependsOn(typeof(AbpMultiTenancyEntityFrameworkCoreModule))] - public class MicroservicesAuthServerModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - var hostingEnvironment = services.GetSingletonInstance(); - var configuration = BuildConfiguration(hostingEnvironment); - - services.Configure(configuration); - - services.Configure(options => - { - options.Configure(context => - { - if (context.ExistingConnection != null) - { - context.DbContextOptions.UseSqlServer(context.ExistingConnection); - } - else - { - context.DbContextOptions.UseSqlServer(context.ConnectionString); - } - }); - }); - - services.Configure(iis => - { - iis.AuthenticationDisplayName = "Windows"; - iis.AutomaticAuthentication = false; - }); - - if (hostingEnvironment.IsDevelopment()) - { - services.Configure(options => - { - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.AspNetCore.Mvc.UI")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Account.Web")); - options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Account.Web.IdentityServer")); - }); - } - - services.AddAuthentication() - .AddFacebook(options => - { - options.AppId = configuration["Authentication:Facebook:AppId"]; - options.AppSecret = configuration["Authentication:Facebook:AppSecret"]; - - options.Scope.Add("email"); - options.Scope.Add("public_profile"); - }); - - services.AddDistributedSqlServerCache(options => - { - options.ConnectionString = configuration.GetConnectionString("SqlServerCache"); - options.SchemaName = "dbo"; - options.TableName = "TestCache"; - }); - - services.AddAssemblyOf(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - var app = context.GetApplicationBuilder(); - - if (context.GetEnvironment().IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseStaticFiles(); - app.UseVirtualFiles(); - - app.UseAuthentication(); //TODO: This makes it twice since UseIdentityServer also internally adds UseAuthentication! - app.UseMultiTenancy(); - - app.UseIdentityServer(); //This internally adds .UseAuthentication() (we should be carefully about that) - - app.UseMvc(routes => - { - //TODO: Can we make an extension method for adding these two routes inside the framework? - routes.MapRoute( - name: "defaultWithArea", - template: "{area}/{controller=Home}/{action=Index}/{id?}"); - - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - - private static IConfigurationRoot BuildConfiguration(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - - return builder.Build(); - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.Designer.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.Designer.cs deleted file mode 100644 index d86373b34b..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.Designer.cs +++ /dev/null @@ -1,526 +0,0 @@ -// -using MicroserviceDemo.AuthServer.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace MicroserviceDemo.AuthServer.Migrations -{ - [DbContext(typeof(MigrationDbContext))] - [Migration("20180228110952_Added_IdentityServer_Module")] - partial class Added_IdentityServer_Module - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.ToTable("IdentityServerApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Type"); - - b.ToTable("IdentityServerApiClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("DisplayName") - .HasMaxLength(128); - - b.Property("Emphasize"); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("ApiResourceId", "Name"); - - b.ToTable("IdentityServerApiScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Name", "Type"); - - b.ToTable("IdentityServerApiScopeClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ApiResourceId", "Type", "Value"); - - b.ToTable("IdentityServerApiSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AbsoluteRefreshTokenLifetime"); - - b.Property("AccessTokenLifetime"); - - b.Property("AccessTokenType"); - - b.Property("AllowAccessTokensViaBrowser"); - - b.Property("AllowOfflineAccess"); - - b.Property("AllowPlainTextPkce"); - - b.Property("AllowRememberConsent"); - - b.Property("AlwaysIncludeUserClaimsInIdToken"); - - b.Property("AlwaysSendClientClaims"); - - b.Property("AuthorizationCodeLifetime"); - - b.Property("BackChannelLogoutSessionRequired"); - - b.Property("BackChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("ClientName") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasMaxLength(2000); - - b.Property("ConsentLifetime"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("EnableLocalLogin"); - - b.Property("Enabled"); - - b.Property("FrontChannelLogoutSessionRequired"); - - b.Property("FrontChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime"); - - b.Property("IncludeJwtId"); - - b.Property("LogoUri") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasMaxLength(200); - - b.Property("ProtocolType") - .IsRequired() - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration"); - - b.Property("RefreshTokenUsage"); - - b.Property("RequireClientSecret"); - - b.Property("RequireConsent"); - - b.Property("RequirePkce"); - - b.Property("SlidingRefreshTokenLifetime"); - - b.Property("UpdateAccessTokenClaimsOnRefresh"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("IdentityServerClients"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("IdentityServerClientClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.Property("ClientId"); - - b.Property("Origin") - .HasMaxLength(150); - - b.HasKey("ClientId", "Origin"); - - b.ToTable("IdentityServerClientCorsOrigins"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("ClientId"); - - b.Property("GrantType") - .HasMaxLength(196); - - b.HasKey("ClientId", "GrantType"); - - b.ToTable("IdentityServerClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("ClientId"); - - b.Property("Provider") - .HasMaxLength(64); - - b.HasKey("ClientId", "Provider"); - - b.ToTable("IdentityServerClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("PostLogoutRedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "PostLogoutRedirectUri"); - - b.ToTable("IdentityServerClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("ClientId"); - - b.Property("Key") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("ClientId", "Key"); - - b.ToTable("IdentityServerClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("RedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "RedirectUri"); - - b.ToTable("IdentityServerClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("ClientId"); - - b.Property("Scope") - .HasMaxLength(196); - - b.HasKey("ClientId", "Scope"); - - b.ToTable("IdentityServerClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("ClientId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ClientId", "Type", "Value"); - - b.ToTable("IdentityServerClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("CreationTime"); - - b.Property("Data") - .IsRequired(); - - b.Property("Expiration"); - - b.Property("Id"); - - b.Property("SubjectId") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("IdentityServerPersistedGrants"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("IdentityResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("IdentityResourceId", "Type"); - - b.ToTable("IdentityServerIdentityClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.cs deleted file mode 100644 index c0ec73b746..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/20180228110952_Added_IdentityServer_Module.cs +++ /dev/null @@ -1,447 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace MicroserviceDemo.AuthServer.Migrations -{ - public partial class Added_IdentityServer_Module : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "IdentityServerApiResources", - columns: table => new - { - Id = table.Column(nullable: false), - Description = table.Column(maxLength: 1000, nullable: true), - DisplayName = table.Column(maxLength: 200, nullable: true), - Enabled = table.Column(nullable: false), - Name = table.Column(maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClients", - columns: table => new - { - Id = table.Column(nullable: false), - AbsoluteRefreshTokenLifetime = table.Column(nullable: false), - AccessTokenLifetime = table.Column(nullable: false), - AccessTokenType = table.Column(nullable: false), - AllowAccessTokensViaBrowser = table.Column(nullable: false), - AllowOfflineAccess = table.Column(nullable: false), - AllowPlainTextPkce = table.Column(nullable: false), - AllowRememberConsent = table.Column(nullable: false), - AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), - AlwaysSendClientClaims = table.Column(nullable: false), - AuthorizationCodeLifetime = table.Column(nullable: false), - BackChannelLogoutSessionRequired = table.Column(nullable: false), - BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), - ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), - ClientId = table.Column(maxLength: 200, nullable: false), - ClientName = table.Column(maxLength: 200, nullable: true), - ClientUri = table.Column(maxLength: 2000, nullable: true), - ConsentLifetime = table.Column(nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - EnableLocalLogin = table.Column(nullable: false), - Enabled = table.Column(nullable: false), - FrontChannelLogoutSessionRequired = table.Column(nullable: false), - FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), - IdentityTokenLifetime = table.Column(nullable: false), - IncludeJwtId = table.Column(nullable: false), - LogoUri = table.Column(maxLength: 2000, nullable: true), - PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), - ProtocolType = table.Column(maxLength: 200, nullable: false), - RefreshTokenExpiration = table.Column(nullable: false), - RefreshTokenUsage = table.Column(nullable: false), - RequireClientSecret = table.Column(nullable: false), - RequireConsent = table.Column(nullable: false), - RequirePkce = table.Column(nullable: false), - SlidingRefreshTokenLifetime = table.Column(nullable: false), - UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerIdentityResources", - columns: table => new - { - Id = table.Column(nullable: false), - Description = table.Column(maxLength: 1000, nullable: true), - DisplayName = table.Column(maxLength: 200, nullable: true), - Emphasize = table.Column(nullable: false), - Enabled = table.Column(nullable: false), - Name = table.Column(maxLength: 200, nullable: false), - Required = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerPersistedGrants", - columns: table => new - { - Key = table.Column(maxLength: 200, nullable: false), - ClientId = table.Column(maxLength: 200, nullable: false), - CreationTime = table.Column(nullable: false), - Data = table.Column(nullable: false), - Expiration = table.Column(nullable: true), - Id = table.Column(nullable: false), - SubjectId = table.Column(maxLength: 200, nullable: true), - Type = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiClaims", - columns: table => new - { - ApiResourceId = table.Column(nullable: false), - Type = table.Column(maxLength: 196, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiScopes", - columns: table => new - { - ApiResourceId = table.Column(nullable: false), - Name = table.Column(maxLength: 196, nullable: false), - Description = table.Column(maxLength: 256, nullable: true), - DisplayName = table.Column(maxLength: 128, nullable: true), - Emphasize = table.Column(nullable: false), - Required = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name }); - table.ForeignKey( - name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiSecrets", - columns: table => new - { - ApiResourceId = table.Column(nullable: false), - Type = table.Column(maxLength: 32, nullable: false), - Value = table.Column(maxLength: 196, nullable: false), - Description = table.Column(maxLength: 256, nullable: true), - Expiration = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ClientId = table.Column(nullable: false), - Type = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 250, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientClaims", x => x.Id); - table.ForeignKey( - name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientCorsOrigins", - columns: table => new - { - ClientId = table.Column(nullable: false), - Origin = table.Column(maxLength: 150, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); - table.ForeignKey( - name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientGrantTypes", - columns: table => new - { - ClientId = table.Column(nullable: false), - GrantType = table.Column(maxLength: 196, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); - table.ForeignKey( - name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientIdPRestrictions", - columns: table => new - { - ClientId = table.Column(nullable: false), - Provider = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); - table.ForeignKey( - name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientPostLogoutRedirectUris", - columns: table => new - { - ClientId = table.Column(nullable: false), - PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); - table.ForeignKey( - name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientProperties", - columns: table => new - { - ClientId = table.Column(nullable: false), - Key = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); - table.ForeignKey( - name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientRedirectUris", - columns: table => new - { - ClientId = table.Column(nullable: false), - RedirectUri = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); - table.ForeignKey( - name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientScopes", - columns: table => new - { - ClientId = table.Column(nullable: false), - Scope = table.Column(maxLength: 196, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); - table.ForeignKey( - name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientSecrets", - columns: table => new - { - ClientId = table.Column(nullable: false), - Type = table.Column(maxLength: 32, nullable: false), - Value = table.Column(maxLength: 196, nullable: false), - Description = table.Column(maxLength: 256, nullable: true), - Expiration = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerIdentityClaims", - columns: table => new - { - IdentityResourceId = table.Column(nullable: false), - Type = table.Column(maxLength: 196, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", - column: x => x.IdentityResourceId, - principalTable: "IdentityServerIdentityResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiScopeClaims", - columns: table => new - { - ApiResourceId = table.Column(nullable: false), - Name = table.Column(maxLength: 196, nullable: false), - Type = table.Column(maxLength: 196, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiResourceId, x.Name, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiResourceId_Name", - columns: x => new { x.ApiResourceId, x.Name }, - principalTable: "IdentityServerApiScopes", - principalColumns: new[] { "ApiResourceId", "Name" }, - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerClientClaims_ClientId", - table: "IdentityServerClientClaims", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerClients_ClientId", - table: "IdentityServerClients", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", - table: "IdentityServerPersistedGrants", - columns: new[] { "SubjectId", "ClientId", "Type" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "IdentityServerApiClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerApiScopeClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerApiSecrets"); - - migrationBuilder.DropTable( - name: "IdentityServerClientClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerClientCorsOrigins"); - - migrationBuilder.DropTable( - name: "IdentityServerClientGrantTypes"); - - migrationBuilder.DropTable( - name: "IdentityServerClientIdPRestrictions"); - - migrationBuilder.DropTable( - name: "IdentityServerClientPostLogoutRedirectUris"); - - migrationBuilder.DropTable( - name: "IdentityServerClientProperties"); - - migrationBuilder.DropTable( - name: "IdentityServerClientRedirectUris"); - - migrationBuilder.DropTable( - name: "IdentityServerClientScopes"); - - migrationBuilder.DropTable( - name: "IdentityServerClientSecrets"); - - migrationBuilder.DropTable( - name: "IdentityServerIdentityClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerPersistedGrants"); - - migrationBuilder.DropTable( - name: "IdentityServerApiScopes"); - - migrationBuilder.DropTable( - name: "IdentityServerClients"); - - migrationBuilder.DropTable( - name: "IdentityServerIdentityResources"); - - migrationBuilder.DropTable( - name: "IdentityServerApiResources"); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/MigrationDbContextModelSnapshot.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/MigrationDbContextModelSnapshot.cs deleted file mode 100644 index 183eb51318..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Migrations/MigrationDbContextModelSnapshot.cs +++ /dev/null @@ -1,525 +0,0 @@ -// -using MicroserviceDemo.AuthServer.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace MicroserviceDemo.AuthServer.Migrations -{ - [DbContext(typeof(MigrationDbContext))] - partial class MigrationDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.ToTable("IdentityServerApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Type"); - - b.ToTable("IdentityServerApiClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("DisplayName") - .HasMaxLength(128); - - b.Property("Emphasize"); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("ApiResourceId", "Name"); - - b.ToTable("IdentityServerApiScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Name", "Type"); - - b.ToTable("IdentityServerApiScopeClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ApiResourceId", "Type", "Value"); - - b.ToTable("IdentityServerApiSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AbsoluteRefreshTokenLifetime"); - - b.Property("AccessTokenLifetime"); - - b.Property("AccessTokenType"); - - b.Property("AllowAccessTokensViaBrowser"); - - b.Property("AllowOfflineAccess"); - - b.Property("AllowPlainTextPkce"); - - b.Property("AllowRememberConsent"); - - b.Property("AlwaysIncludeUserClaimsInIdToken"); - - b.Property("AlwaysSendClientClaims"); - - b.Property("AuthorizationCodeLifetime"); - - b.Property("BackChannelLogoutSessionRequired"); - - b.Property("BackChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("ClientName") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasMaxLength(2000); - - b.Property("ConsentLifetime"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("EnableLocalLogin"); - - b.Property("Enabled"); - - b.Property("FrontChannelLogoutSessionRequired"); - - b.Property("FrontChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime"); - - b.Property("IncludeJwtId"); - - b.Property("LogoUri") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasMaxLength(200); - - b.Property("ProtocolType") - .IsRequired() - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration"); - - b.Property("RefreshTokenUsage"); - - b.Property("RequireClientSecret"); - - b.Property("RequireConsent"); - - b.Property("RequirePkce"); - - b.Property("SlidingRefreshTokenLifetime"); - - b.Property("UpdateAccessTokenClaimsOnRefresh"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("IdentityServerClients"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("IdentityServerClientClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.Property("ClientId"); - - b.Property("Origin") - .HasMaxLength(150); - - b.HasKey("ClientId", "Origin"); - - b.ToTable("IdentityServerClientCorsOrigins"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("ClientId"); - - b.Property("GrantType") - .HasMaxLength(196); - - b.HasKey("ClientId", "GrantType"); - - b.ToTable("IdentityServerClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("ClientId"); - - b.Property("Provider") - .HasMaxLength(64); - - b.HasKey("ClientId", "Provider"); - - b.ToTable("IdentityServerClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("PostLogoutRedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "PostLogoutRedirectUri"); - - b.ToTable("IdentityServerClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("ClientId"); - - b.Property("Key") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("ClientId", "Key"); - - b.ToTable("IdentityServerClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("RedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "RedirectUri"); - - b.ToTable("IdentityServerClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("ClientId"); - - b.Property("Scope") - .HasMaxLength(196); - - b.HasKey("ClientId", "Scope"); - - b.ToTable("IdentityServerClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("ClientId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ClientId", "Type", "Value"); - - b.ToTable("IdentityServerClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("CreationTime"); - - b.Property("Data") - .IsRequired(); - - b.Property("Expiration"); - - b.Property("Id"); - - b.Property("SubjectId") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("IdentityServerPersistedGrants"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("IdentityResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("IdentityResourceId", "Type"); - - b.ToTable("IdentityServerIdentityClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Pages/Index.cshtml b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Pages/Index.cshtml deleted file mode 100644 index 0712e36914..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Pages/Index.cshtml +++ /dev/null @@ -1,20 +0,0 @@ -@page -@model MicroserviceDemo.AuthServer.Pages.IndexModel - -

Welcome to the Authentication Server!

- - - - - Login - - @if (User.Identity.IsAuthenticated) - { - foreach (var claim in User.Claims) - { -
@claim.Type = @claim.Value
- } - } - -
-
\ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Pages/Index.cshtml.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Pages/Index.cshtml.cs deleted file mode 100644 index 0783f603b2..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Pages/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; - -namespace MicroserviceDemo.AuthServer.Pages -{ - public class IndexModel : PageModel - { - public void OnGet() - { - - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Program.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Program.cs deleted file mode 100644 index ebf3acc400..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; - -namespace MicroserviceDemo.AuthServer -{ - public class Program - { - public static void Main(string[] args) - { - BuildWebHostInternal(args).Run(); - } - - public static IWebHost BuildWebHostInternal(string[] args) => - new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseStartup() - .Build(); - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json deleted file mode 100644 index a1c4854f52..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://abp-test-authserver.com:54307/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "MicroserviceDemo.AuthServer": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://abp-test-authserver.com:54308/" - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Startup.cs b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Startup.cs deleted file mode 100644 index bab82c960f..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/Startup.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Serilog; -using Volo.Abp; - -namespace MicroserviceDemo.AuthServer -{ - public class Startup - { - public IServiceProvider ConfigureServices(IServiceCollection services) - { - services.AddApplication(options => - { - options.UseAutofac(); - }); - - return services.BuildServiceProviderFromFactory(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory - .AddConsole() - .AddDebug() - .AddSerilog(new LoggerConfiguration() - .Enrich.FromLogContext() - .WriteTo.File("Logs/logs.txt") - .CreateLogger() - ); - - app.InitializeApplication(); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json deleted file mode 100644 index 4c01ff1527..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/appsettings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true", - "SqlServerCache": "Server=localhost;Database=MicroservicesDemo.Cache;Trusted_Connection=True;MultipleActiveResultSets=true", - "AbpMultiTenancy": "Server=localhost;Database=MicroservicesDemo.Tenancy;Trusted_Connection=True;MultipleActiveResultSets=true" - }, - "Authentication": { - "Facebook": { - "IsEnabled": "true", - "AppId": "911417875702990", - "AppSecret": "adea0bff222ae340d8fb0ce3e6275d6b" - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/tempkey.rsa b/src/MicroserviceDemo/MicroserviceDemo.AuthServer/tempkey.rsa deleted file mode 100644 index 56c077be19..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.AuthServer/tempkey.rsa +++ /dev/null @@ -1 +0,0 @@ -{"KeyId":"173073ce8d3c648d6b25c1b104a1e67b","Parameters":{"D":"a71rLomICvsQCd2KYGw552cks0Sv38mD2wCnMH1At0QLd1t05N5SOvaT3sfockDIuAj4zVHS9L+ZsU44GsOrZ1V8sMug2+ClfAA4K50tR9xdza0qP0xYlhANckBageQed+kFE6q7G/Sh6aG/6lClW/AW044sCyiguzw0HNylKUGPeet246TvKyJmNODYDBs1IvMd2qt/1vrGnk08bTn1CFCbQe7mhYlJLTrNHZWAADrc5/fykcz2SZ9tPwo/YiOWak7xYwYWgy+FAAr7H4r1WCrvRvB7Fr4+yABEZmPbCNSRgw30so8f/ve3S86xSEeZPvN4yfj9BPF601Yk8s+MJQ==","DP":"595opp9oLnJFqhn6/xgoAvayNLOY6zWKgfV8VCo6vwTrLcluIpWGTek9fVwedWUcAAoWUA/mCpsuA+AE19i35ymzdw910mONcHAzPQhr8zn50CeUZCQHJzGHxm11cBrcAguTW6coggxR84VfCR3a0sj6WssvVcVMPw8YSevwei8=","DQ":"hWy0c8gl6xRyVF6XEXaNIg4i1tPTYl/fW0Mq/Daf7X/89xoYPE/VGyhmrtQcTbZSQvja05UdLpAqmZuPiFo2IHS5DhreKkIJmC03gNg/2YsO3wkMpDB3Oz1y4d8E/l1dIR/BBaWs7qnr35lImY/mOq3pO2GFi/t4Eh+uH2rKGy0=","Exponent":"AQAB","InverseQ":"QMUZ9NCw0GvufYNej8qLVMeoLQmuLjjgzjyLpwSiLWZ3JbNt8b1Estngg/2uDIb68zzpyxBC/AIkFE7pVYX+OvGv4N4KsWZJ7cKwyIzh8lsvlsvJNCEEujQN/Pk9e9GNUYwK7xNpn4BErwvpVtgMHBHV+sml80tLu/yOVx7kTio=","Modulus":"uy3Om+Lq9YlGDD1ZkoAL3CXzIs2GPkRc5QAvPY/Gsy1mCqyhwr3Olz7FsceL1UEs8A6ON0WfZNrqci+U5DxU2WmMM0ePLlchxCt84ykY4P2u/7b6kTsnzfLRUawBEuruUmVafI39C7tV0I+3qIq1wUN7QeGpl5cjHkQ5ovb+ph0F46+LD7b5YWY9/yjSmlTFFS79r/DOf925VCryry290YO9qDeXNQEgjxqjotiIJkSp4WzdkQCN+yl67HJtzarNkx9vhEie9qp5S6YZB/vD5C8qo6TOMGtTfBO+gOLIorkv6la9WFivBaVFUwXxRJFysjcKDSgiurIZ4Y0TbgMIpQ==","P":"9/0HEaJwP0cxiYJYoZvJ62X2f023k/CzLFrq2t3GhxlDgLtHpPC5xhpTX6onou9D/USjQj02e/E2nsEwxlDjeDrVbX+fFXvKSnItMzavyjcgJfkkdUNJvx9VPy9t74hVPyDUmBjqscABVhJEd43hXPELUy5nHoVna/RZhmuJdgc=","Q":"wTnb0iMDzvTLvuHeK/PRewji8KOzx3588i1ndldjtdNS7+roOG8n681HYAl55SfWDij3cBYt+lnFbTPtD1zj1QXyx1nM0nw52WmudgC0lIupTU67UfnAXm4HThDCw/41pFy9snJxjGNOJ2EEmSXjnd0nEwL7FkKd3FwYv+84APM="}} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/MicroserviceDemo.ConsoleClient.csproj b/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/MicroserviceDemo.ConsoleClient.csproj deleted file mode 100644 index 3d9798a90e..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/MicroserviceDemo.ConsoleClient.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - netcoreapp2.0 - - - - - - - diff --git a/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/Program.cs b/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/Program.cs deleted file mode 100644 index d192c39bf5..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.ConsoleClient/Program.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using IdentityModel.Client; - -namespace MicroserviceDemo.ConsoleClient -{ - class Program - { - static void Main(string[] args) - { - RunDemo().Wait(); - Console.ReadLine(); - } - - private static async Task RunDemo() - { - // discover endpoints from metadata - var disco = await DiscoveryClient.GetAsync("http://abp-test-authserver.com:54307"); - if (disco.IsError) - { - Console.WriteLine(disco.Error); - return; - } - - // request token - var tokenClient = new TokenClient(disco.TokenEndpoint, "client", "secret"); - var tokenResponse = await tokenClient.RequestClientCredentialsAsync("multi-tenancy-api"); - - if (tokenResponse.IsError) - { - Console.WriteLine(tokenResponse.Error); - return; - } - - Console.WriteLine(tokenResponse.Json); - - // call api - var client = new HttpClient(); - client.SetBearerToken(tokenResponse.AccessToken); - - var response = await client.GetAsync("http://abp-test-tenancy.com:63877/api/multi-tenancy/tenant?SkipCount=0&MaxResultCount=100"); - if (!response.IsSuccessStatusCode) - { - Console.WriteLine(response.StatusCode); - } - else - { - var content = await response.Content.ReadAsStringAsync(); - Console.WriteLine(content); - } - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Controllers/HomeController.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Controllers/HomeController.cs deleted file mode 100644 index 0ce6f259aa..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Controllers/HomeController.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; - -namespace MicroserviceDemo.TenancyService.Controllers -{ - public class HomeController : AbpController - { - public IActionResult Index() - { - return Redirect("/swagger"); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Controllers/IdentityController.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Controllers/IdentityController.cs deleted file mode 100644 index 7d21381e8a..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Controllers/IdentityController.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. -// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. - -using System.Linq; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; - -namespace MicroserviceDemo.TenancyService.Controllers -{ - [Route("[controller]")] - [Authorize] - public class IdentityController : AbpController - { - [HttpGet] - public IActionResult Get() - { - return new JsonResult(new - { - currentUserId = CurrentUser.Id, - currentUserEmail = CurrentUser.Email, - currentUserRoles = CurrentUser.Roles, - currentUserUserName = CurrentUser.UserName, - claims = from c in User.Claims select new { c.Type, c.Value } - }); - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Db/MigrationDbContext.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Db/MigrationDbContext.cs deleted file mode 100644 index 42952a1ab8..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Db/MigrationDbContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; - -namespace MicroserviceDemo.TenancyService.Db -{ - public class MigrationDbContext : AbpDbContext - { - public MigrationDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.ConfigureMultiTenancy(); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Db/MigrationDbContextFactory.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Db/MigrationDbContextFactory.cs deleted file mode 100644 index 95650cd174..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Db/MigrationDbContextFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace MicroserviceDemo.TenancyService.Db -{ - /* This class is needed for EF Core command line tooling */ - - public class MigrationDbContextFactory : IDesignTimeDbContextFactory - { - public MigrationDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=MicroservicesDemo.Tenancy;Trusted_Connection=True;MultipleActiveResultSets=true"); - return new MigrationDbContext(builder.Options); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroserviceDemo.TenancyService.csproj b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroserviceDemo.TenancyService.csproj deleted file mode 100644 index 10c93f1e64..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroserviceDemo.TenancyService.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - netcoreapp2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroservicesDemoTenancyServiceModule.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroservicesDemoTenancyServiceModule.cs deleted file mode 100644 index d6568e6a28..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/MicroservicesDemoTenancyServiceModule.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Swashbuckle.AspNetCore.Swagger; -using Volo.Abp; -using Volo.Abp.AspNetCore.Modularity; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.Autofac; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.MultiTenancy; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; -using Volo.Abp.Permissions.EntityFrameworkCore; -using Volo.Abp.Security.Claims; - -namespace MicroserviceDemo.TenancyService -{ - [DependsOn(typeof(AbpAutofacModule))] - [DependsOn(typeof(AbpMultiTenancyEntityFrameworkCoreModule))] - [DependsOn(typeof(AbpMultiTenancyHttpApiModule))] - [DependsOn(typeof(AbpMultiTenancyApplicationModule))] - [DependsOn(typeof(AbpPermissionsEntityFrameworkCoreModule))] - [DependsOn(typeof(AbpAspNetCoreMultiTenancyModule))] - public class MicroservicesDemoTenancyServiceModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - var hostingEnvironment = services.GetSingletonInstance(); - var configuration = BuildConfiguration(hostingEnvironment); - - services.Configure(configuration); - - services.Configure(options => - { - options.Configure(context => - { - if (context.ExistingConnection != null) - { - context.DbContextOptions.UseSqlServer(context.ExistingConnection); - } - else - { - context.DbContextOptions.UseSqlServer(context.ConnectionString); - } - }); - }); - - services.AddSwaggerGen( - options => - { - options.SwaggerDoc("v1", new Info { Title = "Multi-Tenancy API", Version = "v1" }); - options.DocInclusionPredicate((docName, description) => true); - }); - - services.AddAuthentication("Bearer") - .AddIdentityServerAuthentication(options => - { - options.Authority = "http://abp-test-authserver.com:54307"; - options.RequireHttpsMetadata = false; - - options.ApiName = "multi-tenancy-api"; - - //This should be automatically done :( - options.InboundJwtClaimTypeMap["sub"] = AbpClaimTypes.UserId; - options.InboundJwtClaimTypeMap["role"] = AbpClaimTypes.Role; - options.InboundJwtClaimTypeMap["email"] = AbpClaimTypes.Email; - }); - - services.AddDistributedSqlServerCache(options => - { - options.ConnectionString = configuration.GetConnectionString("SqlServerCache"); - options.SchemaName = "dbo"; - options.TableName = "TestCache"; - }); - - services.AddAssemblyOf(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - var app = context.GetApplicationBuilder(); - - app.UseStaticFiles(); - - app.UseSwagger(); - app.UseSwaggerUI(options => - { - options.SwaggerEndpoint("/swagger/v1/swagger.json", "Multi-Tenancy API"); - }); - - app.UseAuthentication(); - - app.UseMultiTenancy(); - - app.UseMvcWithDefaultRoute(); - } - - private static IConfigurationRoot BuildConfiguration(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - - return builder.Build(); - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/20180227101655_Added_MultiTenancy_Module.Designer.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/20180227101655_Added_MultiTenancy_Module.Designer.cs deleted file mode 100644 index f77b15a304..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/20180227101655_Added_MultiTenancy_Module.Designer.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -using MicroserviceDemo.TenancyService.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace MicroserviceDemo.TenancyService.Migrations -{ - [DbContext(typeof(MigrationDbContext))] - [Migration("20180227101655_Added_MultiTenancy_Module")] - partial class Added_MultiTenancy_Module - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("MtTenants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.Property("TenantId"); - - b.Property("Name") - .HasMaxLength(128); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("MtTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.MultiTenancy.Tenant") - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/20180227101655_Added_MultiTenancy_Module.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/20180227101655_Added_MultiTenancy_Module.cs deleted file mode 100644 index df09be2697..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/20180227101655_Added_MultiTenancy_Module.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace MicroserviceDemo.TenancyService.Migrations -{ - public partial class Added_MultiTenancy_Module : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "MtTenants", - columns: table => new - { - Id = table.Column(nullable: false), - Name = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MtTenants", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MtTenantConnectionStrings", - columns: table => new - { - TenantId = table.Column(nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - Value = table.Column(maxLength: 1024, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MtTenantConnectionStrings", x => new { x.TenantId, x.Name }); - table.ForeignKey( - name: "FK_MtTenantConnectionStrings_MtTenants_TenantId", - column: x => x.TenantId, - principalTable: "MtTenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_MtTenants_Name", - table: "MtTenants", - column: "Name", - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MtTenantConnectionStrings"); - - migrationBuilder.DropTable( - name: "MtTenants"); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/MigrationDbContextModelSnapshot.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/MigrationDbContextModelSnapshot.cs deleted file mode 100644 index fb31d5f061..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Migrations/MigrationDbContextModelSnapshot.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -using MicroserviceDemo.TenancyService.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace MicroserviceDemo.TenancyService.Migrations -{ - [DbContext(typeof(MigrationDbContext))] - partial class MigrationDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("MtTenants"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.Property("TenantId"); - - b.Property("Name") - .HasMaxLength(128); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("MtTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.MultiTenancy.Tenant") - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Program.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Program.cs deleted file mode 100644 index 7fce24ea66..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; - -namespace MicroserviceDemo.TenancyService -{ - public class Program - { - public static void Main(string[] args) - { - BuildWebHostInternal(args).Run(); - } - - public static IWebHost BuildWebHostInternal(string[] args) => - new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseStartup() - .Build(); - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Properties/launchSettings.json b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Properties/launchSettings.json deleted file mode 100644 index c45d7b98d3..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://abp-test-tenancy.com:63877/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "MicroserviceDemo.TenancyService": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://abp-test-tenancy.com:63878/" - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Startup.cs b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Startup.cs deleted file mode 100644 index 795f768579..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/Startup.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Serilog; -using Volo.Abp; - -namespace MicroserviceDemo.TenancyService -{ - public class Startup - { - public IServiceProvider ConfigureServices(IServiceCollection services) - { - services.AddApplication(options => - { - options.UseAutofac(); - }); - - return services.BuildServiceProviderFromFactory(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory - .AddConsole() - .AddDebug() - .AddSerilog(new LoggerConfiguration() - .Enrich.FromLogContext() - .WriteTo.File("Logs/logs.txt") - .CreateLogger() - ); - - app.InitializeApplication(); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/appsettings.json b/src/MicroserviceDemo/MicroserviceDemo.TenancyService/appsettings.json deleted file mode 100644 index 0c40cf0c2f..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.TenancyService/appsettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=localhost;Database=MicroservicesDemo.Tenancy;Trusted_Connection=True;MultipleActiveResultSets=true", - "AbpPermissions": "Server=localhost;Database=MicroservicesDemo.Permissions;Trusted_Connection=True;MultipleActiveResultSets=true", - "SqlServerCache": "Server=localhost;Database=MicroservicesDemo.Cache;Trusted_Connection=True;MultipleActiveResultSets=true" - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs deleted file mode 100644 index 672911f8c6..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using IdentityModel.Client; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Newtonsoft.Json.Linq; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Ui; - -namespace MicroserviceDemo.Web.Controllers -{ - public class AccountController : AbpController - { - private readonly ITenantStore _tenantStore; - private readonly AspNetCoreMultiTenancyOptions _options; - - public AccountController(ITenantStore tenantStore, IOptions options) - { - _tenantStore = tenantStore; - _options = options.Value; - } - - public async Task Logout() - { - await HttpContext.SignOutAsync(IdentityConstants.ApplicationScheme); - await HttpContext.SignOutAsync("oidc"); - } - - public async Task CallApiUsingUserAccessToken() - { - var accessToken = await HttpContext.GetTokenAsync("access_token"); - - var client = new HttpClient(); - client.SetBearerToken(accessToken); - var content = await client.GetStringAsync("http://abp-test-tenancy.com:63877/identity"); - - ViewBag.Json = JObject.Parse(content).ToString(); - return View("json"); - } - - public async Task CallApiUsingClientCredentials() - { - var tokenClient = new TokenClient("http://abp-test-authserver.com:54307/connect/token", "client", "secret"); - var tokenResponse = await tokenClient.RequestClientCredentialsAsync("multi-tenancy-api"); - - var client = new HttpClient(); - client.SetBearerToken(tokenResponse.AccessToken); - var content = await client.GetStringAsync("http://abp-test-tenancy.com:63877/identity"); - - ViewBag.Json = JObject.Parse(content).ToString(); - return View("json"); - } - - public async Task SwitchTenant(string tenant = "") - { - if (tenant.IsNullOrEmpty()) - { - HttpContext.Response.Cookies.Delete(_options.TenantKey); - } - else - { - var tenantInfo = await FindTenantAsync(tenant); - if (tenantInfo == null) - { - throw new UserFriendlyException("Unknown tenant: " + tenant); - } - - HttpContext.Response.Cookies.Append( - _options.TenantKey, - tenantInfo.Id.ToString(), - new CookieOptions - { - Expires = DateTimeOffset.Now.AddYears(1) - } - ); - } - - return Redirect("/"); - } - - private async Task FindTenantAsync(string tenantIdOrName) - { - if (Guid.TryParse(tenantIdOrName, out var parsedTenantId)) - { - return await _tenantStore.FindAsync(parsedTenantId); - } - else - { - return await _tenantStore.FindAsync(tenantIdOrName); - } - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/MultiTenancyController.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/MultiTenancyController.cs deleted file mode 100644 index e4a8e3a6ad..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/MultiTenancyController.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Ui; - -namespace MicroserviceDemo.Web.Controllers -{ - /* TODO: This is temporary solution to switch tenant. - */ - - public class MultiTenancyController : AbpController - { - private readonly ITenantStore _tenantStore; - private readonly AspNetCoreMultiTenancyOptions _options; - - public MultiTenancyController(ITenantStore tenantStore, IOptions options) - { - _tenantStore = tenantStore; - _options = options.Value; - } - - public async Task SwitchTenant(string tenant = "") - { - if (tenant.IsNullOrEmpty()) - { - HttpContext.Response.Cookies.Delete(_options.TenantKey); - } - else - { - var tenantInfo = await FindTenantAsync(tenant); - if (tenantInfo == null) - { - throw new UserFriendlyException("Unknown tenant: " + tenant); - } - - HttpContext.Response.Cookies.Append( - _options.TenantKey, - tenantInfo.Id.ToString(), - new CookieOptions - { - Expires = DateTimeOffset.Now.AddYears(1) - } - ); - } - - return Redirect("/"); - } - - private async Task FindTenantAsync(string tenantIdOrName) - { - if (Guid.TryParse(tenantIdOrName, out var parsedTenantId)) - { - return await _tenantStore.FindAsync(parsedTenantId); - } - else - { - return await _tenantStore.FindAsync(tenantIdOrName); - } - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Db/MigrationDbContext.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Db/MigrationDbContext.cs deleted file mode 100644 index d80fbc7759..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Db/MigrationDbContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; - -namespace MicroserviceDemo.Web.Db -{ - public class MigrationDbContext : AbpDbContext - { - public MigrationDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.ConfigureAbpIdentity(); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Db/MigrationDbContextFactory.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Db/MigrationDbContextFactory.cs deleted file mode 100644 index c0862c7d76..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Db/MigrationDbContextFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace MicroserviceDemo.Web.Db -{ - /* This class is needed for EF Core command line tooling */ - - public class MigrationDbContextFactory : IDesignTimeDbContextFactory - { - public MigrationDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true"); - return new MigrationDbContext(builder.Options); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj deleted file mode 100644 index 70de5e7e7e..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroserviceDemo.Web.csproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - netcoreapp2.0 - ..\docker-compose.dcproj - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs deleted file mode 100644 index f0ff9fed1e..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authentication.OAuth.Claims; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.IdentityModel.Protocols.OpenIdConnect; -using Swashbuckle.AspNetCore.Swagger; -using Volo.Abp; -using Volo.Abp.AspNetCore.Authentication.OAuth; -using Volo.Abp.AspNetCore.Modularity; -using Volo.Abp.AspNetCore.MultiTenancy; -using Volo.Abp.AspNetCore.Mvc.Bundling; -using Volo.Abp.Autofac; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Http.Client; -using Volo.Abp.Identity; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Identity.Web; -using Volo.Abp.Modularity; -using Volo.Abp.MultiTenancy; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; -using Volo.Abp.MultiTenancy.Web; -using Volo.Abp.Permissions.EntityFrameworkCore; - -namespace MicroserviceDemo.Web -{ - [DependsOn(typeof(AbpAutofacModule))] - [DependsOn(typeof(AbpPermissionsEntityFrameworkCoreModule))] - [DependsOn(typeof(AbpIdentityApplicationModule))] - [DependsOn(typeof(AbpIdentityWebModule))] - [DependsOn(typeof(AbpIdentityEntityFrameworkCoreModule))] - [DependsOn(typeof(AbpMultiTenancyHttpApiClientModule))] - [DependsOn(typeof(AbpMultiTenancyWebModule))] - [DependsOn(typeof(AbpAspNetCoreAuthenticationOAuthModule))] - [DependsOn(typeof(AbpAspNetCoreMultiTenancyModule))] - [DependsOn(typeof(AbpMultiTenancyEntityFrameworkCoreModule))] - public class MicroservicesDemoWebModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - var hostingEnvironment = services.GetSingletonInstance(); //TODO: Create an extension method, like GetHostingEnvironment() ? - var configuration = BuildConfiguration(hostingEnvironment); - - services.Configure(configuration); - - services.Configure(options => - { - options.Configure(context => - { - if (context.ExistingConnection != null) - { - context.DbContextOptions.UseSqlServer(context.ExistingConnection); - } - else - { - context.DbContextOptions.UseSqlServer(context.ConnectionString); - } - }); - }); - - services.Configure(options => - { - //TODO: To the framework! - options.ScriptBundles.Add("GlobalScripts", new[] - { - "/Abp/ApplicationConfigurationScript?_v=" + DateTime.Now.Ticks, - "/Abp/ServiceProxyScript?_v=" + DateTime.Now.Ticks - }); - }); - - services.AddAuthentication(options => - { - options.DefaultChallengeScheme = "oidc"; - }) - .AddOpenIdConnect("oidc", options => - { - options.SignInScheme = IdentityConstants.ApplicationScheme; - - options.Authority = "http://abp-test-authserver.com:54307"; - options.RequireHttpsMetadata = false; - - options.ClientId = "client"; - options.ClientSecret = "secret"; - - options.ResponseType = OpenIdConnectResponseType.CodeIdToken; - - options.SaveTokens = true; - options.GetClaimsFromUserInfoEndpoint = true; - - options.Scope.Add("role"); - options.Scope.Add("email"); - options.Scope.Add("phone"); - options.Scope.Add("multi-tenancy-api"); - - options.ClaimActions.MapAbpClaimTypes(); - - options.Events.OnRedirectToIdentityProvider += context => - { - //TODO: ... - - var tenantId = context.HttpContext.RequestServices.GetRequiredService().Id?.ToString(); - if (!tenantId.IsNullOrEmpty()) - { - context.ProtocolMessage.Parameters[TenantResolverConsts.DefaultTenantKey] = tenantId; - } - - return Task.CompletedTask; - }; - }); - - services.Configure(configuration); - - services.AddSwaggerGen( - options => - { - options.SwaggerDoc("v1", new Info { Title = "Microservice Test Web API", Version = "v1" }); - options.DocInclusionPredicate((docName, description) => true); - }); - - services.AddDistributedSqlServerCache(options => - { - options.ConnectionString = configuration.GetConnectionString("SqlServerCache"); - options.SchemaName = "dbo"; - options.TableName = "TestCache"; - }); - - services.AddAssemblyOf(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - var app = context.GetApplicationBuilder(); - - if (context.GetEnvironment().IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseStaticFiles(); - app.UseVirtualFiles(); - - app.UseSwagger(); - app.UseSwaggerUI(options => - { - options.SwaggerEndpoint("/swagger/v1/swagger.json", "Microservice Test Web API"); - }); - - app.UseAuthentication(); - - app.UseMultiTenancy(); - - app.UseMvc(routes => - { - routes.MapRoute( - name: "defaultWithArea", - template: "{area}/{controller=Home}/{action=Index}/{id?}"); - - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - - //TODO: Create an extension method to IHostingEnvironment for that? - private static IConfigurationRoot BuildConfiguration(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - - return builder.Build(); - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180226091102_Installed_Identity_Module.Designer.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180226091102_Installed_Identity_Module.Designer.cs deleted file mode 100644 index 10f30a4254..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180226091102_Installed_Identity_Module.Designer.cs +++ /dev/null @@ -1,263 +0,0 @@ -// -using MicroserviceDemo.Web.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace MicroserviceDemo.Web.Migrations -{ - [DbContext(typeof(MigrationDbContext))] - [Migration("20180226091102_Installed_Identity_Module")] - partial class Installed_Identity_Module - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("TenantId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196); - - b.Property("TenantId"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(128); - - b.Property("Name"); - - b.Property("TenantId"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180226091102_Installed_Identity_Module.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180226091102_Installed_Identity_Module.cs deleted file mode 100644 index 9127ba6f36..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180226091102_Installed_Identity_Module.cs +++ /dev/null @@ -1,220 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace MicroserviceDemo.Web.Migrations -{ - public partial class Installed_Identity_Module : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "IdentityRoles", - columns: table => new - { - Id = table.Column(nullable: false), - ConcurrencyStamp = table.Column(nullable: true), - Name = table.Column(maxLength: 256, nullable: false), - NormalizedName = table.Column(maxLength: 256, nullable: false), - TenantId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityUsers", - columns: table => new - { - Id = table.Column(nullable: false), - AccessFailedCount = table.Column(nullable: false, defaultValue: 0), - ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), - Email = table.Column(maxLength: 256, nullable: true), - EmailConfirmed = table.Column(nullable: false, defaultValue: false), - LockoutEnabled = table.Column(nullable: false, defaultValue: false), - LockoutEnd = table.Column(nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), - NormalizedUserName = table.Column(maxLength: 256, nullable: false), - PasswordHash = table.Column(maxLength: 256, nullable: true), - PhoneNumber = table.Column(maxLength: 16, nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false, defaultValue: false), - SecurityStamp = table.Column(maxLength: 256, nullable: false), - TenantId = table.Column(nullable: true), - TwoFactorEnabled = table.Column(nullable: false, defaultValue: false), - UserName = table.Column(maxLength: 256, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - RoleId = table.Column(nullable: false), - TenantId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_IdentityRoleClaims_IdentityRoles_RoleId", - column: x => x.RoleId, - principalTable: "IdentityRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - TenantId = table.Column(nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_IdentityUserClaims_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserLogins", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 64, nullable: false), - ProviderDisplayName = table.Column(maxLength: 128, nullable: true), - ProviderKey = table.Column(maxLength: 196, nullable: false), - TenantId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserLogins", x => new { x.UserId, x.LoginProvider }); - table.ForeignKey( - name: "FK_IdentityUserLogins_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserRoles", - columns: table => new - { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false), - TenantId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_IdentityUserRoles_IdentityRoles_RoleId", - column: x => x.RoleId, - principalTable: "IdentityRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_IdentityUserRoles_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserTokens", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 128, nullable: false), - Name = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_IdentityUserTokens_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityRoleClaims_RoleId", - table: "IdentityRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityRoles_NormalizedName", - table: "IdentityRoles", - column: "NormalizedName"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserClaims_UserId", - table: "IdentityUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserLogins_LoginProvider_ProviderKey", - table: "IdentityUserLogins", - columns: new[] { "LoginProvider", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserRoles_RoleId_UserId", - table: "IdentityUserRoles", - columns: new[] { "RoleId", "UserId" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUsers_NormalizedEmail", - table: "IdentityUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUsers_NormalizedUserName", - table: "IdentityUsers", - column: "NormalizedUserName"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "IdentityRoleClaims"); - - migrationBuilder.DropTable( - name: "IdentityUserClaims"); - - migrationBuilder.DropTable( - name: "IdentityUserLogins"); - - migrationBuilder.DropTable( - name: "IdentityUserRoles"); - - migrationBuilder.DropTable( - name: "IdentityUserTokens"); - - migrationBuilder.DropTable( - name: "IdentityRoles"); - - migrationBuilder.DropTable( - name: "IdentityUsers"); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180313083424_IdentityUser_Added_Indexes.Designer.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180313083424_IdentityUser_Added_Indexes.Designer.cs deleted file mode 100644 index 71b187f28a..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180313083424_IdentityUser_Added_Indexes.Designer.cs +++ /dev/null @@ -1,272 +0,0 @@ -// -using MicroserviceDemo.Web.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace MicroserviceDemo.Web.Migrations -{ - [DbContext(typeof(MigrationDbContext))] - [Migration("20180313083424_IdentityUser_Added_Indexes")] - partial class IdentityUser_Added_Indexes - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("Email") - .HasColumnName("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("EmailConfirmed") - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasColumnName("PhoneNumber") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("PhoneNumberConfirmed") - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasColumnName("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("Email"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.HasIndex("UserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("TenantId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196); - - b.Property("TenantId"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(128); - - b.Property("Name"); - - b.Property("TenantId"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180313083424_IdentityUser_Added_Indexes.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180313083424_IdentityUser_Added_Indexes.cs deleted file mode 100644 index 131084362c..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/20180313083424_IdentityUser_Added_Indexes.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace MicroserviceDemo.Web.Migrations -{ - public partial class IdentityUser_Added_Indexes : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "IX_IdentityUsers_Email", - table: "IdentityUsers", - column: "Email"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUsers_UserName", - table: "IdentityUsers", - column: "UserName"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_IdentityUsers_Email", - table: "IdentityUsers"); - - migrationBuilder.DropIndex( - name: "IX_IdentityUsers_UserName", - table: "IdentityUsers"); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/MigrationDbContextModelSnapshot.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/MigrationDbContextModelSnapshot.cs deleted file mode 100644 index 3f0495a8e1..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Migrations/MigrationDbContextModelSnapshot.cs +++ /dev/null @@ -1,271 +0,0 @@ -// -using MicroserviceDemo.Web.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace MicroserviceDemo.Web.Migrations -{ - [DbContext(typeof(MigrationDbContext))] - partial class MigrationDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("Email") - .HasColumnName("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("EmailConfirmed") - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasColumnName("PhoneNumber") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("PhoneNumberConfirmed") - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasColumnName("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("Email"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.HasIndex("UserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("TenantId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196); - - b.Property("TenantId"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(128); - - b.Property("Name"); - - b.Property("TenantId"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml b/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml deleted file mode 100644 index 7cc98887ca..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml +++ /dev/null @@ -1,34 +0,0 @@ -@page -@using Microsoft.AspNetCore.Authentication -@using Microsoft.AspNetCore.Http -@model MicroserviceDemo.Web.Pages.IndexModel -@inject IHttpContextAccessor HttpContextAccessor -

- - - - Login - - @if (User.Identity.IsAuthenticated) - { - foreach (var claim in User.Claims) - { -

@claim.Type = @claim.Value
- } - } - -
- - @{ - var accessToken = await HttpContextAccessor.HttpContext.GetTokenAsync("access_token"); - var refreshToken = await HttpContextAccessor.HttpContext.GetTokenAsync("refresh_token"); - } - - accessToken = @accessToken
- refreshToken = @refreshToken
- - isInRole(admin) = @User.IsInRole("admin") - - - -

\ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml.cs deleted file mode 100644 index dca3bddd63..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; - -namespace MicroserviceDemo.Web.Pages -{ - public class IndexModel : PageModel - { - public void OnGet() - { - - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Program.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Program.cs deleted file mode 100644 index 6bcf14a1b8..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; - -namespace MicroserviceDemo.Web -{ - public class Program - { - public static void Main(string[] args) - { - BuildWebHostInternal(args).Run(); - } - - public static IWebHost BuildWebHostInternal(string[] args) => - new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseStartup() - .Build(); - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Properties/launchSettings.json b/src/MicroserviceDemo/MicroserviceDemo.Web/Properties/launchSettings.json deleted file mode 100644 index 0dc5bcbb84..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://abp-test-web.com:61144/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "MicroserviceDemo.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://abp-test-web.com:61145/" - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Startup.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Startup.cs deleted file mode 100644 index 5f798df736..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Startup.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Serilog; -using Volo.Abp; - -namespace MicroserviceDemo.Web -{ - public class Startup - { - public IServiceProvider ConfigureServices(IServiceCollection services) - { - services.AddApplication(options => - { - options.UseAutofac(); - }); - - return services.BuildServiceProviderFromFactory(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - loggerFactory - .AddConsole() - .AddDebug() - .AddSerilog(new LoggerConfiguration() - .Enrich.FromLogContext() - .WriteTo.File("Logs/logs.txt") - .CreateLogger() - ); - - app.InitializeApplication(); - } - } -} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Views/Shared/Json.cshtml b/src/MicroserviceDemo/MicroserviceDemo.Web/Views/Shared/Json.cshtml deleted file mode 100644 index ba89653efa..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/Views/Shared/Json.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -

API response

- -
@ViewBag.Json
\ No newline at end of file diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/appsettings.json b/src/MicroserviceDemo/MicroserviceDemo.Web/appsettings.json deleted file mode 100644 index 056c46bc29..0000000000 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/appsettings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=localhost;Database=MicroservicesDemo.Web;Trusted_Connection=True;MultipleActiveResultSets=true", - "AbpPermissions": "Server=localhost;Database=MicroservicesDemo.Permissions;Trusted_Connection=True;MultipleActiveResultSets=true", - "SqlServerCache": "Server=localhost;Database=MicroservicesDemo.Cache;Trusted_Connection=True;MultipleActiveResultSets=true", - "AbpMultiTenancy": "Server=localhost;Database=MicroservicesDemo.Tenancy;Trusted_Connection=True;MultipleActiveResultSets=true" - }, - "RemoteServices": { - "AbpMultiTenancy": { - "BaseUrl": "http://abp-test-tenancy.com:63877/" - } - } -} \ No newline at end of file diff --git a/src/MicroserviceDemo/README.md b/src/MicroserviceDemo/README.md deleted file mode 100644 index a025eb97ce..0000000000 --- a/src/MicroserviceDemo/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Micro-service Architecture Demo - -## Applications - -* **MicroserviceDemo.AuthServer**: Identity4 Server used for authentication. -* **MicroserviceDemo.TenancyService**: API service to manage tenants. -* **MicroserviceDemo.Web**: Web UI application to manage users, roles and tenants. - -## How To Run - -#### Run Database Migrations - -TODO:... Also need to seed database! - -#### Host File - -Add these lines into *C:\Windows\System32\drivers\etc\host* file: - -```` -127.0.0.1 openidclientdemo.com -127.0.0.1 abp-test-authserver.com -127.0.0.1 abp-test-web.com -127.0.0.1 abp-test-tenancy.com -```` - -#### IIS Express Configuration - -Add the sites into *C:\Users\%USER%\Documents\IISExpress\config\applicationhost.config* file: - -````xml - - - - - - - - - - - - - - - - - - - - - - - - - -```` - -... \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs b/src/Volo.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs deleted file mode 100644 index 21ec67aa81..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.IdentityServer; -using Volo.Abp.Modularity; -using Volo.Abp.VirtualFileSystem; - -namespace Volo.Abp.Account.Web -{ - [DependsOn(typeof(AbpAccountWebModule))] - [DependsOn(typeof(AbpIdentityServerDomainModule))] - public class AbpAccountWebIdentityServerModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.FileSets.AddEmbedded("Volo.Abp.Account.Web"); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Auth/SignInResultExtensions.cs b/src/Volo.Abp.Account.Web.IdentityServer/Auth/SignInResultExtensions.cs deleted file mode 100644 index ac229fbf52..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Auth/SignInResultExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.AspNetCore.Identity; - -namespace Volo.Abp.Account.Web.Auth -{ - //TODO: Move to the framework..? - public static class SignInResultExtensions - { - public static string GetResultAsString(this SignInResult signInResult) - { - if (signInResult.Succeeded) - { - return "Succeeded"; - } - - if (signInResult.IsLockedOut) - { - return "IsLockedOut"; - } - - if (signInResult.IsNotAllowed) - { - return "IsNotAllowed"; - } - - if (signInResult.RequiresTwoFactor) - { - return "RequiresTwoFactor"; - } - - return "Unknown"; - } - } -} diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Grants.cshtml b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Grants.cshtml deleted file mode 100644 index 1f02ca8888..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Grants.cshtml +++ /dev/null @@ -1,82 +0,0 @@ -@page -@using Volo.Abp.Account.Web.Pages.Account -@model GrantsModel - -@* TODO: Should work on the page HTML, copy/pasted from IDS4 samples *@ - -
- - @if (Model.Grants.Any() == false) - { -
-
-
- You have not given access to any applications -
-
-
- } - else - { - foreach (var grant in Model.Grants) - { -
-
- @if (grant.ClientLogoUrl != null) - { - - } -
-
-
@grant.ClientName
-
- Created: @grant.Created.ToString("yyyy-MM-dd") -
- @if (grant.Expires.HasValue) - { -
- Expires: @grant.Expires.Value.ToString("yyyy-MM-dd") -
- } - @if (grant.IdentityGrantNames.Any()) - { -
-
Identity Grants
-
    - @foreach (var name in grant.IdentityGrantNames) - { -
  • @name
  • - } -
-
- } - @if (grant.ApiGrantNames.Any()) - { -
-
API Grants
-
    - @foreach (var name in grant.ApiGrantNames) - { -
  • @name
  • - } -
-
- } -
-
-
- - -
-
-
- } - } -
\ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Grants.cshtml.cs b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Grants.cshtml.cs deleted file mode 100644 index eeb83453a6..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Grants.cshtml.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Account.Web.Pages.Account -{ - public class GrantsModel : AbpPageModel - { - public List Grants { get; set; } - - private readonly IIdentityServerInteractionService _interaction; - private readonly IClientStore _clients; - private readonly IResourceStore _resources; - - public GrantsModel(IIdentityServerInteractionService interaction, - IClientStore clients, - IResourceStore resources) - { - _interaction = interaction; - _clients = clients; - _resources = resources; - } - - public async Task OnGet() - { - Grants = new List(); - - foreach (var consent in await _interaction.GetAllUserConsentsAsync()) - { - var client = await _clients.FindClientByIdAsync(consent.ClientId); - if (client != null) - { - var resources = await _resources.FindResourcesByScopeAsync(consent.Scopes); - - var item = new GrantViewModel - { - ClientId = client.ClientId, - ClientName = client.ClientName ?? client.ClientId, - ClientLogoUrl = client.LogoUri, - ClientUrl = client.ClientUri, - Created = consent.CreationTime, - Expires = consent.Expiration, - IdentityGrantNames = resources.IdentityResources.Select(x => x.DisplayName ?? x.Name).ToArray(), - ApiGrantNames = resources.ApiResources.Select(x => x.DisplayName ?? x.Name).ToArray() - }; - - Grants.Add(item); - } - } - } - - public async Task OnPostRevokeAsync(string clientId) - { - await _interaction.RevokeUserConsentAsync(clientId); - return Redirect("/"); //TODO: ..? - } - - public class GrantViewModel - { - public string ClientId { get; set; } - public string ClientName { get; set; } - public string ClientUrl { get; set; } - public string ClientLogoUrl { get; set; } - public DateTime Created { get; set; } - public DateTime? Expires { get; set; } - public IEnumerable IdentityGrantNames { get; set; } - public IEnumerable ApiGrantNames { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Login.cshtml b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Login.cshtml deleted file mode 100644 index c5aac37e46..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Login.cshtml +++ /dev/null @@ -1,61 +0,0 @@ -@page -@model Volo.Abp.Account.Web.Pages.Account.IdentityServerLoginModel -
- - @if (Model.EnableLocalLogin) - { -
-
-
- - -
- - - -
-
- - - -
-
- -
- - @* TODO: Only show if identity server is used *@ -
- -
- Register -
-
-
- } - - @if (Model.VisibleExternalProviders.Any()) - { -
-

Use another service to log in.

-
- - - @foreach (var provider in Model.VisibleExternalProviders) - { - - } -
-
- } - - @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any()) - { -
- Invalid login request - There are no login schemes configured for this client. -
- } -
\ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Login.cshtml.cs b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Login.cshtml.cs deleted file mode 100644 index 2303e2b13f..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/Login.cshtml.cs +++ /dev/null @@ -1,336 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics; -using System.Linq; -using System.Security.Claims; -using System.Security.Principal; -using System.Threading.Tasks; -using IdentityModel; -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Volo.Abp.Account.Web.Auth; -using Volo.Abp.Identity; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Ui; -using Volo.Abp.Uow; - -namespace Volo.Abp.Account.Web.Pages.Account -{ - //TODO: Inherit from LoginModel of Account.Web project. We should design it as extensible. - public class IdentityServerLoginModel : AccountModelBase - { - [HiddenInput] - [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } - - [HiddenInput] - [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } - - [BindProperty] - public LoginInputModel LoginInput { get; set; } - - public bool EnableLocalLogin { get; set; } - - //TODO: Why there is an ExternalProviders if only the VisibleExternalProviders is used. - public IEnumerable ExternalProviders { get; set; } - public IEnumerable VisibleExternalProviders => ExternalProviders.Where(x => !String.IsNullOrWhiteSpace(x.DisplayName)); - - public bool IsExternalLoginOnly => EnableLocalLogin == false && ExternalProviders?.Count() == 1; - public string ExternalLoginScheme => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null; - - private readonly SignInManager _signInManager; - private readonly IdentityUserManager _userManager; - private readonly IIdentityServerInteractionService _interaction; - private readonly IAuthenticationSchemeProvider _schemeProvider; - private readonly AbpAccountOptions _accountOptions; - private readonly IClientStore _clientStore; - private readonly IEventService _identityServerEvents; - - public IdentityServerLoginModel( - SignInManager signInManager, - IdentityUserManager userManager, - IIdentityServerInteractionService interaction, - IAuthenticationSchemeProvider schemeProvider, - IOptions accountOptions, - IClientStore clientStore, - IEventService identityServerEvents) - { - _signInManager = signInManager; - _userManager = userManager; - _interaction = interaction; - _schemeProvider = schemeProvider; - _clientStore = clientStore; - _identityServerEvents = identityServerEvents; - _accountOptions = accountOptions.Value; - } - - public async Task OnGetAsync() - { - LoginInput = new LoginInputModel(); - - var context = await _interaction.GetAuthorizationContextAsync(ReturnUrl); - - if (context != null) - { - LoginInput.UserNameOrEmailAddress = context.LoginHint; - - //TODO: Reference AspNetCore MultiTenancy module and use options to get the tenant key! - var tenant = context.Parameters[TenantResolverConsts.DefaultTenantKey]; - if (tenant.IsNullOrEmpty()) - { - if (Request.Cookies.ContainsKey(TenantResolverConsts.DefaultTenantKey)) - { - CurrentTenant.Change(null); - Response.Cookies.Delete(TenantResolverConsts.DefaultTenantKey); - } - } - else - { - CurrentTenant.Change(Guid.Parse(tenant)); - Response.Cookies.Append(TenantResolverConsts.DefaultTenantKey, tenant); - } - } - - if (context?.IdP != null) - { - LoginInput.UserNameOrEmailAddress = context.LoginHint; - ExternalProviders = new[] { new ExternalProviderModel { AuthenticationScheme = context.IdP } }; - return; - } - - var schemes = await _schemeProvider.GetAllSchemesAsync(); - - var providers = schemes - .Where(x => x.DisplayName != null || x.Name.Equals(_accountOptions.WindowsAuthenticationSchemeName, StringComparison.OrdinalIgnoreCase)) - .Select(x => new ExternalProviderModel - { - DisplayName = x.DisplayName, - AuthenticationScheme = x.Name - }) - .ToList(); - - EnableLocalLogin = true; //TODO: We can get default from a setting? - if (context?.ClientId != null) - { - var client = await _clientStore.FindEnabledClientByIdAsync(context.ClientId); - if (client != null) - { - EnableLocalLogin = client.EnableLocalLogin; - - if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Any()) - { - providers = providers.Where(provider => client.IdentityProviderRestrictions.Contains(provider.AuthenticationScheme)).ToList(); - } - } - } - - ExternalProviders = providers.ToArray(); - - if (IsExternalLoginOnly) - { - //return await ExternalLogin(vm.ExternalLoginScheme, returnUrl); - throw new NotImplementedException(); - } - } - - [UnitOfWork] //TODO: Will be removed when we implement action filter - public virtual async Task OnPostAsync(string action) - { - if (action == "Cancel") - { - var context = await _interaction.GetAuthorizationContextAsync(ReturnUrl); - if (context == null) - { - return Redirect("~/"); - } - - await _interaction.GrantConsentAsync(context, ConsentResponse.Denied); - return Redirect(ReturnUrl); - } - - ValidateModel(); - - var result = await _signInManager.PasswordSignInAsync( - LoginInput.UserNameOrEmailAddress, - LoginInput.Password, - LoginInput.RememberMe, - true - ); - - //TODO: Find a way of getting user's id from the logged in user and do not query it again like that! - var user = await _userManager.FindByNameAsync(LoginInput.UserNameOrEmailAddress) ?? - await _userManager.FindByEmailAsync(LoginInput.UserNameOrEmailAddress); - - if (!result.Succeeded) - { - await _identityServerEvents.RaiseAsync(new UserLoginFailureEvent(LoginInput.UserNameOrEmailAddress, "Login failed: " + result.GetResultAsString())); - throw new UserFriendlyException("Login failed!"); //TODO: Handle other cases, do not throw exception - } - - Debug.Assert(user != null, nameof(user) + " != null"); - await _identityServerEvents.RaiseAsync(new UserLoginSuccessEvent(user.UserName, user.Id.ToString(), user.UserName)); //TODO: Use user's name once implemented - - if (!_interaction.IsValidReturnUrl(ReturnUrl)) - { - return Redirect("~/"); - } - - return Redirect(ReturnUrl); //ReturnUrlHash? - } - - [UnitOfWork] - public virtual async Task OnPostExternalLogin(string provider) - { - if (_accountOptions.WindowsAuthenticationSchemeName == provider) - { - return await ProcessWindowsLoginAsync(); - } - - var redirectUrl = Url.Page("./Login", pageHandler: "ExternalLoginCallback", values: new { ReturnUrl, ReturnUrlHash }); - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); - properties.Items["scheme"] = provider; - - return Challenge(properties, provider); - } - - [UnitOfWork] - public virtual async Task OnGetExternalLoginCallbackAsync(string returnUrl = "", string returnUrlHash = "", string remoteError = null) - { - //TODO: Did not implemented Identity Server 4 sample for this method (see ExternalLoginCallback in Quickstart of IDS4 sample) - /* Also did not implement these: - * - Logout(string logoutId) - */ - - if (remoteError != null) - { - Logger.LogWarning($"External login callback error: {remoteError}"); - return RedirectToPage("./Login"); - } - - var loginInfo = await _signInManager.GetExternalLoginInfoAsync(); - if (loginInfo == null) - { - Logger.LogWarning("External login info is not available"); - return RedirectToPage("./Login"); - } - - var result = await _signInManager.ExternalLoginSignInAsync( - loginInfo.LoginProvider, - loginInfo.ProviderKey, - isPersistent: false, - bypassTwoFactor: true - ); - - if (result.IsLockedOut) - { - throw new UserFriendlyException("Cannot proceed because user is locked out!"); - } - - if (result.Succeeded) - { - return RedirectSafely(returnUrl, returnUrlHash); - } - - //TODO: Handle other cases for result! - - // Get the information about the user from the external login provider - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - throw new ApplicationException("Error loading external login information during confirmation."); - } - - var user = await CreateExternalUserAsync(info); - - await _signInManager.SignInAsync(user, false); - return RedirectSafely(returnUrl, returnUrlHash); - } - - private async Task CreateExternalUserAsync(ExternalLoginInfo info) - { - var emailAddress = info.Principal.FindFirstValue(ClaimTypes.Email); - - var user = new IdentityUser(GuidGenerator.Create(), emailAddress, CurrentTenant.Id); - - CheckIdentityErrors(await _userManager.CreateAsync(user)); - CheckIdentityErrors(await _userManager.SetEmailAsync(user, emailAddress)); - CheckIdentityErrors(await _userManager.AddLoginAsync(user, info)); - - return user; - } - - private async Task ProcessWindowsLoginAsync() - { - var result = await HttpContext.AuthenticateAsync(_accountOptions.WindowsAuthenticationSchemeName); - if (!(result?.Principal is WindowsPrincipal windowsPrincipal)) - { - return Challenge(_accountOptions.WindowsAuthenticationSchemeName); - } - - var props = new AuthenticationProperties - { - RedirectUri = Url.Page("./Login", pageHandler: "ExternalLoginCallback", values: new { ReturnUrl, ReturnUrlHash }), - Items = - { - {"scheme", _accountOptions.WindowsAuthenticationSchemeName}, - } - }; - - var identity = new ClaimsIdentity(_accountOptions.WindowsAuthenticationSchemeName); - identity.AddClaim(new Claim(JwtClaimTypes.Subject, windowsPrincipal.Identity.Name)); - identity.AddClaim(new Claim(JwtClaimTypes.Name, windowsPrincipal.Identity.Name)); - - //TODO: Consider to add Windows groups the the identity - //if (_accountOptions.IncludeWindowsGroups) - //{ - // var windowsIdentity = windowsPrincipal.Identity as WindowsIdentity; - // if (windowsIdentity != null) - // { - // var groups = windowsIdentity.Groups?.Translate(typeof(NTAccount)); - // var roles = groups.Select(x => new Claim(JwtClaimTypes.Role, x.Value)); - // identity.AddClaims(roles); - // } - //} - - await HttpContext.SignInAsync( - IdentityServer4.IdentityServerConstants.ExternalCookieAuthenticationScheme, - new ClaimsPrincipal(identity), - props - ); - - return RedirectSafely(props.RedirectUri); - } - - public class LoginInputModel - { - [Required] - [StringLength(255)] - [Display(Name = "UserNameOrEmailAddress")] - public string UserNameOrEmailAddress { get; set; } - - [Required] - [StringLength(32)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [Display(Name = "RememberMe")] - public bool RememberMe { get; set; } - } - - public class ExternalProviderModel - { - public string DisplayName { get; set; } - public string AuthenticationScheme { get; set; } - } - } -} diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ScopeListItem.cshtml b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ScopeListItem.cshtml deleted file mode 100644 index 95fee3a858..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ScopeListItem.cshtml +++ /dev/null @@ -1,28 +0,0 @@ -@using Volo.Abp.Account.Web.Pages -@using Volo.Abp.Account.Web.Pages.Account -@model ConsentModel.ScopeViewModel -@* TODO: Should re-format this, just made copy/paste *@ -
  • -
    - -
    - @if (Model.Required) - { - (required) - } - @if (Model.Description != null) - { - - } -
  • \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ViewImports.cshtml b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ViewImports.cshtml deleted file mode 100644 index d1ac64721f..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml deleted file mode 100644 index fa3efda621..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml +++ /dev/null @@ -1,113 +0,0 @@ -@page -@using Volo.Abp.Account.Web.Pages -@using Volo.Abp.Account.Web.Pages.Account -@model ConsentModel - - -
    -
    -

    - @if (Model.ClientInfo.ClientLogoUrl != null) - { - - } - - @Model.ClientInfo.ClientName - is requesting your permission -

    -
    -
    -
    - -
    - - - -
    Uncheck the permissions you do not wish to grant.
    - - @if (Model.ConsentInput.IdentityScopes.Any()) - { -

    Personal Information

    - -
      - @for (var i = 0; i < Model.ConsentInput.IdentityScopes.Count; i++) - { -
    • -
      - -
      - @* TODO: Use attributes on the view model instead of using hidden here *@ - @if (Model.ConsentInput.IdentityScopes[i].Description != null) - { - - } -
    • - } -
    - } - - @if (Model.ConsentInput.ApiScopes.Any()) - { -

    Application Access

    - -
      - @for (var i = 0; i < Model.ConsentInput.ApiScopes.Count; i++) - { -
    • -
      - -
      - @* TODO: Use attributes on the view model instead of using hidden here *@ - @if (Model.ConsentInput.ApiScopes[i].Description != null) - { - - } -
    • - } -
    - } - - @if (Model.ClientInfo.AllowRememberConsent) - { -
    - -
    - } - -
    - - - @if (Model.ClientInfo.ClientUrl != null) - { - - @Model.ClientInfo.ClientName - - } -
    - -
    - -
    -
    -
    \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml.cs b/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml.cs deleted file mode 100644 index 4188b1b2a6..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Stores; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; -using Volo.Abp.Ui; - -namespace Volo.Abp.Account.Web.Pages -{ - //TODO: Move this into the Account folder!!! - public class ConsentModel : AbpPageModel - { - [HiddenInput] - [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } - - [HiddenInput] - [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } - - [BindProperty] - public ConsentModel.ConsentInputModel ConsentInput { get; set; } - - public ClientInfoModel ClientInfo { get; set; } - - private readonly IIdentityServerInteractionService _interaction; - private readonly IClientStore _clientStore; - private readonly IResourceStore _resourceStore; - - public ConsentModel( - IIdentityServerInteractionService interaction, - IClientStore clientStore, - IResourceStore resourceStore) - { - _interaction = interaction; - _clientStore = clientStore; - _resourceStore = resourceStore; - } - - public virtual async Task OnGet() - { - var request = await _interaction.GetAuthorizationContextAsync(ReturnUrl); - if (request == null) - { - throw new ApplicationException($"No consent request matching request: {ReturnUrl}"); - } - - var client = await _clientStore.FindEnabledClientByIdAsync(request.ClientId); - if (client == null) - { - throw new ApplicationException($"Invalid client id: {request.ClientId}"); - } - - var resources = await _resourceStore.FindEnabledResourcesByScopeAsync(request.ScopesRequested); - if (resources == null || (!resources.IdentityResources.Any() && !resources.ApiResources.Any())) - { - throw new ApplicationException($"No scopes matching: {request.ScopesRequested.Aggregate((x, y) => x + ", " + y)}"); - } - - ClientInfo = new ClientInfoModel(client); - ConsentInput = new ConsentInputModel - { - RememberConsent = true, - IdentityScopes = resources.IdentityResources.Select(x => CreateScopeViewModel(x, true)).ToList(), - ApiScopes = resources.ApiResources.SelectMany(x => x.Scopes).Select(x => CreateScopeViewModel(x, true)).ToList() - }; - - if (resources.OfflineAccess) - { - ConsentInput.ApiScopes.Add(GetOfflineAccessScope(true)); - } - } - - public virtual async Task OnPost(string userDecision) - { - var result = await ProcessConsentAsync(); - - if (result.IsRedirect) - { - return Redirect(result.RedirectUri); - } - - if (result.HasValidationError) - { - //ModelState.AddModelError("", result.ValidationError); - throw new ApplicationException("Error: " + result.ValidationError); - } - - throw new ApplicationException("Unknown Error!"); - } - - protected virtual async Task ProcessConsentAsync() - { - var result = new ConsentModel.ProcessConsentResult(); - - ConsentResponse grantedConsent; - - if (ConsentInput.UserDecision == "no") - { - grantedConsent = ConsentResponse.Denied; - } - else - { - if (ConsentInput.IdentityScopes.Any() || ConsentInput.ApiScopes.Any()) - { - grantedConsent = new ConsentResponse - { - RememberConsent = ConsentInput.RememberConsent, - ScopesConsented = ConsentInput.GetAllowedScopeNames() - }; - } - else - { - throw new UserFriendlyException("You must pick at least one permission"); //TODO: How to handle this - } - } - - if (grantedConsent != null) - { - var request = await _interaction.GetAuthorizationContextAsync(ReturnUrl); - if (request == null) - { - return result; - } - - await _interaction.GrantConsentAsync(request, grantedConsent); - - result.RedirectUri = ReturnUrl; //TODO: ReturnUrlHash? - } - - return result; - } - - protected virtual ConsentModel.ScopeViewModel CreateScopeViewModel(IdentityResource identity, bool check) - { - return new ConsentModel.ScopeViewModel - { - Name = identity.Name, - DisplayName = identity.DisplayName, - Description = identity.Description, - Emphasize = identity.Emphasize, - Required = identity.Required, - Checked = check || identity.Required - }; - } - - protected virtual ConsentModel.ScopeViewModel CreateScopeViewModel(Scope scope, bool check) - { - return new ConsentModel.ScopeViewModel - { - Name = scope.Name, - DisplayName = scope.DisplayName, - Description = scope.Description, - Emphasize = scope.Emphasize, - Required = scope.Required, - Checked = check || scope.Required - }; - } - - protected virtual ConsentModel.ScopeViewModel GetOfflineAccessScope(bool check) - { - return new ConsentModel.ScopeViewModel - { - Name = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, - DisplayName = "Offline Access", //TODO: Localize - Description = "Access to your applications and resources, even when you are offline", - Emphasize = true, - Checked = check - }; - } - - public class ConsentInputModel - { - public List IdentityScopes { get; set; } - - public List ApiScopes { get; set; } - - [Required] - public string UserDecision { get; set; } - - public bool RememberConsent { get; set; } - - public List GetAllowedScopeNames() - { - return IdentityScopes.Union(ApiScopes).Where(s => s.Checked).Select(s => s.Name).ToList(); - } - } - - public class ScopeViewModel - { - [Required] - [HiddenInput] - public string Name { get; set; } - - public bool Checked { get; set; } - - public string DisplayName { get; set; } - - public string Description { get; set; } - - public bool Emphasize { get; set; } - - public bool Required { get; set; } - } - - public class ProcessConsentResult - { - public bool IsRedirect => RedirectUri != null; - public string RedirectUri { get; set; } - - public bool HasValidationError => ValidationError != null; - public string ValidationError { get; set; } - } - - public class ClientInfoModel - { - public string ClientName { get; set; } - - public string ClientUrl { get; set; } - - public string ClientLogoUrl { get; set; } - - public bool AllowRememberConsent { get; set; } - - public ClientInfoModel(Client client) - { - //TODO: Automap - ClientName = client.ClientId; - ClientUrl = client.ClientUri; - ClientLogoUrl = client.LogoUri; - AllowRememberConsent = client.AllowRememberConsent; - } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Pages/_ViewImports.cshtml b/src/Volo.Abp.Account.Web.IdentityServer/Pages/_ViewImports.cshtml deleted file mode 100644 index 05e1baf060..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Pages/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Properties/launchSettings.json b/src/Volo.Abp.Account.Web.IdentityServer/Properties/launchSettings.json deleted file mode 100644 index 9201292f23..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:55202/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.Account.Web.IdentityServer": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55203/" - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj b/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj deleted file mode 100644 index 32143716e5..0000000000 --- a/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Account.Web.IdentityServer - Volo.Abp.Account.Web.IdentityServer - true - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - Volo.Abp.Account.Web - Library - - - - - - - - - - - - diff --git a/src/Volo.Abp.Account.Web/AbpAccountOptions.cs b/src/Volo.Abp.Account.Web/AbpAccountOptions.cs deleted file mode 100644 index 21e72155cc..0000000000 --- a/src/Volo.Abp.Account.Web/AbpAccountOptions.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Volo.Abp.Account.Web -{ - public class AbpAccountOptions - { - /// - /// Default value: . - /// - public string WindowsAuthenticationSchemeName { get; set; } - - public AbpAccountOptions() - { - //TODO: This makes us depend on the Microsoft.AspNetCore.Server.IISIntegration package. - WindowsAuthenticationSchemeName = Microsoft.AspNetCore.Server.IISIntegration.IISDefaults.AuthenticationScheme; - } - } -} diff --git a/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs b/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs deleted file mode 100644 index e35f0050ed..0000000000 --- a/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; -using Volo.Abp.Identity; -using Volo.Abp.Modularity; -using Volo.Abp.VirtualFileSystem; - -namespace Volo.Abp.Account.Web -{ - [DependsOn(typeof(AbpIdentityDomainModule))] - [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] - public class AbpAccountWebModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.FileSets.AddEmbedded("Volo.Abp.Account.Web"); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs b/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs deleted file mode 100644 index e1620ed342..0000000000 --- a/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Identity; - -namespace Volo.Abp.Account.Web.Areas.Account.Controllers -{ - [Area("Account")] - public class LogoutController : AbpController - { - private readonly SignInManager _signInManager; - - public LogoutController(SignInManager signInManager) - { - _signInManager = signInManager; - } - - public async Task Index() - { - await _signInManager.SignOutAsync(); - - return RedirectToPage("/Account/Login"); - } - } -} diff --git a/src/Volo.Abp.Account.Web/Pages/Account/AccountModelBase.cs b/src/Volo.Abp.Account.Web/Pages/Account/AccountModelBase.cs deleted file mode 100644 index 6398b98f7b..0000000000 --- a/src/Volo.Abp.Account.Web/Pages/Account/AccountModelBase.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; -using Volo.Abp.Ui; - -namespace Volo.Abp.Account.Web.Pages.Account -{ - public abstract class AccountModelBase : AbpPageModel - { - protected RedirectResult RedirectSafely(string returnUrl, string returnUrlHash = null) - { - return Redirect(GetRedirectUrl(returnUrl, returnUrlHash)); - } - - protected void CheckIdentityErrors(IdentityResult identityResult) - { - if (!identityResult.Succeeded) - { - throw new UserFriendlyException("Operation failed: " + identityResult.Errors.Select(e => $"[{e.Code}] {e.Description}").JoinAsString(", ")); - } - - //identityResult.CheckErrors(LocalizationManager); //TODO: Get from old Abp - } - - private string GetRedirectUrl(string returnUrl, string returnUrlHash = null) - { - returnUrl = NormalizeReturnUrl(returnUrl); - - if (!returnUrlHash.IsNullOrWhiteSpace()) - { - returnUrl = returnUrl + returnUrlHash; - } - - return returnUrl; - } - - private string NormalizeReturnUrl(string returnUrl) - { - if (returnUrl.IsNullOrEmpty()) - { - return GetAppHomeUrl(); - } - - if (Url.IsLocalUrl(returnUrl)) - { - return returnUrl; - } - - return GetAppHomeUrl(); - } - - private string GetAppHomeUrl() - { - return "/"; //TODO: ??? - } - } -} diff --git a/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml b/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml deleted file mode 100644 index de098fa3f9..0000000000 --- a/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@page -@model Volo.Abp.Account.Web.Pages.Account.LoginModel -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    - -
    - -
    - Register -
    -
    -
    - - @if (Model.ExternalLogins.Any()) - { -
    -

    Use another service to log in.

    -
    -
    - @foreach (var provider in Model.ExternalLogins) - { - - } -
    -
    -
    - } - -
    \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs b/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs deleted file mode 100644 index 5ef29b6a1e..0000000000 --- a/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Volo.Abp.Identity; -using Volo.Abp.Security.Claims; -using Volo.Abp.Ui; -using Volo.Abp.Uow; - -namespace Volo.Abp.Account.Web.Pages.Account -{ - public class LoginModel : AccountModelBase - { - public string ReturnUrl { get; set; } //TODO: Try to automatically bind from querystring! - - public string ReturnUrlHash { get; set; } //TODO: Try to automatically bind from querystring! - - public IList ExternalLogins { get; set; } - - private readonly SignInManager _signInManager; - private readonly IdentityUserManager _userManager; - - public LoginModel(SignInManager signInManager, IdentityUserManager userManager) - { - _signInManager = signInManager; - _userManager = userManager; - } - - public async Task OnGetAsync(string returnUrl = "", string returnUrlHash = "") - { - ReturnUrl = returnUrl; - ReturnUrlHash = returnUrl; - ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList(); - } - - //TODO: Bind input to a property instead of getting as parameter..? - [UnitOfWork] //TODO: Will be removed when we implement action filter - public virtual async Task OnPostAsync(PostInput input, string returnUrl = "", string returnUrlHash = "") - { - ReturnUrl = returnUrl; - ReturnUrlHash = returnUrl; - - ValidateModel(); - - var result = await _signInManager.PasswordSignInAsync( - input.UserNameOrEmailAddress, - input.Password, - input.RememberMe, - true - ); - - if (!result.Succeeded) - { - throw new UserFriendlyException("Login failed!"); //TODO: Handle other cases, do not throw exception - } - - return RedirectSafely(returnUrl, returnUrlHash); - } - - [UnitOfWork] - public virtual IActionResult OnPostExternalLogin(string provider, string returnUrl = "", string returnUrlHash = "") - { - var redirectUrl = Url.Page("./Login", pageHandler: "ExternalLoginCallback", values: new { returnUrl, returnUrlHash }); - - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); - - return new ChallengeResult(provider, properties); - } - - [UnitOfWork] - public virtual async Task OnGetExternalLoginCallbackAsync(string returnUrl = "", string returnUrlHash = "", string remoteError = null) - { - if (remoteError != null) - { - Logger.LogWarning($"External login callback error: {remoteError}"); - return RedirectToPage("./Login"); - } - - var loginInfo = await _signInManager.GetExternalLoginInfoAsync(); - if (loginInfo == null) - { - Logger.LogWarning("External login info is not available"); - return RedirectToPage("./Login"); - } - - var result = await _signInManager.ExternalLoginSignInAsync( - loginInfo.LoginProvider, - loginInfo.ProviderKey, - isPersistent: false, - bypassTwoFactor: true - ); - - if (result.IsLockedOut) - { - throw new UserFriendlyException("Cannot proceed because user is locked out!"); - } - - //TODO: Handle other cases - - if (result.Succeeded) - { - return RedirectSafely(returnUrl, returnUrlHash); - } - - // Get the information about the user from the external login provider - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - throw new ApplicationException("Error loading external login information during confirmation."); - } - - var user = await CreateExternalUserAsync(info); - - await _signInManager.SignInAsync(user, false); - return RedirectSafely(returnUrl, returnUrlHash); - } - - private async Task CreateExternalUserAsync(ExternalLoginInfo info) - { - var emailAddress = info.Principal.FindFirstValue(AbpClaimTypes.Email); - - var user = new IdentityUser(GuidGenerator.Create(), emailAddress, CurrentTenant.Id); - - CheckIdentityErrors(await _userManager.CreateAsync(user)); - CheckIdentityErrors(await _userManager.SetEmailAsync(user, emailAddress)); - CheckIdentityErrors(await _userManager.AddLoginAsync(user, info)); - - return user; - } - - public class PostInput - { - [Required] - [StringLength(255)] - public string UserNameOrEmailAddress { get; set; } - - [Required] - [StringLength(32)] - public string Password { get; set; } - - public bool RememberMe { get; set; } - } - } -} diff --git a/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml b/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml deleted file mode 100644 index b072302928..0000000000 --- a/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@page -@model Volo.Abp.Account.Web.Pages.Account.RegisterModel -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    - -
    -
    -
    \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs b/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs deleted file mode 100644 index d091f5d1c2..0000000000 --- a/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.Identity; -using Volo.Abp.Uow; - -namespace Volo.Abp.Account.Web.Pages.Account -{ - public class RegisterModel : AccountModelBase - { - public string ReturnUrl { get; set; } //TODO: Try to automatically bind from querystring! - - public string ReturnUrlHash { get; set; } //TODO: Try to automatically bind from querystring! - - private readonly IdentityUserManager _userManager; - private readonly SignInManager _signInManager; - - public RegisterModel(IdentityUserManager userManager, SignInManager signInManager) - { - _userManager = userManager; - _signInManager = signInManager; - } - - public void OnGet(string returnUrl = "", string returnUrlHash = "") - { - ReturnUrl = returnUrl; - ReturnUrlHash = returnUrl; - } - - //TODO: Bind input to a property instead of getting as parameter..? - [UnitOfWork] //TODO: Will be removed when we implement action filter - public virtual async Task OnPostAsync(PostInput input, string returnUrl = "", string returnUrlHash = "") - { - if (!ModelState.IsValid) - { - throw new NotImplementedException(); - } - - var user = new IdentityUser(GuidGenerator.Create(), input.UserName, CurrentTenant.Id); - - var result = await _userManager.CreateAsync(user, input.Password); - - if (!result.Succeeded) - { - throw new NotImplementedException(); - } - - await _userManager.SetEmailAsync(user, input.EmailAddress); - - await _signInManager.SignInAsync(user, isPersistent: false); - - return Redirect(returnUrl); //TODO: How to ensure safety? IdentityServer requires it however it should be checked somehow! - } - - public class PostInput - { - [Required] - [StringLength(32)] - public string UserName { get; set; } - - [Required] - [EmailAddress] - [StringLength(255)] - public string EmailAddress { get; set; } - - [Required] - [StringLength(32)] - public string Password { get; set; } - } - } -} diff --git a/src/Volo.Abp.Account.Web/Pages/Account/_ViewImports.cshtml b/src/Volo.Abp.Account.Web/Pages/Account/_ViewImports.cshtml deleted file mode 100644 index d1ac64721f..0000000000 --- a/src/Volo.Abp.Account.Web/Pages/Account/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web/Properties/launchSettings.json b/src/Volo.Abp.Account.Web/Properties/launchSettings.json deleted file mode 100644 index 6ea8ca0918..0000000000 --- a/src/Volo.Abp.Account.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:53098/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.Account.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:53099/" - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj b/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj deleted file mode 100644 index 71eca09c86..0000000000 --- a/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Account.Web - Volo.Abp.Account.Web - true - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - Volo.Abp.Account.Web - Library - - - - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.Application.Contracts/Properties/AssemblyInfo.cs b/src/Volo.Abp.Identity.Application.Contracts/Properties/AssemblyInfo.cs deleted file mode 100644 index 2d276baf9f..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.Identity.Application.Contracts")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c714a3ab-8402-4dc2-b120-accb2e29bd8f")] diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo.Abp.Identity.Application.Contracts.csproj b/src/Volo.Abp.Identity.Application.Contracts/Volo.Abp.Identity.Application.Contracts.csproj deleted file mode 100644 index 42ae0d8a47..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo.Abp.Identity.Application.Contracts.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.Application.Contracts - Volo.Abp.Identity.Application.Contracts - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs deleted file mode 100644 index 63223c67bd..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Application; -using Volo.Abp.Authorization; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Modularity; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - [DependsOn(typeof(AbpIdentityDomainSharedModule))] - [DependsOn(typeof(AbpAuthorizationModule))] - [DependsOn(typeof(AbpDddApplicationModule))] - [DependsOn(typeof(AbpPermissionsApplicationContractsModule))] - public class AbpIdentityApplicationContractsModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.DefinitionProviders.Add(); - }); - - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs deleted file mode 100644 index c5db3405a8..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityRolesInput.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.Identity -{ - public class GetIdentityRolesInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } -} diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityUsersInput.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityUsersInput.cs deleted file mode 100644 index 29c6e296e7..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/GetIdentityUsersInput.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.Identity -{ - public class GetIdentityUsersInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } -} diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs deleted file mode 100644 index e723226ac1..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityRoleAppService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Application.Services; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - public interface IIdentityRoleAppService : IAsyncCrudAppService - { - //TODO: remove after a better design - Task> GetAllListAsync(); - - Task GetPermissionsAsync(Guid id); - - Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input); - } -} diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs deleted file mode 100644 index 52330478b7..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IIdentityUserAppService.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - public interface IIdentityUserAppService : IAsyncCrudAppService - { - Task> GetRolesAsync(Guid id); - - Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input); - - Task GetPermissionsAsync(Guid id); - - Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input); - } -} diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissionDefinitionProvider.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissionDefinitionProvider.cs deleted file mode 100644 index f8e200dc2a..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissionDefinitionProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Volo.Abp.Authorization.Permissions; - -namespace Volo.Abp.Identity -{ - public class IdentityPermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var identityGroup = context.AddGroup(IdentityPermissions.GroupName); - - var rolesPermission = identityGroup.AddPermission(IdentityPermissions.Roles.Default); - rolesPermission.AddChild(IdentityPermissions.Roles.Create); - rolesPermission.AddChild(IdentityPermissions.Roles.Update); - rolesPermission.AddChild(IdentityPermissions.Roles.Delete); - rolesPermission.AddChild(IdentityPermissions.Roles.ManagePermissions); - - var usersPermission = identityGroup.AddPermission(IdentityPermissions.Users.Default); - usersPermission.AddChild(IdentityPermissions.Users.Create); - usersPermission.AddChild(IdentityPermissions.Users.Update); - usersPermission.AddChild(IdentityPermissions.Users.Delete); - usersPermission.AddChild(IdentityPermissions.Users.ManagePermissions); - } - } -} diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissions.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissions.cs deleted file mode 100644 index 0ab82132ff..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissions.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class IdentityPermissions - { - public const string GroupName = "AbpIdentity"; - - public static class Roles - { - public const string Default = GroupName + ".Roles"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManagePermissions = Default + ".ManagePermissions"; - } - - public static class Users - { - public const string Default = GroupName + ".Users"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManagePermissions = Default + ".ManagePermissions"; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateDto.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateDto.cs deleted file mode 100644 index d98edfb638..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.Identity -{ - public class IdentityRoleCreateDto : IdentityRoleCreateOrUpdateDtoBase - { - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateOrUpdateDtoBase.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateOrUpdateDtoBase.cs deleted file mode 100644 index 474e5cbd57..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleCreateOrUpdateDtoBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Volo.Abp.Identity -{ - public class IdentityRoleCreateOrUpdateDtoBase - { - [Required] - [StringLength(IdentityRoleConsts.MaxNameLength)] - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleDto.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleDto.cs deleted file mode 100644 index 13aa96f41b..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.Identity -{ - public class IdentityRoleDto : EntityDto - { - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleUpdateDto.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleUpdateDto.cs deleted file mode 100644 index c569957f23..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRoleUpdateDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.Identity -{ - public class IdentityRoleUpdateDto : IdentityRoleCreateOrUpdateDtoBase - { - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateDto.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateDto.cs deleted file mode 100644 index cc2e21eeda..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateDto.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Volo.Abp.Identity -{ - public class IdentityUserCreateDto : IdentityUserCreateOrUpdateDtoBase - { - [Required] - [StringLength(IdentityUserConsts.MaxPasswordLength)] - public string Password { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateDtoBase.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateDtoBase.cs deleted file mode 100644 index a3461fcd90..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateDtoBase.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using JetBrains.Annotations; - -namespace Volo.Abp.Identity -{ - public abstract class IdentityUserCreateOrUpdateDtoBase - { - [Required] - [StringLength(IdentityUserConsts.MaxUserNameLength)] - public string UserName { get; set; } - - [Required] - [EmailAddress] - [StringLength(IdentityUserConsts.MaxEmailLength)] - public string Email { get; set; } - - [StringLength(IdentityUserConsts.MaxPhoneNumberLength)] - public string PhoneNumber { get; set; } - - public bool TwoFactorEnabled { get; set; } - - public bool LockoutEnabled { get; set; } - - [CanBeNull] - public string[] RoleNames { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserDto.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserDto.cs deleted file mode 100644 index a5a549545b..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.Identity -{ - public class IdentityUserDto : EntityDto - { - public string UserName { get; set; } - - public string Email { get; set; } - - public bool EmailConfirmed { get; set; } - - public string PhoneNumber { get; set; } - - public bool PhoneNumberConfirmed { get; set; } - - public bool TwoFactorEnabled { get; set; } - - public bool LockoutEnabled { get; set; } - - public DateTimeOffset? LockoutEnd { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserUpdateDto.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserUpdateDto.cs deleted file mode 100644 index 3117ff8003..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserUpdateDto.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Volo.Abp.Identity -{ - public class IdentityUserUpdateDto : IdentityUserCreateOrUpdateDtoBase - { - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserUpdateRolesDto.cs b/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserUpdateRolesDto.cs deleted file mode 100644 index c6f86669b4..0000000000 --- a/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserUpdateRolesDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Volo.Abp.Identity -{ - public class IdentityUserUpdateRolesDto - { - [Required] - public string[] RoleNames { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application/Properties/AssemblyInfo.cs b/src/Volo.Abp.Identity.Application/Properties/AssemblyInfo.cs deleted file mode 100644 index e197afe6b9..0000000000 --- a/src/Volo.Abp.Identity.Application/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.Identity.Application")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("54592671-9cb6-48ae-9ae0-84cd016e87ff")] diff --git a/src/Volo.Abp.Identity.Application/Volo.Abp.Identity.Application.csproj b/src/Volo.Abp.Identity.Application/Volo.Abp.Identity.Application.csproj deleted file mode 100644 index d9541fcf58..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo.Abp.Identity.Application.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.Application - Volo.Abp.Identity.Application - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModule.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModule.cs deleted file mode 100644 index 0535eddf98..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModule.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; -using Volo.Abp.Permissions; -using Volo.Abp.Users; - -namespace Volo.Abp.Identity -{ - [DependsOn( - typeof(AbpIdentityDomainModule), - typeof(AbpIdentityApplicationContractsModule), - typeof(AbpAutoMapperModule), - typeof(AbpUsersModule), - typeof(AbpPermissionsApplicationModule) - )] - public class AbpIdentityApplicationModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.ManagementProviders.Add(); - options.ManagementProviders.Add(); - }); - - services.Configure(options => - { - options.AddProfile(); - }); - - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs deleted file mode 100644 index e796a0a7ae..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoMapper; - -namespace Volo.Abp.Identity -{ - public class AbpIdentityApplicationModuleAutoMapperProfile : Profile - { - public AbpIdentityApplicationModuleAutoMapperProfile() - { - CreateMap(); - CreateMap(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityAppServiceBase.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityAppServiceBase.cs deleted file mode 100644 index 3f1919323f..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityAppServiceBase.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Identity; -using Volo.Abp.Application.Services; - -namespace Volo.Abp.Identity -{ - public abstract class IdentityAppServiceBase : ApplicationService - { - protected void CheckIdentityErrors(IdentityResult identityResult) - { - if (!identityResult.Succeeded) - { - //TODO: A better exception that can be shown on UI as localized? - throw new AbpException("Operation failed: " + identityResult.Errors.Select(e => $"[{e.Code}] {e.Description}").JoinAsString(", ")); - } - - //identityResult.CheckErrors(LocalizationManager); //TODO: Get from old Abp - } - } -} diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs deleted file mode 100644 index e68b0b45e0..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityRoleAppService.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - [Authorize(IdentityPermissions.Roles.Default)] - public class IdentityRoleAppService : ApplicationService, IIdentityRoleAppService - { - private readonly IdentityRoleManager _roleManager; - private readonly IIdentityRoleRepository _roleRepository; - private readonly IPermissionAppServiceHelper _permissionAppServiceHelper; - - public IdentityRoleAppService( - IdentityRoleManager roleManager, - IIdentityRoleRepository roleRepository, - IPermissionAppServiceHelper permissionAppServiceHelper) - { - _roleManager = roleManager; - _roleRepository = roleRepository; - _permissionAppServiceHelper = permissionAppServiceHelper; - } - - public async Task GetAsync(Guid id) - { - return ObjectMapper.Map( - await _roleManager.GetByIdAsync(id) - ); - } - - public async Task> GetListAsync(GetIdentityRolesInput input) //TODO: Remove this method since it's not used - { - var count = (int) await _roleRepository.GetCountAsync(); - var list = await _roleRepository.GetListAsync(); - - return new PagedResultDto( - count, - ObjectMapper.Map, List>(list) - ); - } - - public async Task> GetAllListAsync() //TODO: Rename to GetList (however it's not possible because of the design of the IAsyncCrudAppService) - { - var list = await _roleRepository.GetListAsync(); - - return ObjectMapper.Map, List>(list); - } - - [Authorize(IdentityPermissions.Roles.ManagePermissions)] - public async Task GetPermissionsAsync(Guid id) - { - var role = await _roleRepository.GetAsync(id); - return await _permissionAppServiceHelper.GetAsync(RolePermissionValueProvider.ProviderName, role.Name); //TODO: User normalized role name instad of name? - } - - [Authorize(IdentityPermissions.Roles.ManagePermissions)] - public async Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input) - { - var role = await _roleRepository.GetAsync(id); - await _permissionAppServiceHelper.UpdateAsync(RolePermissionValueProvider.ProviderName, role.Name, input); - } - - [Authorize(IdentityPermissions.Roles.Create)] - public async Task CreateAsync(IdentityRoleCreateDto input) - { - var role = new IdentityRole(GuidGenerator.Create(), input.Name, CurrentTenant.Id); - - await _roleManager.CreateAsync(role); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(role); - } - - [Authorize(IdentityPermissions.Roles.Update)] - public async Task UpdateAsync(Guid id, IdentityRoleUpdateDto input) - { - var role = await _roleManager.GetByIdAsync(id); - - await _roleManager.SetRoleNameAsync(role, input.Name); - - await _roleManager.UpdateAsync(role); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(role); - } - - [Authorize(IdentityPermissions.Roles.Delete)] - public async Task DeleteAsync(Guid id) - { - var role = await _roleManager.FindByIdAsync(id.ToString()); - if (role == null) - { - return; - } - - await _roleManager.DeleteAsync(role); - } - } -} diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs deleted file mode 100644 index 9feb57504f..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - [Authorize(IdentityPermissions.Users.Default)] - public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppService - { - private readonly IdentityUserManager _userManager; - private readonly IIdentityUserRepository _userRepository; - private readonly IPermissionAppServiceHelper _permissionAppServiceHelper; - - public IdentityUserAppService( - IdentityUserManager userManager, - IIdentityUserRepository userRepository, - IPermissionAppServiceHelper permissionAppServiceHelper) - { - _userManager = userManager; - _userRepository = userRepository; - _permissionAppServiceHelper = permissionAppServiceHelper; - } - - public async Task GetAsync(Guid id) - { - return ObjectMapper.Map( - await _userManager.GetByIdAsync(id) - ); - } - - public async Task> GetListAsync(GetIdentityUsersInput input) - { - var count = await _userRepository.GetCountAsync(); - var list = await _userRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter); - - return new PagedResultDto( - count, - ObjectMapper.Map, List>(list) - ); - } - - public async Task> GetRolesAsync(Guid id) - { - var roles = await _userRepository.GetRolesAsync(id); - return new ListResultDto( - ObjectMapper.Map, List>(roles) - ); - } - - [Authorize(IdentityPermissions.Users.Create)] - public async Task CreateAsync(IdentityUserCreateDto input) - { - var user = new IdentityUser(GuidGenerator.Create(), input.UserName, CurrentTenant.Id); - - CheckIdentityErrors(await _userManager.CreateAsync(user, input.Password)); - await UpdateUserByInput(user, input); - - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(user); - } - - [Authorize(IdentityPermissions.Users.Update)] - public async Task UpdateAsync(Guid id, IdentityUserUpdateDto input) - { - var user = await _userManager.GetByIdAsync(id); - - CheckIdentityErrors(await _userManager.SetUserNameAsync(user, input.UserName)); - await UpdateUserByInput(user, input); - CheckIdentityErrors(await _userManager.UpdateAsync(user)); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(user); - } - - [Authorize(IdentityPermissions.Users.Delete)] - public async Task DeleteAsync(Guid id) - { - var user = await _userManager.FindByIdAsync(id.ToString()); - if (user == null) - { - return; - } - - CheckIdentityErrors(await _userManager.DeleteAsync(user)); - } - - [Authorize(IdentityPermissions.Users.Update)] - public async Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input) - { - var user = await _userManager.GetByIdAsync(id); - CheckIdentityErrors(await _userManager.SetRolesAsync(user, input.RoleNames)); - } - - [Authorize(IdentityPermissions.Users.ManagePermissions)] - public async Task GetPermissionsAsync(Guid id) - { - return await _permissionAppServiceHelper.GetAsync(UserPermissionValueProvider.ProviderName, id.ToString()); - } - - [Authorize(IdentityPermissions.Users.ManagePermissions)] - public async Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input) - { - await _permissionAppServiceHelper.UpdateAsync(UserPermissionValueProvider.ProviderName, id.ToString(), input); - } - - private async Task UpdateUserByInput(IdentityUser user, IdentityUserCreateOrUpdateDtoBase input) - { - CheckIdentityErrors(await _userManager.SetEmailAsync(user, input.Email)); - CheckIdentityErrors(await _userManager.SetPhoneNumberAsync(user, input.PhoneNumber)); - CheckIdentityErrors(await _userManager.SetTwoFactorEnabledAsync(user, input.TwoFactorEnabled)); - CheckIdentityErrors(await _userManager.SetLockoutEnabledAsync(user, input.LockoutEnabled)); - - if (input.RoleNames != null) - { - CheckIdentityErrors(await _userManager.SetRolesAsync(user, input.RoleNames)); - } - } - } -} diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/RolePermissionManagementProvider.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/RolePermissionManagementProvider.cs deleted file mode 100644 index 9e576827a4..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/RolePermissionManagementProvider.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Guids; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - public class RolePermissionManagementProvider : PermissionManagementProvider - { - public override string Name => RolePermissionValueProvider.ProviderName; - - private readonly IIdentityUserRepository _identityUserRepository; - - public RolePermissionManagementProvider( - IPermissionGrantRepository permissionGrantRepository, - IGuidGenerator guidGenerator, - IIdentityUserRepository identityUserRepository, - ICurrentTenant currentTenant) - : base( - permissionGrantRepository, - guidGenerator, - currentTenant) - { - _identityUserRepository = identityUserRepository; - } - - public override async Task CheckAsync(string name, string providerName, string providerKey) - { - if (providerName == Name) - { - return new PermissionValueProviderGrantInfo( - await PermissionGrantRepository.FindAsync(name, providerName, providerKey) != null, - providerKey - ); - } - - if (providerName == "User") - { - var userId = Guid.Parse(providerKey); - var roleNames = await _identityUserRepository.GetRoleNamesAsync(userId); - - foreach (var roleName in roleNames) - { - var permissionGrant = await PermissionGrantRepository.FindAsync(name, Name, roleName); - if (permissionGrant != null) - { - return new PermissionValueProviderGrantInfo(true, roleName); - } - } - } - - return PermissionValueProviderGrantInfo.NonGranted; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/UserPermissionManagementProvider.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/UserPermissionManagementProvider.cs deleted file mode 100644 index 8bed30d1f8..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/UserPermissionManagementProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Guids; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - public class UserPermissionManagementProvider : PermissionManagementProvider - { - public override string Name => UserPermissionValueProvider.ProviderName; - - public UserPermissionManagementProvider(IPermissionGrantRepository - permissionGrantRepository, - IGuidGenerator guidGenerator, - ICurrentTenant currentTenant) - : base( - permissionGrantRepository, - guidGenerator, - currentTenant) - { - - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Permissions/RolePermissionManagerExtensions.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Permissions/RolePermissionManagerExtensions.cs deleted file mode 100644 index 135ab02ebc..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Permissions/RolePermissionManagerExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Authorization.Permissions; - -namespace Volo.Abp.Permissions -{ - public static class RolePermissionManagerExtensions - { - public static Task GetForRoleAsync([NotNull] this IPermissionManager permissionManager, string roleName, string permissionName) - { - Check.NotNull(permissionManager, nameof(permissionManager)); - - return permissionManager.GetAsync(permissionName, RolePermissionValueProvider.ProviderName, roleName); - } - - public static Task> GetAllForRoleAsync([NotNull] this IPermissionManager permissionManager, string roleName) - { - Check.NotNull(permissionManager, nameof(permissionManager)); - - return permissionManager.GetAllAsync(RolePermissionValueProvider.ProviderName, roleName); - } - - public static Task SetForRoleAsync([NotNull] this IPermissionManager permissionManager, string roleName, [NotNull] string permissionName, bool isGranted) - { - Check.NotNull(permissionManager, nameof(permissionManager)); - - return permissionManager.SetAsync(permissionName, RolePermissionValueProvider.ProviderName, roleName, isGranted); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Application/Volo/Abp/Permissions/UserPermissionManagerExtensions.cs b/src/Volo.Abp.Identity.Application/Volo/Abp/Permissions/UserPermissionManagerExtensions.cs deleted file mode 100644 index cd5c910618..0000000000 --- a/src/Volo.Abp.Identity.Application/Volo/Abp/Permissions/UserPermissionManagerExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Authorization.Permissions; - -namespace Volo.Abp.Permissions -{ - public static class UserPermissionManagerExtensions - { - public static Task> GetAllForUserAsync([NotNull] this IPermissionManager permissionManager, Guid userId) - { - Check.NotNull(permissionManager, nameof(permissionManager)); - - return permissionManager.GetAllAsync(UserPermissionValueProvider.ProviderName, userId.ToString()); - } - - public static Task SetForUserAsync([NotNull] this IPermissionManager permissionManager, Guid userId, [NotNull] string name, bool isGranted) - { - Check.NotNull(permissionManager, nameof(permissionManager)); - - return permissionManager.SetAsync(name, UserPermissionValueProvider.ProviderName, userId.ToString(), isGranted); - } - } -} diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo.Abp.Identity.Domain.Shared.csproj b/src/Volo.Abp.Identity.Domain.Shared/Volo.Abp.Identity.Domain.Shared.csproj deleted file mode 100644 index f6f1b36532..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo.Abp.Identity.Domain.Shared.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.Domain.Shared - Volo.Abp.Identity.Domain.Shared - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/AbpIdentityDomainSharedModule.cs b/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/AbpIdentityDomainSharedModule.cs deleted file mode 100644 index bd4a869b20..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/AbpIdentityDomainSharedModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Identity -{ - public class AbpIdentityDomainSharedModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleClaimConsts.cs b/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleClaimConsts.cs deleted file mode 100644 index f53717486f..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleClaimConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class IdentityRoleClaimConsts - { - public const int MaxClaimTypeLength = IdentityUserClaimConsts.MaxClaimTypeLength; - - public const int MaxClaimValueLength = IdentityUserClaimConsts.MaxClaimValueLength; - } -} diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleConsts.cs b/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleConsts.cs deleted file mode 100644 index 11bde27f34..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleConsts.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class IdentityRoleConsts - { - public const int MaxNameLength = 256; - public const int MaxNormalizedNameLength = MaxNameLength; - } -} diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserClaimConsts.cs b/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserClaimConsts.cs deleted file mode 100644 index 025b255f11..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserClaimConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class IdentityUserClaimConsts - { - public const int MaxClaimTypeLength = 256; - - public const int MaxClaimValueLength = 1024; - } -} diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs b/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs deleted file mode 100644 index 3533796111..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class IdentityUserConsts - { - public const int MaxUserNameLength = 256; - - public const int MaxNormalizedUserNameLength = MaxUserNameLength; - - public const int MaxEmailLength = 256; - - public const int MaxNormalizedEmailLength = MaxEmailLength; - - public const int MaxPasswordLength = 32; - - public const int MaxPasswordHashLength = 256; - - public const int MaxSecurityStampLength = 256; - - public const int MaxConcurrencyStampLength = 256; - - public const int MaxPhoneNumberLength = 16; - } -} diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserLoginConsts.cs b/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserLoginConsts.cs deleted file mode 100644 index 0ef43bb1b1..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserLoginConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class IdentityUserLoginConsts - { - public const int MaxLoginProviderLength = 64; - public const int MaxProviderKeyLength = 196; - public const int MaxProviderDisplayNameLength = 128; - } -} diff --git a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserTokenConsts.cs b/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserTokenConsts.cs deleted file mode 100644 index 92305851fb..0000000000 --- a/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserTokenConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class IdentityUserTokenConsts - { - public const int MaxLoginProviderLength = 64; - - public const int MaxNameLength = 128; - } -} diff --git a/src/Volo.Abp.Identity.Domain/Microsoft/Extensions/DependencyInjection/AbpIdentityServiceCollectionExtensions.cs b/src/Volo.Abp.Identity.Domain/Microsoft/Extensions/DependencyInjection/AbpIdentityServiceCollectionExtensions.cs deleted file mode 100644 index 5a59253205..0000000000 --- a/src/Volo.Abp.Identity.Domain/Microsoft/Extensions/DependencyInjection/AbpIdentityServiceCollectionExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Volo.Abp.Identity; - -namespace Microsoft.Extensions.DependencyInjection -{ - public static class AbpIdentityServiceCollectionExtensions - { - public static IdentityBuilder AddAbpIdentity(this IServiceCollection services) - { - return services.AddAbpIdentity(setupAction: null); - } - - public static IdentityBuilder AddAbpIdentity(this IServiceCollection services, Action setupAction) - { - //AbpRoleManager - services.TryAddScoped(); - services.TryAddScoped(typeof(RoleManager), provider => provider.GetService(typeof(IdentityRoleManager))); - - //AbpUserManager - services.TryAddScoped(); - services.TryAddScoped(typeof(UserManager), provider => provider.GetService(typeof(IdentityUserManager))); - - //AbpSecurityStampValidator - services.TryAddScoped(); - services.TryAddScoped(typeof(SecurityStampValidator), provider => provider.GetService(typeof(AbpSecurityStampValidator))); - services.TryAddScoped(typeof(ISecurityStampValidator), provider => provider.GetService(typeof(AbpSecurityStampValidator))); - - //AbpUserStore - services.TryAddScoped(); - services.TryAddScoped(typeof(IUserStore), provider => provider.GetService(typeof(IdentityUserStore))); - - //AbpRoleStore - services.TryAddScoped(); - services.TryAddScoped(typeof(IRoleStore), provider => provider.GetService(typeof(IdentityRoleStore))); - - return services.AddIdentity(setupAction) - .AddDefaultTokenProviders() - .AddClaimsPrincipalFactory(); - //return services.AddIdentityCore(setupAction); - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Properties/AssemblyInfo.cs b/src/Volo.Abp.Identity.Domain/Properties/AssemblyInfo.cs deleted file mode 100644 index 9e3183705f..0000000000 --- a/src/Volo.Abp.Identity.Domain/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.Identity")] -[assembly: AssemblyTrademark("")] -[assembly: InternalsVisibleTo("Volo.Abp.Identity.Application.Tests")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("17dbb40a-243e-41f7-a672-fa316ecb1e33")] diff --git a/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj b/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj deleted file mode 100644 index dbda23dad3..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.Domain - Volo.Abp.Identity.Domain - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj.DotSettings b/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj.DotSettings deleted file mode 100644 index 58ad6c8854..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp71 \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityConsts.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityConsts.cs deleted file mode 100644 index 9998016302..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class AbpIdentityConsts - { - public const string DefaultDbTablePrefix = "Identity"; - - public const string DefaultDbSchema = null; - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs deleted file mode 100644 index f54bce7755..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Domain; -using Volo.Abp.Modularity; -using Volo.Abp.Permissions; -using Volo.Abp.Users; - -namespace Volo.Abp.Identity -{ - [DependsOn(typeof(AbpPermissionsDomainModule))] - [DependsOn(typeof(AbpDddDomainModule))] - [DependsOn(typeof(AbpIdentityDomainSharedModule))] - [DependsOn(typeof(AbpUsersModule))] - public class AbpIdentityDomainModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - var identityBuilder = services.AddAbpIdentity(); - services.ExecutePreConfiguredActions(identityBuilder); - - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpSecurityStampValidator.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpSecurityStampValidator.cs deleted file mode 100644 index 5259047096..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpSecurityStampValidator.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Options; -using Volo.Abp.Uow; - -namespace Volo.Abp.Identity -{ - public class AbpSecurityStampValidator : SecurityStampValidator - { - public AbpSecurityStampValidator( - IOptions options, - SignInManager signInManager, - ISystemClock systemClock) - : base( - options, - signInManager, - systemClock) - { - } - - [UnitOfWork] - public override Task ValidateAsync(CookieValidatePrincipalContext context) - { - return base.ValidateAsync(context); - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpUserClaimsPrincipalFactory.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpUserClaimsPrincipalFactory.cs deleted file mode 100644 index 10e7ae3c3f..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpUserClaimsPrincipalFactory.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Options; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Security.Claims; -using Volo.Abp.Uow; - -namespace Volo.Abp.Identity -{ - public class AbpUserClaimsPrincipalFactory : UserClaimsPrincipalFactory, ITransientDependency - { - public AbpUserClaimsPrincipalFactory( - UserManager userManager, - RoleManager roleManager, - IOptions options) - : base( - userManager, - roleManager, - options) - { - } - - [UnitOfWork] - public override async Task CreateAsync(IdentityUser user) - { - var principal = await base.CreateAsync(user); - - if (user.TenantId.HasValue) - { - principal.Identities.First().AddClaim(new Claim(AbpClaimTypes.TenantId, user.TenantId.ToString())); - } - - return principal; - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityRoleRepository.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityRoleRepository.cs deleted file mode 100644 index b68ac92ccd..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityRoleRepository.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.Identity -{ - public interface IIdentityRoleRepository : IBasicRepository - { - Task FindByNormalizedNameAsync(string normalizedRoleName, CancellationToken cancellationToken); - - Task> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0); - - Task GetCountAsync(CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs deleted file mode 100644 index 0f6acf0151..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Security.Claims; -using System.Threading; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.Identity -{ - public interface IIdentityUserRepository : IBasicRepository - { - Task FindByNormalizedUserNameAsync([NotNull] string normalizedUserName, CancellationToken cancellationToken = default); - - Task> GetRoleNamesAsync(Guid userId); - - Task FindByLoginAsync([NotNull] string loginProvider, [NotNull] string providerKey, CancellationToken cancellationToken = default); - - Task FindByNormalizedEmailAsync([NotNull] string normalizedEmail, CancellationToken cancellationToken = default); - - //TODO: Why not return List instead of IList - Task> GetListByClaimAsync(Claim claim, CancellationToken cancellationToken = default); - - //TODO: Why not return List instead of IList - Task> GetListByNormalizedRoleNameAsync(string normalizedRoleName, CancellationToken cancellationToken = default); - - //TODO: DTO can be used instead of parameters - Task> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter, CancellationToken cancellationToken = default); - - Task> GetRolesAsync(Guid userId); - - Task GetCountAsync(CancellationToken cancellationToken = default); - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaim.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaim.cs deleted file mode 100644 index d64218a68f..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaim.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Security.Claims; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Identity -{ - public abstract class IdentityClaim : Entity, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - /// - /// Gets or sets the claim type for this claim. - /// - public virtual string ClaimType { get; protected set; } - - /// - /// Gets or sets the claim value for this claim. - /// - public virtual string ClaimValue { get; protected set; } - - protected IdentityClaim() - { - - } - - protected internal IdentityClaim(Guid id, [NotNull] Claim claim, Guid? tenantId) - : this(id, claim.Type, claim.Value, tenantId) - { - - } - - protected internal IdentityClaim(Guid id, [NotNull] string claimType, string claimValue, Guid? tenantId) - { - Check.NotNull(claimType, nameof(claimType)); - - Id = id; - ClaimType = claimType; - ClaimValue = claimValue; - TenantId = tenantId; - } - - /// - /// Creates a Claim instance from this entity. - /// - /// - public virtual Claim ToClaim() - { - return new Claim(ClaimType, ClaimValue); - } - - public virtual void SetClaim([NotNull] Claim claim) - { - Check.NotNull(claim, nameof(claim)); - - ClaimType = claim.Type; - ClaimValue = claim.Value; - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRole.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRole.cs deleted file mode 100644 index 7b720862b0..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRole.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Security.Claims; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Guids; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Identity -{ - /// - /// Represents a role in the identity system - /// - public class IdentityRole : AggregateRoot, IHasConcurrencyStamp, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - /// - /// Gets or sets the name for this role. - /// - public virtual string Name { get; protected internal set; } - - /// - /// Gets or sets the normalized name for this role. - /// - public virtual string NormalizedName { get; protected internal set; } - - /// - /// Navigation property for claims in this role. - /// - public virtual ICollection Claims { get; protected set; } - - /// - /// A random value that should change whenever a role is persisted to the store - /// - public virtual string ConcurrencyStamp { get; set; } - - /// - /// Initializes a new instance of . - /// - protected IdentityRole() { } - - public IdentityRole(Guid id, [NotNull] string name, Guid? tenantId = null) - { - Check.NotNull(name, nameof(name)); - - Id = id; - Name = name; - TenantId = tenantId; - NormalizedName = name.ToUpperInvariant(); - ConcurrencyStamp = Guid.NewGuid().ToString(); - - Claims = new Collection(); - } - - public virtual void AddClaim([NotNull] IGuidGenerator guidGenerator, [NotNull] Claim claim) - { - Check.NotNull(guidGenerator, nameof(guidGenerator)); - Check.NotNull(claim, nameof(claim)); - - Claims.Add(new IdentityRoleClaim(guidGenerator.Create(), Id, claim, TenantId)); - } - - public virtual void AddClaims([NotNull] IGuidGenerator guidGenerator, [NotNull] IEnumerable claims) - { - Check.NotNull(guidGenerator, nameof(guidGenerator)); - Check.NotNull(claims, nameof(claims)); - - foreach (var claim in claims) - { - AddClaim(guidGenerator, claim); - } - } - - public virtual void RemoveClaim([NotNull] Claim claim) - { - Check.NotNull(claim, nameof(claim)); - - Claims.RemoveAll(c => c.ClaimType == claim.Type && c.ClaimValue == claim.Value); - } - - public override string ToString() - { - return $"{base.ToString()}, Name = {Name}"; - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleClaim.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleClaim.cs deleted file mode 100644 index 70cf33b3d5..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleClaim.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Security.Claims; -using JetBrains.Annotations; - -namespace Volo.Abp.Identity -{ - /// - /// Represents a claim that is granted to all users within a role. - /// - public class IdentityRoleClaim : IdentityClaim - { - /// - /// Gets or sets the of the primary key of the role associated with this claim. - /// - public virtual Guid RoleId { get; protected set; } - - protected IdentityRoleClaim() - { - - } - - protected internal IdentityRoleClaim( - Guid id, - Guid roleId, - [NotNull] Claim claim, - Guid? tenantId) - : base( - id, - claim, - tenantId) - { - RoleId = roleId; - } - - protected internal IdentityRoleClaim( - Guid id, - Guid roleId, - [NotNull] string claimType, - string claimValue, - Guid? tenantId) - : base( - id, - claimType, - claimValue, - tenantId) - { - RoleId = roleId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleManager.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleManager.cs deleted file mode 100644 index e59a056566..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleManager.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Services; -using Volo.Abp.Threading; - -namespace Volo.Abp.Identity -{ - public class IdentityRoleManager : RoleManager, IDomainService - { - protected override CancellationToken CancellationToken => _cancellationTokenProvider.Token; - - private readonly ICancellationTokenProvider _cancellationTokenProvider; - - public IdentityRoleManager( - IdentityRoleStore store, - IEnumerable> roleValidators, - ILookupNormalizer keyNormalizer, - IdentityErrorDescriber errors, - ILogger logger, - ICancellationTokenProvider cancellationTokenProvider) - : base( - store, - roleValidators, - keyNormalizer, - errors, - logger) - { - _cancellationTokenProvider = cancellationTokenProvider; - } - - public async Task GetByIdAsync(Guid id) - { - var role = await Store.FindByIdAsync(id.ToString(), CancellationToken); - if (role == null) - { - throw new EntityNotFoundException(typeof(IdentityRole), id); - } - - return role; - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleStore.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleStore.cs deleted file mode 100644 index 5a2781cd6e..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleStore.cs +++ /dev/null @@ -1,293 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Guids; - -namespace Volo.Abp.Identity -{ - /// - /// Creates a new instance of a persistence store for roles. - /// - public class IdentityRoleStore : - IRoleStore, - IRoleClaimStore, - ITransientDependency - { - private readonly IIdentityRoleRepository _roleRepository; - private readonly ILogger _logger; - private readonly IGuidGenerator _guidGenerator; - - /// - /// Constructs a new instance of . - /// - public IdentityRoleStore( - IIdentityRoleRepository roleRepository, - ILogger logger, - IGuidGenerator guidGenerator, - IdentityErrorDescriber describer = null) - { - _roleRepository = roleRepository; - _logger = logger; - _guidGenerator = guidGenerator; - - ErrorDescriber = describer ?? new IdentityErrorDescriber(); - } - - /// - /// Gets or sets the for any error that occurred with the current operation. - /// - public IdentityErrorDescriber ErrorDescriber { get; set; } - - /// - /// Gets or sets a flag indicating if changes should be persisted after CreateAsync, UpdateAsync and DeleteAsync are called. - /// - /// - /// True if changes should be automatically persisted, otherwise false. - /// - public bool AutoSaveChanges { get; set; } = true; - - /// - /// Creates a new role in a store as an asynchronous operation. - /// - /// The role to create in the store. - /// The used to propagate notifications that the operation should be canceled. - /// A that represents the of the asynchronous query. - public virtual async Task CreateAsync([NotNull] IdentityRole role, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - await _roleRepository.InsertAsync(role, AutoSaveChanges, cancellationToken); - - return IdentityResult.Success; - } - - /// - /// Updates a role in a store as an asynchronous operation. - /// - /// The role to update in the store. - /// The used to propagate notifications that the operation should be canceled. - /// A that represents the of the asynchronous query. - public virtual async Task UpdateAsync([NotNull] IdentityRole role, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - try - { - await _roleRepository.UpdateAsync(role, AutoSaveChanges, cancellationToken); - } - catch (AbpDbConcurrencyException ex) - { - _logger.LogWarning(ex.ToString()); //Trigger some AbpHandledException event - return IdentityResult.Failed(ErrorDescriber.ConcurrencyFailure()); - } - - return IdentityResult.Success; - } - - /// - /// Deletes a role from the store as an asynchronous operation. - /// - /// The role to delete from the store. - /// The used to propagate notifications that the operation should be canceled. - /// A that represents the of the asynchronous query. - public virtual async Task DeleteAsync([NotNull] IdentityRole role, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - try - { - await _roleRepository.DeleteAsync(role, AutoSaveChanges, cancellationToken); - } - catch (AbpDbConcurrencyException ex) - { - _logger.LogWarning(ex.ToString()); //Trigger some AbpHandledException event - return IdentityResult.Failed(ErrorDescriber.ConcurrencyFailure()); - } - - return IdentityResult.Success; - } - - /// - /// Gets the ID for a role from the store as an asynchronous operation. - /// - /// The role whose ID should be returned. - /// The used to propagate notifications that the operation should be canceled. - /// A that contains the ID of the role. - public Task GetRoleIdAsync([NotNull] IdentityRole role, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - return Task.FromResult(role.Id.ToString()); - } - - /// - /// Gets the name of a role from the store as an asynchronous operation. - /// - /// The role whose name should be returned. - /// The used to propagate notifications that the operation should be canceled. - /// A that contains the name of the role. - public Task GetRoleNameAsync([NotNull] IdentityRole role, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - return Task.FromResult(role.Name); - } - - /// - /// Sets the name of a role in the store as an asynchronous operation. - /// - /// The role whose name should be set. - /// The name of the role. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public Task SetRoleNameAsync([NotNull] IdentityRole role, string roleName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - role.Name = roleName; - return Task.CompletedTask; - } - - /// - /// Finds the role who has the specified ID as an asynchronous operation. - /// - /// The role ID to look for. - /// The used to propagate notifications that the operation should be canceled. - /// A that result of the look up. - public virtual Task FindByIdAsync(string id, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - return _roleRepository.FindAsync(Guid.Parse(id), cancellationToken); - } - - /// - /// Finds the role who has the specified normalized name as an asynchronous operation. - /// - /// The normalized role name to look for. - /// The used to propagate notifications that the operation should be canceled. - /// A that result of the look up. - public virtual Task FindByNameAsync([NotNull] string normalizedName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(normalizedName, nameof(normalizedName)); - - return _roleRepository.FindByNormalizedNameAsync(normalizedName, cancellationToken); - } - - /// - /// Get a role's normalized name as an asynchronous operation. - /// - /// The role whose normalized name should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// A that contains the name of the role. - public virtual Task GetNormalizedRoleNameAsync([NotNull] IdentityRole role, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - return Task.FromResult(role.NormalizedName); - } - - /// - /// Set a role's normalized name as an asynchronous operation. - /// - /// The role whose normalized name should be set. - /// The normalized name to set - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetNormalizedRoleNameAsync([NotNull] IdentityRole role, string normalizedName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - role.NormalizedName = normalizedName; - - return Task.CompletedTask; - } - - /// - /// Dispose the stores - /// - public void Dispose() - { - } - - /// - /// Get the claims associated with the specified as an asynchronous operation. - /// - /// The role whose claims should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// A that contains the claims granted to a role. - public async Task> GetClaimsAsync([NotNull] IdentityRole role, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - - await _roleRepository.EnsureCollectionLoadedAsync(role, r => r.Claims, cancellationToken); - - return role.Claims.Select(c => c.ToClaim()).ToList(); - } - - /// - /// Adds the given to the specified . - /// - /// The role to add the claim to. - /// The claim to add to the role. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public async Task AddClaimAsync([NotNull] IdentityRole role, [NotNull] Claim claim, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(role, nameof(role)); - Check.NotNull(claim, nameof(claim)); - - await _roleRepository.EnsureCollectionLoadedAsync(role, r => r.Claims, cancellationToken); - - role.AddClaim(_guidGenerator, claim); - } - - /// - /// Removes the given from the specified . - /// - /// The role to remove the claim from. - /// The claim to remove from the role. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public async Task RemoveClaimAsync([NotNull] IdentityRole role, [NotNull] Claim claim, CancellationToken cancellationToken = default) - { - Check.NotNull(role, nameof(role)); - Check.NotNull(claim, nameof(claim)); - - await _roleRepository.EnsureCollectionLoadedAsync(role, r => r.Claims, cancellationToken); - - role.RemoveClaim(claim); - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs deleted file mode 100644 index 8e7f79cc35..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Security.Claims; -using JetBrains.Annotations; -using Microsoft.AspNetCore.Identity; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Guids; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Identity -{ - public class IdentityUser : AggregateRoot, IHasConcurrencyStamp, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - /// - /// Gets or sets the user name for this user. - /// - public virtual string UserName { get; protected internal set; } - - /// - /// Gets or sets the normalized user name for this user. - /// - public virtual string NormalizedUserName { get; protected internal set; } - - /// - /// Gets or sets the email address for this user. - /// - public virtual string Email { get; protected internal set; } - - /// - /// Gets or sets the normalized email address for this user. - /// - public virtual string NormalizedEmail { get; protected internal set; } - - /// - /// Gets or sets a flag indicating if a user has confirmed their email address. - /// - /// True if the email address has been confirmed, otherwise false. - public virtual bool EmailConfirmed { get; protected internal set; } - - /// - /// Gets or sets a salted and hashed representation of the password for this user. - /// - public virtual string PasswordHash { get; protected internal set; } - - /// - /// A random value that must change whenever a users credentials change (password changed, login removed) - /// - public virtual string SecurityStamp { get; protected internal set; } - - /// - /// A random value that must change whenever a user is persisted to the store - /// - public virtual string ConcurrencyStamp { get; set; } - - /// - /// Gets or sets a telephone number for the user. - /// - public virtual string PhoneNumber { get; protected internal set; } - - /// - /// Gets or sets a flag indicating if a user has confirmed their telephone address. - /// - /// True if the telephone number has been confirmed, otherwise false. - public virtual bool PhoneNumberConfirmed { get; protected internal set; } - - /// - /// Gets or sets a flag indicating if two factor authentication is enabled for this user. - /// - /// True if 2fa is enabled, otherwise false. - public virtual bool TwoFactorEnabled { get; protected internal set; } - - /// - /// Gets or sets the date and time, in UTC, when any user lockout ends. - /// - /// - /// A value in the past means the user is not locked out. - /// - public virtual DateTimeOffset? LockoutEnd { get; protected internal set; } - - /// - /// Gets or sets a flag indicating if the user could be locked out. - /// - /// True if the user could be locked out, otherwise false. - public virtual bool LockoutEnabled { get; protected internal set; } - - /// - /// Gets or sets the number of failed login attempts for the current user. - /// - public virtual int AccessFailedCount { get; protected internal set; } - - //TODO: Can we make collections readonly collection, which will provide encapsulation. But... can work for all ORMs? - - /// - /// Navigation property for the roles this user belongs to. - /// - public virtual ICollection Roles { get; protected set; } - - /// - /// Navigation property for the claims this user possesses. - /// - public virtual ICollection Claims { get; protected set; } - - /// - /// Navigation property for this users login accounts. - /// - public virtual ICollection Logins { get; protected set; } - - /// - /// Navigation property for this users tokens. - /// - public virtual ICollection Tokens { get; protected set; } - - protected IdentityUser() - { - - } - - public IdentityUser(Guid id, [NotNull] string userName, Guid? tenantId = null) - { - Check.NotNull(userName, nameof(userName)); - - Id = id; - TenantId = tenantId; - UserName = userName; - NormalizedUserName = userName.ToUpperInvariant(); - ConcurrencyStamp = Guid.NewGuid().ToString(); - SecurityStamp = Guid.NewGuid().ToString(); - - Roles = new Collection(); - Claims = new Collection(); - Logins = new Collection(); - Tokens = new Collection(); - } - - public virtual void AddRole(Guid roleId) - { - Check.NotNull(roleId, nameof(roleId)); - - if (IsInRole(roleId)) - { - return; - } - - Roles.Add(new IdentityUserRole(Id, roleId, TenantId)); - } - - public virtual void RemoveRole(Guid roleId) - { - Check.NotNull(roleId, nameof(roleId)); - - if (!IsInRole(roleId)) - { - return; - } - - Roles.RemoveAll(r => r.RoleId == roleId); - } - - public virtual bool IsInRole(Guid roleId) - { - Check.NotNull(roleId, nameof(roleId)); - - return Roles.Any(r => r.RoleId == roleId); - } - - public virtual void AddClaim([NotNull] IGuidGenerator guidGenerator, [NotNull] Claim claim) - { - Check.NotNull(guidGenerator, nameof(guidGenerator)); - Check.NotNull(claim, nameof(claim)); - - Claims.Add(new IdentityUserClaim(guidGenerator.Create(), Id, claim, TenantId)); - } - - public virtual void AddClaims([NotNull] IGuidGenerator guidGenerator, [NotNull] IEnumerable claims) - { - Check.NotNull(guidGenerator, nameof(guidGenerator)); - Check.NotNull(claims, nameof(claims)); - - foreach (var claim in claims) - { - AddClaim(guidGenerator, claim); - } - } - - public virtual void ReplaceClaim([NotNull] Claim claim, [NotNull] Claim newClaim) - { - Check.NotNull(claim, nameof(claim)); - Check.NotNull(newClaim, nameof(newClaim)); - - var userClaims = Claims.Where(uc => uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type); - foreach (var userClaim in userClaims) - { - userClaim.SetClaim(newClaim); - } - } - - public virtual void RemoveClaims([NotNull] IEnumerable claims) - { - Check.NotNull(claims, nameof(claims)); - - foreach (var claim in claims) - { - RemoveClaim(claim); - } - } - - public virtual void RemoveClaim([NotNull] Claim claim) - { - Check.NotNull(claim, nameof(claim)); - - Claims.RemoveAll(c => c.ClaimValue == claim.Value && c.ClaimType == claim.Type); - } - - public virtual void AddLogin([NotNull] UserLoginInfo login) - { - Check.NotNull(login, nameof(login)); - - Logins.Add(new IdentityUserLogin(Id, login, TenantId)); - } - - public virtual void RemoveLogin([NotNull] string loginProvider, [NotNull] string providerKey) - { - Check.NotNull(loginProvider, nameof(loginProvider)); - Check.NotNull(providerKey, nameof(providerKey)); - - Logins.RemoveAll(userLogin => userLogin.LoginProvider == loginProvider && userLogin.ProviderKey == providerKey); - } - - [CanBeNull] - public virtual IdentityUserToken FindToken(string loginProvider, string name) - { - return Tokens.FirstOrDefault(t => t.LoginProvider == loginProvider && t.Name == name); - } - - public virtual void SetToken(string loginProvider, string name, string value) - { - var token = FindToken(loginProvider, name); - if (token == null) - { - Tokens.Add(new IdentityUserToken(Id, loginProvider, name, value, TenantId)); - } - else - { - token.Value = value; - } - } - - public virtual void RemoveToken(string loginProvider, string name) - { - Tokens.RemoveAll(t => t.LoginProvider == loginProvider && t.Name == name); - } - - public override string ToString() - { - return $"{base.ToString()}, UserName = {UserName}"; - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserClaim.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserClaim.cs deleted file mode 100644 index d302beb7c2..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserClaim.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Security.Claims; -using JetBrains.Annotations; - -namespace Volo.Abp.Identity -{ - /// - /// Represents a claim that a user possesses. - /// - public class IdentityUserClaim : IdentityClaim - { - /// - /// Gets or sets the primary key of the user associated with this claim. - /// - public virtual Guid UserId { get; protected set; } - - protected IdentityUserClaim() - { - - } - - protected internal IdentityUserClaim(Guid id, Guid userId, [NotNull] Claim claim, Guid? tenantId) - : base(id, claim, tenantId) - { - UserId = userId; - } - - protected internal IdentityUserClaim(Guid id, Guid userId, [NotNull] string claimType, string claimValue, Guid? tenantId) - : base(id, claimType, claimValue, tenantId) - { - UserId = userId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserExtensions.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserExtensions.cs deleted file mode 100644 index 760a045116..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Volo.Abp.Users; - -namespace Volo.Abp.Identity -{ - public static class IdentityUserExtensions - { - public static IUserInfo ToUserInfo(this IdentityUser user) - { - return new UserInfo( - user.Id, - user.UserName, - user.Email, - user.EmailConfirmed, - user.PhoneNumber, - user.PhoneNumberConfirmed - ); - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserLogin.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserLogin.cs deleted file mode 100644 index f0747708e6..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserLogin.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using JetBrains.Annotations; -using Microsoft.AspNetCore.Identity; -using Volo.Abp.Domain.Entities; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Identity -{ - /// - /// Represents a login and its associated provider for a user. - /// - public class IdentityUserLogin : Entity, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - /// - /// Gets or sets the of the primary key of the user associated with this login. - /// - public virtual Guid UserId { get; protected set; } - - /// - /// Gets or sets the login provider for the login (e.g. facebook, google) - /// - public virtual string LoginProvider { get; protected set; } - - /// - /// Gets or sets the unique provider identifier for this login. - /// - public virtual string ProviderKey { get; protected set; } - - /// - /// Gets or sets the friendly name used in a UI for this login. - /// - public virtual string ProviderDisplayName { get; protected set; } - - protected IdentityUserLogin() - { - - } - - protected internal IdentityUserLogin( - Guid userId, - [NotNull] string loginProvider, - [NotNull] string providerKey, - string providerDisplayName, - Guid? tenantId) - { - Check.NotNull(loginProvider, nameof(loginProvider)); - Check.NotNull(providerKey, nameof(providerKey)); - - UserId = userId; - LoginProvider = loginProvider; - ProviderKey = providerKey; - ProviderDisplayName = providerDisplayName; - TenantId = tenantId; - } - - protected internal IdentityUserLogin( - Guid userId, - [NotNull] UserLoginInfo login, - Guid? tenantId) - : this( - userId, - login.LoginProvider, - login.ProviderKey, - login.ProviderDisplayName, - tenantId) - { - } - - public UserLoginInfo ToUserLoginInfo() - { - return new UserLoginInfo(LoginProvider, ProviderKey, ProviderDisplayName); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserLookupService.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserLookupService.cs deleted file mode 100644 index de92191d63..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserLookupService.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Users; - -namespace Volo.Abp.Identity -{ - public class IdentityUserLookupService : IUserLookupService, ITransientDependency - { - private readonly IIdentityUserRepository _userRepository; - private readonly ILookupNormalizer _lookupNormalizer; - - public IdentityUserLookupService(IIdentityUserRepository userRepository, ILookupNormalizer lookupNormalizer) - { - _userRepository = userRepository; - _lookupNormalizer = lookupNormalizer; - } - - public async Task FindByIdAsync(Guid id) - { - return (await _userRepository.FindAsync(id)).ToUserInfo(); - } - - public async Task FindByUserNameAsync(string userName) - { - return (await _userRepository.FindByNormalizedUserNameAsync(_lookupNormalizer.Normalize(userName))).ToUserInfo(); - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs deleted file mode 100644 index dc4b2fe4b2..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Services; -using Volo.Abp.Threading; - -namespace Volo.Abp.Identity -{ - public class IdentityUserManager : UserManager, IDomainService - { - protected override CancellationToken CancellationToken => _cancellationTokenProvider.Token; - - private readonly ICancellationTokenProvider _cancellationTokenProvider; - - public IdentityUserManager( - IdentityUserStore store, - IOptions optionsAccessor, - IPasswordHasher passwordHasher, - IEnumerable> userValidators, - IEnumerable> passwordValidators, - ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, - IServiceProvider services, - ILogger logger, - ICancellationTokenProvider cancellationTokenProvider) - : base( - store, - optionsAccessor, - passwordHasher, - userValidators, - passwordValidators, - keyNormalizer, - errors, - services, - logger) - { - _cancellationTokenProvider = cancellationTokenProvider; - } - - public async Task GetByIdAsync(Guid id) - { - var user = await Store.FindByIdAsync(id.ToString(), CancellationToken); - if (user == null) - { - throw new EntityNotFoundException(typeof(IdentityUser), id); - } - - return user; - } - - public async Task SetRolesAsync([NotNull] IdentityUser user, [NotNull] IEnumerable roleNames) - { - Check.NotNull(user, nameof(user)); - Check.NotNull(roleNames, nameof(roleNames)); - - var currentRoleNames = await GetRolesAsync(user); - - var result = await RemoveFromRolesAsync(user, currentRoleNames.Except(roleNames).Distinct()); - if (!result.Succeeded) - { - return result; - } - - result = await AddToRolesAsync(user, roleNames.Except(currentRoleNames).Distinct()); - if (!result.Succeeded) - { - return result; - } - - return IdentityResult.Success; - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserRole.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserRole.cs deleted file mode 100644 index d684bded4e..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserRole.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Identity -{ - /// - /// Represents the link between a user and a role. - /// - public class IdentityUserRole : Entity, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - /// - /// Gets or sets the primary key of the user that is linked to a role. - /// - public virtual Guid UserId { get; protected set; } - - /// - /// Gets or sets the primary key of the role that is linked to the user. - /// - public virtual Guid RoleId { get; protected set; } - - protected IdentityUserRole() - { - - } - - protected internal IdentityUserRole(Guid userId, Guid roleId, Guid? tenantId) - { - UserId = userId; - RoleId = roleId; - TenantId = tenantId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs deleted file mode 100644 index 0cec26858e..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs +++ /dev/null @@ -1,1108 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Security.Claims; -using System.Threading; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Guids; - -namespace Volo.Abp.Identity -{ - /// - /// Represents a new instance of a persistence store for the specified user and role types. - /// - public class IdentityUserStore : - IUserLoginStore, - IUserRoleStore, - IUserClaimStore, - IUserPasswordStore, - IUserSecurityStampStore, - IUserEmailStore, - IUserLockoutStore, - IUserPhoneNumberStore, - IUserTwoFactorStore, - IUserAuthenticationTokenStore, - IUserAuthenticatorKeyStore, - IUserTwoFactorRecoveryCodeStore, - ITransientDependency - { - private const string InternalLoginProvider = "[AspNetUserStore]"; - private const string AuthenticatorKeyTokenName = "AuthenticatorKey"; - private const string RecoveryCodeTokenName = "RecoveryCodes"; - - /// - /// Gets or sets the for any error that occurred with the current operation. - /// - public IdentityErrorDescriber ErrorDescriber { get; set; } - - /// - /// Gets or sets a flag indicating if changes should be persisted after CreateAsync, UpdateAsync and DeleteAsync are called. - /// - /// - /// True if changes should be automatically persisted, otherwise false. - /// - public bool AutoSaveChanges { get; set; } = true; - - private readonly IIdentityRoleRepository _roleRepository; - private readonly IGuidGenerator _guidGenerator; - private readonly ILogger _logger; - private readonly IIdentityUserRepository _userRepository; - - public IdentityUserStore( - IIdentityUserRepository userRepository, - IIdentityRoleRepository roleRepository, - IGuidGenerator guidGenerator, - ILogger logger, - IdentityErrorDescriber describer = null) - { - _userRepository = userRepository; - _roleRepository = roleRepository; - _guidGenerator = guidGenerator; - _logger = logger; - - ErrorDescriber = describer ?? new IdentityErrorDescriber(); - } - - /// - /// Gets the user identifier for the specified . - /// - /// The user whose identifier should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the identifier for the specified . - public virtual Task GetUserIdAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.Id.ToString()); - } - - /// - /// Gets the user name for the specified . - /// - /// The user whose name should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the name for the specified . - public virtual Task GetUserNameAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.UserName); - } - - /// - /// Sets the given for the specified . - /// - /// The user whose name should be set. - /// The user name to set. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetUserNameAsync([NotNull] IdentityUser user, string userName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.UserName = userName; - - return Task.CompletedTask; - } - - /// - /// Gets the normalized user name for the specified . - /// - /// The user whose normalized name should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the normalized user name for the specified . - public virtual Task GetNormalizedUserNameAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.NormalizedUserName); - } - - /// - /// Sets the given normalized name for the specified . - /// - /// The user whose name should be set. - /// The normalized name to set. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetNormalizedUserNameAsync([NotNull] IdentityUser user, string normalizedName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.NormalizedUserName = normalizedName; - - return Task.CompletedTask; - } - - /// - /// Creates the specified in the user store. - /// - /// The user to create. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the of the creation operation. - public virtual async Task CreateAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - await _userRepository.InsertAsync(user, AutoSaveChanges, cancellationToken); - - return IdentityResult.Success; - } - - /// - /// Updates the specified in the user store. - /// - /// The user to update. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the of the update operation. - public virtual async Task UpdateAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - try - { - await _userRepository.UpdateAsync(user, AutoSaveChanges, cancellationToken); - } - catch (AbpDbConcurrencyException ex) - { - _logger.LogWarning(ex.ToString()); //Trigger some AbpHandledException event - return IdentityResult.Failed(ErrorDescriber.ConcurrencyFailure()); - } - - return IdentityResult.Success; - } - - /// - /// Deletes the specified from the user store. - /// - /// The user to delete. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the of the update operation. - public virtual async Task DeleteAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - try - { - await _userRepository.DeleteAsync(user, AutoSaveChanges, cancellationToken); - } - catch (AbpDbConcurrencyException ex) - { - _logger.LogWarning(ex.ToString()); //Trigger some AbpHandledException event - return IdentityResult.Failed(ErrorDescriber.ConcurrencyFailure()); - } - - return IdentityResult.Success; - } - - /// - /// Finds and returns a user, if any, who has the specified . - /// - /// The user ID to search for. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The that represents the asynchronous operation, containing the user matching the specified if it exists. - /// - public virtual Task FindByIdAsync(string userId, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - return _userRepository.FindAsync(Guid.Parse(userId), cancellationToken); - } - - /// - /// Finds and returns a user, if any, who has the specified normalized user name. - /// - /// The normalized user name to search for. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The that represents the asynchronous operation, containing the user matching the specified if it exists. - /// - public virtual Task FindByNameAsync([NotNull] string normalizedUserName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(normalizedUserName, nameof(normalizedUserName)); - - return _userRepository.FindByNormalizedUserNameAsync(normalizedUserName, cancellationToken); - } - - /// - /// Sets the password hash for a user. - /// - /// The user to set the password hash for. - /// The password hash to set. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetPasswordHashAsync([NotNull] IdentityUser user, string passwordHash, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.PasswordHash = passwordHash; - - return Task.CompletedTask; - } - - /// - /// Gets the password hash for a user. - /// - /// The user to retrieve the password hash for. - /// The used to propagate notifications that the operation should be canceled. - /// A that contains the password hash for the user. - public virtual Task GetPasswordHashAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.PasswordHash); - } - - /// - /// Returns a flag indicating if the specified user has a password. - /// - /// The user to retrieve the password hash for. - /// The used to propagate notifications that the operation should be canceled. - /// A containing a flag indicating if the specified user has a password. If the - /// user has a password the returned value with be true, otherwise it will be false. - public virtual Task HasPasswordAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.PasswordHash != null); - } - - /// - /// Adds the given to the specified . - /// - /// The user to add the role to. - /// The role to add. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task AddToRoleAsync([NotNull] IdentityUser user, [NotNull] string normalizedRoleName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - Check.NotNull(normalizedRoleName, nameof(normalizedRoleName)); - - var role = await _roleRepository.FindByNormalizedNameAsync(normalizedRoleName, cancellationToken); - - if (role == null) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "Role {0} does not exist!", normalizedRoleName)); - } - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Roles, cancellationToken); - - user.AddRole(role.Id); - } - - /// - /// Removes the given from the specified . - /// - /// The user to remove the role from. - /// The role to remove. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task RemoveFromRoleAsync([NotNull] IdentityUser user, [NotNull] string normalizedRoleName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - if (string.IsNullOrWhiteSpace(normalizedRoleName)) - { - throw new ArgumentException(nameof(normalizedRoleName) + " can not be null or whitespace"); - } - - var role = await _roleRepository.FindByNormalizedNameAsync(normalizedRoleName, cancellationToken); - if (role == null) - { - return; - } - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Roles, cancellationToken); - - user.RemoveRole(role.Id); - } - - /// - /// Retrieves the roles the specified is a member of. - /// - /// The user whose roles should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// A that contains the roles the user is a member of. - public virtual async Task> GetRolesAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return await _userRepository.GetRoleNamesAsync(user.Id); - } - - /// - /// Returns a flag indicating if the specified user is a member of the give . - /// - /// The user whose role membership should be checked. - /// The role to check membership of - /// The used to propagate notifications that the operation should be canceled. - /// A containing a flag indicating if the specified user is a member of the given group. If the - /// user is a member of the group the returned value with be true, otherwise it will be false. - public virtual async Task IsInRoleAsync([NotNull] IdentityUser user, [NotNull] string normalizedRoleName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - if (string.IsNullOrWhiteSpace(normalizedRoleName)) - { - throw new ArgumentException(nameof(normalizedRoleName) + " can not be null or whitespace"); - } - - var role = await _roleRepository.FindByNormalizedNameAsync(normalizedRoleName, cancellationToken); - if (role == null) - { - return false; - } - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Roles, cancellationToken); - - return user.IsInRole(role.Id); - } - - /// - /// Get the claims associated with the specified as an asynchronous operation. - /// - /// The user whose claims should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// A that contains the claims granted to a user. - public virtual async Task> GetClaimsAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Claims, cancellationToken); - - return user.Claims.Select(c => c.ToClaim()).ToList(); - } - - /// - /// Adds the given to the specified . - /// - /// The user to add the claim to. - /// The claim to add to the user. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task AddClaimsAsync([NotNull] IdentityUser user, [NotNull] IEnumerable claims, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - Check.NotNull(claims, nameof(claims)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Claims, cancellationToken); - - user.AddClaims(_guidGenerator, claims); - } - - /// - /// Replaces the on the specified , with the . - /// - /// The user to replace the claim on. - /// The claim replace. - /// The new claim replacing the . - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task ReplaceClaimAsync([NotNull] IdentityUser user, [NotNull] Claim claim, [NotNull] Claim newClaim, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - Check.NotNull(claim, nameof(claim)); - Check.NotNull(newClaim, nameof(newClaim)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Claims, cancellationToken); - - user.ReplaceClaim(claim, newClaim); - } - - /// - /// Removes the given from the specified . - /// - /// The user to remove the claims from. - /// The claim to remove. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task RemoveClaimsAsync([NotNull] IdentityUser user, [NotNull] IEnumerable claims, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - Check.NotNull(claims, nameof(claims)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Claims, cancellationToken); - - user.RemoveClaims(claims); - } - - /// - /// Adds the given to the specified . - /// - /// The user to add the login to. - /// The login to add to the user. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task AddLoginAsync([NotNull] IdentityUser user, [NotNull] UserLoginInfo login, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - Check.NotNull(login, nameof(login)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Logins, cancellationToken); - - user.AddLogin(login); - } - - /// - /// Removes the given from the specified . - /// - /// The user to remove the login from. - /// The login to remove from the user. - /// The key provided by the to identify a user. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task RemoveLoginAsync([NotNull] IdentityUser user, [NotNull] string loginProvider, [NotNull] string providerKey, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - Check.NotNull(loginProvider, nameof(loginProvider)); - Check.NotNull(providerKey, nameof(providerKey)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Logins, cancellationToken); - - user.RemoveLogin(loginProvider, providerKey); - } - - /// - /// Retrieves the associated logins for the specified . - /// - /// The user whose associated logins to retrieve. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The for the asynchronous operation, containing a list of for the specified , if any. - /// - public virtual async Task> GetLoginsAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Logins, cancellationToken); - - return user.Logins.Select(l => l.ToUserLoginInfo()).ToList(); - } - - /// - /// Retrieves the user associated with the specified login provider and login provider key.. - /// - /// The login provider who provided the . - /// The key provided by the to identify a user. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The for the asynchronous operation, containing the user, if any which matched the specified login provider and key. - /// - public virtual Task FindByLoginAsync([NotNull] string loginProvider, [NotNull] string providerKey, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(loginProvider, nameof(loginProvider)); - Check.NotNull(providerKey, nameof(providerKey)); - - return _userRepository.FindByLoginAsync(loginProvider, providerKey, cancellationToken); - } - - /// - /// Gets a flag indicating whether the email address for the specified has been verified, true if the email address is verified otherwise - /// false. - /// - /// The user whose email confirmation status should be returned. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The task object containing the results of the asynchronous operation, a flag indicating whether the email address for the specified - /// has been confirmed or not. - /// - public virtual Task GetEmailConfirmedAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.EmailConfirmed); - } - - /// - /// Sets the flag indicating whether the specified 's email address has been confirmed or not. - /// - /// The user whose email confirmation status should be set. - /// A flag indicating if the email address has been confirmed, true if the address is confirmed otherwise false. - /// The used to propagate notifications that the operation should be canceled. - /// The task object representing the asynchronous operation. - public virtual Task SetEmailConfirmedAsync([NotNull] IdentityUser user, bool confirmed, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.EmailConfirmed = confirmed; - - return Task.CompletedTask; - } - - /// - /// Sets the address for a . - /// - /// The user whose email should be set. - /// The email to set. - /// The used to propagate notifications that the operation should be canceled. - /// The task object representing the asynchronous operation. - public virtual Task SetEmailAsync([NotNull] IdentityUser user, string email, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.Email = email; - - return Task.CompletedTask; - } - - /// - /// Gets the email address for the specified . - /// - /// The user whose email should be returned. - /// The used to propagate notifications that the operation should be canceled. - /// The task object containing the results of the asynchronous operation, the email address for the specified . - public virtual Task GetEmailAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.Email); - } - - /// - /// Returns the normalized email for the specified . - /// - /// The user whose email address to retrieve. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The task object containing the results of the asynchronous lookup operation, the normalized email address if any associated with the specified user. - /// - public virtual Task GetNormalizedEmailAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.NormalizedEmail); - } - - /// - /// Sets the normalized email for the specified . - /// - /// The user whose email address to set. - /// The normalized email to set for the specified . - /// The used to propagate notifications that the operation should be canceled. - /// The task object representing the asynchronous operation. - public virtual Task SetNormalizedEmailAsync([NotNull] IdentityUser user, string normalizedEmail, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.NormalizedEmail = normalizedEmail; - - return Task.CompletedTask; - } - - /// - /// Gets the user, if any, associated with the specified, normalized email address. - /// - /// The normalized email address to return the user for. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The task object containing the results of the asynchronous lookup operation, the user if any associated with the specified normalized email address. - /// - public virtual Task FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - return _userRepository.FindByNormalizedEmailAsync(normalizedEmail, cancellationToken); - } - - /// - /// Gets the last a user's last lockout expired, if any. - /// Any time in the past should be indicates a user is not locked out. - /// - /// The user whose lockout date should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// - /// A that represents the result of the asynchronous query, a containing the last time - /// a user's lockout expired, if any. - /// - public virtual Task GetLockoutEndDateAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.LockoutEnd); - } - - /// - /// Locks out a user until the specified end date has passed. Setting a end date in the past immediately unlocks a user. - /// - /// The user whose lockout date should be set. - /// The after which the 's lockout should end. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetLockoutEndDateAsync([NotNull] IdentityUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.LockoutEnd = lockoutEnd; - - return Task.CompletedTask; - } - - /// - /// Records that a failed access has occurred, incrementing the failed access count. - /// - /// The user whose cancellation count should be incremented. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the incremented failed access count. - public virtual Task IncrementAccessFailedCountAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.AccessFailedCount++; - - return Task.FromResult(user.AccessFailedCount); - } - - /// - /// Resets a user's failed access count. - /// - /// The user whose failed access count should be reset. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - /// This is typically called after the account is successfully accessed. - public virtual Task ResetAccessFailedCountAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.AccessFailedCount = 0; - - return Task.CompletedTask; - } - - /// - /// Retrieves the current failed access count for the specified .. - /// - /// The user whose failed access count should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the failed access count. - public virtual Task GetAccessFailedCountAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.AccessFailedCount); - } - - /// - /// Retrieves a flag indicating whether user lockout can enabled for the specified user. - /// - /// The user whose ability to be locked out should be returned. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The that represents the asynchronous operation, true if a user can be locked out, otherwise false. - /// - public virtual Task GetLockoutEnabledAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.LockoutEnabled); - } - - /// - /// Set the flag indicating if the specified can be locked out.. - /// - /// The user whose ability to be locked out should be set. - /// A flag indicating if lock out can be enabled for the specified . - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetLockoutEnabledAsync([NotNull] IdentityUser user, bool enabled, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.LockoutEnabled = enabled; - - return Task.CompletedTask; - } - - /// - /// Sets the telephone number for the specified . - /// - /// The user whose telephone number should be set. - /// The telephone number to set. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetPhoneNumberAsync([NotNull] IdentityUser user, string phoneNumber, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.PhoneNumber = phoneNumber; - - return Task.CompletedTask; - } - - /// - /// Gets the telephone number, if any, for the specified . - /// - /// The user whose telephone number should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the user's telephone number, if any. - public virtual Task GetPhoneNumberAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.PhoneNumber); - } - - /// - /// Gets a flag indicating whether the specified 's telephone number has been confirmed. - /// - /// The user to return a flag for, indicating whether their telephone number is confirmed. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The that represents the asynchronous operation, returning true if the specified has a confirmed - /// telephone number otherwise false. - /// - public virtual Task GetPhoneNumberConfirmedAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.PhoneNumberConfirmed); - } - - /// - /// Sets a flag indicating if the specified 's phone number has been confirmed.. - /// - /// The user whose telephone number confirmation status should be set. - /// A flag indicating whether the user's telephone number has been confirmed. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetPhoneNumberConfirmedAsync([NotNull] IdentityUser user, bool confirmed, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.PhoneNumberConfirmed = confirmed; - - return Task.CompletedTask; - } - - /// - /// Sets the provided security for the specified . - /// - /// The user whose security stamp should be set. - /// The security stamp to set. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetSecurityStampAsync([NotNull] IdentityUser user, string stamp, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.SecurityStamp = stamp; - - return Task.CompletedTask; - } - - /// - /// Get the security stamp for the specified . - /// - /// The user whose security stamp should be set. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation, containing the security stamp for the specified . - public virtual Task GetSecurityStampAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.SecurityStamp); - } - - /// - /// Sets a flag indicating whether the specified has two factor authentication enabled or not, - /// as an asynchronous operation. - /// - /// The user whose two factor authentication enabled status should be set. - /// A flag indicating whether the specified has two factor authentication enabled. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual Task SetTwoFactorEnabledAsync([NotNull] IdentityUser user, bool enabled, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - user.TwoFactorEnabled = enabled; - - return Task.CompletedTask; - } - - /// - /// Returns a flag indicating whether the specified has two factor authentication enabled or not, - /// as an asynchronous operation. - /// - /// The user whose two factor authentication enabled status should be set. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The that represents the asynchronous operation, containing a flag indicating whether the specified - /// has two factor authentication enabled or not. - /// - public virtual Task GetTwoFactorEnabledAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - return Task.FromResult(user.TwoFactorEnabled); - } - - /// - /// Retrieves all users with the specified claim. - /// - /// The claim whose users should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The contains a list of users, if any, that contain the specified claim. - /// - public virtual Task> GetUsersForClaimAsync([NotNull] Claim claim, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(claim, nameof(claim)); - - return _userRepository.GetListByClaimAsync(claim, cancellationToken); - } - - /// - /// Retrieves all users in the specified role. - /// - /// The role whose users should be retrieved. - /// The used to propagate notifications that the operation should be canceled. - /// - /// The contains a list of users, if any, that are in the specified role. - /// - public virtual Task> GetUsersInRoleAsync([NotNull] string normalizedRoleName, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); - - if (string.IsNullOrEmpty(normalizedRoleName)) - { - throw new ArgumentNullException(nameof(normalizedRoleName)); - } - - return _userRepository.GetListByNormalizedRoleNameAsync(normalizedRoleName, cancellationToken); - } - - /// - /// Sets the token value for a particular user. - /// - /// The user. - /// The authentication provider for the token. - /// The name of the token. - /// The value of the token. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public virtual async Task SetTokenAsync([NotNull] IdentityUser user, string loginProvider, string name, string value, CancellationToken cancellationToken) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Tokens, cancellationToken); - - user.SetToken(loginProvider, name, value); - } - - /// - /// Deletes a token for a user. - /// - /// The user. - /// The authentication provider for the token. - /// The name of the token. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public async Task RemoveTokenAsync(IdentityUser user, string loginProvider, string name, CancellationToken cancellationToken) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Tokens, cancellationToken); - - user.RemoveToken(loginProvider, name); - } - - /// - /// Returns the token value. - /// - /// The user. - /// The authentication provider for the token. - /// The name of the token. - /// The used to propagate notifications that the operation should be canceled. - /// The that represents the asynchronous operation. - public async Task GetTokenAsync(IdentityUser user, string loginProvider, string name, CancellationToken cancellationToken) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - await _userRepository.EnsureCollectionLoadedAsync(user, u => u.Tokens, cancellationToken); - - return user.FindToken(loginProvider, name)?.Value; - } - - public Task SetAuthenticatorKeyAsync(IdentityUser user, string key, CancellationToken cancellationToken) - { - return SetTokenAsync(user, InternalLoginProvider, AuthenticatorKeyTokenName, key, cancellationToken); - } - - public Task GetAuthenticatorKeyAsync(IdentityUser user, CancellationToken cancellationToken) - { - return GetTokenAsync(user, InternalLoginProvider, AuthenticatorKeyTokenName, cancellationToken); - } - - /// - /// Returns how many recovery code are still valid for a user. - /// - /// The user who owns the recovery code. - /// The used to propagate notifications that the operation should be canceled. - /// The number of valid recovery codes for the user.. - public virtual async Task CountCodesAsync(IdentityUser user, CancellationToken cancellationToken) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - - var mergedCodes = await GetTokenAsync(user, InternalLoginProvider, RecoveryCodeTokenName, cancellationToken) ?? ""; - if (mergedCodes.Length > 0) - { - return mergedCodes.Split(';').Length; - } - - return 0; - } - - /// - /// Updates the recovery codes for the user while invalidating any previous recovery codes. - /// - /// The user to store new recovery codes for. - /// The new recovery codes for the user. - /// The used to propagate notifications that the operation should be canceled. - /// The new recovery codes for the user. - public virtual Task ReplaceCodesAsync(IdentityUser user, IEnumerable recoveryCodes, CancellationToken cancellationToken) - { - var mergedCodes = string.Join(";", recoveryCodes); - return SetTokenAsync(user, InternalLoginProvider, RecoveryCodeTokenName, mergedCodes, cancellationToken); - } - - /// - /// Returns whether a recovery code is valid for a user. Note: recovery codes are only valid - /// once, and will be invalid after use. - /// - /// The user who owns the recovery code. - /// The recovery code to use. - /// The used to propagate notifications that the operation should be canceled. - /// True if the recovery code was found for the user. - public virtual async Task RedeemCodeAsync(IdentityUser user, string code, CancellationToken cancellationToken) - { - cancellationToken.ThrowIfCancellationRequested(); - - Check.NotNull(user, nameof(user)); - Check.NotNull(code, nameof(code)); - - var mergedCodes = await GetTokenAsync(user, InternalLoginProvider, RecoveryCodeTokenName, cancellationToken) ?? ""; - var splitCodes = mergedCodes.Split(';'); - if (splitCodes.Contains(code)) - { - var updatedCodes = new List(splitCodes.Where(s => s != code)); - await ReplaceCodesAsync(user, updatedCodes, cancellationToken); - return true; - } - return false; - } - - public void Dispose() - { - - } - } -} diff --git a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserToken.cs b/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserToken.cs deleted file mode 100644 index 8950d47e28..0000000000 --- a/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserToken.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Identity -{ - /// - /// Represents an authentication token for a user. - /// - public class IdentityUserToken : Entity, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - /// - /// Gets or sets the primary key of the user that the token belongs to. - /// - public virtual Guid UserId { get; protected set; } - - /// - /// Gets or sets the LoginProvider this token is from. - /// - public virtual string LoginProvider { get; protected set; } - - /// - /// Gets or sets the name of the token. - /// - public virtual string Name { get; protected set; } - - /// - /// Gets or sets the token value. - /// - public virtual string Value { get; set; } - - protected IdentityUserToken() - { - - } - - protected internal IdentityUserToken( - Guid userId, - [NotNull] string loginProvider, - [NotNull] string name, - string value, - Guid? tenantId) - { - Check.NotNull(loginProvider, nameof(loginProvider)); - Check.NotNull(name, nameof(name)); - - UserId = userId; - LoginProvider = loginProvider; - Name = name; - Value = value; - TenantId = tenantId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123121521_Identity_Initial.Designer.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123121521_Identity_Initial.Designer.cs deleted file mode 100644 index 42a0a38486..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123121521_Identity_Initial.Designer.cs +++ /dev/null @@ -1,261 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Volo.Abp.Identity.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityDbContext))] - [Migration("20170123121521_Identity_Initial")] - partial class Identity_Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("LoginProvider") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(256); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId", "LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("IdentityUserId1"); - - b.Property("RoleId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("IdentityUserId1"); - - b.HasIndex("RoleId", "UserId"); - - b.HasIndex("UserId", "RoleId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("LoginProvider") - .IsRequired() - .HasMaxLength(64); - - b.Property("Name"); - - b.Property("UserId"); - - b.Property("Value"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("IdentityUserId1"); - - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123121521_Identity_Initial.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123121521_Identity_Initial.cs deleted file mode 100644 index 75d1c5acdd..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123121521_Identity_Initial.cs +++ /dev/null @@ -1,243 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - public partial class Identity_Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "IdentityRoles", - columns: table => new - { - Id = table.Column(nullable: false), - ConcurrencyStamp = table.Column(nullable: true), - Name = table.Column(maxLength: 256, nullable: true), - NormalizedName = table.Column(maxLength: 256, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityUsers", - columns: table => new - { - Id = table.Column(nullable: false), - AccessFailedCount = table.Column(nullable: false, defaultValue: 0), - ConcurrencyStamp = table.Column(nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - EmailConfirmed = table.Column(nullable: false, defaultValue: false), - LockoutEnabled = table.Column(nullable: false, defaultValue: false), - LockoutEnd = table.Column(nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), - NormalizedUserName = table.Column(maxLength: 256, nullable: true), - PasswordHash = table.Column(nullable: true), - PhoneNumber = table.Column(nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false, defaultValue: false), - SecurityStamp = table.Column(nullable: true), - TwoFactorEnabled = table.Column(nullable: false, defaultValue: false), - UserName = table.Column(maxLength: 256, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - RoleId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_IdentityRoleClaims_IdentityRoles_RoleId", - column: x => x.RoleId, - principalTable: "IdentityRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_IdentityUserClaims_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserLogins", - columns: table => new - { - Id = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 64, nullable: false), - ProviderDisplayName = table.Column(maxLength: 128, nullable: true), - ProviderKey = table.Column(maxLength: 256, nullable: false), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserLogins", x => x.Id); - table.ForeignKey( - name: "FK_IdentityUserLogins_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserRoles", - columns: table => new - { - Id = table.Column(nullable: false), - IdentityUserId1 = table.Column(nullable: true), - RoleId = table.Column(nullable: false), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserRoles", x => x.Id); - table.ForeignKey( - name: "FK_IdentityUserRoles_IdentityUsers_IdentityUserId1", - column: x => x.IdentityUserId1, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_IdentityUserRoles_IdentityRoles_RoleId", - column: x => x.RoleId, - principalTable: "IdentityRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_IdentityUserRoles_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityUserTokens", - columns: table => new - { - Id = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 64, nullable: false), - Name = table.Column(nullable: true), - UserId = table.Column(nullable: false), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityUserTokens", x => x.Id); - table.ForeignKey( - name: "FK_IdentityUserTokens_IdentityUsers_UserId", - column: x => x.UserId, - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityRoles_NormalizedName", - table: "IdentityRoles", - column: "NormalizedName"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityRoleClaims_RoleId", - table: "IdentityRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUsers_NormalizedEmail", - table: "IdentityUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUsers_NormalizedUserName", - table: "IdentityUsers", - column: "NormalizedUserName"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserClaims_UserId", - table: "IdentityUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserLogins_LoginProvider_ProviderKey", - table: "IdentityUserLogins", - columns: new[] { "LoginProvider", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserLogins_UserId_LoginProvider_ProviderKey", - table: "IdentityUserLogins", - columns: new[] { "UserId", "LoginProvider", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserRoles_IdentityUserId1", - table: "IdentityUserRoles", - column: "IdentityUserId1"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserRoles_RoleId_UserId", - table: "IdentityUserRoles", - columns: new[] { "RoleId", "UserId" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserRoles_UserId_RoleId", - table: "IdentityUserRoles", - columns: new[] { "UserId", "RoleId" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserTokens_UserId_LoginProvider_Name", - table: "IdentityUserTokens", - columns: new[] { "UserId", "LoginProvider", "Name" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "IdentityRoleClaims"); - - migrationBuilder.DropTable( - name: "IdentityUserClaims"); - - migrationBuilder.DropTable( - name: "IdentityUserLogins"); - - migrationBuilder.DropTable( - name: "IdentityUserRoles"); - - migrationBuilder.DropTable( - name: "IdentityUserTokens"); - - migrationBuilder.DropTable( - name: "IdentityRoles"); - - migrationBuilder.DropTable( - name: "IdentityUsers"); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123193838_Fix_IdentityUserRole_UserId_Nav_Property.Designer.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123193838_Fix_IdentityUserRole_UserId_Nav_Property.Designer.cs deleted file mode 100644 index de69569235..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123193838_Fix_IdentityUserRole_UserId_Nav_Property.Designer.cs +++ /dev/null @@ -1,253 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Volo.Abp.Identity.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityDbContext))] - [Migration("20170123193838_Fix_IdentityUserRole_UserId_Nav_Property")] - partial class Fix_IdentityUserRole_UserId_Nav_Property - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("LoginProvider") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(256); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId", "LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("RoleId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId", "UserId"); - - b.HasIndex("UserId", "RoleId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("LoginProvider") - .IsRequired() - .HasMaxLength(64); - - b.Property("Name"); - - b.Property("UserId"); - - b.Property("Value"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123193838_Fix_IdentityUserRole_UserId_Nav_Property.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123193838_Fix_IdentityUserRole_UserId_Nav_Property.cs deleted file mode 100644 index 91c6aa450a..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20170123193838_Fix_IdentityUserRole_UserId_Nav_Property.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - public partial class Fix_IdentityUserRole_UserId_Nav_Property : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_IdentityUserRoles_IdentityUsers_IdentityUserId1", - table: "IdentityUserRoles"); - - migrationBuilder.DropIndex( - name: "IX_IdentityUserRoles_IdentityUserId1", - table: "IdentityUserRoles"); - - migrationBuilder.DropColumn( - name: "IdentityUserId1", - table: "IdentityUserRoles"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IdentityUserId1", - table: "IdentityUserRoles", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserRoles_IdentityUserId1", - table: "IdentityUserRoles", - column: "IdentityUserId1"); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityUserRoles_IdentityUsers_IdentityUserId1", - table: "IdentityUserRoles", - column: "IdentityUserId1", - principalTable: "IdentityUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180131140437_Identity_Revisions.Designer.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180131140437_Identity_Revisions.Designer.cs deleted file mode 100644 index ec8b4de92e..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180131140437_Identity_Revisions.Designer.cs +++ /dev/null @@ -1,251 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.Identity.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityDbContext))] - [Migration("20180131140437_Identity_Revisions")] - partial class Identity_Revisions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(256); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(128); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180131140437_Identity_Revisions.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180131140437_Identity_Revisions.cs deleted file mode 100644 index 99f7145049..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180131140437_Identity_Revisions.cs +++ /dev/null @@ -1,322 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - public partial class Identity_Revisions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityUserTokens", - table: "IdentityUserTokens"); - - migrationBuilder.DropIndex( - name: "IX_IdentityUserTokens_UserId_LoginProvider_Name", - table: "IdentityUserTokens"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityUserRoles", - table: "IdentityUserRoles"); - - migrationBuilder.DropIndex( - name: "IX_IdentityUserRoles_UserId_RoleId", - table: "IdentityUserRoles"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityUserLogins", - table: "IdentityUserLogins"); - - migrationBuilder.DropIndex( - name: "IX_IdentityUserLogins_UserId_LoginProvider_ProviderKey", - table: "IdentityUserLogins"); - - migrationBuilder.DropColumn( - name: "Id", - table: "IdentityUserTokens"); - - migrationBuilder.DropColumn( - name: "Id", - table: "IdentityUserRoles"); - - migrationBuilder.DropColumn( - name: "Id", - table: "IdentityUserLogins"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "IdentityUserTokens", - type: "nvarchar(450)", - nullable: false, - oldClrType: typeof(string), - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "LoginProvider", - table: "IdentityUserTokens", - type: "nvarchar(128)", - maxLength: 128, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 64); - - migrationBuilder.AlterColumn( - name: "UserName", - table: "IdentityUsers", - type: "nvarchar(256)", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "SecurityStamp", - table: "IdentityUsers", - type: "nvarchar(256)", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "PhoneNumber", - table: "IdentityUsers", - type: "nvarchar(16)", - maxLength: 16, - nullable: true, - oldClrType: typeof(string), - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "PasswordHash", - table: "IdentityUsers", - type: "nvarchar(256)", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "NormalizedUserName", - table: "IdentityUsers", - type: "nvarchar(256)", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ConcurrencyStamp", - table: "IdentityUsers", - type: "nvarchar(256)", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ProviderKey", - table: "IdentityUserLogins", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 256); - - migrationBuilder.AlterColumn( - name: "NormalizedName", - table: "IdentityRoles", - type: "nvarchar(256)", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "IdentityRoles", - type: "nvarchar(256)", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityUserTokens", - table: "IdentityUserTokens", - columns: new[] { "UserId", "LoginProvider", "Name" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityUserRoles", - table: "IdentityUserRoles", - columns: new[] { "UserId", "RoleId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityUserLogins", - table: "IdentityUserLogins", - columns: new[] { "UserId", "LoginProvider" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityUserTokens", - table: "IdentityUserTokens"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityUserRoles", - table: "IdentityUserRoles"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityUserLogins", - table: "IdentityUserLogins"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "IdentityUserTokens", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(450)"); - - migrationBuilder.AlterColumn( - name: "LoginProvider", - table: "IdentityUserTokens", - maxLength: 64, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(128)", - oldMaxLength: 128); - - migrationBuilder.AddColumn( - name: "Id", - table: "IdentityUserTokens", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "UserName", - table: "IdentityUsers", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256); - - migrationBuilder.AlterColumn( - name: "SecurityStamp", - table: "IdentityUsers", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256); - - migrationBuilder.AlterColumn( - name: "PhoneNumber", - table: "IdentityUsers", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(16)", - oldMaxLength: 16, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "PasswordHash", - table: "IdentityUsers", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "NormalizedUserName", - table: "IdentityUsers", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256); - - migrationBuilder.AlterColumn( - name: "ConcurrencyStamp", - table: "IdentityUsers", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256); - - migrationBuilder.AddColumn( - name: "Id", - table: "IdentityUserRoles", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "ProviderKey", - table: "IdentityUserLogins", - maxLength: 256, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AddColumn( - name: "Id", - table: "IdentityUserLogins", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "NormalizedName", - table: "IdentityRoles", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256); - - migrationBuilder.AlterColumn( - name: "Name", - table: "IdentityRoles", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityUserTokens", - table: "IdentityUserTokens", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityUserRoles", - table: "IdentityUserRoles", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityUserLogins", - table: "IdentityUserLogins", - column: "Id"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserTokens_UserId_LoginProvider_Name", - table: "IdentityUserTokens", - columns: new[] { "UserId", "LoginProvider", "Name" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserRoles_UserId_RoleId", - table: "IdentityUserRoles", - columns: new[] { "UserId", "RoleId" }); - - migrationBuilder.CreateIndex( - name: "IX_IdentityUserLogins_UserId_LoginProvider_ProviderKey", - table: "IdentityUserLogins", - columns: new[] { "UserId", "LoginProvider", "ProviderKey" }); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180218140410_Made_Identity_Entities_MultiTenant.Designer.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180218140410_Made_Identity_Entities_MultiTenant.Designer.cs deleted file mode 100644 index 625d16cefb..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180218140410_Made_Identity_Entities_MultiTenant.Designer.cs +++ /dev/null @@ -1,265 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.Identity.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityDbContext))] - [Migration("20180218140410_Made_Identity_Entities_MultiTenant")] - partial class Made_Identity_Entities_MultiTenant - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(256); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("TenantId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196); - - b.Property("TenantId"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(128); - - b.Property("Name"); - - b.Property("TenantId"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180218140410_Made_Identity_Entities_MultiTenant.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180218140410_Made_Identity_Entities_MultiTenant.cs deleted file mode 100644 index ca0c3b7797..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/20180218140410_Made_Identity_Entities_MultiTenant.cs +++ /dev/null @@ -1,77 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - public partial class Made_Identity_Entities_MultiTenant : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "IdentityUserTokens", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "IdentityUsers", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "IdentityUserRoles", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "IdentityUserLogins", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "IdentityUserClaims", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "IdentityRoles", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "IdentityRoleClaims", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "TenantId", - table: "IdentityUserTokens"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "IdentityUsers"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "IdentityUserRoles"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "IdentityUserLogins"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "IdentityUserClaims"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "IdentityRoles"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "IdentityRoleClaims"); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/IdentityDbContextModelSnapshot.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/IdentityDbContextModelSnapshot.cs deleted file mode 100644 index b998948e52..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Migrations/IdentityDbContextModelSnapshot.cs +++ /dev/null @@ -1,264 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.Identity.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityDbContext))] - partial class IdentityDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("IdentityRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("IdentityRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(256); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.ToTable("IdentityUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("TenantId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("IdentityUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196); - - b.Property("TenantId"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("IdentityUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("IdentityUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(128); - - b.Property("Name"); - - b.Property("TenantId"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("IdentityUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Properties/AssemblyInfo.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Properties/AssemblyInfo.cs deleted file mode 100644 index a55409d7fd..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.Identity.EntityFrameworkCore")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("439dfc0f-1ba2-464f-900e-ea7e18c08975")] diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo.Abp.Identity.EntityFrameworkCore.csproj b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo.Abp.Identity.EntityFrameworkCore.csproj deleted file mode 100644 index a981c8955d..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo.Abp.Identity.EntityFrameworkCore.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.EntityFrameworkCore - Volo.Abp.Identity.EntityFrameworkCore - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo.Abp.Identity.EntityFrameworkCore.csproj.DotSettings b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo.Abp.Identity.EntityFrameworkCore.csproj.DotSettings deleted file mode 100644 index 58ad6c8854..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo.Abp.Identity.EntityFrameworkCore.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp71 \ No newline at end of file diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityRoleRepository.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityRoleRepository.cs deleted file mode 100644 index ba57e90cfb..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityRoleRepository.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Linq.Dynamic.Core; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; -using System; - -namespace Volo.Abp.Identity -{ - public class EfCoreIdentityRoleRepository : EfCoreRepository, IIdentityRoleRepository - { - public EfCoreIdentityRoleRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } - - public virtual async Task FindByNormalizedNameAsync(string normalizedRoleName, CancellationToken cancellationToken) - { - return await DbSet.FirstOrDefaultAsync(r => r.NormalizedName == normalizedRoleName, cancellationToken); - } - - public virtual async Task> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0) - { - return await this - .OrderBy(sorting ?? nameof(IdentityRole.Name)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(); - } - - public virtual async Task GetCountAsync(CancellationToken cancellationToken = default) - { - return await this.LongCountAsync(cancellationToken); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityUserRepository.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityUserRepository.cs deleted file mode 100644 index 7803b55ced..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EfCoreIdentityUserRepository.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Linq; -using System.Linq.Dynamic.Core; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; - -namespace Volo.Abp.Identity -{ - public class EfCoreIdentityUserRepository : EfCoreRepository, IIdentityUserRepository - { - public EfCoreIdentityUserRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } - - public virtual async Task FindByNormalizedUserNameAsync(string normalizedUserName, CancellationToken cancellationToken) - { - return await DbSet.FirstOrDefaultAsync(u => u.NormalizedUserName == normalizedUserName, cancellationToken); - } - - public virtual async Task> GetRoleNamesAsync(Guid userId) - { - var query = from userRole in DbContext.UserRoles - join role in DbContext.Roles on userRole.RoleId equals role.Id - where userRole.UserId.Equals(userId) - select role.Name; - - return await query.ToListAsync(); - } - - public virtual async Task FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken) - { - var userLogin = await DbContext.UserLogins - .Where(login => login.LoginProvider == loginProvider && login.ProviderKey == providerKey) - .FirstOrDefaultAsync(cancellationToken); - - if (userLogin == null) - { - return null; - } - - return await DbSet.FindAsync(new object[] { userLogin.UserId }, cancellationToken); - } - - public virtual async Task FindByNormalizedEmailAsync(string normalizedEmail, CancellationToken cancellationToken) - { - return await DbSet.FirstOrDefaultAsync(u => u.NormalizedEmail == normalizedEmail, cancellationToken); - } - - public virtual async Task> GetListByClaimAsync(Claim claim, CancellationToken cancellationToken) - { - var query = from userclaims in DbContext.UserClaims - join user in DbContext.Users on userclaims.UserId equals user.Id - where userclaims.ClaimValue == claim.Value && userclaims.ClaimType == claim.Type - select user; - - return await query.ToListAsync(cancellationToken); - } - - public virtual async Task> GetListByNormalizedRoleNameAsync(string normalizedRoleName, CancellationToken cancellationToken) - { - var role = await DbContext.Roles.Where(x => x.NormalizedName == normalizedRoleName).FirstOrDefaultAsync(cancellationToken); - - if (role == null) - { - return new List(); - } - - var query = from userrole in DbContext.UserRoles - join user in DbContext.Users on userrole.UserId equals user.Id - where userrole.RoleId.Equals(role.Id) - select user; - - return await query.ToListAsync(cancellationToken); - } - - public virtual async Task> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter, CancellationToken cancellationToken = default) - { - return await this.WhereIf( - !filter.IsNullOrWhiteSpace(), - u => - u.UserName.Contains(filter) || - u.Email.Contains(filter) - ) - .OrderBy(sorting ?? nameof(IdentityUser.UserName)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(cancellationToken); - } - - public virtual async Task> GetListAsync(string sorting, int maxResultCount, int skipCount) - { - return await this.OrderBy(sorting ?? nameof(IdentityUser.UserName)).PageBy(skipCount, maxResultCount).ToListAsync(); - } - - public virtual async Task> GetRolesAsync(Guid userId) - { - var query = from userRole in DbContext.UserRoles - join role in DbContext.Roles on userRole.RoleId equals role.Id - where userRole.UserId == userId - select role; - - return await query.ToListAsync(); - } - - public virtual async Task GetCountAsync(CancellationToken cancellationToken = default) - { - return await this.LongCountAsync(cancellationToken); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs deleted file mode 100644 index 069bb22d78..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Identity.EntityFrameworkCore -{ - [DependsOn(typeof(AbpIdentityDomainModule), typeof(AbpEntityFrameworkCoreModule))] - public class AbpIdentityEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); - options.AddRepository(); - options.AddRepository(); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IIdentityDbContext.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IIdentityDbContext.cs deleted file mode 100644 index e68863914c..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IIdentityDbContext.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore -{ - [ConnectionStringName("AbpIdentity")] - public interface IIdentityDbContext : IEfCoreDbContext - { - DbSet Users { get; set; } - - DbSet UserClaims { get; set; } - - DbSet UserLogins { get; set; } - - DbSet UserRoles { get; set; } - - DbSet UserTokens { get; set; } - - DbSet Roles { get; set; } - - DbSet RoleClaims { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContext.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContext.cs deleted file mode 100644 index c9bc93c519..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContext.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore -{ - /// - /// Base class for the Entity Framework database context used for identity. - /// - [ConnectionStringName("AbpIdentity")] - public class IdentityDbContext : AbpDbContext, IIdentityDbContext - { - public static string TablePrefix { get; set; } = AbpIdentityConsts.DefaultDbTablePrefix; - - public static string Schema { get; set; } = AbpIdentityConsts.DefaultDbSchema; - - /// - /// Gets or sets the of Users. - /// - public DbSet Users { get; set; } - - /// - /// Gets or sets the of User claims. - /// - public DbSet UserClaims { get; set; } - - /// - /// Gets or sets the of User logins. - /// - public DbSet UserLogins { get; set; } - - /// - /// Gets or sets the of User roles. - /// - public DbSet UserRoles { get; set; } - - /// - /// Gets or sets the of User tokens. - /// - public DbSet UserTokens { get; set; } - - /// - /// Gets or sets the of roles. - /// - public DbSet Roles { get; set; } - - /// - /// Gets or sets the of role claims. - /// - public DbSet RoleClaims { get; set; } - - /// - /// Initializes a new instance of . - /// - /// The options to be used by a . - public IdentityDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - - builder.ConfigureAbpIdentity(TablePrefix, Schema); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextFactory.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextFactory.cs deleted file mode 100644 index 94d89c961b..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace Volo.Abp.Identity.EntityFrameworkCore -{ - /* This class is needed for EF Core command line tooling */ - - public class IdentityDbContextFactory : IDesignTimeDbContextFactory - { - public IdentityDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=AbpDesk;Trusted_Connection=True;"); - return new IdentityDbContext(builder.Options); - } - } -} diff --git a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs b/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs deleted file mode 100644 index 73182b491b..0000000000 --- a/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs +++ /dev/null @@ -1,119 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Volo.Abp.Identity.EntityFrameworkCore -{ - public static class IdentityDbContextModelBuilderExtensions - { - public static void ConfigureAbpIdentity( - [NotNull] this ModelBuilder builder, - [CanBeNull] string tablePrefix = AbpIdentityConsts.DefaultDbTablePrefix, - [CanBeNull] string schema = AbpIdentityConsts.DefaultDbSchema) - { - Check.NotNull(builder, nameof(builder)); - - if (tablePrefix == null) - { - tablePrefix = ""; - } - - //TODO: Set column names for all EF Core mappings as did for some of the user properties below (this is needed for table splitting scenario): - - builder.Entity(b => - { - b.ToTable(tablePrefix + "Users", schema); - - b.Property(u => u.UserName).IsRequired().HasMaxLength(IdentityUserConsts.MaxUserNameLength).HasColumnName("UserName"); - b.Property(u => u.NormalizedUserName).IsRequired().HasMaxLength(IdentityUserConsts.MaxNormalizedUserNameLength); - b.Property(u => u.Email).HasMaxLength(IdentityUserConsts.MaxEmailLength).HasColumnName("Email"); - b.Property(u => u.NormalizedEmail).HasMaxLength(IdentityUserConsts.MaxNormalizedEmailLength); - b.Property(u => u.PhoneNumber).HasMaxLength(IdentityUserConsts.MaxPhoneNumberLength).HasColumnName("PhoneNumber"); - b.Property(u => u.PasswordHash).HasMaxLength(IdentityUserConsts.MaxPasswordHashLength); - b.Property(u => u.SecurityStamp).IsRequired().HasMaxLength(IdentityUserConsts.MaxSecurityStampLength); - b.Property(u => u.ConcurrencyStamp).IsRequired().HasMaxLength(IdentityUserConsts.MaxConcurrencyStampLength); - b.Property(u => u.EmailConfirmed).HasDefaultValue(false).HasColumnName("EmailConfirmed"); - b.Property(u => u.PhoneNumberConfirmed).HasDefaultValue(false).HasColumnName("PhoneNumberConfirmed"); - b.Property(u => u.TwoFactorEnabled).HasDefaultValue(false); - b.Property(u => u.LockoutEnabled).HasDefaultValue(false); - b.Property(u => u.AccessFailedCount).HasDefaultValue(0); - - b.HasMany(u => u.Claims).WithOne().HasForeignKey(uc => uc.UserId).IsRequired(); - b.HasMany(u => u.Logins).WithOne().HasForeignKey(ul => ul.UserId).IsRequired(); - b.HasMany(u => u.Roles).WithOne().HasForeignKey(ur => ur.UserId).IsRequired(); - b.HasMany(u => u.Tokens).WithOne().HasForeignKey(ur => ur.UserId).IsRequired(); - - b.HasIndex(u => u.NormalizedUserName); - b.HasIndex(u => u.NormalizedEmail); - b.HasIndex(u => u.UserName); - b.HasIndex(u => u.Email); - }); - - builder.Entity(b => - { - b.ToTable(tablePrefix + "UserClaims", schema); - - b.Property(uc => uc.ClaimType).HasMaxLength(IdentityUserClaimConsts.MaxClaimTypeLength).IsRequired(); - b.Property(uc => uc.ClaimValue).HasMaxLength(IdentityUserClaimConsts.MaxClaimValueLength); - - b.HasIndex(uc => uc.UserId); - }); - - builder.Entity(b => - { - b.ToTable(tablePrefix + "UserRoles", schema); - - b.HasKey(ur => new { ur.UserId, ur.RoleId }); - - b.HasOne().WithMany().HasForeignKey(ur => ur.RoleId).IsRequired(); - b.HasOne().WithMany(u => u.Roles).HasForeignKey(ur => ur.UserId).IsRequired(); - - b.HasIndex(ur => new { ur.RoleId, ur.UserId }); - }); - - builder.Entity(b => - { - b.ToTable(tablePrefix + "UserLogins", schema); - - b.HasKey(x => new { x.UserId, x.LoginProvider }); - - b.Property(ul => ul.LoginProvider).HasMaxLength(IdentityUserLoginConsts.MaxLoginProviderLength).IsRequired(); - b.Property(ul => ul.ProviderKey).HasMaxLength(IdentityUserLoginConsts.MaxProviderKeyLength).IsRequired(); - b.Property(ul => ul.ProviderDisplayName).HasMaxLength(IdentityUserLoginConsts.MaxProviderDisplayNameLength); - - b.HasIndex(l => new { l.LoginProvider, l.ProviderKey }); - }); - - builder.Entity(b => - { - b.ToTable(tablePrefix + "UserTokens", schema); - - b.HasKey(l => new { l.UserId, l.LoginProvider, l.Name }); - - b.Property(ul => ul.LoginProvider).HasMaxLength(IdentityUserTokenConsts.MaxLoginProviderLength).IsRequired(); - b.Property(ul => ul.LoginProvider).HasMaxLength(IdentityUserTokenConsts.MaxNameLength).IsRequired(); - }); - - builder.Entity(b => - { - b.ToTable(tablePrefix + "Roles", schema); - - b.Property(r => r.Name).IsRequired().HasMaxLength(IdentityRoleConsts.MaxNameLength); - b.Property(r => r.NormalizedName).IsRequired().HasMaxLength(IdentityRoleConsts.MaxNormalizedNameLength); - - b.HasMany(r => r.Claims).WithOne().HasForeignKey(rc => rc.RoleId).IsRequired(); - - b.HasIndex(r => r.NormalizedName); - }); - - builder.Entity(b => - { - b.ToTable(tablePrefix + "RoleClaims", schema); - - b.Property(uc => uc.ClaimType).HasMaxLength(IdentityRoleClaimConsts.MaxClaimTypeLength).IsRequired(); - b.Property(uc => uc.ClaimValue).HasMaxLength(IdentityRoleClaimConsts.MaxClaimValueLength); - - b.HasIndex(uc => uc.RoleId); - }); - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Client/Properties/AssemblyInfo.cs b/src/Volo.Abp.Identity.HttpApi.Client/Properties/AssemblyInfo.cs deleted file mode 100644 index d408ff5633..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Client/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.Identity.HttpApi.Client")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("00b240b6-ec44-461a-9578-ef4f1be9c688")] diff --git a/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj b/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj deleted file mode 100644 index 70532204b9..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.HttpApi.Client - Volo.Abp.Identity.HttpApi.Client - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj.DotSettings b/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj.DotSettings deleted file mode 100644 index 58ad6c8854..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp71 \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs b/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs deleted file mode 100644 index 113c9d3d77..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Http.Client; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Identity -{ - [DependsOn(typeof(AbpIdentityApplicationContractsModule), typeof(AbpHttpClientModule))] - public class AbpIdentityHttpApiClientModule : AbpModule - { - public const string RemoteServiceName = "AbpIdentity"; - - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - - services.AddHttpClientProxies(typeof(AbpIdentityApplicationContractsModule).Assembly, RemoteServiceName); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientIdentityUserLookupService.cs b/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientIdentityUserLookupService.cs deleted file mode 100644 index 8f21dd569b..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientIdentityUserLookupService.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Users; - -namespace Volo.Abp.Identity -{ - public class HttpClientIdentityUserLookupService : IUserLookupService, ITransientDependency - { - private readonly IIdentityUserAppService _userAppService; - - public HttpClientIdentityUserLookupService(IIdentityUserAppService userAppService) - { - _userAppService = userAppService; - } - - public async Task FindByIdAsync(Guid id) - { - //TODO: Should return null if not found! - return (await _userAppService.GetAsync(id)).ToUserInfo(); - } - - public async Task FindByUserNameAsync(string userName) - { - //TODO: Should return null if not found! - //TODO: Search by UserName, not by a general filter! - return (await _userAppService.GetListAsync(new GetIdentityUsersInput { Filter = userName })).Items.FirstOrDefault()?.ToUserInfo(); - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/IdentityUserExtensions.cs b/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/IdentityUserExtensions.cs deleted file mode 100644 index 8cc10fe85a..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/IdentityUserExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Volo.Abp.Users; - -namespace Volo.Abp.Identity -{ - public static class IdentityUserDtoExtensions - { - public static IUserInfo ToUserInfo(this IdentityUserDto user) - { - return new UserInfo( - user.Id, - user.UserName, - user.Email, - user.EmailConfirmed, - user.PhoneNumber, - user.PhoneNumberConfirmed - ); - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Host/AbpIdentityHttpApiHostModule.cs b/src/Volo.Abp.Identity.HttpApi.Host/AbpIdentityHttpApiHostModule.cs deleted file mode 100644 index 03f463bc32..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/AbpIdentityHttpApiHostModule.cs +++ /dev/null @@ -1,175 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Swashbuckle.AspNetCore.Swagger; -using Volo.Abp.AspNetCore.Modularity; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Autofac; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Identity.HttpApi.Host.VersioningTests.V1; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Identity.HttpApi.Host -{ - [DependsOn( - typeof(AbpIdentityApplicationModule), - typeof(AbpIdentityEntityFrameworkCoreModule), - typeof(AbpIdentityHttpApiModule), - typeof(AbpAutofacModule))] - public class AbpIdentityHttpApiHostModule : AbpModule - { - public override void PreConfigureServices(IServiceCollection services) - { - services.PreConfigure(builder => - { - // add the versioned api explorer, which also adds IApiVersionDescriptionProvider service - // note: the specified format code will format the version as "'v'major[.minor][-status]" - - builder.AddVersionedApiExplorer(o => o.GroupNameFormat = "'v'VVV"); - }); - } - - public override void ConfigureServices(IServiceCollection services) - { - var hostingEnvironment = services.GetSingletonInstance(); //TOD: Move to BuildConfiguration method - var configuration = BuildConfiguration(hostingEnvironment); - - services.Configure(configuration); - - services.Configure(options => - { - //Configures all dbcontextes to use Sql Server with calculated connection string - options.Configure(context => - { - context.DbContextOptions.UseSqlServer(context.ConnectionString); - }); - }); - - services.AddApiVersioning(o => - { - o.ReportApiVersions = true; - //o.Conventions.Controller().Action((MethodInfo)null).MapToApiVersion(new ApiVersion(1,1),).IsApiVersionNeutral(); - //o.Conventions.Controller().HasApiVersion(new ApiVersion(3, 0)); //We can do that based on controller's AbpApiVersion attribute! - o.AssumeDefaultVersionWhenUnspecified = true; - o.DefaultApiVersion = new ApiVersion(3, 0); //Default: 1.0 //We can not rely on that, application should do. - - //o.ErrorResponses //TOD: We can override error response generator (to solve https://github.com/Microsoft/aspnet-api-versioning/issues/195) - - //o.Conventions.Controller().HasApiVersion(2, 0); - //o.Conventions.Controller().IsApiVersionNeutral(); - - o.ConfigureAbp(services); - }); - - services.AddSwaggerGen( - options => - { - //options.SwaggerDoc("v1", new Info { Title = "Volo.Abp.Identity API", Version = "v1" }); - //options.DocInclusionPredicate((docName, description) => true); - - - // resolve the IApiVersionDescriptionProvider service - // note: that we have to build a temporary service provider here because one has not been created yet - var provider = services.BuildServiceProvider().GetRequiredService(); - - // add a swagger document for each discovered API version - // note: you might choose to skip or document deprecated API versions differently - foreach (var description in provider.ApiVersionDescriptions) - { - options.SwaggerDoc(description.GroupName, CreateInfoForApiVersion(description)); - } - - // add a custom operation filter which sets default values - options.OperationFilter(); - - // integrate xml comments - //options.IncludeXmlComments(XmlCommentsFilePath); //TODO: Add XML comments! - }); - - services.Configure(options => - { - options.ConventionalControllers.Create(typeof(AbpIdentityHttpApiHostModule).Assembly, o => - { - o.TypePredicate = t => t == typeof(CallsController); - }); - - options.ConventionalControllers.Create(typeof(AbpIdentityHttpApiHostModule).Assembly, o => - { - o.TypePredicate = t => t == typeof(Host.VersioningTests.V2.CallsController); - o.RootPath = "app/compat"; - }); - }); - - services.AddAssemblyOf(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - var app = context.GetApplicationBuilder(); - - context.GetLoggerFactory().AddConsole().AddDebug(); - - if (context.GetEnvironment().IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseStaticFiles(); - - var provider = context.ServiceProvider.GetRequiredService(); - - app.UseSwagger(); - app.UseSwaggerUI(options => - { - //options.SwaggerEndpoint("/swagger/v1/swagger.json", "Volo.Abp.Identity API"); - - - - // build a swagger endpoint for each discovered API version - foreach (var description in provider.ApiVersionDescriptions) - { - options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", description.GroupName.ToUpperInvariant()); - } - }); - - app.UseMvcWithDefaultRoute(); - } - - private static IConfigurationRoot BuildConfiguration(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - - return builder.Build(); - } - - private static Info CreateInfoForApiVersion(ApiVersionDescription description) - { - var info = new Info() - { - Title = $"Sample API {description.ApiVersion}", - Version = description.ApiVersion.ToString(), - Description = "A sample application with Swagger, Swashbuckle, and API versioning.", - Contact = new Contact() { Name = "Bill Mei", Email = "bill.mei@somewhere.com" }, - TermsOfService = "Shareware", - License = new License() { Name = "MIT", Url = "https://opensource.org/licenses/MIT" } - }; - - if (description.IsDeprecated) - { - info.Description += " This API version has been deprecated."; - } - - return info; - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Host/Controllers/HomeController.cs b/src/Volo.Abp.Identity.HttpApi.Host/Controllers/HomeController.cs deleted file mode 100644 index 34283e4d36..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/Controllers/HomeController.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; - -namespace Volo.Abp.Identity.HttpApi.Host.Controllers -{ - public class HomeController : AbpController - { - public IActionResult Index() - { - return Redirect("/swagger"); - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Host/Dockerfile b/src/Volo.Abp.Identity.HttpApi.Host/Dockerfile deleted file mode 100644 index 853a01fe0b..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM microsoft/aspnetcore - -WORKDIR /app -COPY . . - -ENTRYPOINT ["dotnet", "Volo.Abp.Identity.HttpApi.Host.dll"] \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Host/Program.cs b/src/Volo.Abp.Identity.HttpApi.Host/Program.cs deleted file mode 100644 index ccf8ec917f..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.IO; -using Microsoft.AspNetCore.Hosting; - -namespace Volo.Abp.Identity.HttpApi.Host -{ - public class Program - { - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Host/Properties/launchSettings.json b/src/Volo.Abp.Identity.HttpApi.Host/Properties/launchSettings.json deleted file mode 100644 index 41f665cad8..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:63290/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.Identity.HttpApi.Host": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Host/Startup.cs b/src/Volo.Abp.Identity.HttpApi.Host/Startup.cs deleted file mode 100644 index f585a5dbde..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/Startup.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Serilog; - -namespace Volo.Abp.Identity.HttpApi.Host -{ - public class Startup - { - public IServiceProvider ConfigureServices(IServiceCollection services) - { - services.AddApplication(options => - { - options.UseAutofac(); - }); - - //TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory! - return services.BuildServiceProviderFromFactory(); - } - - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) - { - loggerFactory - .AddConsole() - .AddDebug() - .AddSerilog(new LoggerConfiguration() - .Enrich.FromLogContext() - .WriteTo.RollingFile("Logs/logs.txt") - .CreateLogger() - ); - - app.InitializeApplication(); - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Host/SwaggerDefaultValues.cs b/src/Volo.Abp.Identity.HttpApi.Host/SwaggerDefaultValues.cs deleted file mode 100644 index f273dced70..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/SwaggerDefaultValues.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Linq; -using Swashbuckle.AspNetCore.Swagger; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace Volo.Abp.Identity.HttpApi.Host -{ - /// - /// Represents the Swagger/Swashbuckle operation filter used to document the implicit API version parameter. - /// - /// This is only required due to bugs in the . - /// Once they are fixed and published, this class can be removed. - public class SwaggerDefaultValues : IOperationFilter - { - /// - /// Applies the filter to the specified operation using the given context. - /// - /// The operation to apply the filter to. - /// The current operation filter context. - public void Apply(Operation operation, OperationFilterContext context) - { - // REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/412 - // REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/413 - foreach (var parameter in operation.Parameters.OfType()) - { - var description = context.ApiDescription.ParameterDescriptions.First(p => p.Name == parameter.Name); - - if (parameter.Description == null) - { - parameter.Description = description.ModelMetadata.Description; - } - - if (parameter.Default == null) - { - parameter.Default = description.RouteInfo?.DefaultValue; - } - - parameter.Required |= description.RouteInfo?.IsOptional == true; - } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V1/CallDto.cs b/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V1/CallDto.cs deleted file mode 100644 index b8aa84f150..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V1/CallDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.Identity.HttpApi.Host.VersioningTests.V1 -{ - public class CallDto : EntityDto - { - public string Number { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V1/CallsController.cs b/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V1/CallsController.cs deleted file mode 100644 index 00fec75890..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V1/CallsController.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; - -namespace Volo.Abp.Identity.HttpApi.Host.VersioningTests.V1 -{ - [ApiVersion("1.0")] - [Route("api/v{apiVersion:apiVersion}/calls")] - public class CallsController : AbpController, IRemoteService - { - private static readonly List Calls = new List - { - new CallDto {Id = 1, Number = "123456"}, - new CallDto { Id = 2, Number = "123457" } - }; - - [HttpGet] - public List GetList() - { - return Calls; - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V2/Calls2Controller.cs b/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V2/Calls2Controller.cs deleted file mode 100644 index 73b990ec3c..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/VersioningTests/V2/Calls2Controller.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Identity.HttpApi.Host.VersioningTests.V1; - -namespace Volo.Abp.Identity.HttpApi.Host.VersioningTests.V2 -{ - [ApiVersion("2.0")] - [Route("api/v{apiVersion:apiVersion}/calls")] - public class CallsController : AbpController, IRemoteService - { - private static List _calls = new List - { - new CallDto {Id = 1, Number = "123456000"}, - new CallDto { Id = 2, Number = "123457000" } - }; - - [HttpGet] - public List GetList() - { - return _calls; - } - - [HttpGet] - [Route("by-filter")] - public List GetList(string num) - { - return _calls.Where(c => c.Number.Contains(num)).ToList(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Host/Volo.Abp.Identity.HttpApi.Host.csproj b/src/Volo.Abp.Identity.HttpApi.Host/Volo.Abp.Identity.HttpApi.Host.csproj deleted file mode 100644 index 00fd64b080..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/Volo.Abp.Identity.HttpApi.Host.csproj +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - netcoreapp2.0 - true - Volo.Abp.Identity.HttpApi.Host - Exe - Volo.Abp.Identity.HttpApi.Host - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - All - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.HttpApi.Host/appsettings.Staging.json b/src/Volo.Abp.Identity.HttpApi.Host/appsettings.Staging.json deleted file mode 100644 index a8d2e43f7e..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/appsettings.Staging.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=10.0.75.1;Database=AbpDesk;User=sa;Password=123qwe;" - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi.Host/appsettings.json b/src/Volo.Abp.Identity.HttpApi.Host/appsettings.json deleted file mode 100644 index 0f39b1b157..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/appsettings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ConnectionStrings": { - "Default": "Server=localhost;Database=AbpDesk;Trusted_Connection=True;" - } -} diff --git a/src/Volo.Abp.Identity.HttpApi.Host/web.config b/src/Volo.Abp.Identity.HttpApi.Host/web.config deleted file mode 100644 index dc0514fca5..0000000000 --- a/src/Volo.Abp.Identity.HttpApi.Host/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.HttpApi/Properties/AssemblyInfo.cs b/src/Volo.Abp.Identity.HttpApi/Properties/AssemblyInfo.cs deleted file mode 100644 index 0964ce2598..0000000000 --- a/src/Volo.Abp.Identity.HttpApi/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.Identity.HttpApi")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("57fca6cb-9d99-411e-8abf-20acfbd61d61")] diff --git a/src/Volo.Abp.Identity.HttpApi/Volo.Abp.Identity.HttpApi.csproj b/src/Volo.Abp.Identity.HttpApi/Volo.Abp.Identity.HttpApi.csproj deleted file mode 100644 index 17b43c8e71..0000000000 --- a/src/Volo.Abp.Identity.HttpApi/Volo.Abp.Identity.HttpApi.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.HttpApi - Volo.Abp.Identity.HttpApi - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs b/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs deleted file mode 100644 index 69891d1ccb..0000000000 --- a/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Identity -{ - [DependsOn(typeof(AbpIdentityApplicationContractsModule), typeof(AbpAspNetCoreMvcModule))] - public class AbpIdentityHttpApiModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs b/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs deleted file mode 100644 index 99a590ca7a..0000000000 --- a/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - [RemoteService] - [Area("identity")] - [Controller] - [ControllerName("Role")] - public class IdentityRoleController : IIdentityRoleAppService, ITransientDependency - { - private readonly IIdentityRoleAppService _roleAppService; - - public IdentityRoleController(IIdentityRoleAppService roleAppService) - { - _roleAppService = roleAppService; - } - - public virtual Task GetAsync(Guid id) - { - return _roleAppService.GetAsync(id); - } - - public virtual Task> GetListAsync(GetIdentityRolesInput input) - { - return _roleAppService.GetListAsync(input); - } - - public virtual Task CreateAsync(IdentityRoleCreateDto input) - { - return _roleAppService.CreateAsync(input); - } - - public virtual Task UpdateAsync(Guid id, IdentityRoleUpdateDto input) - { - return _roleAppService.UpdateAsync(id, input); - } - - public virtual Task DeleteAsync(Guid id) - { - return _roleAppService.DeleteAsync(id); - } - - public virtual Task> GetAllListAsync() - { - return _roleAppService.GetAllListAsync(); - } - - public virtual Task GetPermissionsAsync(Guid id) - { - return _roleAppService.GetPermissionsAsync(id); - } - - public virtual Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input) - { - return _roleAppService.UpdatePermissionsAsync(id, input); - } - } -} diff --git a/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs b/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs deleted file mode 100644 index 42ac0412f1..0000000000 --- a/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - [RemoteService] - [Area("identity")] - [Controller] - [ControllerName("User")] - public class IdentityUserController : IIdentityUserAppService, ITransientDependency //TODO: Try to implement these type wrapper controllers automatically! - { - private readonly IIdentityUserAppService _userAppService; - - public IdentityUserController(IIdentityUserAppService userAppService) - { - _userAppService = userAppService; - } - - public virtual Task GetAsync(Guid id) - { - return _userAppService.GetAsync(id); - } - - public virtual Task> GetListAsync(GetIdentityUsersInput input) - { - return _userAppService.GetListAsync(input); - } - - public virtual Task CreateAsync(IdentityUserCreateDto input) - { - return _userAppService.CreateAsync(input); - } - - public virtual Task UpdateAsync(Guid id, IdentityUserUpdateDto input) - { - return _userAppService.UpdateAsync(id, input); - } - - public virtual Task DeleteAsync(Guid id) - { - return _userAppService.DeleteAsync(id); - } - - public virtual Task> GetRolesAsync(Guid id) - { - return _userAppService.GetRolesAsync(id); - } - - public virtual Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input) - { - return _userAppService.UpdateRolesAsync(id, input); - } - - public virtual Task GetPermissionsAsync(Guid id) - { - return _userAppService.GetPermissionsAsync(id); - } - - public virtual Task UpdatePermissionsAsync(Guid id, UpdatePermissionsDto input) - { - return _userAppService.UpdatePermissionsAsync(id, input); - } - } -} diff --git a/src/Volo.Abp.Identity.Web/AbpIdentityWebAutoMapperProfile.cs b/src/Volo.Abp.Identity.Web/AbpIdentityWebAutoMapperProfile.cs deleted file mode 100644 index c8651d8e88..0000000000 --- a/src/Volo.Abp.Identity.Web/AbpIdentityWebAutoMapperProfile.cs +++ /dev/null @@ -1,48 +0,0 @@ -using AutoMapper; -using Volo.Abp.Identity.Web.Pages.Identity.Roles; -using CreateUserModalModel = Volo.Abp.Identity.Web.Pages.Identity.Users.CreateModalModel; -using EditUserModalModel = Volo.Abp.Identity.Web.Pages.Identity.Users.EditModalModel; - -namespace Volo.Abp.Identity.Web -{ - public class AbpIdentityWebAutoMapperProfile : Profile - { - public AbpIdentityWebAutoMapperProfile() - { - CreateUserMappings(); - CreateRoleMappings(); - } - - private void CreateUserMappings() - { - //List - CreateMap(); - - //CreateModal - CreateMap() - .ForMember(dest => dest.RoleNames, opt => opt.Ignore()); - - CreateMap() - .ForMember(dest => dest.IsAssigned, opt => opt.Ignore()); - - //EditModal - CreateMap() - .ForMember(dest => dest.RoleNames, opt => opt.Ignore()); - - CreateMap() - .ForMember(dest => dest.IsAssigned, opt => opt.Ignore()); - } - - private void CreateRoleMappings() - { - //List - CreateMap(); - - //CreateModal - CreateMap(); - - //EditModal - CreateMap(); - } - } -} diff --git a/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs b/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs deleted file mode 100644 index 94d80d4fab..0000000000 --- a/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; -using Volo.Abp.AutoMapper; -using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity; -using Volo.Abp.Identity.Web.Navigation; -using Volo.Abp.Localization; -using Volo.Abp.Modularity; -using Volo.Abp.Permissions.Web; -using Volo.Abp.Ui.Navigation; -using Volo.Abp.VirtualFileSystem; - -namespace Volo.Abp.Identity.Web -{ - [DependsOn(typeof(AbpIdentityHttpApiModule))] - [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] - [DependsOn(typeof(AbpAutoMapperModule))] - [DependsOn(typeof(AbpPermissionsWebModule))] - public class AbpIdentityWebModule : AbpModule - { - public override void PreConfigureServices(IServiceCollection services) - { - services.PreConfigure(options => - { - options.AddAssemblyResource(typeof(IdentityResource)); - }); - } - - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.MenuContributors.Add(new AbpIdentityWebMainMenuContributor()); - }); - - services.Configure(options => - { - options.FileSets.AddEmbedded("Volo.Abp.Identity.Web"); - }); - - services.Configure(options => - { - options.Resources.AddVirtualJson("en", "/Localization/Resources/AbpIdentity"); - }); - - services.Configure(options => - { - options.AddProfile(validate: true); - }); - - services.Configure(options => - { - options.Conventions.AuthorizePage("/Identity/Users/Index", IdentityPermissions.Users.Default); - options.Conventions.AuthorizePage("/Identity/Users/CreateModal", IdentityPermissions.Users.Create); - options.Conventions.AuthorizePage("/Identity/Users/EditModal", IdentityPermissions.Users.Update); - options.Conventions.AuthorizePage("/Identity/Roles/Index", IdentityPermissions.Roles.Default); - options.Conventions.AuthorizePage("/Identity/Roles/CreateModal", IdentityPermissions.Roles.Create); - options.Conventions.AuthorizePage("/Identity/Roles/EditModal", IdentityPermissions.Roles.Update); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/IdentityResource.cs b/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/IdentityResource.cs deleted file mode 100644 index fed35c92cd..0000000000 --- a/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/IdentityResource.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Localization.Resources.AbpBootstrap; -using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; - -namespace Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity -{ - [InheritResource( - typeof(AbpValidationResource), - typeof(AbpBootstrapResource))] - [ShortLocalizationResourceName("AbpIdentity")] - public class IdentityResource //TODO: Rename to AbpIdentityResource - { - - } -} diff --git a/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/en.json b/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/en.json deleted file mode 100644 index f12cad4212..0000000000 --- a/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/en.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "culture": "en", - "texts": { - "Users": "Users", - "NewUser": "New user", - "UserName": "User name", - "EmailAddress": "Email address", - "PhoneNumber": "Phone number", - "UserInformations": "User informations", - "Roles": "Roles", - "Password": "Password", - "UserDeletionConfirmationMessage": "User '{0}' will be deleted. Do you confirm that?", - "TwoFactorVerification": "Two factor verification", - "AccountLockoutOnFailedLoginAttempts": "Locking account after failed login attempts", - "NewRole": "New role", - "RoleName": "Role name" - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/tr.json b/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/tr.json deleted file mode 100644 index a19ffbcad8..0000000000 --- a/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/tr.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "culture": "tr", - "texts": { - "Users": "Kullanıcılar", - "NewUser": "Yeni kullanıcı", - "Actions": "İşlemler", - "UserName": "Kullanıcı adı", - "EmailAddress": "E-posta adresi", - "PhoneNumber": "Telefon numarası", - "UserInformations": "Kullanıcı bilgileri", - "Roles": "Roller", - "Close": "Kapat", - "Delete": "Sil", - "Edit": "Düzenle", - "Save": "Kaydet", - "Password": "Şifre", - "UserDeletionConfirmationMessage": "{0} kullanıcısı silinecektir. Onaylıyor musunuz?", - "TwoFactorVerification": "İki aşamalı doğrumala", - "AccountLockoutOnFailedLoginAttempts": "Başarısız giriş denemeleri sonrası hesabı kilitleme", - "NewRole": "Yeni rol", - "RoleName": "Rol adı", - "CreationTime": "Oluşturma zamanı" - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs b/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs deleted file mode 100644 index 2f0fb56892..0000000000 --- a/src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Ui.Navigation; - -namespace Volo.Abp.Identity.Web.Navigation -{ - public class AbpIdentityWebMainMenuContributor : IMenuContributor - { - public async Task ConfigureMenuAsync(MenuConfigurationContext context) - { - if (context.Menu.Name != StandardMenus.Main) - { - return; - } - - var permissionChecker = context.ServiceProvider.GetRequiredService(); - - //TODO: We should not add this if none of the children available. Alternatively, we can handle it on menu rendering (would be simpler). - var identityMenuItem = new ApplicationMenuItem("Identity", "Identity"); - - context.Menu.AddItem(identityMenuItem); - - if (await permissionChecker.IsGrantedAsync(IdentityPermissions.Roles.Default)) - { - identityMenuItem.AddItem(new ApplicationMenuItem("Roles", "Roles", url: "/Identity/Roles")); - } - - if (await permissionChecker.IsGrantedAsync(IdentityPermissions.Users.Default)) - { - identityMenuItem.AddItem(new ApplicationMenuItem("Users", "Users", url: "/Identity/Users")); - } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml deleted file mode 100644 index c76d414a34..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml +++ /dev/null @@ -1,32 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity -@model Volo.Abp.Identity.Web.Pages.Identity.Roles.CreateModalModel -@inject IStringLocalizer L -@{ - Layout = null; -} - -
    - - - - - - - -
    - - - -
    - -
    - -
    - - - -
    - -
    diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml.cs b/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml.cs deleted file mode 100644 index 55383f91ce..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Identity.Web.Pages.Identity.Roles -{ - public class CreateModalModel : AbpPageModel - { - [BindProperty] - public RoleInfoModel RoleModel { get; set; } - - private readonly IIdentityRoleAppService _identityRoleAppService; - - public CreateModalModel(IIdentityRoleAppService identityRoleAppService) - { - _identityRoleAppService = identityRoleAppService; - } - - public async Task OnPostAsync() - { - ValidateModel(); - - var input = ObjectMapper.Map(RoleModel); - await _identityRoleAppService.CreateAsync(input); - - return NoContent(); - } - - public class RoleInfoModel - { - [Required] - [StringLength(IdentityRoleConsts.MaxNameLength)] - [Display(Name = "RoleName")] - public string Name { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml deleted file mode 100644 index 70b6bd3c10..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml +++ /dev/null @@ -1,34 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity -@model Volo.Abp.Identity.Web.Pages.Identity.Roles.EditModalModel -@inject IStringLocalizer L -@{ - Layout = null; -} - -
    - - - - - - - - - -
    - - - -
    - -
    - -
    - - - -
    - -
    \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml.cs b/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml.cs deleted file mode 100644 index 3ad82c16bf..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Identity.Web.Pages.Identity.Roles -{ - public class EditModalModel : AbpPageModel - { - [BindProperty] - public RoleInfoModel RoleInfo { get; set; } - - private readonly IIdentityRoleAppService _identityRoleAppService; - - public EditModalModel(IIdentityRoleAppService identityRoleAppService) - { - _identityRoleAppService = identityRoleAppService; - } - - public async Task OnGetAsync(Guid id) - { - RoleInfo = ObjectMapper.Map( - await _identityRoleAppService.GetAsync(id) - ); - } - - public async Task OnPostAsync() - { - ValidateModel(); - - var input = ObjectMapper.Map(RoleInfo); - await _identityRoleAppService.UpdateAsync(RoleInfo.Id, input); - - return NoContent(); - } - - public class RoleInfoModel - { - [HiddenInput] - public Guid Id { get; set; } - - [Required] - [StringLength(IdentityRoleConsts.MaxNameLength)] - [Display(Name = "RoleName")] - public string Name { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml deleted file mode 100644 index 3bbaa3b48b..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@page -@model Volo.Abp.Identity.Web.Pages.Identity.Roles.IndexModel -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity -@inject IHtmlLocalizer L -@section styles { - -} - -@section scripts { - - - - - -} - - - -
    -
    -

    @L["Roles"]

    -
    -
    - -
    -
    -
    - - - - - - - - -
    @L["Actions"]@L["RoleName"]
    -
    -
    \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml.cs b/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml.cs deleted file mode 100644 index 12b0477d3b..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Identity.Web.Pages.Identity.Roles -{ - public class IndexModel : AbpPageModel - { - public void OnGet() - { - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml deleted file mode 100644 index 2bf4388f4b..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml +++ /dev/null @@ -1,88 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity -@model Volo.Abp.Identity.Web.Pages.Identity.Users.CreateModalModel -@inject IStringLocalizer L -@{ - Layout = null; -} - -
    - - - - - - - - - -
    - -
    - -
    - - - -
    -
    - - - -
    -
    - - - -
    -
    - - - -
    -
    - -
    -
    - -
    - -
    -
    - @for (var i = 0; i < Model.Roles.Length; i++) - { -
    - -
    - - } -
    - -
    - -
    - -
    - - - -
    - -
    diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs deleted file mode 100644 index a3e5397ef8..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Identity.Web.Pages.Identity.Users -{ - public class CreateModalModel : AbpPageModel - { - [BindProperty] - public UserInfoViewModel UserInfo { get; set; } - - [BindProperty] - public AssignedRoleViewModel[] Roles { get; set; } - - private readonly IIdentityUserAppService _identityUserAppService; - private readonly IIdentityRoleAppService _identityRoleAppService; - - public CreateModalModel(IIdentityUserAppService identityUserAppService, IIdentityRoleAppService identityRoleAppService) - { - _identityUserAppService = identityUserAppService; - _identityRoleAppService = identityRoleAppService; - } - - public async Task OnGetAsync() - { - UserInfo = new UserInfoViewModel(); - - Roles = ObjectMapper.Map, AssignedRoleViewModel[]>( - await _identityRoleAppService.GetAllListAsync() - ); - } - - public async Task OnPostAsync() - { - ValidateModel(); - - var input = ObjectMapper.Map(UserInfo); - input.RoleNames = Roles.Where(r => r.IsAssigned).Select(r => r.Name).ToArray(); - - await _identityUserAppService.CreateAsync(input); - - return NoContent(); - } - - public class UserInfoViewModel - { - [Required] - [StringLength(IdentityUserConsts.MaxUserNameLength)] - [Display(Name = "UserName")] - public string UserName { get; set; } - - [Required] - [StringLength(IdentityUserConsts.MaxPasswordLength)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [Required] - [EmailAddress] - [StringLength(IdentityUserConsts.MaxEmailLength)] - [Display(Name = "EmailAddress")] - public string Email { get; set; } - - [StringLength(IdentityUserConsts.MaxPhoneNumberLength)] - [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } - - [Display(Name = "TwoFactorVerification")] - public bool TwoFactorEnabled { get; set; } = true; - - [Display(Name = "AccountLockoutOnFailedLoginAttempts")] - public bool LockoutEnabled { get; set; } = true; - } - - public class AssignedRoleViewModel - { - [Required] - [HiddenInput] - public string Name { get; set; } - - public bool IsAssigned { get; set; } - } - } -} diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml deleted file mode 100644 index 731cddb457..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml +++ /dev/null @@ -1,85 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity -@model Volo.Abp.Identity.Web.Pages.Identity.Users.EditModalModel -@inject IStringLocalizer L -@{ - Layout = null; -} - -
    - - - - - - - - - -
    - -
    - - - -
    - - - -
    -
    - - - -
    -
    - - - -
    -
    - -
    -
    - -
    - -
    -
    - @for (var i = 0; i < Model.Roles.Length; i++) - { -
    - -
    - - } -
    - -
    - -
    - -
    - - - -
    - -
    \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs deleted file mode 100644 index 832def1a3e..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Identity.Web.Pages.Identity.Users -{ - public class EditModalModel : AbpPageModel - { - [BindProperty] - public UserInfoViewModel UserInfo { get; set; } - - [BindProperty] - public AssignedRoleViewModel[] Roles { get; set; } - - private readonly IIdentityUserAppService _identityUserAppService; - private readonly IIdentityRoleAppService _identityRoleAppService; - - public EditModalModel(IIdentityUserAppService identityUserAppService, IIdentityRoleAppService identityRoleAppService) - { - _identityUserAppService = identityUserAppService; - _identityRoleAppService = identityRoleAppService; - } - - public async Task OnGetAsync(Guid id) - { - UserInfo = ObjectMapper.Map(await _identityUserAppService.GetAsync(id)); - - Roles = ObjectMapper.Map, AssignedRoleViewModel[]>( - await _identityRoleAppService.GetAllListAsync() - ); - - var userRoleNames = (await _identityUserAppService.GetRolesAsync(UserInfo.Id)).Items.Select(r => r.Name).ToList(); - foreach (var role in Roles) - { - if (userRoleNames.Contains(role.Name)) - { - role.IsAssigned = true; - } - } - } - - public async Task OnPostAsync() - { - ValidateModel(); - - var input = ObjectMapper.Map(UserInfo); - input.RoleNames = Roles.Where(r => r.IsAssigned).Select(r => r.Name).ToArray(); - await _identityUserAppService.UpdateAsync(UserInfo.Id, input); - - return NoContent(); - } - - public class UserInfoViewModel - { - [HiddenInput] - public Guid Id { get; set; } - - [Required] - [StringLength(IdentityUserConsts.MaxUserNameLength)] - [Display(Name = "UserName")] - public string UserName { get; set; } - - [Required] - [EmailAddress] - [StringLength(IdentityUserConsts.MaxEmailLength)] - [Display(Name = "EmailAddress")] - public string Email { get; set; } - - [StringLength(IdentityUserConsts.MaxPhoneNumberLength)] - [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } - - [Display(Name = "TwoFactorVerification")] - public bool TwoFactorEnabled { get; set; } - - [Display(Name = "AccountLockoutOnFailedLoginAttempts")] - public bool LockoutEnabled { get; set; } - } - - public class AssignedRoleViewModel - { - [Required] - [HiddenInput] - public string Name { get; set; } - - public bool IsAssigned { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml deleted file mode 100644 index ac47f90490..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml +++ /dev/null @@ -1,51 +0,0 @@ -@page -@model Volo.Abp.Identity.Web.Pages.Identity.Users.IndexModel -@using Microsoft.AspNetCore.Authorization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.Authorization -@using Volo.Abp.Identity -@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity -@inject IHtmlLocalizer L -@inject IAuthorizationService Authorization -@section styles { - -} - -@section scripts { - - - - - -} - - - -
    -
    -

    @L["Users"]

    -
    -
    - @if (await Authorization.IsGrantedAsync(IdentityPermissions.Users.Create)) - { - - } -
    -
    -
    - - - - - - - - - - -
    @L["Actions"]@L["UserName"]@L["EmailAddress"]@L["PhoneNumber"]
    -
    -
    \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml.cs b/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml.cs deleted file mode 100644 index 4997f911f7..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Identity.Web.Pages.Identity.Users -{ - public class IndexModel : AbpPageModel - { - public void OnGet() - { - - } - } -} diff --git a/src/Volo.Abp.Identity.Web/Pages/Identity/_ViewImports.cshtml b/src/Volo.Abp.Identity.Web/Pages/Identity/_ViewImports.cshtml deleted file mode 100644 index d1ac64721f..0000000000 --- a/src/Volo.Abp.Identity.Web/Pages/Identity/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Permissions/IdentityPermissionAppServiceGateway.cs b/src/Volo.Abp.Identity.Web/Permissions/IdentityPermissionAppServiceGateway.cs deleted file mode 100644 index 8fd683d77b..0000000000 --- a/src/Volo.Abp.Identity.Web/Permissions/IdentityPermissionAppServiceGateway.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Permissions; -using Volo.Abp.Permissions.Web.Pages.AbpPermissions; - -namespace Volo.Abp.Identity.Web.Permissions -{ - //TODO: Instead of creating such a gateway/adapter, we can implement a common interface for app services, like IHasPermissionManagementApi and manage it dynamically! - - public class IdentityPermissionAppServiceGateway : IPermissionAppServiceGateway, ITransientDependency - { - private readonly IIdentityUserAppService _userAppService; - private readonly IIdentityRoleAppService _roleAppService; - - public IdentityPermissionAppServiceGateway(IIdentityUserAppService userAppService, IIdentityRoleAppService roleAppService) - { - _userAppService = userAppService; - _roleAppService = roleAppService; - } - - public virtual async Task GetAsync(string providerName, string providerKey) - { - switch (providerName) - { - case UserPermissionValueProvider.ProviderName: - return await _userAppService.GetPermissionsAsync(Guid.Parse(providerKey)); - case RolePermissionValueProvider.ProviderName: - return await _roleAppService.GetPermissionsAsync(Guid.Parse(providerKey)); - default: - throw new NotImplementedException(); - } - } - - public virtual async Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input) - { - switch (providerName) - { - case UserPermissionValueProvider.ProviderName: - await _userAppService.UpdatePermissionsAsync(Guid.Parse(providerKey), input); - break; - case RolePermissionValueProvider.ProviderName: - await _roleAppService.UpdatePermissionsAsync(Guid.Parse(providerKey), input); - break; - default: - throw new NotImplementedException(); - } - } - } -} diff --git a/src/Volo.Abp.Identity.Web/Properties/launchSettings.json b/src/Volo.Abp.Identity.Web/Properties/launchSettings.json deleted file mode 100644 index 36ebaa878f..0000000000 --- a/src/Volo.Abp.Identity.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:49677/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.Identity.Web": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj b/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj deleted file mode 100644 index 8f83907662..0000000000 --- a/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Identity.Web - Volo.Abp.Identity.Web - true - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - Library - - - - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Identity.Web/compilerconfig.json b/src/Volo.Abp.Identity.Web/compilerconfig.json deleted file mode 100644 index c1d8f6c5c9..0000000000 --- a/src/Volo.Abp.Identity.Web/compilerconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "outputFile": "wwwroot/modules/identity/views/users/index.css", - "inputFile": "wwwroot/modules/identity/views/users/index.less" - }, - { - "outputFile": "wwwroot/modules/identity/views/users/index.es5.js", - "inputFile": "wwwroot/modules/identity/views/users/index.js" - } -] \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/compilerconfig.json.defaults b/src/Volo.Abp.Identity.Web/compilerconfig.json.defaults deleted file mode 100644 index c75eb7d519..0000000000 --- a/src/Volo.Abp.Identity.Web/compilerconfig.json.defaults +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilers": { - "less": { - "autoPrefix": "", - "cssComb": "none", - "ieCompat": true, - "strictMath": false, - "strictUnits": false, - "relativeUrls": true, - "rootPath": "", - "sourceMapRoot": "", - "sourceMapBasePath": "", - "sourceMap": false - }, - "sass": { - "includePath": "", - "indentType": "space", - "indentWidth": 2, - "outputStyle": "nested", - "Precision": 5, - "relativeUrls": true, - "sourceMapRoot": "", - "sourceMap": false - }, - "stylus": { - "sourceMap": false - }, - "babel": { - "sourceMap": false - }, - "coffeescript": { - "bare": false, - "runtimeMode": "node", - "sourceMap": false - } - }, - "minifiers": { - "css": { - "enabled": true, - "termSemicolons": true, - "gzip": false - }, - "javascript": { - "enabled": true, - "termSemicolons": true, - "gzip": false - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.css b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.css deleted file mode 100644 index 41fbd4eaf0..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.css +++ /dev/null @@ -1,21 +0,0 @@ -.dataTable { - width: 100% !important; - border-spacing: 0 !important; -} -.table td, -.table th { - padding: 8px 10px; -} -.dataTable tbody tr td button { - cursor: pointer; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li { - cursor: pointer; - padding: 5px; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li a { - display: block; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover { - background: #f4f5f8; -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.js deleted file mode 100644 index bc6107abbc..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -$(function () { - $('#IdentityUsersTable').DataTable(); -}); - diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.min.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.min.js deleted file mode 100644 index 9a2c19267e..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";$(function(){$("#IdentityUsersTable").DataTable()}); \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.js deleted file mode 100644 index ebfef708ef..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.js +++ /dev/null @@ -1,100 +0,0 @@ -(function () { - - var l = abp.localization.getResource('AbpIdentity'); - var _identityRoleAppService = volo.abp.identity.identityRole; - var _permissionsModal = new abp.ModalManager(abp.appPath + 'AbpPermissions/PermissionManagementModal'); - - var _editModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Identity/Roles/EditModal' - }); - - var _createModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Identity/Roles/CreateModal' - }); - - var app = new Vue({ - el: '#IdentityRolesWrapper', - methods: { - openCreateModal: function () { - _createModal.open(); - } - } - }); - - $(function () { - - var _$wrapper = $('#IdentityRolesWrapper'); - var _$table = _$wrapper.find('table'); - - var _dataTable = _$table.DataTable({ - order: [[1, "asc"]], - ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), - columnDefs: [ - { - targets: 0, - data: null, - orderable: false, - autoWidth: false, - defaultContent: '', - rowAction: { - text: ' ' + l('Actions') + ' ', - items: - [ - { - text: l('Edit'), - visible: function () { - return true; - }, - action: function (data) { - _editModal.open({ - id: data.record.id - }); - } - }, - { - text: 'Permissions', //TODO: Localize - visible: function () { - return true; - }, - action: function (data) { - _permissionsModal.open({ - providerName: 'Role', - providerKey: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: function () { - return true; - }, - action: function (data) { - if (confirm(l('UserDeletionConfirmationMessage', data.record.name))) { - _identityRoleAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - } - } - ] - } - }, - { - targets: 1, - data: "name" - } - ] - }); - - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - }); - -})(); diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.less b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.less deleted file mode 100644 index 7534888421..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.less +++ /dev/null @@ -1,38 +0,0 @@ -.dataTable { - width: 100% !important; - border-spacing: 0 !important; -} - -.table td, .table th { - padding: 8px 10px; -} - -.dataTable { - tbody { - tr { - td { - - button { - cursor: pointer; - } - - div.dropdown { - ul.dropdown-menu { - li { - cursor: pointer; - padding: 5px; - - a { - display: block; - } - } - - li:hover { - background: #f4f5f8; - } - } - } - } - } - } -} diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.min.css b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.min.css deleted file mode 100644 index e70b9e330b..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.min.css +++ /dev/null @@ -1 +0,0 @@ -.dataTable{width:100% !important;border-spacing:0 !important;}.table td,.table th{padding:8px 10px;}.dataTable tbody tr td button{cursor:pointer;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer;padding:5px;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li a{display:block;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover{background:#f4f5f8;} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.css b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.css deleted file mode 100644 index 41fbd4eaf0..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.css +++ /dev/null @@ -1,21 +0,0 @@ -.dataTable { - width: 100% !important; - border-spacing: 0 !important; -} -.table td, -.table th { - padding: 8px 10px; -} -.dataTable tbody tr td button { - cursor: pointer; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li { - cursor: pointer; - padding: 5px; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li a { - display: block; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover { - background: #f4f5f8; -} \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.es5.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.es5.js deleted file mode 100644 index bc6107abbc..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.es5.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -$(function () { - $('#IdentityUsersTable').DataTable(); -}); - diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.es5.min.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.es5.min.js deleted file mode 100644 index 9a2c19267e..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.es5.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";$(function(){$("#IdentityUsersTable").DataTable()}); \ No newline at end of file diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js deleted file mode 100644 index 16ddd5bbcc..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js +++ /dev/null @@ -1,105 +0,0 @@ -(function () { - - var l = abp.localization.getResource('AbpIdentity'); - var _identityUserAppService = volo.abp.identity.identityUser; - - var _editModal = new abp.ModalManager(abp.appPath + 'Identity/Users/EditModal'); - var _createModal = new abp.ModalManager(abp.appPath + 'Identity/Users/CreateModal'); - var _permissionsModal = new abp.ModalManager(abp.appPath + 'AbpPermissions/PermissionManagementModal'); - - var app = new Vue({ - el: '#IdentityUsersWrapper', - methods: { - openCreateModal: function () { - _createModal.open(); - } - } - }); - - $(function () { - - var _$wrapper = $('#IdentityUsersWrapper'); - var _$table = _$wrapper.find('table'); - - var _dataTable = _$table.DataTable({ - order: [[1, "asc"]], - ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList), - columnDefs: [ - { - //TODO: Can we eleminate targets, data, orderable, autoWidth, defaultContent fields or make these values default - targets: 0, - data: null, - orderable: false, - autoWidth: false, - defaultContent: '', - rowAction: { - text: ' ' + l('Actions') + ' ', //TODO: Add icon option and set text as only l('Actions') - items: - [ - { - //TODO: Allow to add icon - text: l('Edit'), - visible: function () { //TODO: Allow visible to be a boolean for simple cases - return true; - }, - action: function (data) { - _editModal.open({ - id: data.record.id - }); - } - }, - { - text: 'Permissions', //TODO: Localize - visible: function () { - return true; - }, - action: function (data) { - _permissionsModal.open({ - providerName: 'User', - providerKey: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: function () { - return true; - }, - action: function (data) { - if (confirm(l('UserDeletionConfirmationMessage', data.record.userName))) { - _identityUserAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - } - } - ] - } - }, - { - targets: 1, - data: "userName" - }, - { - targets: 2, - data: "email" - }, - { - targets: 3, - data: "phoneNumber" - } - ] - }); - - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - }); - -})(); diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.less b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.less deleted file mode 100644 index 21adf56097..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.less +++ /dev/null @@ -1,39 +0,0 @@ -//TODO: This code is duplicated for other pages too. Unify them. -.dataTable { - width: 100% !important; - border-spacing: 0 !important; -} - -.table td, .table th { - padding: 8px 10px; -} - -.dataTable { - tbody { - tr { - td { - - button { - cursor: pointer; - } - - div.dropdown { - ul.dropdown-menu { - li { - cursor: pointer; - padding: 5px; - - a { - display: block; - } - } - - li:hover { - background: #f4f5f8; - } - } - } - } - } - } -} diff --git a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.min.css b/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.min.css deleted file mode 100644 index e70b9e330b..0000000000 --- a/src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.min.css +++ /dev/null @@ -1 +0,0 @@ -.dataTable{width:100% !important;border-spacing:0 !important;}.table td,.table th{padding:8px 10px;}.dataTable tbody tr td button{cursor:pointer;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer;padding:5px;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li a{display:block;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover{background:#f4f5f8;} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Application.Contracts/Volo.Abp.IdentityServer.Application.Contracts.csproj b/src/Volo.Abp.IdentityServer.Application.Contracts/Volo.Abp.IdentityServer.Application.Contracts.csproj deleted file mode 100644 index a67c0894f7..0000000000 --- a/src/Volo.Abp.IdentityServer.Application.Contracts/Volo.Abp.IdentityServer.Application.Contracts.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.IdentityServer.Application.Contracts - Volo.Abp.IdentityServer.Application.Contracts - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - diff --git a/src/Volo.Abp.IdentityServer.Application.Contracts/Volo/Abp/IdentityServer/AbpIdentityApplicationContractsModule.cs b/src/Volo.Abp.IdentityServer.Application.Contracts/Volo/Abp/IdentityServer/AbpIdentityApplicationContractsModule.cs deleted file mode 100644 index e9958fdfde..0000000000 --- a/src/Volo.Abp.IdentityServer.Application.Contracts/Volo/Abp/IdentityServer/AbpIdentityApplicationContractsModule.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Application; -using Volo.Abp.Modularity; - -namespace Volo.Abp.IdentityServer -{ - [DependsOn(typeof(AbpDddApplicationModule))] - [DependsOn(typeof(AbpIdentityServerDomainSharedModule))] - public class AbpIdentityServerApplicationContractsModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Application/Volo.Abp.IdentityServer.Application.csproj b/src/Volo.Abp.IdentityServer.Application/Volo.Abp.IdentityServer.Application.csproj deleted file mode 100644 index 0adc0d131e..0000000000 --- a/src/Volo.Abp.IdentityServer.Application/Volo.Abp.IdentityServer.Application.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.IdentityServer.Application - Volo.Abp.IdentityServer.Application - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - diff --git a/src/Volo.Abp.IdentityServer.Application/Volo/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs b/src/Volo.Abp.IdentityServer.Application/Volo/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs deleted file mode 100644 index a17aa2cb0b..0000000000 --- a/src/Volo.Abp.IdentityServer.Application/Volo/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.IdentityServer -{ - [DependsOn(typeof(AbpIdentityServerDomainModule))] - [DependsOn(typeof(AbpIdentityServerApplicationContractsModule))] - public class AbpIdentityServerApplicationModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo.Abp.IdentityServer.Domain.Shared.csproj b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo.Abp.IdentityServer.Domain.Shared.csproj deleted file mode 100644 index c3422ab8c6..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo.Abp.IdentityServer.Domain.Shared.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.IdentityServer.Domain.Shared - Volo.Abp.IdentityServer.Domain.Shared - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/AbpIdentityServerDomainSharedModule.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/AbpIdentityServerDomainSharedModule.cs deleted file mode 100644 index e0abc9e7bf..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/AbpIdentityServerDomainSharedModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.IdentityServer -{ - public class AbpIdentityServerDomainSharedModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceConsts.cs deleted file mode 100644 index 1c3aecc531..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.IdentityServer.ApiResources -{ - public class ApiResourceConsts - { - public const int NameMaxLength = 200; - public const int DisplayNameMaxLength = 200; - public const int DescriptionMaxLength = 1000; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiScopeConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiScopeConsts.cs deleted file mode 100644 index 79629fee83..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiScopeConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.IdentityServer.ApiResources -{ - public class ApiScopeConsts - { - public const int NameMaxLength = 196; - public const int DisplayNameMaxLength = 128; - public const int DescriptionMaxLength = 256; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientClaimConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientClaimConsts.cs deleted file mode 100644 index 3a5d1fe907..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientClaimConsts.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientClaimConsts - { - public const int TypeMaxLength = 250; - public const int ValueMaxLength = 250; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs deleted file mode 100644 index d83138fd2f..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientConsts - { - public const int ClientIdMaxLength = 200; - - public const int ProtocolTypeMaxLength = 200; - - public const int ClientNameMaxLength = 200; - - public const int ClientUriMaxLength = 2000; - - public const int LogoUriMaxLength = 2000; - - public const int DescriptionMaxLength = 1000; - - public const int FrontChannelLogoutUriMaxLength = 2000; - - public const int BackChannelLogoutUriMaxLength = 2000; - - public const int ClientClaimsPrefixMaxLength = 200; - - public const int PairWiseSubjectSaltMaxLength = 200; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientCorsOriginConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientCorsOriginConsts.cs deleted file mode 100644 index 07ba598d6c..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientCorsOriginConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientCorsOriginConsts - { - public const int OriginMaxLength = 150; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientGrantTypeConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientGrantTypeConsts.cs deleted file mode 100644 index f13f6cda1e..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientGrantTypeConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientGrantTypeConsts - { - public const int GrantTypeMaxLength = 196; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientIdPRestrictionConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientIdPRestrictionConsts.cs deleted file mode 100644 index d89d76bdc5..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientIdPRestrictionConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientIdPRestrictionConsts - { - public const int ProviderMaxLength = 64; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs deleted file mode 100644 index 8fe55ba018..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientPostLogoutRedirectUriConsts - { - public const int PostLogoutRedirectUriMaxLength = 2000; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPropertyConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPropertyConsts.cs deleted file mode 100644 index 6535304596..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPropertyConsts.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientPropertyConsts - { - public const int KeyMaxLength = 250; - public const int ValueMaxLength = 2000; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs deleted file mode 100644 index d67bbea509..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientRedirectUriConsts - { - public const int RedirectUriMaxLength = 2000; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientScopeConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientScopeConsts.cs deleted file mode 100644 index 9b9d4f8077..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientScopeConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientScopeConsts - { - public const int ScopeMaxLength = 196; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs deleted file mode 100644 index 75f67dcc3a..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Volo.Abp.IdentityServer.Grants -{ - public class PersistedGrantConsts - { - public const int KeyMaxLength = 200; - public const int TypeMaxLength = 50; - public const int SubjectIdMaxLength = 200; - public const int ClientIdMaxLength = 200; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceConsts.cs deleted file mode 100644 index c60cc34ad8..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.IdentityServer.IdentityResources -{ - public class IdentityResourceConsts - { - public const int NameMaxLength = 200; - public const int DisplayNameMaxLength = 200; - public const int DescriptionMaxLength = 1000; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs deleted file mode 100644 index 1194a7c82d..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.IdentityServer -{ - public class SecretConsts - { - public const int TypeMaxLength = 32; - public const int ValueMaxLength = 196; - public const int DescriptionMaxLength = 256; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/UserClaimConsts.cs b/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/UserClaimConsts.cs deleted file mode 100644 index bb10344a63..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/UserClaimConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.IdentityServer -{ - public class UserClaimConsts - { - public const int TypeMaxLength = 196; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj b/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj deleted file mode 100644 index ff1c42bdb5..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.IdentityServer.Domain - Volo.Abp.IdentityServer.Domain - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - - - - diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj.DotSettings b/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj.DotSettings deleted file mode 100644 index 58ad6c8854..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp71 \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpClaimsService.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpClaimsService.cs deleted file mode 100644 index 60453bc927..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpClaimsService.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using IdentityServer4.Services; -using Microsoft.Extensions.Logging; -using Volo.Abp.Security.Claims; - -namespace Volo.Abp.IdentityServer -{ - public class AbpClaimsService : DefaultClaimsService - { - public AbpClaimsService(IProfileService profile, ILogger logger) - : base(profile, logger) - { - } - - protected override IEnumerable GetOptionalClaims(ClaimsPrincipal subject) - { - var tenantClaim = subject.FindFirst(AbpClaimTypes.TenantId); - if (tenantClaim == null) - { - return base.GetOptionalClaims(subject); - } - else - { - return base.GetOptionalClaims(subject).Union(new[] { tenantClaim }); - } - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderExtensions.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderExtensions.cs deleted file mode 100644 index 585b022b34..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.IdentityModel.Tokens.Jwt; -using IdentityModel; -using IdentityServer4.Services; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Volo.Abp.Identity; -using Volo.Abp.IdentityServer.AspNetIdentity; -using Volo.Abp.Security.Claims; - -namespace Volo.Abp.IdentityServer -{ - public static class AbpIdentityServerBuilderExtensions - { - public static IIdentityServerBuilder AddAbpIdentityServer( - this IIdentityServerBuilder builder, - Action optionsAction = null) - { - var options = new AbpIdentityServerOptions(); - optionsAction?.Invoke(options); - - //TODO: AspNet Identity integration lines. Can be extracted to a extension method - builder.AddAspNetIdentity(); - builder.AddProfileService(); - builder.AddResourceOwnerValidator(); - - builder.Services.Replace(ServiceDescriptor.Transient()); - - if (options.UpdateAbpClaimTypes) - { - AbpClaimTypes.UserId = JwtClaimTypes.Subject; - AbpClaimTypes.UserName = JwtClaimTypes.Name; - AbpClaimTypes.Role = JwtClaimTypes.Role; - AbpClaimTypes.Email = JwtClaimTypes.Email; - } - - if (options.UpdateJwtSecurityTokenHandlerDefaultInboundClaimTypeMap) - { - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap[AbpClaimTypes.UserId] = AbpClaimTypes.UserId; - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap[AbpClaimTypes.UserName] = AbpClaimTypes.UserName; - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap[AbpClaimTypes.Role] = AbpClaimTypes.Role; - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap[AbpClaimTypes.Email] = AbpClaimTypes.Email; - } - - return builder; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerConsts.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerConsts.cs deleted file mode 100644 index c0593a245e..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.IdentityServer -{ - public static class AbpIdentityServerConsts - { - public const string DefaultDbTablePrefix = "IdentityServer"; - - public const string DefaultDbSchema = null; - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs deleted file mode 100644 index 70e6eefbd9..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Domain; -using Volo.Abp.Identity; -using Volo.Abp.IdentityServer.Clients; -using Volo.Abp.Modularity; -using Volo.Abp.Security; - -namespace Volo.Abp.IdentityServer -{ - [DependsOn(typeof(AbpIdentityServerDomainSharedModule))] - [DependsOn(typeof(AbpDddDomainModule))] - [DependsOn(typeof(AbpAutoMapperModule))] - [DependsOn(typeof(AbpIdentityDomainModule))] - [DependsOn(typeof(AbpSecurityModule))] - public class AbpIdentityServerDomainModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.AddProfile(validate: true); - }); - - AddIdentityServer(services); - - services.AddAssemblyOf(); - } - - private static void AddIdentityServer(IServiceCollection services) - { - var identityServerBuilder = services.AddIdentityServer(options => - { - options.Events.RaiseErrorEvents = true; - options.Events.RaiseInformationEvents = true; - options.Events.RaiseFailureEvents = true; - options.Events.RaiseSuccessEvents = true; - }); - - identityServerBuilder - .AddDeveloperSigningCredential() //TODO: Should be able to change this! - .AddClientStore() - .AddResourceStore() - .AddAbpIdentityServer(); - - services.ExecutePreConfiguredActions(identityServerBuilder); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerOptions.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerOptions.cs deleted file mode 100644 index 2b66f7a0fb..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerOptions.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Volo.Abp.IdentityServer -{ - public class AbpIdentityServerOptions - { - /// - /// Updates to be compatible with identity server claims. - /// Default: true. - /// - public bool UpdateJwtSecurityTokenHandlerDefaultInboundClaimTypeMap { get; set; } = true; - - /// - /// Updates to be compatible with identity server claims. - /// Default: true. - /// - public bool UpdateAbpClaimTypes { get; set; } = true; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiAndIdentityResources.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiAndIdentityResources.cs deleted file mode 100644 index 0645d19597..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiAndIdentityResources.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.IdentityResources; - -namespace Volo.Abp.IdentityServer -{ - public class ApiAndIdentityResources - { - public IdentityResource[] IdentityResources { get; set; } - - public ApiResource[] ApiResources { get; set; } - - public ApiAndIdentityResources(IdentityResource[] identityResources, ApiResource[] apiResources) - { - IdentityResources = identityResources; - ApiResources = apiResources; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResource.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResource.cs deleted file mode 100644 index fa0614a70c..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResource.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using IdentityServer4; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.ApiResources -{ - public class ApiResource : AggregateRoot - { - [NotNull] - public virtual string Name { get; protected set; } - - public virtual string DisplayName { get; set; } - - public virtual string Description { get; set; } - - public virtual bool Enabled { get; set; } - - public virtual List Secrets { get; protected set; } - - public virtual List Scopes { get; protected set; } - - public virtual List UserClaims { get; protected set; } - - protected ApiResource() - { - - } - - public ApiResource(Guid id, [NotNull] string name, string displayName = null, string description = null) - { - Check.NotNull(name, nameof(name)); - - Id = id; - - Name = name; - - DisplayName = displayName; - Description = description; - - Enabled = true; - - Secrets = new List(); - Scopes = new List(); - UserClaims = new List(); - - Scopes.Add(new ApiScope(id, name, displayName, description)); - } - - public virtual void AddSecret( - [NotNull] string value, - DateTime? expiration = null, - string type = IdentityServerConstants.SecretTypes.SharedSecret, - string description = null) - { - Secrets.Add(new ApiSecret(Id, value, expiration, type, description)); - } - - public virtual void AddScope( - [NotNull] string name, - string displayName = null, - string description = null, - bool required = false, - bool emphasize = false, - bool showInDiscoveryDocument = true) - { - Scopes.Add(new ApiScope(Id, name, displayName, description, required, emphasize, showInDiscoveryDocument)); - } - - public virtual void AddUserClaim([NotNull] string type) - { - UserClaims.Add(new ApiResourceClaim(Id, type)); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResourceClaim.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResourceClaim.cs deleted file mode 100644 index 6a81efa084..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResourceClaim.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using JetBrains.Annotations; - -namespace Volo.Abp.IdentityServer.ApiResources -{ - public class ApiResourceClaim : UserClaim - { - public virtual Guid ApiResourceId { get; set; } - - protected ApiResourceClaim() - { - - } - - protected internal ApiResourceClaim(Guid apiResourceId, [NotNull] string type) - : base(type) - { - ApiResourceId = apiResourceId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiScope.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiScope.cs deleted file mode 100644 index 6965c96acd..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiScope.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.ApiResources -{ - public class ApiScope : Entity - { - public virtual Guid ApiResourceId { get; protected set; } - - [NotNull] - public virtual string Name { get; protected set; } - - public virtual string DisplayName { get; set; } - - public virtual string Description { get; set; } - - public virtual bool Required { get; set; } - - public virtual bool Emphasize { get; set; } - - public virtual bool ShowInDiscoveryDocument { get; set; } - - public virtual List UserClaims { get; protected set; } - - protected ApiScope() - { - - } - - protected internal ApiScope( - Guid apiResourceId, - [NotNull] string name, - string displayName = null, - string description = null, - bool required = false, - bool emphasize = false, - bool showInDiscoveryDocument = true) - { - Check.NotNull(name, nameof(name)); - - ApiResourceId = apiResourceId; - Name = name; - DisplayName = displayName ?? name; - Description = description; - Required = required; - Emphasize = emphasize; - ShowInDiscoveryDocument = showInDiscoveryDocument; - - UserClaims = new List(); - } - - public virtual void AddUserClaim([NotNull] string type) - { - UserClaims.Add(new ApiScopeClaim(ApiResourceId, Name, type)); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiScopeClaim.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiScopeClaim.cs deleted file mode 100644 index 4005a85fc6..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiScopeClaim.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using JetBrains.Annotations; - -namespace Volo.Abp.IdentityServer.ApiResources -{ - public class ApiScopeClaim : UserClaim - { - public Guid ApiResourceId { get; protected set; } - - [NotNull] - public string Name { get; protected set; } - - protected ApiScopeClaim() - { - - } - - protected internal ApiScopeClaim(Guid apiResourceId, [NotNull] string name, [NotNull] string type) - : base(type) - { - Check.NotNull(name, nameof(name)); - - ApiResourceId = apiResourceId; - Name = name; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiSecret.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiSecret.cs deleted file mode 100644 index ec809fccb4..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiSecret.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using IdentityServer4; -using JetBrains.Annotations; - -namespace Volo.Abp.IdentityServer.ApiResources -{ - public class ApiSecret : Secret - { - public virtual Guid ApiResourceId { get; protected set; } - - protected ApiSecret() - { - - } - - protected internal ApiSecret( - Guid apiResourceId, - [NotNull] string value, - DateTime? expiration = null, - string type = IdentityServerConstants.SecretTypes.SharedSecret, - string description = null - ) : base( - value, - expiration, - type, - description) - { - ApiResourceId = apiResourceId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs deleted file mode 100644 index 0050584088..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.IdentityServer.ApiResources -{ - public interface IApiResourceRepository : IBasicRepository - { - Task FindByNameAsync(string name, CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpProfileService.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpProfileService.cs deleted file mode 100644 index 7b411221df..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpProfileService.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Threading.Tasks; -using System.Security.Principal; -using IdentityServer4.AspNetIdentity; -using IdentityServer4.Models; -using Microsoft.AspNetCore.Identity; -using Volo.Abp.Identity; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Uow; - -namespace Volo.Abp.IdentityServer.AspNetIdentity -{ - public class AbpProfileService : ProfileService - { - private readonly ICurrentTenant _currentTenant; - public AbpProfileService( - IdentityUserManager userManager, - IUserClaimsPrincipalFactory claimsFactory, - ICurrentTenant currentTenant) - : base(userManager, claimsFactory) - { - _currentTenant = currentTenant; - } - - [UnitOfWork] - public override async Task GetProfileDataAsync(ProfileDataRequestContext context) - { - using (_currentTenant.Change(context.Subject.FindTenantId())) - { - await base.GetProfileDataAsync(context); - } - } - - [UnitOfWork] - public override async Task IsActiveAsync(IsActiveContext context) - { - using (_currentTenant.Change(context.Subject.FindTenantId())) - { - await base.IsActiveAsync(context); - } - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs deleted file mode 100644 index 778b3445bf..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Threading.Tasks; -using IdentityServer4.AspNetIdentity; -using IdentityServer4.Services; -using IdentityServer4.Validation; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Volo.Abp.Identity; -using Volo.Abp.Uow; - -namespace Volo.Abp.IdentityServer.AspNetIdentity -{ - public class AbpResourceOwnerPasswordValidator : ResourceOwnerPasswordValidator - { - public AbpResourceOwnerPasswordValidator( - IdentityUserManager userManager, - SignInManager signInManager, - IEventService events, - ILogger> logger - ) : base( - userManager, - signInManager, - events, - logger) - { - } - - [UnitOfWork] - public override async Task ValidateAsync(ResourceOwnerPasswordValidationContext context) - { - await base.ValidateAsync(context); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs deleted file mode 100644 index 13ae8d7f6c..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs +++ /dev/null @@ -1,196 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using IdentityServer4; -using IdentityServer4.Models; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Guids; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class Client : AggregateRoot - { - public virtual string ClientId { get; set; } - - public virtual string ClientName { get; set; } - - public virtual string Description { get; set; } - - public virtual string ClientUri { get; set; } - - public virtual string LogoUri { get; set; } - - public virtual bool Enabled { get; set; } = true; - - public virtual string ProtocolType { get; set; } - - public virtual bool RequireClientSecret { get; set; } - - public virtual bool RequireConsent { get; set; } - - public virtual bool AllowRememberConsent { get; set; } - - public virtual bool AlwaysIncludeUserClaimsInIdToken { get; set; } - - public virtual bool RequirePkce { get; set; } - - public virtual bool AllowPlainTextPkce { get; set; } - - public virtual bool AllowAccessTokensViaBrowser { get; set; } - - public virtual string FrontChannelLogoutUri { get; set; } - - public virtual bool FrontChannelLogoutSessionRequired { get; set; } - - public virtual string BackChannelLogoutUri { get; set; } - - public virtual bool BackChannelLogoutSessionRequired { get; set; } - - public virtual bool AllowOfflineAccess { get; set; } - - public virtual int IdentityTokenLifetime { get; set; } - - public virtual int AccessTokenLifetime { get; set; } - - public virtual int AuthorizationCodeLifetime { get; set; } - - public virtual int? ConsentLifetime { get; set; } - - public virtual int AbsoluteRefreshTokenLifetime { get; set; } - - public virtual int SlidingRefreshTokenLifetime { get; set; } - - public virtual int RefreshTokenUsage { get; set; } - - public virtual bool UpdateAccessTokenClaimsOnRefresh { get; set; } - - public virtual int RefreshTokenExpiration { get; set; } - - public virtual int AccessTokenType { get; set; } - - public virtual bool EnableLocalLogin { get; set; } - - public virtual bool IncludeJwtId { get; set; } - - public virtual bool AlwaysSendClientClaims { get; set; } - - public virtual string ClientClaimsPrefix { get; set; } - - public virtual string PairWiseSubjectSalt { get; set; } - - public virtual List AllowedScopes { get; set; } - - public virtual List ClientSecrets { get; set; } - - public virtual List AllowedGrantTypes { get; set; } - - public virtual List AllowedCorsOrigins { get; set; } - - public virtual List RedirectUris { get; set; } - - public virtual List PostLogoutRedirectUris { get; set; } - - public virtual List IdentityProviderRestrictions { get; set; } - - public virtual List Claims { get; set; } - - public virtual List Properties { get; set; } - - protected Client() - { - - } - - public Client(Guid id, [NotNull] string clientId) - { - Check.NotNull(clientId, nameof(clientId)); - - Id = id; - ClientId = clientId; - - //TODO: Replace magics with constants? - - ProtocolType = IdentityServerConstants.ProtocolTypes.OpenIdConnect; - RequireClientSecret = true; - RequireConsent = true; - AllowRememberConsent = true; - FrontChannelLogoutSessionRequired = true; - BackChannelLogoutSessionRequired = true; - IdentityTokenLifetime = 300; - AccessTokenLifetime = 3600; - AuthorizationCodeLifetime = 300; - AbsoluteRefreshTokenLifetime = 2592000; - SlidingRefreshTokenLifetime = 1296000; - RefreshTokenUsage = (int)TokenUsage.OneTimeOnly; - RefreshTokenExpiration = (int)TokenExpiration.Absolute; - AccessTokenType = (int)IdentityServer4.Models.AccessTokenType.Jwt; - EnableLocalLogin = true; - ClientClaimsPrefix = "client_"; - - AllowedScopes = new List(); - ClientSecrets = new List(); - AllowedGrantTypes = new List(); - AllowedCorsOrigins = new List(); - RedirectUris = new List(); - PostLogoutRedirectUris = new List(); - IdentityProviderRestrictions = new List(); - Claims = new List(); - Properties = new List(); - } - - public virtual void AddGrantType([NotNull] string grantType) - { - AllowedGrantTypes.Add(new ClientGrantType(Id, grantType)); - } - - public virtual void AddGrantTypes(IEnumerable grantTypes) - { - AllowedGrantTypes.AddRange( - grantTypes.Select( - grantType => new ClientGrantType(Id, grantType) - ) - ); - } - - public virtual void AddSecret([NotNull] string value, DateTime? expiration = null, string type = IdentityServerConstants.SecretTypes.SharedSecret, string description = null) - { - ClientSecrets.Add(new ClientSecret(Id, value, expiration, type, description)); - } - - public virtual void AddScope([NotNull] string scope) - { - AllowedScopes.Add(new ClientScope(Id, scope)); - } - - public virtual void AddCorsOrigin([NotNull] string origin) - { - AllowedCorsOrigins.Add(new ClientCorsOrigin(Id, origin)); - } - - public virtual void AddRedirectUri([NotNull] string redirectUri) - { - RedirectUris.Add(new ClientRedirectUri(Id, redirectUri)); - } - - public virtual void AddPostLogoutRedirectUri([NotNull] string postLogoutRedirectUri) - { - PostLogoutRedirectUris.Add(new ClientPostLogoutRedirectUri(Id, postLogoutRedirectUri)); - } - - public virtual void AddIdentityProviderRestriction([NotNull] string provider) - { - IdentityProviderRestrictions.Add(new ClientIdPRestriction(Id, provider)); - } - - public virtual void AddProperty([NotNull] string key) - { - Properties.Add(new ClientProperty(Id, key)); - } - - public virtual void AddClaim(IGuidGenerator guidGenerator, [NotNull] string type, string value) - { - Claims.Add(new ClientClaim(guidGenerator.Create(), Id, type, value)); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientAutoMapperProfile.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientAutoMapperProfile.cs deleted file mode 100644 index 81e5841d6b..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientAutoMapperProfile.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.Collections.Generic; -using System.Security.Claims; -using AutoMapper; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.Grants; -using Volo.Abp.IdentityServer.IdentityResources; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientAutoMapperProfile : Profile - { - public ClientAutoMapperProfile() - { - //TODO: Reverse maps will not used probably. Remove those will not used - - CreateMap(); - - CreateMap() - .ConstructUsing(src => src.Origin) - .ReverseMap() - .ForMember(dest => dest.Origin, opt => opt.MapFrom(src => src)); - - CreateMap() - .ForMember(dest => dest.ApiSecrets, opt => opt.MapFrom(src => src.Secrets)); - - //TODO: Why PersistedGrant mapping is in this profile? - CreateMap().ReverseMap(); - - CreateMap(); - - CreateMap() - .ConstructUsing(src => src.Type) - .ReverseMap() - .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src)); - - CreateMap(); - - CreateMap(); - - CreateMap>() - .ReverseMap(); - - CreateMap() - .ForMember(dest => dest.ProtocolType, opt => opt.Condition(srs => srs != null)) - .ReverseMap(); - - CreateMap() - .ConstructUsing(src => src.Origin) - .ReverseMap() - .ForMember(dest => dest.Origin, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.Provider) - .ReverseMap() - .ForMember(dest => dest.Provider, opt => opt.MapFrom(src => src)); - - CreateMap(MemberList.None) - .ConstructUsing(src => new Claim(src.Type, src.Value)) - .ReverseMap(); - - CreateMap() - .ConstructUsing(src => src.Scope) - .ReverseMap() - .ForMember(dest => dest.Scope, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.PostLogoutRedirectUri) - .ReverseMap() - .ForMember(dest => dest.PostLogoutRedirectUri, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.RedirectUri) - .ReverseMap() - .ForMember(dest => dest.RedirectUri, opt => opt.MapFrom(src => src)); - - CreateMap() - .ConstructUsing(src => src.GrantType) - .ReverseMap() - .ForMember(dest => dest.GrantType, opt => opt.MapFrom(src => src)); - - CreateMap(MemberList.Destination) - .ForMember(dest => dest.Type, opt => opt.Condition(srs => srs != null)) - .ReverseMap(); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientClaim.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientClaim.cs deleted file mode 100644 index 29b44a40f7..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientClaim.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientClaim : Entity - { - public virtual Guid ClientId { get; set; } - - public virtual string Type { get; set; } - - public virtual string Value { get; set; } - - protected ClientClaim() - { - - } - - protected internal ClientClaim(Guid id, Guid clientId, [NotNull] string type, string value) - { - Check.NotNull(type, nameof(type)); - - Id = id; - ClientId = clientId; - Type = type; - Value = value; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientCorsOrigin.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientCorsOrigin.cs deleted file mode 100644 index e90095db86..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientCorsOrigin.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientCorsOrigin : Entity - { - public virtual Guid ClientId { get; protected set; } - - public virtual string Origin { get; protected set; } - - protected ClientCorsOrigin() - { - - } - - protected internal ClientCorsOrigin(Guid clientId, [NotNull] string origin) - { - Check.NotNull(origin, nameof(origin)); - - ClientId = clientId; - Origin = origin; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientGrantType.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientGrantType.cs deleted file mode 100644 index 8d6925244d..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientGrantType.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientGrantType : Entity - { - public virtual Guid ClientId { get; protected set; } - - public virtual string GrantType { get; protected set; } - - protected ClientGrantType() - { - - } - - protected internal ClientGrantType(Guid clientId, [NotNull] string grantType) - { - Check.NotNull(grantType, nameof(grantType)); - - ClientId = clientId; - GrantType = grantType; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientIdPRestriction.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientIdPRestriction.cs deleted file mode 100644 index d6207dca1b..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientIdPRestriction.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientIdPRestriction : Entity - { - public virtual Guid ClientId { get; set; } - - public virtual string Provider { get; set; } - - protected ClientIdPRestriction() - { - - } - - protected internal ClientIdPRestriction(Guid clientId, [NotNull] string provider) - { - Check.NotNull(provider, nameof(provider)); - - ClientId = clientId; - Provider = provider; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUri.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUri.cs deleted file mode 100644 index 2a82643e5c..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUri.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientPostLogoutRedirectUri : Entity - { - public virtual Guid ClientId { get; protected set; } - - public virtual string PostLogoutRedirectUri { get; protected set; } - - protected ClientPostLogoutRedirectUri() - { - - } - - protected internal ClientPostLogoutRedirectUri(Guid clientId, [NotNull] string postLogoutRedirectUri) - { - Check.NotNull(postLogoutRedirectUri, nameof(postLogoutRedirectUri)); - - ClientId = clientId; - PostLogoutRedirectUri = postLogoutRedirectUri; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientProperty.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientProperty.cs deleted file mode 100644 index cf70c4378e..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientProperty.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientProperty : Entity - { - public virtual Guid ClientId { get; set; } - - public virtual string Key { get; set; } - - public virtual string Value { get; set; } - - protected ClientProperty() - { - - } - - protected internal ClientProperty(Guid clientId, [NotNull] string key) - { - Check.NotNull(key, nameof(key)); - - ClientId = clientId; - Key = key; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientRedirectUri.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientRedirectUri.cs deleted file mode 100644 index 81d2bfb6de..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientRedirectUri.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientRedirectUri : Entity - { - public virtual Guid ClientId { get; protected set; } - - public virtual string RedirectUri { get; protected set; } - - protected ClientRedirectUri() - { - - } - - protected internal ClientRedirectUri(Guid clientId, [NotNull] string redirectUri) - { - Check.NotNull(redirectUri, nameof(redirectUri)); - - ClientId = clientId; - RedirectUri = redirectUri; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientScope.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientScope.cs deleted file mode 100644 index a7047dfc48..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientScope.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientScope : Entity - { - public virtual Guid ClientId { get; protected set; } - - public virtual string Scope { get; protected set; } - - protected ClientScope() - { - - } - - protected internal ClientScope(Guid clientId, string scope) - { - ClientId = clientId; - Scope = scope; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientSecret.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientSecret.cs deleted file mode 100644 index 62affd2858..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientSecret.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using IdentityServer4; -using JetBrains.Annotations; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientSecret : Secret - { - public virtual Guid ClientId { get; protected set; } - - protected ClientSecret() - { - - } - - protected internal ClientSecret( - Guid clientId, - [NotNull] string value, - DateTime? expiration = null, - string type = IdentityServerConstants.SecretTypes.SharedSecret, - string description = null - ) : base( - value, - expiration, - type, - description) - { - ClientId = clientId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientStore.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientStore.cs deleted file mode 100644 index 467967b26e..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientStore.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Threading.Tasks; -using IdentityServer4.Stores; -using Volo.Abp.ObjectMapping; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientStore : IClientStore - { - private readonly IClientRepository _clientRepository; - private readonly IObjectMapper _objectMapper; - - public ClientStore(IClientRepository clientRepository, IObjectMapper objectMapper) - { - _clientRepository = clientRepository; - _objectMapper = objectMapper; - } - - public virtual async Task FindClientByIdAsync(string clientId) - { - var client = await _clientRepository.FindByCliendIdIncludingAllAsync(clientId); - return _objectMapper.Map(client); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/IClientRepository.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/IClientRepository.cs deleted file mode 100644 index df5bc2bd43..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/IClientRepository.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.IdentityServer.Clients -{ - public interface IClientRepository : IBasicRepository - { - Task FindByCliendIdIncludingAllAsync([NotNull] string clientId); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs deleted file mode 100644 index 414484bc51..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.IdentityServer.Grants -{ - public interface IPersistentGrantRepository : IBasicRepository - { - Task FindByKeyAsync(string key); - - Task> GetListBySubjectIdAsync(string key); - - Task DeleteAsync(string subjectId, string clientId); - - Task DeleteAsync(string subjectId, string clientId, string type); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrant.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrant.cs deleted file mode 100644 index 4a2bccd456..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrant.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.Grants -{ - public class PersistedGrant : AggregateRoot - { - public virtual string Key { get; set; } - - public virtual string Type { get; set; } - - public virtual string SubjectId { get; set; } - - public virtual string ClientId { get; set; } - - public virtual DateTime CreationTime { get; set; } - - public virtual DateTime? Expiration { get; set; } - - public virtual string Data { get; set; } - - protected PersistedGrant() - { - - } - - public PersistedGrant(Guid id) - { - Id = id; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrantStore.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrantStore.cs deleted file mode 100644 index 0d40241ee5..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrantStore.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using IdentityServer4.Stores; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; -using Volo.Abp.ObjectMapping; - -namespace Volo.Abp.IdentityServer.Grants -{ - public class PersistedGrantStore : IPersistedGrantStore, ITransientDependency - { - private readonly IPersistentGrantRepository _persistentGrantRepository; - private readonly IObjectMapper _objectMapper; - private readonly IGuidGenerator _guidGenerator; - - public PersistedGrantStore(IPersistentGrantRepository persistentGrantRepository, IObjectMapper objectMapper, IGuidGenerator guidGenerator) - { - _persistentGrantRepository = persistentGrantRepository; - _objectMapper = objectMapper; - _guidGenerator = guidGenerator; - } - - public virtual async Task StoreAsync(IdentityServer4.Models.PersistedGrant grant) - { - var entity = _objectMapper.Map(grant); - var existing = await _persistentGrantRepository.FindByKeyAsync(grant.Key); - if (existing == null) - { - entity.Id = _guidGenerator.Create(); - await _persistentGrantRepository.InsertAsync(entity); - } - else - { - await _persistentGrantRepository.UpdateAsync(entity); - } - } - - public virtual async Task GetAsync(string key) - { - var persistedGrant = await _persistentGrantRepository.FindByKeyAsync(key); - return _objectMapper.Map(persistedGrant); - } - - public virtual async Task> GetAllAsync(string subjectId) - { - var persistedGrants = await _persistentGrantRepository.GetListBySubjectIdAsync(subjectId); - return persistedGrants.Select(x => _objectMapper.Map(x)); - } - - public virtual async Task RemoveAsync(string key) - { - var persistedGrant = await _persistentGrantRepository.FindByKeyAsync(key); - if (persistedGrant == null) - { - return; - } - - await _persistentGrantRepository.DeleteAsync(persistedGrant); - } - - public virtual async Task RemoveAllAsync(string subjectId, string clientId) - { - await _persistentGrantRepository.DeleteAsync(subjectId, clientId); - } - - public virtual async Task RemoveAllAsync(string subjectId, string clientId, string type) - { - await _persistentGrantRepository.DeleteAsync(subjectId, clientId, type); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs deleted file mode 100644 index 473f96baed..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; -using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; - -namespace Volo.Abp.IdentityServer.IdentityResources -{ - public interface IIdentityResourceRepository : IBasicRepository - { - Task> FindIdentityResourcesByScopeAsync(string[] scopeNames); - - Task> FindApiResourcesByScopeAsync(string[] scopeNames); - - Task FindApiResourceAsync(string name); - - Task GetAllResourcesAsync(); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs deleted file mode 100644 index f59bfd845f..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using JetBrains.Annotations; - -namespace Volo.Abp.IdentityServer.IdentityResources -{ - public class IdentityClaim : UserClaim - { - public virtual Guid IdentityResourceId { get; set; } - - protected IdentityClaim() - { - - } - - protected internal IdentityClaim(Guid identityResourceId, [NotNull] string type) - : base(type) - { - IdentityResourceId = identityResourceId; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs deleted file mode 100644 index e3628ffa14..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer.IdentityResources -{ - public class IdentityResource : AggregateRoot - { - public virtual string Name { get; set; } - - public virtual string DisplayName { get; set; } - - public virtual string Description { get; set; } - - public virtual bool Enabled { get; set; } - - public virtual bool Required { get; set; } - - public virtual bool Emphasize { get; set; } - - public virtual bool ShowInDiscoveryDocument { get; set; } - - public virtual List UserClaims { get; set; } - - protected IdentityResource() - { - - } - - public IdentityResource( - Guid id, - [NotNull] string name, - string displayName = null, - string description = null, - bool enabled = true, - bool required = false, - bool emphasize = false, - bool showInDiscoveryDocument = true) - { - Check.NotNull(name, nameof(name)); - - Id = id; - Name = name; - DisplayName = displayName; - Description = description; - Enabled = enabled; - Required = required; - Emphasize = emphasize; - ShowInDiscoveryDocument = showInDiscoveryDocument; - - UserClaims = new List(); - } - - public virtual void AddUserClaim([NotNull] string type) - { - UserClaims.Add(new IdentityClaim(Id, type)); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Jwt/JwtTokenMiddleware.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Jwt/JwtTokenMiddleware.cs deleted file mode 100644 index 57ca9cc4c2..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Jwt/JwtTokenMiddleware.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Builder; - -namespace Volo.Abp.IdentityServer.Jwt -{ - //TODO: Should we move this to another package..? - - public static class JwtTokenMiddleware - { - public static IApplicationBuilder UseJwtTokenMiddleware(this IApplicationBuilder app, string schema) - { - return app.Use(async (ctx, next) => - { - if (ctx.User.Identity?.IsAuthenticated != true) - { - var result = await ctx.AuthenticateAsync(schema); - if (result.Succeeded && result.Principal != null) - { - ctx.User = result.Principal; - } - } - - await next(); - }); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs deleted file mode 100644 index f7025abd95..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using Volo.Abp.IdentityServer.IdentityResources; -using Volo.Abp.ObjectMapping; -using IdentityResource = Volo.Abp.IdentityServer.IdentityResources.IdentityResource; - -namespace Volo.Abp.IdentityServer -{ - public class ResourceStore : IResourceStore - { - private readonly IIdentityResourceRepository _identityResourceRepository; - private readonly IObjectMapper _objectMapper; - - public ResourceStore(IIdentityResourceRepository identityResourceRepository, IObjectMapper objectMapper) - { - _identityResourceRepository = identityResourceRepository; - _objectMapper = objectMapper; - } - - public virtual async Task> FindIdentityResourcesByScopeAsync(IEnumerable scopeNames) - { - var resource = await _identityResourceRepository.FindIdentityResourcesByScopeAsync(scopeNames.ToArray()); - return _objectMapper.Map, List>(resource); - } - - public virtual async Task> FindApiResourcesByScopeAsync(IEnumerable scopeNames) - { - var resources = await _identityResourceRepository.FindApiResourcesByScopeAsync(scopeNames.ToArray()); - return resources?.Select(x => _objectMapper.Map(x)); - } - - public virtual async Task FindApiResourceAsync(string name) - { - var resource = await _identityResourceRepository.FindApiResourceAsync(name); - return _objectMapper.Map(resource); - } - - public virtual async Task GetAllResourcesAsync() - { - var resources = await _identityResourceRepository.GetAllResourcesAsync(); - - return new Resources( - _objectMapper.Map(resources.IdentityResources), - _objectMapper.Map(resources.ApiResources) - ); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Secret.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Secret.cs deleted file mode 100644 index faef3a12ed..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Secret.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using IdentityServer4; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer -{ - public abstract class Secret : Entity - { - public virtual string Type { get; protected set; } - - public virtual string Value { get; set; } - - public virtual string Description { get; set; } - - public virtual DateTime? Expiration { get; set; } - - protected Secret() - { - - } - - protected Secret( - [NotNull] string value, - DateTime? expiration = null, - string type = IdentityServerConstants.SecretTypes.SharedSecret, - string description = null) - { - Check.NotNull(value, nameof(value)); - - Value = value; - Expiration = expiration; - Type = type; - Description = description; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Temp/IdentityServerConfig.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Temp/IdentityServerConfig.cs deleted file mode 100644 index 183a9b61ac..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Temp/IdentityServerConfig.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Volo.Abp.IdentityServer.Temp -{ - //TODO: Remove! - //internal static class IdentityServerConfig - //{ - // public static IEnumerable GetApiResources() - // { - // return new List - // { - // new ApiResource("api1", "My API") - // }; - // } - - // public static IEnumerable GetClients() - // { - // return new List - // { - // new Client - // { - // ClientId = "client", - - // // no interactive user, use the clientid/secret for authentication - // AllowedGrantTypes = GrantTypes.ClientCredentials, - - // // secret for authentication - // ClientSecrets = - // { - // new IdentityServer4.Models.Secret("secret".Sha256()) - // }, - - // // scopes that client has access to - // AllowedScopes = { "api1" } - // } - // }; - // } - //} -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/UserClaim.cs b/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/UserClaim.cs deleted file mode 100644 index 7acaa695db..0000000000 --- a/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/UserClaim.cs +++ /dev/null @@ -1,22 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.IdentityServer -{ - public abstract class UserClaim : Entity - { - public virtual string Type { get; protected set; } - - protected UserClaim() - { - - } - - protected UserClaim([NotNull] string type) - { - Check.NotNull(type, nameof(type)); - - Type = type; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180108150119_IdentityServer_Initial.Designer.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180108150119_IdentityServer_Initial.Designer.cs deleted file mode 100644 index 580a47ec10..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180108150119_IdentityServer_Initial.Designer.cs +++ /dev/null @@ -1,609 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.IdentityServer.EntityFrameworkCore; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityServerDbContext))] - [Migration("20180108150119_IdentityServer_Initial")] - partial class IdentityServer_Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpIdsApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiResourceId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.ToTable("AbpIdsApiClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiResourceId"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpIdsApiScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiScopeId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ApiScopeId"); - - b.ToTable("AbpIdsApiScopeClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiResourceId"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("Expiration"); - - b.Property("Type") - .HasMaxLength(250); - - b.Property("Value") - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.ToTable("AbpIdsApiSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AbsoluteRefreshTokenLifetime"); - - b.Property("AccessTokenLifetime"); - - b.Property("AccessTokenType"); - - b.Property("AllowAccessTokensViaBrowser"); - - b.Property("AllowOfflineAccess"); - - b.Property("AllowPlainTextPkce"); - - b.Property("AllowRememberConsent"); - - b.Property("AlwaysIncludeUserClaimsInIdToken"); - - b.Property("AlwaysSendClientClaims"); - - b.Property("AuthorizationCodeLifetime"); - - b.Property("BackChannelLogoutSessionRequired"); - - b.Property("BackChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("ClientName") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasMaxLength(2000); - - b.Property("ConsentLifetime"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("EnableLocalLogin"); - - b.Property("Enabled"); - - b.Property("FrontChannelLogoutSessionRequired"); - - b.Property("FrontChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime"); - - b.Property("IncludeJwtId"); - - b.Property("LogoUri") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasMaxLength(200); - - b.Property("ProtocolType") - .IsRequired() - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration"); - - b.Property("RefreshTokenUsage"); - - b.Property("RequireClientSecret"); - - b.Property("RequireConsent"); - - b.Property("RequirePkce"); - - b.Property("SlidingRefreshTokenLifetime"); - - b.Property("UpdateAccessTokenClaimsOnRefresh"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("AbpIdsClients"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Origin") - .IsRequired() - .HasMaxLength(150); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientCorsOrigins"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("GrantType") - .IsRequired() - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Provider") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("PostLogoutRedirectUri") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("RedirectUri") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Scope") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Description") - .HasMaxLength(2000); - - b.Property("Expiration"); - - b.Property("Type") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("CreationTime"); - - b.Property("Data") - .IsRequired(); - - b.Property("Expiration"); - - b.Property("Id"); - - b.Property("SubjectId") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("AbpIdsPersistedGrants"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("IdentityResourceId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("IdentityResourceId"); - - b.ToTable("AbpIdsIdentityClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpIdsIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") - .WithMany("UserClaims") - .HasForeignKey("ApiScopeId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180108150119_IdentityServer_Initial.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180108150119_IdentityServer_Initial.cs deleted file mode 100644 index 6f71f502c8..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180108150119_IdentityServer_Initial.cs +++ /dev/null @@ -1,542 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore.Migrations -{ - public partial class IdentityServer_Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AbpIdsApiResources", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Enabled = table.Column(type: "bit", nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsApiResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClients", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - AbsoluteRefreshTokenLifetime = table.Column(type: "int", nullable: false), - AccessTokenLifetime = table.Column(type: "int", nullable: false), - AccessTokenType = table.Column(type: "int", nullable: false), - AllowAccessTokensViaBrowser = table.Column(type: "bit", nullable: false), - AllowOfflineAccess = table.Column(type: "bit", nullable: false), - AllowPlainTextPkce = table.Column(type: "bit", nullable: false), - AllowRememberConsent = table.Column(type: "bit", nullable: false), - AlwaysIncludeUserClaimsInIdToken = table.Column(type: "bit", nullable: false), - AlwaysSendClientClaims = table.Column(type: "bit", nullable: false), - AuthorizationCodeLifetime = table.Column(type: "int", nullable: false), - BackChannelLogoutSessionRequired = table.Column(type: "bit", nullable: false), - BackChannelLogoutUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - ClientClaimsPrefix = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - ClientName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - ClientUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - ConsentLifetime = table.Column(type: "int", nullable: true), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - EnableLocalLogin = table.Column(type: "bit", nullable: false), - Enabled = table.Column(type: "bit", nullable: false), - FrontChannelLogoutSessionRequired = table.Column(type: "bit", nullable: false), - FrontChannelLogoutUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - IdentityTokenLifetime = table.Column(type: "int", nullable: false), - IncludeJwtId = table.Column(type: "bit", nullable: false), - LogoUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - PairWiseSubjectSalt = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - ProtocolType = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - RefreshTokenExpiration = table.Column(type: "int", nullable: false), - RefreshTokenUsage = table.Column(type: "int", nullable: false), - RequireClientSecret = table.Column(type: "bit", nullable: false), - RequireConsent = table.Column(type: "bit", nullable: false), - RequirePkce = table.Column(type: "bit", nullable: false), - SlidingRefreshTokenLifetime = table.Column(type: "int", nullable: false), - UpdateAccessTokenClaimsOnRefresh = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsIdentityResources", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Emphasize = table.Column(type: "bit", nullable: false), - Enabled = table.Column(type: "bit", nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Required = table.Column(type: "bit", nullable: false), - ShowInDiscoveryDocument = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsIdentityResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsPersistedGrants", - columns: table => new - { - Key = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - Data = table.Column(type: "nvarchar(max)", nullable: false), - Expiration = table.Column(type: "datetime2", nullable: true), - Id = table.Column(type: "uniqueidentifier", nullable: false), - SubjectId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsPersistedGrants", x => x.Key); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsApiClaims", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ApiResourceId = table.Column(type: "uniqueidentifier", nullable: false), - Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsApiClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsApiClaims_AbpIdsApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "AbpIdsApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsApiScopes", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ApiResourceId = table.Column(type: "uniqueidentifier", nullable: false), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Emphasize = table.Column(type: "bit", nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Required = table.Column(type: "bit", nullable: false), - ShowInDiscoveryDocument = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsApiScopes", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsApiScopes_AbpIdsApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "AbpIdsApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsApiSecrets", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ApiResourceId = table.Column(type: "uniqueidentifier", nullable: false), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - Expiration = table.Column(type: "datetime2", nullable: true), - Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsApiSecrets", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsApiSecrets_AbpIdsApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "AbpIdsApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientClaims", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), - Value = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientClaims_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientCorsOrigins", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - Origin = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientCorsOrigins", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientCorsOrigins_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientGrantTypes", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - GrantType = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientGrantTypes", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientGrantTypes_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientIdPRestrictions", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - Provider = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientIdPRestrictions", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientIdPRestrictions_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientPostLogoutRedirectUris", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - PostLogoutRedirectUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientPostLogoutRedirectUris", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientPostLogoutRedirectUris_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientProperties", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - Key = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), - Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientProperties", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientProperties_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientRedirectUris", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - RedirectUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientRedirectUris", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientRedirectUris_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientScopes", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - Scope = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientScopes", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientScopes_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsClientSecrets", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ClientId = table.Column(type: "uniqueidentifier", nullable: false), - Description = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - Expiration = table.Column(type: "datetime2", nullable: true), - Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsClientSecrets", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsClientSecrets_AbpIdsClients_ClientId", - column: x => x.ClientId, - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsIdentityClaims", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - IdentityResourceId = table.Column(type: "uniqueidentifier", nullable: false), - Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsIdentityClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsIdentityClaims_AbpIdsIdentityResources_IdentityResourceId", - column: x => x.IdentityResourceId, - principalTable: "AbpIdsIdentityResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpIdsApiScopeClaims", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ApiScopeId = table.Column(type: "uniqueidentifier", nullable: false), - Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpIdsApiScopeClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpIdsApiScopeClaims_AbpIdsApiScopes_ApiScopeId", - column: x => x.ApiScopeId, - principalTable: "AbpIdsApiScopes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiClaims_ApiResourceId", - table: "AbpIdsApiClaims", - column: "ApiResourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiResources_Name", - table: "AbpIdsApiResources", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiScopeClaims_ApiScopeId", - table: "AbpIdsApiScopeClaims", - column: "ApiScopeId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiScopes_ApiResourceId", - table: "AbpIdsApiScopes", - column: "ApiResourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiScopes_Name", - table: "AbpIdsApiScopes", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiSecrets_ApiResourceId", - table: "AbpIdsApiSecrets", - column: "ApiResourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientClaims_ClientId", - table: "AbpIdsClientClaims", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientCorsOrigins_ClientId", - table: "AbpIdsClientCorsOrigins", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientGrantTypes_ClientId", - table: "AbpIdsClientGrantTypes", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientIdPRestrictions_ClientId", - table: "AbpIdsClientIdPRestrictions", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientPostLogoutRedirectUris_ClientId", - table: "AbpIdsClientPostLogoutRedirectUris", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientProperties_ClientId", - table: "AbpIdsClientProperties", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientRedirectUris_ClientId", - table: "AbpIdsClientRedirectUris", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClients_ClientId", - table: "AbpIdsClients", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientScopes_ClientId", - table: "AbpIdsClientScopes", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientSecrets_ClientId", - table: "AbpIdsClientSecrets", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsIdentityClaims_IdentityResourceId", - table: "AbpIdsIdentityClaims", - column: "IdentityResourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsIdentityResources_Name", - table: "AbpIdsIdentityResources", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsPersistedGrants_SubjectId_ClientId_Type", - table: "AbpIdsPersistedGrants", - columns: new[] { "SubjectId", "ClientId", "Type" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AbpIdsApiClaims"); - - migrationBuilder.DropTable( - name: "AbpIdsApiScopeClaims"); - - migrationBuilder.DropTable( - name: "AbpIdsApiSecrets"); - - migrationBuilder.DropTable( - name: "AbpIdsClientClaims"); - - migrationBuilder.DropTable( - name: "AbpIdsClientCorsOrigins"); - - migrationBuilder.DropTable( - name: "AbpIdsClientGrantTypes"); - - migrationBuilder.DropTable( - name: "AbpIdsClientIdPRestrictions"); - - migrationBuilder.DropTable( - name: "AbpIdsClientPostLogoutRedirectUris"); - - migrationBuilder.DropTable( - name: "AbpIdsClientProperties"); - - migrationBuilder.DropTable( - name: "AbpIdsClientRedirectUris"); - - migrationBuilder.DropTable( - name: "AbpIdsClientScopes"); - - migrationBuilder.DropTable( - name: "AbpIdsClientSecrets"); - - migrationBuilder.DropTable( - name: "AbpIdsIdentityClaims"); - - migrationBuilder.DropTable( - name: "AbpIdsPersistedGrants"); - - migrationBuilder.DropTable( - name: "AbpIdsApiScopes"); - - migrationBuilder.DropTable( - name: "AbpIdsClients"); - - migrationBuilder.DropTable( - name: "AbpIdsIdentityResources"); - - migrationBuilder.DropTable( - name: "AbpIdsApiResources"); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180111095012_Removed_Id_From_ClientGrantType.Designer.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180111095012_Removed_Id_From_ClientGrantType.Designer.cs deleted file mode 100644 index 744bda13b3..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180111095012_Removed_Id_From_ClientGrantType.Designer.cs +++ /dev/null @@ -1,603 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.IdentityServer.EntityFrameworkCore; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityServerDbContext))] - [Migration("20180111095012_Removed_Id_From_ClientGrantType")] - partial class Removed_Id_From_ClientGrantType - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpIdsApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiResourceId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.ToTable("AbpIdsApiClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiResourceId"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpIdsApiScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiScopeId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ApiScopeId"); - - b.ToTable("AbpIdsApiScopeClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiResourceId"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("Expiration"); - - b.Property("Type") - .HasMaxLength(250); - - b.Property("Value") - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.ToTable("AbpIdsApiSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AbsoluteRefreshTokenLifetime"); - - b.Property("AccessTokenLifetime"); - - b.Property("AccessTokenType"); - - b.Property("AllowAccessTokensViaBrowser"); - - b.Property("AllowOfflineAccess"); - - b.Property("AllowPlainTextPkce"); - - b.Property("AllowRememberConsent"); - - b.Property("AlwaysIncludeUserClaimsInIdToken"); - - b.Property("AlwaysSendClientClaims"); - - b.Property("AuthorizationCodeLifetime"); - - b.Property("BackChannelLogoutSessionRequired"); - - b.Property("BackChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("ClientName") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasMaxLength(2000); - - b.Property("ConsentLifetime"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("EnableLocalLogin"); - - b.Property("Enabled"); - - b.Property("FrontChannelLogoutSessionRequired"); - - b.Property("FrontChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime"); - - b.Property("IncludeJwtId"); - - b.Property("LogoUri") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasMaxLength(200); - - b.Property("ProtocolType") - .IsRequired() - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration"); - - b.Property("RefreshTokenUsage"); - - b.Property("RequireClientSecret"); - - b.Property("RequireConsent"); - - b.Property("RequirePkce"); - - b.Property("SlidingRefreshTokenLifetime"); - - b.Property("UpdateAccessTokenClaimsOnRefresh"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("AbpIdsClients"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Origin") - .IsRequired() - .HasMaxLength(150); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientCorsOrigins"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("ClientId"); - - b.Property("GrantType") - .HasMaxLength(250); - - b.HasKey("ClientId", "GrantType"); - - b.ToTable("AbpIdsClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Provider") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("PostLogoutRedirectUri") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("RedirectUri") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Scope") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Description") - .HasMaxLength(2000); - - b.Property("Expiration"); - - b.Property("Type") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("AbpIdsClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("CreationTime"); - - b.Property("Data") - .IsRequired(); - - b.Property("Expiration"); - - b.Property("Id"); - - b.Property("SubjectId") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("AbpIdsPersistedGrants"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("IdentityResourceId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("IdentityResourceId"); - - b.ToTable("AbpIdsIdentityClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpIdsIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") - .WithMany("UserClaims") - .HasForeignKey("ApiScopeId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180111095012_Removed_Id_From_ClientGrantType.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180111095012_Removed_Id_From_ClientGrantType.cs deleted file mode 100644 index 0fa1138280..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180111095012_Removed_Id_From_ClientGrantType.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore.Migrations -{ - public partial class Removed_Id_From_ClientGrantType : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientGrantTypes", - table: "AbpIdsClientGrantTypes"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientGrantTypes_ClientId", - table: "AbpIdsClientGrantTypes"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientGrantTypes"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientGrantTypes", - table: "AbpIdsClientGrantTypes", - columns: new[] { "ClientId", "GrantType" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientGrantTypes", - table: "AbpIdsClientGrantTypes"); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientGrantTypes", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientGrantTypes", - table: "AbpIdsClientGrantTypes", - column: "Id"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientGrantTypes_ClientId", - table: "AbpIdsClientGrantTypes", - column: "ClientId"); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180131140336_IdentityServer_Revisions.Designer.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180131140336_IdentityServer_Revisions.Designer.cs deleted file mode 100644 index 72bf5214d3..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180131140336_IdentityServer_Revisions.Designer.cs +++ /dev/null @@ -1,526 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.IdentityServer.EntityFrameworkCore; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityServerDbContext))] - [Migration("20180131140336_IdentityServer_Revisions")] - partial class IdentityServer_Revisions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.ToTable("IdentityServerApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Type"); - - b.ToTable("IdentityServerApiClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("DisplayName") - .HasMaxLength(128); - - b.Property("Emphasize"); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("ApiResourceId", "Name"); - - b.ToTable("IdentityServerApiScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Name", "Type"); - - b.ToTable("IdentityServerApiScopeClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ApiResourceId", "Type", "Value"); - - b.ToTable("IdentityServerApiSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AbsoluteRefreshTokenLifetime"); - - b.Property("AccessTokenLifetime"); - - b.Property("AccessTokenType"); - - b.Property("AllowAccessTokensViaBrowser"); - - b.Property("AllowOfflineAccess"); - - b.Property("AllowPlainTextPkce"); - - b.Property("AllowRememberConsent"); - - b.Property("AlwaysIncludeUserClaimsInIdToken"); - - b.Property("AlwaysSendClientClaims"); - - b.Property("AuthorizationCodeLifetime"); - - b.Property("BackChannelLogoutSessionRequired"); - - b.Property("BackChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("ClientName") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasMaxLength(2000); - - b.Property("ConsentLifetime"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("EnableLocalLogin"); - - b.Property("Enabled"); - - b.Property("FrontChannelLogoutSessionRequired"); - - b.Property("FrontChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime"); - - b.Property("IncludeJwtId"); - - b.Property("LogoUri") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasMaxLength(200); - - b.Property("ProtocolType") - .IsRequired() - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration"); - - b.Property("RefreshTokenUsage"); - - b.Property("RequireClientSecret"); - - b.Property("RequireConsent"); - - b.Property("RequirePkce"); - - b.Property("SlidingRefreshTokenLifetime"); - - b.Property("UpdateAccessTokenClaimsOnRefresh"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("IdentityServerClients"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("IdentityServerClientClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.Property("ClientId"); - - b.Property("Origin") - .HasMaxLength(150); - - b.HasKey("ClientId", "Origin"); - - b.ToTable("IdentityServerClientCorsOrigins"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("ClientId"); - - b.Property("GrantType") - .HasMaxLength(196); - - b.HasKey("ClientId", "GrantType"); - - b.ToTable("IdentityServerClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("ClientId"); - - b.Property("Provider") - .HasMaxLength(64); - - b.HasKey("ClientId", "Provider"); - - b.ToTable("IdentityServerClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("PostLogoutRedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "PostLogoutRedirectUri"); - - b.ToTable("IdentityServerClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("ClientId"); - - b.Property("Key") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("ClientId", "Key"); - - b.ToTable("IdentityServerClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("RedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "RedirectUri"); - - b.ToTable("IdentityServerClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("ClientId"); - - b.Property("Scope") - .HasMaxLength(196); - - b.HasKey("ClientId", "Scope"); - - b.ToTable("IdentityServerClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("ClientId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ClientId", "Type", "Value"); - - b.ToTable("IdentityServerClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("CreationTime"); - - b.Property("Data") - .IsRequired(); - - b.Property("Expiration"); - - b.Property("Id"); - - b.Property("SubjectId") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("IdentityServerPersistedGrants"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("IdentityResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("IdentityResourceId", "Type"); - - b.ToTable("IdentityServerIdentityClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180131140336_IdentityServer_Revisions.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180131140336_IdentityServer_Revisions.cs deleted file mode 100644 index 44249ea0f6..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/20180131140336_IdentityServer_Revisions.cs +++ /dev/null @@ -1,1420 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore.Migrations -{ - public partial class IdentityServer_Revisions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsApiClaims_AbpIdsApiResources_ApiResourceId", - table: "AbpIdsApiClaims"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsApiScopeClaims_AbpIdsApiScopes_ApiScopeId", - table: "AbpIdsApiScopeClaims"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsApiScopes_AbpIdsApiResources_ApiResourceId", - table: "AbpIdsApiScopes"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsApiSecrets_AbpIdsApiResources_ApiResourceId", - table: "AbpIdsApiSecrets"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientClaims_AbpIdsClients_ClientId", - table: "AbpIdsClientClaims"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientCorsOrigins_AbpIdsClients_ClientId", - table: "AbpIdsClientCorsOrigins"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientGrantTypes_AbpIdsClients_ClientId", - table: "AbpIdsClientGrantTypes"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientIdPRestrictions_AbpIdsClients_ClientId", - table: "AbpIdsClientIdPRestrictions"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientPostLogoutRedirectUris_AbpIdsClients_ClientId", - table: "AbpIdsClientPostLogoutRedirectUris"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientProperties_AbpIdsClients_ClientId", - table: "AbpIdsClientProperties"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientRedirectUris_AbpIdsClients_ClientId", - table: "AbpIdsClientRedirectUris"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientScopes_AbpIdsClients_ClientId", - table: "AbpIdsClientScopes"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsClientSecrets_AbpIdsClients_ClientId", - table: "AbpIdsClientSecrets"); - - migrationBuilder.DropForeignKey( - name: "FK_AbpIdsIdentityClaims_AbpIdsIdentityResources_IdentityResourceId", - table: "AbpIdsIdentityClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsPersistedGrants", - table: "AbpIdsPersistedGrants"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsIdentityResources", - table: "AbpIdsIdentityResources"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsIdentityResources_Name", - table: "AbpIdsIdentityResources"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsIdentityClaims", - table: "AbpIdsIdentityClaims"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsIdentityClaims_IdentityResourceId", - table: "AbpIdsIdentityClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientSecrets", - table: "AbpIdsClientSecrets"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientSecrets_ClientId", - table: "AbpIdsClientSecrets"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientScopes", - table: "AbpIdsClientScopes"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientScopes_ClientId", - table: "AbpIdsClientScopes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClients", - table: "AbpIdsClients"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientRedirectUris", - table: "AbpIdsClientRedirectUris"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientRedirectUris_ClientId", - table: "AbpIdsClientRedirectUris"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientProperties", - table: "AbpIdsClientProperties"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientProperties_ClientId", - table: "AbpIdsClientProperties"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientPostLogoutRedirectUris", - table: "AbpIdsClientPostLogoutRedirectUris"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientPostLogoutRedirectUris_ClientId", - table: "AbpIdsClientPostLogoutRedirectUris"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientIdPRestrictions", - table: "AbpIdsClientIdPRestrictions"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientIdPRestrictions_ClientId", - table: "AbpIdsClientIdPRestrictions"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientGrantTypes", - table: "AbpIdsClientGrantTypes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientCorsOrigins", - table: "AbpIdsClientCorsOrigins"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsClientCorsOrigins_ClientId", - table: "AbpIdsClientCorsOrigins"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsClientClaims", - table: "AbpIdsClientClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsApiSecrets", - table: "AbpIdsApiSecrets"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsApiSecrets_ApiResourceId", - table: "AbpIdsApiSecrets"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsApiScopes", - table: "AbpIdsApiScopes"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsApiScopes_ApiResourceId", - table: "AbpIdsApiScopes"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsApiScopes_Name", - table: "AbpIdsApiScopes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsApiScopeClaims", - table: "AbpIdsApiScopeClaims"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsApiScopeClaims_ApiScopeId", - table: "AbpIdsApiScopeClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsApiResources", - table: "AbpIdsApiResources"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsApiResources_Name", - table: "AbpIdsApiResources"); - - migrationBuilder.DropPrimaryKey( - name: "PK_AbpIdsApiClaims", - table: "AbpIdsApiClaims"); - - migrationBuilder.DropIndex( - name: "IX_AbpIdsApiClaims_ApiResourceId", - table: "AbpIdsApiClaims"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsIdentityClaims"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientSecrets"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientScopes"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientRedirectUris"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientProperties"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientPostLogoutRedirectUris"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientIdPRestrictions"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsClientCorsOrigins"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsApiSecrets"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsApiScopes"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsApiScopeClaims"); - - migrationBuilder.DropColumn( - name: "ApiScopeId", - table: "AbpIdsApiScopeClaims"); - - migrationBuilder.DropColumn( - name: "Id", - table: "AbpIdsApiClaims"); - - migrationBuilder.RenameTable( - name: "AbpIdsPersistedGrants", - newName: "IdentityServerPersistedGrants"); - - migrationBuilder.RenameTable( - name: "AbpIdsIdentityResources", - newName: "IdentityServerIdentityResources"); - - migrationBuilder.RenameTable( - name: "AbpIdsIdentityClaims", - newName: "IdentityServerIdentityClaims"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientSecrets", - newName: "IdentityServerClientSecrets"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientScopes", - newName: "IdentityServerClientScopes"); - - migrationBuilder.RenameTable( - name: "AbpIdsClients", - newName: "IdentityServerClients"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientRedirectUris", - newName: "IdentityServerClientRedirectUris"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientProperties", - newName: "IdentityServerClientProperties"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientPostLogoutRedirectUris", - newName: "IdentityServerClientPostLogoutRedirectUris"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientIdPRestrictions", - newName: "IdentityServerClientIdPRestrictions"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientGrantTypes", - newName: "IdentityServerClientGrantTypes"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientCorsOrigins", - newName: "IdentityServerClientCorsOrigins"); - - migrationBuilder.RenameTable( - name: "AbpIdsClientClaims", - newName: "IdentityServerClientClaims"); - - migrationBuilder.RenameTable( - name: "AbpIdsApiSecrets", - newName: "IdentityServerApiSecrets"); - - migrationBuilder.RenameTable( - name: "AbpIdsApiScopes", - newName: "IdentityServerApiScopes"); - - migrationBuilder.RenameTable( - name: "AbpIdsApiScopeClaims", - newName: "IdentityServerApiScopeClaims"); - - migrationBuilder.RenameTable( - name: "AbpIdsApiResources", - newName: "IdentityServerApiResources"); - - migrationBuilder.RenameTable( - name: "AbpIdsApiClaims", - newName: "IdentityServerApiClaims"); - - migrationBuilder.RenameIndex( - name: "IX_AbpIdsPersistedGrants_SubjectId_ClientId_Type", - table: "IdentityServerPersistedGrants", - newName: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type"); - - migrationBuilder.RenameIndex( - name: "IX_AbpIdsClients_ClientId", - table: "IdentityServerClients", - newName: "IX_IdentityServerClients_ClientId"); - - migrationBuilder.RenameIndex( - name: "IX_AbpIdsClientClaims_ClientId", - table: "IdentityServerClientClaims", - newName: "IX_IdentityServerClientClaims_ClientId"); - - migrationBuilder.AlterColumn( - name: "Type", - table: "IdentityServerIdentityClaims", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - name: "Value", - table: "IdentityServerClientSecrets", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 2000); - - migrationBuilder.AlterColumn( - name: "Type", - table: "IdentityServerClientSecrets", - type: "nvarchar(32)", - maxLength: 32, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 250, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Description", - table: "IdentityServerClientSecrets", - type: "nvarchar(256)", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 2000, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Scope", - table: "IdentityServerClientScopes", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - name: "Provider", - table: "IdentityServerClientIdPRestrictions", - type: "nvarchar(64)", - maxLength: 64, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - name: "GrantType", - table: "IdentityServerClientGrantTypes", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 250); - - migrationBuilder.AlterColumn( - name: "Value", - table: "IdentityServerApiSecrets", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 2000, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Type", - table: "IdentityServerApiSecrets", - type: "nvarchar(32)", - maxLength: 32, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 250, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Description", - table: "IdentityServerApiSecrets", - type: "nvarchar(256)", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 1000, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "IdentityServerApiScopes", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - name: "DisplayName", - table: "IdentityServerApiScopes", - type: "nvarchar(128)", - maxLength: 128, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Description", - table: "IdentityServerApiScopes", - type: "nvarchar(256)", - maxLength: 256, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 1000, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Type", - table: "IdentityServerApiScopeClaims", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 200); - - migrationBuilder.AddColumn( - name: "ApiResourceId", - table: "IdentityServerApiScopeClaims", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "Name", - table: "IdentityServerApiScopeClaims", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - defaultValue: ""); - - migrationBuilder.AlterColumn( - name: "Type", - table: "IdentityServerApiClaims", - type: "nvarchar(196)", - maxLength: 196, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 200); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerPersistedGrants", - table: "IdentityServerPersistedGrants", - column: "Key"); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerIdentityResources", - table: "IdentityServerIdentityResources", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerIdentityClaims", - table: "IdentityServerIdentityClaims", - columns: new[] { "IdentityResourceId", "Type" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientSecrets", - table: "IdentityServerClientSecrets", - columns: new[] { "ClientId", "Type", "Value" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientScopes", - table: "IdentityServerClientScopes", - columns: new[] { "ClientId", "Scope" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClients", - table: "IdentityServerClients", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientRedirectUris", - table: "IdentityServerClientRedirectUris", - columns: new[] { "ClientId", "RedirectUri" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientProperties", - table: "IdentityServerClientProperties", - columns: new[] { "ClientId", "Key" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientPostLogoutRedirectUris", - table: "IdentityServerClientPostLogoutRedirectUris", - columns: new[] { "ClientId", "PostLogoutRedirectUri" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientIdPRestrictions", - table: "IdentityServerClientIdPRestrictions", - columns: new[] { "ClientId", "Provider" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientGrantTypes", - table: "IdentityServerClientGrantTypes", - columns: new[] { "ClientId", "GrantType" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientCorsOrigins", - table: "IdentityServerClientCorsOrigins", - columns: new[] { "ClientId", "Origin" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerClientClaims", - table: "IdentityServerClientClaims", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerApiSecrets", - table: "IdentityServerApiSecrets", - columns: new[] { "ApiResourceId", "Type", "Value" }); - - 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_IdentityServerApiResources", - table: "IdentityServerApiResources", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_IdentityServerApiClaims", - table: "IdentityServerApiClaims", - columns: new[] { "ApiResourceId", "Type" }); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", - table: "IdentityServerApiClaims", - column: "ApiResourceId", - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiResourceId_Name", - table: "IdentityServerApiScopeClaims", - columns: new[] { "ApiResourceId", "Name" }, - principalTable: "IdentityServerApiScopes", - principalColumns: new[] { "ApiResourceId", "Name" }, - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", - table: "IdentityServerApiScopes", - column: "ApiResourceId", - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", - table: "IdentityServerApiSecrets", - column: "ApiResourceId", - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", - table: "IdentityServerClientClaims", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", - table: "IdentityServerClientCorsOrigins", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", - table: "IdentityServerClientGrantTypes", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", - table: "IdentityServerClientIdPRestrictions", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", - table: "IdentityServerClientPostLogoutRedirectUris", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", - table: "IdentityServerClientProperties", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", - table: "IdentityServerClientRedirectUris", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", - table: "IdentityServerClientScopes", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", - table: "IdentityServerClientSecrets", - column: "ClientId", - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", - table: "IdentityServerIdentityClaims", - column: "IdentityResourceId", - principalTable: "IdentityServerIdentityResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", - table: "IdentityServerApiClaims"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiResourceId_Name", - table: "IdentityServerApiScopeClaims"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", - table: "IdentityServerApiScopes"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", - table: "IdentityServerApiSecrets"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", - table: "IdentityServerClientClaims"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", - table: "IdentityServerClientCorsOrigins"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", - table: "IdentityServerClientGrantTypes"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", - table: "IdentityServerClientIdPRestrictions"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", - table: "IdentityServerClientPostLogoutRedirectUris"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", - table: "IdentityServerClientProperties"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", - table: "IdentityServerClientRedirectUris"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", - table: "IdentityServerClientScopes"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", - table: "IdentityServerClientSecrets"); - - migrationBuilder.DropForeignKey( - name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", - table: "IdentityServerIdentityClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerPersistedGrants", - table: "IdentityServerPersistedGrants"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerIdentityResources", - table: "IdentityServerIdentityResources"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerIdentityClaims", - table: "IdentityServerIdentityClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientSecrets", - table: "IdentityServerClientSecrets"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientScopes", - table: "IdentityServerClientScopes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClients", - table: "IdentityServerClients"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientRedirectUris", - table: "IdentityServerClientRedirectUris"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientProperties", - table: "IdentityServerClientProperties"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientPostLogoutRedirectUris", - table: "IdentityServerClientPostLogoutRedirectUris"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientIdPRestrictions", - table: "IdentityServerClientIdPRestrictions"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientGrantTypes", - table: "IdentityServerClientGrantTypes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientCorsOrigins", - table: "IdentityServerClientCorsOrigins"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerClientClaims", - table: "IdentityServerClientClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerApiSecrets", - table: "IdentityServerApiSecrets"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerApiScopes", - table: "IdentityServerApiScopes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerApiScopeClaims", - table: "IdentityServerApiScopeClaims"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerApiResources", - table: "IdentityServerApiResources"); - - migrationBuilder.DropPrimaryKey( - name: "PK_IdentityServerApiClaims", - table: "IdentityServerApiClaims"); - - migrationBuilder.DropColumn( - name: "ApiResourceId", - table: "IdentityServerApiScopeClaims"); - - migrationBuilder.DropColumn( - name: "Name", - table: "IdentityServerApiScopeClaims"); - - migrationBuilder.RenameTable( - name: "IdentityServerPersistedGrants", - newName: "AbpIdsPersistedGrants"); - - migrationBuilder.RenameTable( - name: "IdentityServerIdentityResources", - newName: "AbpIdsIdentityResources"); - - migrationBuilder.RenameTable( - name: "IdentityServerIdentityClaims", - newName: "AbpIdsIdentityClaims"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientSecrets", - newName: "AbpIdsClientSecrets"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientScopes", - newName: "AbpIdsClientScopes"); - - migrationBuilder.RenameTable( - name: "IdentityServerClients", - newName: "AbpIdsClients"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientRedirectUris", - newName: "AbpIdsClientRedirectUris"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientProperties", - newName: "AbpIdsClientProperties"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientPostLogoutRedirectUris", - newName: "AbpIdsClientPostLogoutRedirectUris"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientIdPRestrictions", - newName: "AbpIdsClientIdPRestrictions"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientGrantTypes", - newName: "AbpIdsClientGrantTypes"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientCorsOrigins", - newName: "AbpIdsClientCorsOrigins"); - - migrationBuilder.RenameTable( - name: "IdentityServerClientClaims", - newName: "AbpIdsClientClaims"); - - migrationBuilder.RenameTable( - name: "IdentityServerApiSecrets", - newName: "AbpIdsApiSecrets"); - - migrationBuilder.RenameTable( - name: "IdentityServerApiScopes", - newName: "AbpIdsApiScopes"); - - migrationBuilder.RenameTable( - name: "IdentityServerApiScopeClaims", - newName: "AbpIdsApiScopeClaims"); - - migrationBuilder.RenameTable( - name: "IdentityServerApiResources", - newName: "AbpIdsApiResources"); - - migrationBuilder.RenameTable( - name: "IdentityServerApiClaims", - newName: "AbpIdsApiClaims"); - - migrationBuilder.RenameIndex( - name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", - table: "AbpIdsPersistedGrants", - newName: "IX_AbpIdsPersistedGrants_SubjectId_ClientId_Type"); - - migrationBuilder.RenameIndex( - name: "IX_IdentityServerClients_ClientId", - table: "AbpIdsClients", - newName: "IX_AbpIdsClients_ClientId"); - - migrationBuilder.RenameIndex( - name: "IX_IdentityServerClientClaims_ClientId", - table: "AbpIdsClientClaims", - newName: "IX_AbpIdsClientClaims_ClientId"); - - migrationBuilder.AlterColumn( - name: "Type", - table: "AbpIdsIdentityClaims", - maxLength: 200, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsIdentityClaims", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "Description", - table: "AbpIdsClientSecrets", - maxLength: 2000, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Value", - table: "AbpIdsClientSecrets", - maxLength: 2000, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AlterColumn( - name: "Type", - table: "AbpIdsClientSecrets", - maxLength: 250, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(32)", - oldMaxLength: 32); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientSecrets", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "Scope", - table: "AbpIdsClientScopes", - maxLength: 200, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientScopes", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientRedirectUris", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientProperties", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientPostLogoutRedirectUris", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "Provider", - table: "AbpIdsClientIdPRestrictions", - maxLength: 200, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(64)", - oldMaxLength: 64); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientIdPRestrictions", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "GrantType", - table: "AbpIdsClientGrantTypes", - maxLength: 250, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsClientCorsOrigins", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "Description", - table: "AbpIdsApiSecrets", - maxLength: 1000, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Value", - table: "AbpIdsApiSecrets", - maxLength: 2000, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AlterColumn( - name: "Type", - table: "AbpIdsApiSecrets", - maxLength: 250, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(32)", - oldMaxLength: 32); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsApiSecrets", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "DisplayName", - table: "AbpIdsApiScopes", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(128)", - oldMaxLength: 128, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Description", - table: "AbpIdsApiScopes", - maxLength: 1000, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(256)", - oldMaxLength: 256, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "AbpIdsApiScopes", - maxLength: 200, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsApiScopes", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "Type", - table: "AbpIdsApiScopeClaims", - maxLength: 200, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsApiScopeClaims", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "ApiScopeId", - table: "AbpIdsApiScopeClaims", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AlterColumn( - name: "Type", - table: "AbpIdsApiClaims", - maxLength: 200, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(196)", - oldMaxLength: 196); - - migrationBuilder.AddColumn( - name: "Id", - table: "AbpIdsApiClaims", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsPersistedGrants", - table: "AbpIdsPersistedGrants", - column: "Key"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsIdentityResources", - table: "AbpIdsIdentityResources", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsIdentityClaims", - table: "AbpIdsIdentityClaims", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientSecrets", - table: "AbpIdsClientSecrets", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientScopes", - table: "AbpIdsClientScopes", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClients", - table: "AbpIdsClients", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientRedirectUris", - table: "AbpIdsClientRedirectUris", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientProperties", - table: "AbpIdsClientProperties", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientPostLogoutRedirectUris", - table: "AbpIdsClientPostLogoutRedirectUris", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientIdPRestrictions", - table: "AbpIdsClientIdPRestrictions", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientGrantTypes", - table: "AbpIdsClientGrantTypes", - columns: new[] { "ClientId", "GrantType" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientCorsOrigins", - table: "AbpIdsClientCorsOrigins", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsClientClaims", - table: "AbpIdsClientClaims", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsApiSecrets", - table: "AbpIdsApiSecrets", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsApiScopes", - table: "AbpIdsApiScopes", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsApiScopeClaims", - table: "AbpIdsApiScopeClaims", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsApiResources", - table: "AbpIdsApiResources", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_AbpIdsApiClaims", - table: "AbpIdsApiClaims", - column: "Id"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsIdentityResources_Name", - table: "AbpIdsIdentityResources", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsIdentityClaims_IdentityResourceId", - table: "AbpIdsIdentityClaims", - column: "IdentityResourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientSecrets_ClientId", - table: "AbpIdsClientSecrets", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientScopes_ClientId", - table: "AbpIdsClientScopes", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientRedirectUris_ClientId", - table: "AbpIdsClientRedirectUris", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientProperties_ClientId", - table: "AbpIdsClientProperties", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientPostLogoutRedirectUris_ClientId", - table: "AbpIdsClientPostLogoutRedirectUris", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientIdPRestrictions_ClientId", - table: "AbpIdsClientIdPRestrictions", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsClientCorsOrigins_ClientId", - table: "AbpIdsClientCorsOrigins", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiSecrets_ApiResourceId", - table: "AbpIdsApiSecrets", - column: "ApiResourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiScopes_ApiResourceId", - table: "AbpIdsApiScopes", - column: "ApiResourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiScopes_Name", - table: "AbpIdsApiScopes", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiScopeClaims_ApiScopeId", - table: "AbpIdsApiScopeClaims", - column: "ApiScopeId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiResources_Name", - table: "AbpIdsApiResources", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpIdsApiClaims_ApiResourceId", - table: "AbpIdsApiClaims", - column: "ApiResourceId"); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsApiClaims_AbpIdsApiResources_ApiResourceId", - table: "AbpIdsApiClaims", - column: "ApiResourceId", - principalTable: "AbpIdsApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsApiScopeClaims_AbpIdsApiScopes_ApiScopeId", - table: "AbpIdsApiScopeClaims", - column: "ApiScopeId", - principalTable: "AbpIdsApiScopes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsApiScopes_AbpIdsApiResources_ApiResourceId", - table: "AbpIdsApiScopes", - column: "ApiResourceId", - principalTable: "AbpIdsApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsApiSecrets_AbpIdsApiResources_ApiResourceId", - table: "AbpIdsApiSecrets", - column: "ApiResourceId", - principalTable: "AbpIdsApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientClaims_AbpIdsClients_ClientId", - table: "AbpIdsClientClaims", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientCorsOrigins_AbpIdsClients_ClientId", - table: "AbpIdsClientCorsOrigins", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientGrantTypes_AbpIdsClients_ClientId", - table: "AbpIdsClientGrantTypes", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientIdPRestrictions_AbpIdsClients_ClientId", - table: "AbpIdsClientIdPRestrictions", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientPostLogoutRedirectUris_AbpIdsClients_ClientId", - table: "AbpIdsClientPostLogoutRedirectUris", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientProperties_AbpIdsClients_ClientId", - table: "AbpIdsClientProperties", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientRedirectUris_AbpIdsClients_ClientId", - table: "AbpIdsClientRedirectUris", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientScopes_AbpIdsClients_ClientId", - table: "AbpIdsClientScopes", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsClientSecrets_AbpIdsClients_ClientId", - table: "AbpIdsClientSecrets", - column: "ClientId", - principalTable: "AbpIdsClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AbpIdsIdentityClaims_AbpIdsIdentityResources_IdentityResourceId", - table: "AbpIdsIdentityClaims", - column: "IdentityResourceId", - principalTable: "AbpIdsIdentityResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/IdentityServerDbContextModelSnapshot.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/IdentityServerDbContextModelSnapshot.cs deleted file mode 100644 index f61bf3bbd8..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Migrations/IdentityServerDbContextModelSnapshot.cs +++ /dev/null @@ -1,525 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.IdentityServer.EntityFrameworkCore; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(IdentityServerDbContext))] - partial class IdentityServerDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.HasKey("Id"); - - b.ToTable("IdentityServerApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Type"); - - b.ToTable("IdentityServerApiClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("DisplayName") - .HasMaxLength(128); - - b.Property("Emphasize"); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("ApiResourceId", "Name"); - - b.ToTable("IdentityServerApiScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.Property("ApiResourceId"); - - b.Property("Name") - .HasMaxLength(196); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("ApiResourceId", "Name", "Type"); - - b.ToTable("IdentityServerApiScopeClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.Property("ApiResourceId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ApiResourceId", "Type", "Value"); - - b.ToTable("IdentityServerApiSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AbsoluteRefreshTokenLifetime"); - - b.Property("AccessTokenLifetime"); - - b.Property("AccessTokenType"); - - b.Property("AllowAccessTokensViaBrowser"); - - b.Property("AllowOfflineAccess"); - - b.Property("AllowPlainTextPkce"); - - b.Property("AllowRememberConsent"); - - b.Property("AlwaysIncludeUserClaimsInIdToken"); - - b.Property("AlwaysSendClientClaims"); - - b.Property("AuthorizationCodeLifetime"); - - b.Property("BackChannelLogoutSessionRequired"); - - b.Property("BackChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("ClientName") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasMaxLength(2000); - - b.Property("ConsentLifetime"); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("EnableLocalLogin"); - - b.Property("Enabled"); - - b.Property("FrontChannelLogoutSessionRequired"); - - b.Property("FrontChannelLogoutUri") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime"); - - b.Property("IncludeJwtId"); - - b.Property("LogoUri") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasMaxLength(200); - - b.Property("ProtocolType") - .IsRequired() - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration"); - - b.Property("RefreshTokenUsage"); - - b.Property("RequireClientSecret"); - - b.Property("RequireConsent"); - - b.Property("RequirePkce"); - - b.Property("SlidingRefreshTokenLifetime"); - - b.Property("UpdateAccessTokenClaimsOnRefresh"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("IdentityServerClients"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClientId"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("IdentityServerClientClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.Property("ClientId"); - - b.Property("Origin") - .HasMaxLength(150); - - b.HasKey("ClientId", "Origin"); - - b.ToTable("IdentityServerClientCorsOrigins"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("ClientId"); - - b.Property("GrantType") - .HasMaxLength(196); - - b.HasKey("ClientId", "GrantType"); - - b.ToTable("IdentityServerClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("ClientId"); - - b.Property("Provider") - .HasMaxLength(64); - - b.HasKey("ClientId", "Provider"); - - b.ToTable("IdentityServerClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("PostLogoutRedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "PostLogoutRedirectUri"); - - b.ToTable("IdentityServerClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("ClientId"); - - b.Property("Key") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2000); - - b.HasKey("ClientId", "Key"); - - b.ToTable("IdentityServerClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("ClientId"); - - b.Property("RedirectUri") - .HasMaxLength(2000); - - b.HasKey("ClientId", "RedirectUri"); - - b.ToTable("IdentityServerClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("ClientId"); - - b.Property("Scope") - .HasMaxLength(196); - - b.HasKey("ClientId", "Scope"); - - b.ToTable("IdentityServerClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("ClientId"); - - b.Property("Type") - .HasMaxLength(32); - - b.Property("Value") - .HasMaxLength(196); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("Expiration"); - - b.HasKey("ClientId", "Type", "Value"); - - b.ToTable("IdentityServerClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(200); - - b.Property("CreationTime"); - - b.Property("Data") - .IsRequired(); - - b.Property("Expiration"); - - b.Property("Id"); - - b.Property("SubjectId") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("IdentityServerPersistedGrants"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("IdentityResourceId"); - - b.Property("Type") - .HasMaxLength(196); - - b.HasKey("IdentityResourceId", "Type"); - - b.ToTable("IdentityServerIdentityClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasMaxLength(200); - - b.Property("Emphasize"); - - b.Property("Enabled"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Required"); - - b.Property("ShowInDiscoveryDocument"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope") - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client") - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource") - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo.Abp.IdentityServer.EntityFrameworkCore.csproj b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo.Abp.IdentityServer.EntityFrameworkCore.csproj deleted file mode 100644 index e7feb7ab27..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo.Abp.IdentityServer.EntityFrameworkCore.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.IdentityServer.EntityFrameworkCore - Volo.Abp.IdentityServer.EntityFrameworkCore - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - - diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo.Abp.IdentityServer.EntityFrameworkCore.csproj.DotSettings b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo.Abp.IdentityServer.EntityFrameworkCore.csproj.DotSettings deleted file mode 100644 index 58ad6c8854..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo.Abp.IdentityServer.EntityFrameworkCore.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp71 \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiResourceRepository.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiResourceRepository.cs deleted file mode 100644 index a1c55d6bf8..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ApiResourceRepository.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.EntityFrameworkCore; - -namespace Volo.Abp.IdentityServer -{ - public class ApiResourceRepository : EfCoreRepository, IApiResourceRepository - { - public ApiResourceRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - - } - - public virtual async Task FindByNameAsync(string name, CancellationToken cancellationToken = default) - { - return await this.FirstOrDefaultAsync(ar => ar.Name == name, cancellationToken); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ClientRepository.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ClientRepository.cs deleted file mode 100644 index 43698a0caf..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/ClientRepository.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.Clients; -using Volo.Abp.IdentityServer.EntityFrameworkCore; - -namespace Volo.Abp.IdentityServer -{ - public class ClientRepository : EfCoreRepository, IClientRepository - { - public ClientRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - - } - - public virtual async Task FindByCliendIdIncludingAllAsync(string clientId) - { - return await DbSet - .Include(x => x.AllowedGrantTypes) - .Include(x => x.RedirectUris) - .Include(x => x.PostLogoutRedirectUris) - .Include(x => x.AllowedScopes) - .Include(x => x.ClientSecrets) - .Include(x => x.Claims) - .Include(x => x.IdentityProviderRestrictions) - .Include(x => x.AllowedCorsOrigins) - .Include(x => x.Properties) - .FirstOrDefaultAsync(x => x.ClientId == clientId); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/AbpIdentityServerEntityFrameworkCoreModule.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/AbpIdentityServerEntityFrameworkCoreModule.cs deleted file mode 100644 index 9594451956..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/AbpIdentityServerEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.Clients; -using Volo.Abp.IdentityServer.Grants; -using Volo.Abp.IdentityServer.IdentityResources; -using Volo.Abp.Modularity; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore -{ - [DependsOn(typeof(AbpIdentityServerDomainModule))] - [DependsOn(typeof(AbpEntityFrameworkCoreModule))] - public class AbpIdentityServerEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); - - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IIdentityServerDbContext.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IIdentityServerDbContext.cs deleted file mode 100644 index ded2ca3031..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IIdentityServerDbContext.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.Clients; -using Volo.Abp.IdentityServer.Grants; -using Volo.Abp.IdentityServer.IdentityResources; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore -{ - [ConnectionStringName("AbpIdentityServer")] - public interface IIdentityServerDbContext : IEfCoreDbContext - { - DbSet ApiResources { get; set; } - - DbSet ApiSecrets { get; set; } - - DbSet ApiResourceClaims { get; set; } - - DbSet ApiScopes { get; set; } - - DbSet ApiScopeClaims { get; set; } - - DbSet IdentityResources { get; set; } - - DbSet IdentityClaims { get; set; } - - DbSet Clients { get; set; } - - DbSet ClientGrantTypes { get; set; } - - DbSet ClientRedirectUris { get; set; } - - DbSet ClientPostLogoutRedirectUris { get; set; } - - DbSet ClientScopes { get; set; } - - DbSet ClientSecrets { get; set; } - - DbSet ClientClaims { get; set; } - - DbSet ClientIdPRestrictions { get; set; } - - DbSet ClientCorsOrigins { get; set; } - - DbSet ClientProperties { get; set; } - - DbSet PersistedGrants { get; set; } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContext.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContext.cs deleted file mode 100644 index bda3957e37..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContext.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.Clients; -using Volo.Abp.IdentityServer.Grants; -using Volo.Abp.IdentityServer.IdentityResources; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore -{ - [ConnectionStringName("AbpIdentityServer")] - public class IdentityServerDbContext : AbpDbContext, IIdentityServerDbContext - { - public static string TablePrefix { get; set; } = AbpIdentityServerConsts.DefaultDbTablePrefix; - - public static string Schema { get; set; } = AbpIdentityServerConsts.DefaultDbSchema; - - public DbSet ApiResources { get; set; } - - public DbSet ApiSecrets { get; set; } - - public DbSet ApiResourceClaims { get; set; } - - public DbSet ApiScopes { get; set; } - - public DbSet ApiScopeClaims { get; set; } - - public DbSet IdentityResources { get; set; } - - public DbSet IdentityClaims { get; set; } - - public DbSet Clients { get; set; } - - public DbSet ClientGrantTypes { get; set; } - - public DbSet ClientRedirectUris { get; set; } - - public DbSet ClientPostLogoutRedirectUris { get; set; } - - public DbSet ClientScopes { get; set; } - - public DbSet ClientSecrets { get; set; } - - public DbSet ClientClaims { get; set; } - - public DbSet ClientIdPRestrictions { get; set; } - - public DbSet ClientCorsOrigins { get; set; } - - public DbSet ClientProperties { get; set; } - - public DbSet PersistedGrants { get; set; } - - public IdentityServerDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - builder.ConfigureIdentityServer(TablePrefix, Schema); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextFactory.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextFactory.cs deleted file mode 100644 index 28c9a38cec..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore -{ - /* This class is needed for EF Core command line tooling */ - - public class IdentityServerDbContextFactory : IDesignTimeDbContextFactory - { - public IdentityServerDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=AbpDesk;Trusted_Connection=True;"); - return new IdentityServerDbContext(builder.Options); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs deleted file mode 100644 index a6e9522919..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs +++ /dev/null @@ -1,228 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.Clients; -using Volo.Abp.IdentityServer.Grants; -using Volo.Abp.IdentityServer.IdentityResources; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore -{ - public static class IdentityServerDbContextModelCreatingExtensions - { - public static void ConfigureIdentityServer( - this ModelBuilder builder, - [CanBeNull] string tablePrefix = AbpIdentityServerConsts.DefaultDbTablePrefix, - [CanBeNull] string schema = AbpIdentityServerConsts.DefaultDbSchema) - { - Check.NotNull(builder, nameof(builder)); - - if (tablePrefix == null) - { - tablePrefix = ""; - } - - builder.Entity(client => - { - client.ToTable(tablePrefix + "Clients", schema); - - client.Property(x => x.ClientId).HasMaxLength(ClientConsts.ClientIdMaxLength).IsRequired(); - client.Property(x => x.ProtocolType).HasMaxLength(ClientConsts.ProtocolTypeMaxLength).IsRequired(); - client.Property(x => x.ClientName).HasMaxLength(ClientConsts.ClientNameMaxLength); - client.Property(x => x.ClientUri).HasMaxLength(ClientConsts.ClientUriMaxLength); - client.Property(x => x.LogoUri).HasMaxLength(ClientConsts.LogoUriMaxLength); - client.Property(x => x.Description).HasMaxLength(ClientConsts.DescriptionMaxLength); - client.Property(x => x.FrontChannelLogoutUri).HasMaxLength(ClientConsts.FrontChannelLogoutUriMaxLength); - client.Property(x => x.BackChannelLogoutUri).HasMaxLength(ClientConsts.BackChannelLogoutUriMaxLength); - client.Property(x => x.ClientClaimsPrefix).HasMaxLength(ClientConsts.ClientClaimsPrefixMaxLength); - client.Property(x => x.PairWiseSubjectSalt).HasMaxLength(ClientConsts.PairWiseSubjectSaltMaxLength); - - client.HasMany(x => x.AllowedScopes).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.ClientSecrets).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.AllowedGrantTypes).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.AllowedCorsOrigins).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.RedirectUris).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.PostLogoutRedirectUris).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.IdentityProviderRestrictions).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.Claims).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - client.HasMany(x => x.Properties).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); - - client.HasIndex(x => x.ClientId).IsUnique(); - }); - - builder.Entity(grantType => - { - grantType.ToTable(tablePrefix + "ClientGrantTypes", schema); - - grantType.HasKey(x => new { x.ClientId, x.GrantType }); - - grantType.Property(x => x.GrantType).HasMaxLength(ClientGrantTypeConsts.GrantTypeMaxLength).IsRequired(); - }); - - builder.Entity(redirectUri => - { - redirectUri.ToTable(tablePrefix + "ClientRedirectUris", schema); - - redirectUri.HasKey(x => new { x.ClientId, x.RedirectUri }); - - redirectUri.Property(x => x.RedirectUri).HasMaxLength(ClientRedirectUriConsts.RedirectUriMaxLength).IsRequired(); - }); - - builder.Entity(postLogoutRedirectUri => - { - postLogoutRedirectUri.ToTable(tablePrefix + "ClientPostLogoutRedirectUris", schema); - - postLogoutRedirectUri.HasKey(x => new { x.ClientId, x.PostLogoutRedirectUri }); - - postLogoutRedirectUri.Property(x => x.PostLogoutRedirectUri).HasMaxLength(ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLength).IsRequired(); - }); - - builder.Entity(scope => - { - scope.ToTable(tablePrefix + "ClientScopes", schema); - - scope.HasKey(x => new { x.ClientId, x.Scope }); - - scope.Property(x => x.Scope).HasMaxLength(ClientScopeConsts.ScopeMaxLength).IsRequired(); - }); - - builder.Entity(secret => - { - secret.ToTable(tablePrefix + "ClientSecrets", schema); - - secret.HasKey(x => new { x.ClientId, x.Type, x.Value }); - - secret.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired(); - secret.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired(); - secret.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength); - }); - - builder.Entity(claim => - { - claim.ToTable(tablePrefix + "ClientClaims", schema); - - claim.Property(x => x.Type).HasMaxLength(ClientClaimConsts.TypeMaxLength).IsRequired(); - claim.Property(x => x.Value).HasMaxLength(ClientClaimConsts.ValueMaxLength).IsRequired(); - }); - - builder.Entity(idPRestriction => - { - idPRestriction.ToTable(tablePrefix + "ClientIdPRestrictions", schema); - - idPRestriction.HasKey(x => new { x.ClientId, x.Provider }); - - idPRestriction.Property(x => x.Provider).HasMaxLength(ClientIdPRestrictionConsts.ProviderMaxLength).IsRequired(); - }); - - builder.Entity(corsOrigin => - { - corsOrigin.ToTable(tablePrefix + "ClientCorsOrigins", schema); - - corsOrigin.HasKey(x => new { x.ClientId, x.Origin }); - - corsOrigin.Property(x => x.Origin).HasMaxLength(ClientCorsOriginConsts.OriginMaxLength).IsRequired(); - }); - - builder.Entity(property => - { - property.ToTable(tablePrefix + "ClientProperties", schema); - - property.HasKey(x => new { x.ClientId, x.Key }); - - property.Property(x => x.Key).HasMaxLength(ClientPropertyConsts.KeyMaxLength).IsRequired(); - property.Property(x => x.Value).HasMaxLength(ClientPropertyConsts.ValueMaxLength).IsRequired(); - }); - - builder.Entity(grant => - { - grant.ToTable(tablePrefix + "PersistedGrants", schema); - - grant.Property(x => x.Key).HasMaxLength(PersistedGrantConsts.KeyMaxLength).ValueGeneratedNever(); - grant.Property(x => x.Type).HasMaxLength(PersistedGrantConsts.TypeMaxLength).IsRequired(); - grant.Property(x => x.SubjectId).HasMaxLength(PersistedGrantConsts.SubjectIdMaxLength); - grant.Property(x => x.ClientId).HasMaxLength(PersistedGrantConsts.ClientIdMaxLength).IsRequired(); - grant.Property(x => x.CreationTime).IsRequired(); - grant.Property(x => x.Data).IsRequired(); - - grant.HasKey(x => x.Key); //TODO: What about Id!!! - - grant.HasIndex(x => new { x.SubjectId, x.ClientId, x.Type }); - }); - - builder.Entity(identityResource => - { - identityResource.ToTable(tablePrefix + "IdentityResources", schema); - - identityResource.Property(x => x.Name).HasMaxLength(IdentityResourceConsts.NameMaxLength).IsRequired(); - identityResource.Property(x => x.DisplayName).HasMaxLength(IdentityResourceConsts.DisplayNameMaxLength); - identityResource.Property(x => x.Description).HasMaxLength(IdentityResourceConsts.DescriptionMaxLength); - - identityResource.HasMany(x => x.UserClaims).WithOne().HasForeignKey(x => x.IdentityResourceId).IsRequired(); - }); - - builder.Entity(claim => - { - claim.ToTable(tablePrefix + "IdentityClaims", schema); - - claim.HasKey(x => new { x.IdentityResourceId, x.Type }); - - claim.Property(x => x.Type).HasMaxLength(UserClaimConsts.TypeMaxLength).IsRequired(); - }); - - builder.Entity(apiResource => - { - apiResource.ToTable(tablePrefix + "ApiResources", schema); - - apiResource.Property(x => x.Name).HasMaxLength(ApiResourceConsts.NameMaxLength).IsRequired(); - apiResource.Property(x => x.DisplayName).HasMaxLength(ApiResourceConsts.DisplayNameMaxLength); - apiResource.Property(x => x.Description).HasMaxLength(ApiResourceConsts.DescriptionMaxLength); - - apiResource.HasMany(x => x.Secrets).WithOne().HasForeignKey(x => x.ApiResourceId).IsRequired(); - apiResource.HasMany(x => x.Scopes).WithOne().HasForeignKey(x => x.ApiResourceId).IsRequired(); - apiResource.HasMany(x => x.UserClaims).WithOne().HasForeignKey(x => x.ApiResourceId).IsRequired(); - }); - - builder.Entity(apiSecret => - { - apiSecret.ToTable(tablePrefix + "ApiSecrets", schema); - - apiSecret.HasKey(x => new { x.ApiResourceId, x.Type, x.Value }); - - apiSecret.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired(); - apiSecret.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired(); - apiSecret.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength); - }); - - builder.Entity(apiClaim => - { - apiClaim.ToTable(tablePrefix + "ApiClaims", schema); - - apiClaim.HasKey(x => new { x.ApiResourceId, x.Type }); - - apiClaim.Property(x => x.Type).HasMaxLength(UserClaimConsts.TypeMaxLength).IsRequired(); - }); - - builder.Entity(apiScope => - { - apiScope.ToTable(tablePrefix + "ApiScopes", schema); - - apiScope.HasKey(x => new { x.ApiResourceId, x.Name }); - - apiScope.Property(x => x.Name).HasMaxLength(ApiScopeConsts.NameMaxLength).IsRequired(); - apiScope.Property(x => x.DisplayName).HasMaxLength(ApiScopeConsts.DisplayNameMaxLength); - apiScope.Property(x => x.Description).HasMaxLength(ApiScopeConsts.DescriptionMaxLength); - - apiScope.HasMany(x => x.UserClaims).WithOne().HasForeignKey(x => new { x.ApiResourceId, x.Name }).IsRequired(); - }); - - builder.Entity(apiScopeClaim => - { - apiScopeClaim.ToTable(tablePrefix + "ApiScopeClaims", schema); - - apiScopeClaim.HasKey(x => new { x.ApiResourceId, x.Name, x.Type }); - - apiScopeClaim.Property(x => x.Type).HasMaxLength(UserClaimConsts.TypeMaxLength).IsRequired(); - apiScopeClaim.Property(x => x.Name).HasMaxLength(ApiScopeConsts.NameMaxLength).IsRequired(); - }); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/IdentityResourceRepository.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/IdentityResourceRepository.cs deleted file mode 100644 index 4be163bcd1..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/IdentityResourceRepository.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.EntityFrameworkCore; -using Volo.Abp.IdentityServer.IdentityResources; -using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; -using IdentityResource = Volo.Abp.IdentityServer.IdentityResources.IdentityResource; - -namespace Volo.Abp.IdentityServer -{ - //TODO: This is not true implementation! This repository works for 2 different aggregate root! - - public class IdentityResourceRepository : EfCoreRepository, IIdentityResourceRepository - { - public IdentityResourceRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - - } - - public virtual async Task> FindIdentityResourcesByScopeAsync(string[] scopeNames) - { - var query = from identityResource in DbSet.Include(x => x.UserClaims) - where scopeNames.Contains(identityResource.Name) - select identityResource; - - return await query.ToListAsync(); - } - - public virtual async Task> FindApiResourcesByScopeAsync(string[] scopeNames) - { - var query = from api in DbContext.ApiResources - where api.Scopes.Any(x => scopeNames.Contains(x.Name)) - select api; - - query = query - .Include(x => x.Secrets) - .Include(x => x.UserClaims) - .Include(x => x.Scopes) - .ThenInclude(s => s.UserClaims); - - return await query.ToListAsync(); - } - - public virtual async Task FindApiResourceAsync(string name) - { - var query = from apiResource in DbContext.ApiResources - where apiResource.Name == name - select apiResource; - - query = query - .Include(x => x.Secrets) - .Include(x => x.UserClaims) - .Include(x => x.Scopes) - .ThenInclude(s => s.UserClaims); - - return await query.FirstOrDefaultAsync(); - } - - public virtual async Task GetAllResourcesAsync() - { - var identity = DbContext.IdentityResources - .Include(x => x.UserClaims); - - var apis = DbContext.ApiResources - .Include(x => x.Secrets) - .Include(x => x.UserClaims) - .Include(x => x.Scopes) - .ThenInclude(s => s.UserClaims); - - return new ApiAndIdentityResources( - await identity.ToArrayAsync(), - await apis.ToArrayAsync() - ); - } - } -} diff --git a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/PersistedGrantRepository.cs b/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/PersistedGrantRepository.cs deleted file mode 100644 index e0cdcdc1bc..0000000000 --- a/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/PersistedGrantRepository.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.IdentityServer.EntityFrameworkCore; -using Volo.Abp.IdentityServer.Grants; - -namespace Volo.Abp.IdentityServer -{ - public class PersistentGrantRepository : EfCoreRepository, IPersistentGrantRepository - { - public PersistentGrantRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - - } - - public Task FindByKeyAsync(string key) - { - return DbSet.FirstOrDefaultAsync(x => x.Key == key); - } - - public Task> GetListBySubjectIdAsync(string subjectId) - { - return DbSet.Where(x => x.SubjectId == subjectId).ToListAsync(); - } - - public Task DeleteAsync(string subjectId, string clientId) - { - DbSet.RemoveRange( - DbSet.Where(x => x.SubjectId == subjectId && x.ClientId == clientId) - ); - - return Task.FromResult(0); - } - - public Task DeleteAsync(string subjectId, string clientId, string type) - { - DbSet.RemoveRange( - DbSet.Where(x => - x.SubjectId == subjectId && - x.ClientId == clientId && - x.Type == type) - ); - - return Task.FromResult(0); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo.Abp.MultiTenancy.Application.Contracts.csproj b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo.Abp.MultiTenancy.Application.Contracts.csproj deleted file mode 100644 index 7a27e4868b..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo.Abp.MultiTenancy.Application.Contracts.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.Application.Contracts - Volo.Abp.MultiTenancy.Application.Contracts - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationContractsModule.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationContractsModule.cs deleted file mode 100644 index b0932f56e4..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationContractsModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Application; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Modularity; - -namespace Volo.Abp.MultiTenancy -{ - [DependsOn(typeof(AbpDddApplicationModule))] - [DependsOn(typeof(AbpMultiTenancyDomainSharedModule))] - public class AbpMultiTenancyApplicationContractsModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.DefinitionProviders.Add(); - }); - - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/AbpTenantManagementPermissionDefinitionProvider.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/AbpTenantManagementPermissionDefinitionProvider.cs deleted file mode 100644 index 350eef8b0e..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/AbpTenantManagementPermissionDefinitionProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Volo.Abp.Authorization.Permissions; - -namespace Volo.Abp.MultiTenancy -{ - public class AbpTenantManagementPermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var identityGroup = context.AddGroup(TenantManagementPermissions.GroupName); - - var rolesPermission = identityGroup.AddPermission(TenantManagementPermissions.Tenants.Default); - rolesPermission.AddChild(TenantManagementPermissions.Tenants.Create); - rolesPermission.AddChild(TenantManagementPermissions.Tenants.Update); - rolesPermission.AddChild(TenantManagementPermissions.Tenants.Delete); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/GetTenantsInput.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/GetTenantsInput.cs deleted file mode 100644 index 97b8a95c9e..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/GetTenantsInput.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.MultiTenancy -{ - public class GetTenantsInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/ITenantAppService.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/ITenantAppService.cs deleted file mode 100644 index 0c6d2d109c..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/ITenantAppService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Volo.Abp.Application.Services; - -namespace Volo.Abp.MultiTenancy -{ - public interface ITenantAppService : IAsyncCrudAppService - { - //TODO: Manage connection strings - } -} diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantCreateDto.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantCreateDto.cs deleted file mode 100644 index 4cc17605f2..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantCreateDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.MultiTenancy -{ - public class TenantCreateDto : TenantCreateOrUpdateDtoBase - { - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantCreateOrUpdateDtoBase.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantCreateOrUpdateDtoBase.cs deleted file mode 100644 index 60e5320244..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantCreateOrUpdateDtoBase.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.MultiTenancy -{ - public abstract class TenantCreateOrUpdateDtoBase - { - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantDto.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantDto.cs deleted file mode 100644 index 3dfe2d486f..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantDto.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.MultiTenancy -{ - public class TenantDto : EntityDto - { - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantManagementPermissions.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantManagementPermissions.cs deleted file mode 100644 index 273e96b3f9..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantManagementPermissions.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Volo.Abp.MultiTenancy -{ - public static class TenantManagementPermissions - { - public const string GroupName = "AbpTenantManagement"; - - public static class Tenants - { - public const string Default = GroupName + ".Tenants"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantUpdateDto.cs b/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantUpdateDto.cs deleted file mode 100644 index db3485dd99..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application.Contracts/Volo/Abp/MultiTenancy/TenantUpdateDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.MultiTenancy -{ - public class TenantUpdateDto : TenantCreateOrUpdateDtoBase - { - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application/Volo.Abp.MultiTenancy.Application.csproj b/src/Volo.Abp.MultiTenancy.Application/Volo.Abp.MultiTenancy.Application.csproj deleted file mode 100644 index de2d691c9d..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application/Volo.Abp.MultiTenancy.Application.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.Application - Volo.Abp.MultiTenancy.Application - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationModule.cs b/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationModule.cs deleted file mode 100644 index 659eca6e47..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationModule.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; - -namespace Volo.Abp.MultiTenancy -{ - [DependsOn(typeof(AbpMultiTenancyDomainModule))] - [DependsOn(typeof(AbpMultiTenancyApplicationContractsModule))] - public class AbpMultiTenancyApplicationModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.AddProfile(validate: true); - }); - - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationModuleAutoMapperProfile.cs b/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationModuleAutoMapperProfile.cs deleted file mode 100644 index bc7174b256..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationModuleAutoMapperProfile.cs +++ /dev/null @@ -1,12 +0,0 @@ -using AutoMapper; - -namespace Volo.Abp.MultiTenancy -{ - public class AbpMultiTenancyApplicationModuleAutoMapperProfile : Profile - { - public AbpMultiTenancyApplicationModuleAutoMapperProfile() - { - CreateMap(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/MultiTenancyAppServiceBase.cs b/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/MultiTenancyAppServiceBase.cs deleted file mode 100644 index a9b7284c29..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/MultiTenancyAppServiceBase.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.Abp.Application.Services; - -namespace Volo.Abp.MultiTenancy -{ - public class MultiTenancyAppServiceBase : ApplicationService - { - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/TenantAppService.cs b/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/TenantAppService.cs deleted file mode 100644 index 3ebfe164c8..0000000000 --- a/src/Volo.Abp.MultiTenancy.Application/Volo/Abp/MultiTenancy/TenantAppService.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Volo.Abp.Application.Dtos; - -namespace Volo.Abp.MultiTenancy -{ - [Authorize(TenantManagementPermissions.Tenants.Default)] - public class TenantAppService : MultiTenancyAppServiceBase, ITenantAppService - { - private readonly ITenantRepository _tenantRepository; - private readonly ITenantManager _tenantManager; - - public TenantAppService(ITenantRepository tenantRepository, ITenantManager tenantManager) - { - _tenantRepository = tenantRepository; - _tenantManager = tenantManager; - } - - public async Task GetAsync(Guid id) - { - return ObjectMapper.Map( - await _tenantRepository.GetAsync(id) - ); - } - - public async Task> GetListAsync(GetTenantsInput input) - { - var count = await _tenantRepository.GetCountAsync(); - var list = await _tenantRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter); - - return new PagedResultDto( - count, - ObjectMapper.Map, List>(list) - ); - } - - [Authorize(TenantManagementPermissions.Tenants.Create)] - public async Task CreateAsync(TenantCreateDto input) - { - var tenant = await _tenantManager.CreateAsync(input.Name); - await _tenantRepository.InsertAsync(tenant); - return ObjectMapper.Map(tenant); - } - - [Authorize(TenantManagementPermissions.Tenants.Update)] - public async Task UpdateAsync(Guid id, TenantUpdateDto input) - { - var tenant = await _tenantRepository.GetAsync(id); - await _tenantManager.ChangeNameAsync(tenant, input.Name); - await _tenantRepository.UpdateAsync(tenant); - return ObjectMapper.Map(tenant); - } - - [Authorize(TenantManagementPermissions.Tenants.Delete)] - public async Task DeleteAsync(Guid id) - { - var tenant = await _tenantRepository.FindAsync(id); - if (tenant == null) - { - return; - } - - await _tenantRepository.DeleteAsync(tenant); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo.Abp.MultiTenancy.Domain.Shared.csproj b/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo.Abp.MultiTenancy.Domain.Shared.csproj deleted file mode 100644 index b70a0623dd..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo.Abp.MultiTenancy.Domain.Shared.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.Domain.Shared - Volo.Abp.MultiTenancy.Domain.Shared - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainSharedModule.cs b/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainSharedModule.cs deleted file mode 100644 index 5417f21b69..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainSharedModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.MultiTenancy -{ - public class AbpMultiTenancyDomainSharedModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/TenantConnectionStringConsts.cs b/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/TenantConnectionStringConsts.cs deleted file mode 100644 index a1e00a97fa..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/TenantConnectionStringConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.MultiTenancy -{ - public static class TenantConnectionStringConsts - { - public const int MaxNameLength = 128; - - public const int MaxValueLength = 1024; - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/TenantConsts.cs b/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/TenantConsts.cs deleted file mode 100644 index cfffa5cc25..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain.Shared/Volo/Abp/MultiTenancy/TenantConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.MultiTenancy -{ - public static class TenantConsts - { - public const int MaxNameLength = 64; - } -} diff --git a/src/Volo.Abp.MultiTenancy.Domain/Properties/AssemblyInfo.cs b/src/Volo.Abp.MultiTenancy.Domain/Properties/AssemblyInfo.cs deleted file mode 100644 index e5d9e9a707..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.MultiTenancy")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("58fa9f8f-216d-4c93-8929-d40d22b11ca7")] diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo.Abp.MultiTenancy.Domain.csproj b/src/Volo.Abp.MultiTenancy.Domain/Volo.Abp.MultiTenancy.Domain.csproj deleted file mode 100644 index a5f9ab113d..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo.Abp.MultiTenancy.Domain.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.Domain - Volo.Abp.MultiTenancy.Domain - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo.Abp.MultiTenancy.Domain.csproj.DotSettings b/src/Volo.Abp.MultiTenancy.Domain/Volo.Abp.MultiTenancy.Domain.csproj.DotSettings deleted file mode 100644 index 58ad6c8854..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo.Abp.MultiTenancy.Domain.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp71 \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyConsts.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyConsts.cs deleted file mode 100644 index fa51bb3525..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.MultiTenancy -{ - public static class AbpMultiTenancyConsts - { - public const string DefaultDbTablePrefix = "Mt"; - - public const string DefaultDbSchema = null; - } -} diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainMappingProfile.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainMappingProfile.cs deleted file mode 100644 index 9c38155721..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainMappingProfile.cs +++ /dev/null @@ -1,27 +0,0 @@ -using AutoMapper; -using Volo.Abp.Data; - -namespace Volo.Abp.MultiTenancy -{ - public class AbpMultiTenancyDomainMappingProfile : Profile - { - public AbpMultiTenancyDomainMappingProfile() - { - CreateMap() - .ForMember(ti => ti.ConnectionStrings, opts => - { - opts.ResolveUsing(tenant => - { - var connStrings = new ConnectionStrings(); - - foreach (var connectionString in tenant.ConnectionStrings) - { - connStrings[connectionString.Name] = connectionString.Value; - } - - return connStrings; - }); - }); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainModule.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainModule.cs deleted file mode 100644 index 8356754468..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/AbpMultiTenancyDomainModule.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Data; -using Volo.Abp.Domain; -using Volo.Abp.Modularity; -using Volo.Abp.Ui; - -namespace Volo.Abp.MultiTenancy -{ - [DependsOn(typeof(AbpMultiTenancyAbstractionsModule))] - [DependsOn(typeof(AbpMultiTenancyDomainSharedModule))] - [DependsOn(typeof(AbpDataModule))] - [DependsOn(typeof(AbpDddDomainModule))] - [DependsOn(typeof(AbpAutoMapperModule))] - [DependsOn(typeof(AbpUiModule))] //TODO: It's not good to depend on the UI module. However, UserFriendlyException is inside it! - public class AbpMultiTenancyDomainModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.AddProfile(validate: true); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantManager.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantManager.cs deleted file mode 100644 index 595c3e993e..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantManager.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Domain.Services; - -namespace Volo.Abp.MultiTenancy -{ - public interface ITenantManager : IDomainService - { - [NotNull] - Task CreateAsync([NotNull] string name); - - Task ChangeNameAsync([NotNull] Tenant tenant, [NotNull] string name); - } -} diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantRepository.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantRepository.cs deleted file mode 100644 index e574a72be7..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantRepository.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.MultiTenancy -{ - public interface ITenantRepository : IBasicRepository - { - Task FindByNameAsync(string name, CancellationToken cancellationToken = default); - - Task FindByNameIncludeDetailsAsync(string name, CancellationToken cancellationToken = default); - - Task FindWithIncludeDetailsAsync(Guid id, CancellationToken cancellationToken = default); - - Task GetCountAsync(CancellationToken cancellationToken = default); - - Task> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter, CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/Tenant.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/Tenant.cs deleted file mode 100644 index 0d5573adfb..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/Tenant.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.MultiTenancy -{ - public class Tenant : AggregateRoot - { - public virtual string Name { get; protected set; } - - public virtual List ConnectionStrings { get; protected set; } - - protected Tenant() - { - - } - - protected internal Tenant(Guid id, [NotNull] string name) - { - Check.NotNull(name, nameof(name)); - - Id = id; - Name = name; - - ConnectionStrings = new List(); - } - - [CanBeNull] - public virtual string FindDefaultConnectionString() - { - return FindConnectionString(Data.ConnectionStrings.DefaultConnectionStringName); - } - - [CanBeNull] - public virtual string FindConnectionString(string name) - { - return ConnectionStrings.FirstOrDefault(c => c.Name == name)?.Value; - } - - internal void SetName([NotNull] string name) - { - Check.NotNull(name, nameof(name)); - - Name = name; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantConnectionString.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantConnectionString.cs deleted file mode 100644 index 4be2075df7..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantConnectionString.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.MultiTenancy -{ - public class TenantConnectionString : Entity - { - public virtual Guid TenantId { get; protected set; } - - public virtual string Name { get; protected set; } - - public virtual string Value { get; protected set; } - - protected TenantConnectionString() - { - - } - - public TenantConnectionString(Guid tenantId, [NotNull] string name, [NotNull] string value) - { - Check.NotNull(name, nameof(name)); - Check.NotNull(value, nameof(value)); - - TenantId = tenantId; - Name = name; - Value = value; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantManager.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantManager.cs deleted file mode 100644 index 5a187c7c85..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantManager.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.Domain.Services; -using Volo.Abp.Ui; - -namespace Volo.Abp.MultiTenancy -{ - public class TenantManager : DomainService, ITenantManager - { - private readonly ITenantRepository _tenantRepository; - - public TenantManager(ITenantRepository tenantRepository) - { - _tenantRepository = tenantRepository; - } - - public async Task CreateAsync(string name) - { - Check.NotNull(name, nameof(name)); - - await ValidateNameAsync(name); - return new Tenant(GuidGenerator.Create(), name); - } - - public async Task ChangeNameAsync(Tenant tenant, string name) - { - Check.NotNull(tenant, nameof(tenant)); - Check.NotNull(name, nameof(name)); - - await ValidateNameAsync(name, tenant.Id); - tenant.SetName(name); - } - - protected virtual async Task ValidateNameAsync(string name, Guid? expectedId = null) - { - var tenant = await _tenantRepository.FindByNameAsync(name); - if (tenant != null && tenant.Id != expectedId) - { - throw new UserFriendlyException("Duplicate tenancy name: " + name); //TODO: A domain exception would be better..? - } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantStore.cs b/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantStore.cs deleted file mode 100644 index 576a2e8687..0000000000 --- a/src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/TenantStore.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.ObjectMapping; - -namespace Volo.Abp.MultiTenancy -{ - //TODO: This class should use caching instead of querying everytime! - - public class TenantStore : ITenantStore, ITransientDependency - { - private readonly ITenantRepository _tenantRepository; - private readonly IObjectMapper _objectMapper; - private readonly ICurrentTenant _currentTenant; - - public TenantStore( - ITenantRepository tenantRepository, - IObjectMapper objectMapper, - ICurrentTenant currentTenant) - { - _tenantRepository = tenantRepository; - _objectMapper = objectMapper; - _currentTenant = currentTenant; - } - - public async Task FindAsync(string name) - { - using (_currentTenant.Clear()) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! - { - var tenant = await _tenantRepository.FindByNameIncludeDetailsAsync(name); - if (tenant == null) - { - return null; - } - - return _objectMapper.Map(tenant); - } - } - - public async Task FindAsync(Guid id) - { - using (_currentTenant.Clear()) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! - { - var tenant = await _tenantRepository.FindWithIncludeDetailsAsync(id); - if (tenant == null) - { - return null; - } - - return _objectMapper.Map(tenant); - } - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj deleted file mode 100644 index 58d4cbb8f2..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.EntityFrameworkCore - Volo.Abp.MultiTenancy.EntityFrameworkCore - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj.DotSettings b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj.DotSettings deleted file mode 100644 index 58ad6c8854..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp71 \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EfCoreTenantRepository.cs b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EfCoreTenantRepository.cs deleted file mode 100644 index 42a225d86d..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EfCoreTenantRepository.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Dynamic.Core; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; - -namespace Volo.Abp.MultiTenancy -{ - public class EfCoreTenantRepository : EfCoreRepository, ITenantRepository - { - public EfCoreTenantRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - - } - - public virtual async Task FindByNameAsync(string name, CancellationToken cancellationToken = default) - { - return await DbSet - .FirstOrDefaultAsync(t => t.Name == name, cancellationToken); - } - - public virtual async Task FindByNameIncludeDetailsAsync(string name, CancellationToken cancellationToken = default) - { - return await DbSet - .Include(t => t.ConnectionStrings) //TODO: Why not creating a virtual Include method in EfCoreRepository and override to add included properties to be available for every query..? - .FirstOrDefaultAsync(t => t.Name == name, cancellationToken); - } - - public virtual async Task FindWithIncludeDetailsAsync(Guid id, CancellationToken cancellationToken = default) - { - return await DbSet - .Include(t => t.ConnectionStrings) - .FirstOrDefaultAsync(t => t.Id == id, cancellationToken); - } - - public virtual async Task GetCountAsync(CancellationToken cancellationToken = default) - { - return await DbSet.LongCountAsync(cancellationToken); - } - - public virtual async Task> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter, CancellationToken cancellationToken = default) - { - return await this.WhereIf( - !filter.IsNullOrWhiteSpace(), - u => - u.Name.Contains(filter) - ) - .OrderBy(sorting ?? nameof(Tenant.Name)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(cancellationToken); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/AbpMultiTenancyEntityFrameworkCoreModule.cs b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/AbpMultiTenancyEntityFrameworkCoreModule.cs deleted file mode 100644 index 7a310864d8..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/AbpMultiTenancyEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace Volo.Abp.MultiTenancy.EntityFrameworkCore -{ - [DependsOn(typeof(AbpMultiTenancyDomainModule))] - [DependsOn(typeof(AbpEntityFrameworkCoreModule))] - public class AbpMultiTenancyEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/IMultiTenancyDbContext.cs b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/IMultiTenancyDbContext.cs deleted file mode 100644 index eb6898e06b..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/IMultiTenancyDbContext.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.MultiTenancy.EntityFrameworkCore -{ - [ConnectionStringName("AbpMultiTenancy")] - public interface IMultiTenancyDbContext : IEfCoreDbContext - { - DbSet Tenants { get; set; } - - DbSet TenantConnectionStrings { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/IdentityDbContextFactory.cs b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/IdentityDbContextFactory.cs deleted file mode 100644 index 49eeeba973..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/IdentityDbContextFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace Volo.Abp.MultiTenancy.EntityFrameworkCore -{ - /* This class is needed for EF Core command line tooling */ - - public class MultiTenancyDbContextFactory : IDesignTimeDbContextFactory - { - public MultiTenancyDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=AbpDesk;Trusted_Connection=True;"); - return new MultiTenancyDbContext(builder.Options); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/MultiTenancyDbContext.cs b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/MultiTenancyDbContext.cs deleted file mode 100644 index 3353030a38..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/MultiTenancyDbContext.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.MultiTenancy.EntityFrameworkCore -{ - [ConnectionStringName("AbpMultiTenancy")] - public class MultiTenancyDbContext : AbpDbContext, IMultiTenancyDbContext - { - public static string TablePrefix { get; set; } = AbpMultiTenancyConsts.DefaultDbTablePrefix; - - public static string Schema { get; set; } = AbpMultiTenancyConsts.DefaultDbSchema; - - public DbSet Tenants { get; set; } - - public DbSet TenantConnectionStrings { get; set; } - - public MultiTenancyDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - - builder.ConfigureMultiTenancy(TablePrefix, Schema); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/MultiTenancyDbContextModelCreatingExtensions.cs b/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/MultiTenancyDbContextModelCreatingExtensions.cs deleted file mode 100644 index 330b75782a..0000000000 --- a/src/Volo.Abp.MultiTenancy.EntityFrameworkCore/Volo/Abp/MultiTenancy/EntityFrameworkCore/MultiTenancyDbContextModelCreatingExtensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Volo.Abp.MultiTenancy.EntityFrameworkCore -{ - public static class MultiTenancyDbContextModelCreatingExtensions - { - public static void ConfigureMultiTenancy( - this ModelBuilder builder, - [CanBeNull]string tablePrefix = AbpMultiTenancyConsts.DefaultDbTablePrefix, - [CanBeNull] string schema = AbpMultiTenancyConsts.DefaultDbSchema) - { - Check.NotNull(builder, nameof(builder)); - - if (tablePrefix == null) - { - tablePrefix = ""; - } - - builder.Entity(b => - { - b.ToTable(tablePrefix + "Tenants", schema); - - b.Property(t => t.Name).IsRequired().HasMaxLength(TenantConsts.MaxNameLength); - - b.HasMany(u => u.ConnectionStrings).WithOne().HasForeignKey(uc => uc.TenantId).IsRequired(); - - b.HasIndex(u => u.Name).IsUnique(); - }); - - builder.Entity(b => - { - b.ToTable(tablePrefix + "TenantConnectionStrings", schema); - - b.HasKey(x => new { x.TenantId, x.Name }); - - b.Property(cs => cs.Name).IsRequired().HasMaxLength(TenantConnectionStringConsts.MaxNameLength); - b.Property(cs => cs.Value).IsRequired().HasMaxLength(TenantConnectionStringConsts.MaxValueLength); - }); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.HttpApi.Client/Volo.Abp.MultiTenancy.HttpApi.Client.csproj b/src/Volo.Abp.MultiTenancy.HttpApi.Client/Volo.Abp.MultiTenancy.HttpApi.Client.csproj deleted file mode 100644 index 41ae02d02f..0000000000 --- a/src/Volo.Abp.MultiTenancy.HttpApi.Client/Volo.Abp.MultiTenancy.HttpApi.Client.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.HttpApi.Client - Volo.Abp.MultiTenancy.HttpApi.Client - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.HttpApi.Client/Volo/Abp/MultiTenancy/AbpMultiTenancyHttpApiClientModule.cs b/src/Volo.Abp.MultiTenancy.HttpApi.Client/Volo/Abp/MultiTenancy/AbpMultiTenancyHttpApiClientModule.cs deleted file mode 100644 index 19f1890927..0000000000 --- a/src/Volo.Abp.MultiTenancy.HttpApi.Client/Volo/Abp/MultiTenancy/AbpMultiTenancyHttpApiClientModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Http.Client; -using Volo.Abp.Modularity; - -namespace Volo.Abp.MultiTenancy -{ - [DependsOn(typeof(AbpMultiTenancyApplicationContractsModule), typeof(AbpHttpClientModule))] - public class AbpMultiTenancyHttpApiClientModule : AbpModule - { - public const string RemoteServiceName = "AbpMultiTenancy"; - - public override void ConfigureServices(IServiceCollection services) - { - services.AddHttpClientProxies( - typeof(AbpMultiTenancyApplicationContractsModule).Assembly, - RemoteServiceName - ); - - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.HttpApi/Volo.Abp.MultiTenancy.HttpApi.csproj b/src/Volo.Abp.MultiTenancy.HttpApi/Volo.Abp.MultiTenancy.HttpApi.csproj deleted file mode 100644 index 0d5156c7c8..0000000000 --- a/src/Volo.Abp.MultiTenancy.HttpApi/Volo.Abp.MultiTenancy.HttpApi.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.HttpApi - Volo.Abp.MultiTenancy.HttpApi - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/AbpMultiTenancyHttpApiModule.cs b/src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/AbpMultiTenancyHttpApiModule.cs deleted file mode 100644 index 382d92930c..0000000000 --- a/src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/AbpMultiTenancyHttpApiModule.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Modularity; - -namespace Volo.Abp.MultiTenancy -{ - [DependsOn(typeof(AbpMultiTenancyApplicationContractsModule), typeof(AbpAspNetCoreMvcModule))] - public class AbpMultiTenancyHttpApiModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/TenantController.cs b/src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/TenantController.cs deleted file mode 100644 index 8963cf2cf7..0000000000 --- a/src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/TenantController.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.MultiTenancy -{ - [Controller] - [RemoteService] - [Area("multi-tenancy")] - public class TenantController : ITenantAppService, ITransientDependency //TODO: Throws exception on validation if we inherit from Controller - { - private readonly ITenantAppService _service; - - public TenantController(ITenantAppService service) - { - _service = service; - } - - public virtual Task GetAsync(Guid id) - { - return _service.GetAsync(id); - } - - public virtual Task> GetListAsync(GetTenantsInput input) - { - return _service.GetListAsync(input); - } - - public virtual Task CreateAsync(TenantCreateDto input) - { - return _service.CreateAsync(input); - } - - public virtual Task UpdateAsync(Guid id, TenantUpdateDto input) - { - return _service.UpdateAsync(id, input); - } - - public virtual Task DeleteAsync(Guid id) - { - return _service.DeleteAsync(id); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebAutoMapperProfile.cs b/src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebAutoMapperProfile.cs deleted file mode 100644 index 52c47012bb..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebAutoMapperProfile.cs +++ /dev/null @@ -1,25 +0,0 @@ -using AutoMapper; -using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants; - -namespace Volo.Abp.MultiTenancy.Web -{ - public class AbpMultiTenancyWebAutoMapperProfile : Profile - { - public AbpMultiTenancyWebAutoMapperProfile() - { - CreateRoleMappings(); - } - - private void CreateRoleMappings() - { - //List - CreateMap(); - - //CreateModal - CreateMap(); - - //EditModal - CreateMap(); - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebModule.cs b/src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebModule.cs deleted file mode 100644 index ded1b2f2c3..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebModule.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; -using Volo.Abp.AutoMapper; -using Volo.Abp.Localization; -using Volo.Abp.Modularity; -using Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy; -using Volo.Abp.MultiTenancy.Web.Navigation; -using Volo.Abp.Ui.Navigation; -using Volo.Abp.VirtualFileSystem; - -namespace Volo.Abp.MultiTenancy.Web -{ - [DependsOn(typeof(AbpMultiTenancyHttpApiModule))] - [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] - [DependsOn(typeof(AbpAutoMapperModule))] - public class AbpMultiTenancyWebModule : AbpModule - { - public override void PreConfigureServices(IServiceCollection services) - { - services.PreConfigure(options => - { - options.AddAssemblyResource(typeof(AbpMultiTenancyResource)); - }); - } - - public override void ConfigureServices(IServiceCollection services) - { - services.Configure(options => - { - options.MenuContributors.Add(new AbpMultiTenancyWebMainMenuContributor()); - }); - - services.Configure(options => - { - options.FileSets.AddEmbedded("Volo.Abp.MultiTenancy.Web"); - }); - - services.Configure(options => - { - options.Resources.AddVirtualJson("en", "/Localization/Resources/AbpMultiTenancy"); - }); - - services.Configure(options => - { - options.AddProfile(validate: true); - }); - - services.Configure(options => - { - options.Conventions.AuthorizePage("/MultiTenancy/Tenants/Index", TenantManagementPermissions.Tenants.Default); - options.Conventions.AuthorizePage("/MultiTenancy/Tenants/CreateModal", TenantManagementPermissions.Tenants.Create); - options.Conventions.AuthorizePage("/MultiTenancy/Tenants/EditModal", TenantManagementPermissions.Tenants.Update); - }); - - services.AddAssemblyOf(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/AbpMultiTenancyResource.cs b/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/AbpMultiTenancyResource.cs deleted file mode 100644 index 80329739bd..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/AbpMultiTenancyResource.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Localization.Resources.AbpBootstrap; -using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; - -namespace Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy -{ - [InheritResource( - typeof(AbpValidationResource), - typeof(AbpBootstrapResource))] - [ShortLocalizationResourceName("AbpMultiTenancy")] - public class AbpMultiTenancyResource - { - - } -} diff --git a/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/en.json b/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/en.json deleted file mode 100644 index 7cbdcd8494..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/en.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "culture": "en", - "texts": { - "Tenants": "Tenants", - "NewTenant": "New tenant", - "TenantName": "Tenant name", - "TenantDeletionConfirmationMessage": "Tenant '{0}' will be deleted. Do you confirm that?" - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/tr.json b/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/tr.json deleted file mode 100644 index 6c8cd12915..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/tr.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "tr", - "texts": { - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Navigation/AbpIdentityWebMainMenuContributor.cs b/src/Volo.Abp.MultiTenancy.Web/Navigation/AbpIdentityWebMainMenuContributor.cs deleted file mode 100644 index a1177dd623..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Navigation/AbpIdentityWebMainMenuContributor.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Ui.Navigation; - -namespace Volo.Abp.MultiTenancy.Web.Navigation -{ - public class AbpMultiTenancyWebMainMenuContributor : IMenuContributor - { - public Task ConfigureMenuAsync(MenuConfigurationContext context) - { - if (context.Menu.Name != StandardMenus.Main) - { - return Task.CompletedTask; - } - - context.Menu - .AddItem( - new ApplicationMenuItem("MultiTenancy", "MultiTenancy") - .AddItem(new ApplicationMenuItem("Tenants", "Tenants", url: "/MultiTenancy/Tenants")) - ); - - return Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml b/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml deleted file mode 100644 index ef28fb606e..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml +++ /dev/null @@ -1,33 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy -@using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants -@model CreateModalModel -@inject IStringLocalizer L -@{ - Layout = null; -} - -
    - - - - - - - -
    - - - -
    - -
    - -
    - - - -
    - -
    diff --git a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml.cs b/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml.cs deleted file mode 100644 index d64f3641ed..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants -{ - public class CreateModalModel : AbpPageModel - { - [BindProperty] - public TenantInfoModel TenantModel { get; set; } - - private readonly ITenantAppService _tenantAppService; - - public CreateModalModel(ITenantAppService tenantAppService) - { - _tenantAppService = tenantAppService; - } - - public async Task OnPostAsync() - { - ValidateModel(); - - var input = ObjectMapper.Map(TenantModel); - await _tenantAppService.CreateAsync(input); - - return NoContent(); - } - - public class TenantInfoModel - { - [Required] - [StringLength(TenantConsts.MaxNameLength)] - [Display(Name = "TenantName")] - public string Name { get; set; } - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml b/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml deleted file mode 100644 index 97d9c9d4eb..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml +++ /dev/null @@ -1,35 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy -@using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants -@model EditModalModel -@inject IStringLocalizer L -@{ - Layout = null; -} - -
    - - - - - - - - - -
    - - - -
    - -
    - -
    - - - -
    - -
    \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml.cs b/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml.cs deleted file mode 100644 index 499cb6377b..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants -{ - public class EditModalModel : AbpPageModel - { - [BindProperty] - public TenantInfoModel TenantInfo { get; set; } - - private readonly ITenantAppService _tenantAppService; - - public EditModalModel(ITenantAppService tenantAppService) - { - _tenantAppService = tenantAppService; - } - - public async Task OnGetAsync(Guid id) - { - TenantInfo = ObjectMapper.Map( - await _tenantAppService.GetAsync(id) - ); - } - - public async Task OnPostAsync() - { - ValidateModel(); - - var input = ObjectMapper.Map(TenantInfo); - await _tenantAppService.UpdateAsync(TenantInfo.Id, input); - - return NoContent(); - } - - public class TenantInfoModel - { - [HiddenInput] - public Guid Id { get; set; } - - [Required] - [StringLength(TenantConsts.MaxNameLength)] - [Display(Name = "TenantName")] - public string Name { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml b/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml deleted file mode 100644 index 121aa93333..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@page -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy -@using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants -@model IndexModel -@{ -} -@inject IHtmlLocalizer L -@section styles { - -} - -@section scripts { - - - - - -} - - - -
    -
    -

    @L["Tenants"]

    -
    -
    - -
    -
    -
    - - - - - - - - -
    @L["Actions"]@L["TenantName"]
    -
    -
    \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml.cs b/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml.cs deleted file mode 100644 index f064c45145..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants -{ - public class IndexModel : PageModel - { - public void OnGet() - { - - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/_ViewImports.cshtml b/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/_ViewImports.cshtml deleted file mode 100644 index d1ac64721f..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Properties/launchSettings.json b/src/Volo.Abp.MultiTenancy.Web/Properties/launchSettings.json deleted file mode 100644 index 81ae15bd19..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:62977/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.MultiTenancy.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:62978/" - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/Volo.Abp.MultiTenancy.Web.csproj b/src/Volo.Abp.MultiTenancy.Web/Volo.Abp.MultiTenancy.Web.csproj deleted file mode 100644 index 570ca885c1..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/Volo.Abp.MultiTenancy.Web.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.MultiTenancy.Web - Volo.Abp.MultiTenancy.Web - true - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - Library - - - - - - - - - - - - - - - diff --git a/src/Volo.Abp.MultiTenancy.Web/compilerconfig.json b/src/Volo.Abp.MultiTenancy.Web/compilerconfig.json deleted file mode 100644 index 3104320327..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/compilerconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "outputFile": "wwwroot/modules/multi-tenancy/views/tenants/index.css", - "inputFile": "wwwroot/modules/multi-tenancy/views/tenants/index.less" - } -] \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/compilerconfig.json.defaults b/src/Volo.Abp.MultiTenancy.Web/compilerconfig.json.defaults deleted file mode 100644 index c75eb7d519..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/compilerconfig.json.defaults +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilers": { - "less": { - "autoPrefix": "", - "cssComb": "none", - "ieCompat": true, - "strictMath": false, - "strictUnits": false, - "relativeUrls": true, - "rootPath": "", - "sourceMapRoot": "", - "sourceMapBasePath": "", - "sourceMap": false - }, - "sass": { - "includePath": "", - "indentType": "space", - "indentWidth": 2, - "outputStyle": "nested", - "Precision": 5, - "relativeUrls": true, - "sourceMapRoot": "", - "sourceMap": false - }, - "stylus": { - "sourceMap": false - }, - "babel": { - "sourceMap": false - }, - "coffeescript": { - "bare": false, - "runtimeMode": "node", - "sourceMap": false - } - }, - "minifiers": { - "css": { - "enabled": true, - "termSemicolons": true, - "gzip": false - }, - "javascript": { - "enabled": true, - "termSemicolons": true, - "gzip": false - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.css b/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.css deleted file mode 100644 index 41fbd4eaf0..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.css +++ /dev/null @@ -1,21 +0,0 @@ -.dataTable { - width: 100% !important; - border-spacing: 0 !important; -} -.table td, -.table th { - padding: 8px 10px; -} -.dataTable tbody tr td button { - cursor: pointer; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li { - cursor: pointer; - padding: 5px; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li a { - display: block; -} -.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover { - background: #f4f5f8; -} \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.js b/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.js deleted file mode 100644 index bc6107abbc..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -$(function () { - $('#IdentityUsersTable').DataTable(); -}); - diff --git a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.min.js b/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.min.js deleted file mode 100644 index 9a2c19267e..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";$(function(){$("#IdentityUsersTable").DataTable()}); \ No newline at end of file diff --git a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.js b/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.js deleted file mode 100644 index 95b253fea6..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.js +++ /dev/null @@ -1,84 +0,0 @@ -(function () { - - var l = abp.localization.getResource('AbpMultiTenancy'); - var _tenantAppService = volo.abp.multiTenancy.tenant; - - var _editModal = new abp.ModalManager(abp.appPath + 'MultiTenancy/Tenants/EditModal'); - var _createModal = new abp.ModalManager(abp.appPath + 'MultiTenancy/Tenants/CreateModal'); - - var app = new Vue({ - el: '#TenantsWrapper', - methods: { - openCreateModal: function () { - _createModal.open(); - } - } - }); - - $(function () { - - var _$wrapper = $('#TenantsWrapper'); - var _$table = _$wrapper.find('table'); - - var _dataTable = _$table.DataTable({ - order: [[1, "asc"]], - ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), - columnDefs: [ - { - //TODO: Can we eleminate targets, data, orderable, autoWidth, defaultContent fields or make these values default - targets: 0, - data: null, - orderable: false, - autoWidth: false, - defaultContent: '', - rowAction: { - text: ' ' + l('Actions') + ' ', //TODO: Add icon option and set text as only l('Actions') - items: - [ - { - //TODO: Allow to add icon - text: l('Edit'), - visible: function () { //TODO: Allow visible to be a boolean for simple cases - return true; - }, - action: function (data) { - _editModal.open({ - id: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: function () { - return true; - }, - action: function (data) { - if (confirm(l('TenantDeletionConfirmationMessage', data.record.name))) { - _tenantAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - } - } - ] - } - }, - { - targets: 1, - data: "name" - } - ] - }); - - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - }); - -})(); diff --git a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.less b/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.less deleted file mode 100644 index 21adf56097..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.less +++ /dev/null @@ -1,39 +0,0 @@ -//TODO: This code is duplicated for other pages too. Unify them. -.dataTable { - width: 100% !important; - border-spacing: 0 !important; -} - -.table td, .table th { - padding: 8px 10px; -} - -.dataTable { - tbody { - tr { - td { - - button { - cursor: pointer; - } - - div.dropdown { - ul.dropdown-menu { - li { - cursor: pointer; - padding: 5px; - - a { - display: block; - } - } - - li:hover { - background: #f4f5f8; - } - } - } - } - } - } -} diff --git a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.min.css b/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.min.css deleted file mode 100644 index e70b9e330b..0000000000 --- a/src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.min.css +++ /dev/null @@ -1 +0,0 @@ -.dataTable{width:100% !important;border-spacing:0 !important;}.table td,.table th{padding:8px 10px;}.dataTable tbody tr td button{cursor:pointer;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer;padding:5px;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li a{display:block;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover{background:#f4f5f8;} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo.Abp.Permissions.Application.Contracts.csproj b/src/Volo.Abp.Permissions.Application.Contracts/Volo.Abp.Permissions.Application.Contracts.csproj deleted file mode 100644 index 646c154703..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo.Abp.Permissions.Application.Contracts.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Permissions.Application.Contracts - Volo.Abp.Permissions.Application.Contracts - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/AbpPermissionsApplicationContractsModule.cs b/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/AbpPermissionsApplicationContractsModule.cs deleted file mode 100644 index 818d496083..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/AbpPermissionsApplicationContractsModule.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Application; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Permissions -{ - [DependsOn(typeof(AbpDddApplicationModule))] - [DependsOn(typeof(AbpPermissionsDomainSharedModule))] - public class AbpPermissionsApplicationContractsModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/GetPermissionListResultDto.cs b/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/GetPermissionListResultDto.cs deleted file mode 100644 index f062d93a9f..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/GetPermissionListResultDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace Volo.Abp.Permissions -{ - public class GetPermissionListResultDto - { - public List Groups { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/PermissionGrantInfoDto.cs b/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/PermissionGrantInfoDto.cs deleted file mode 100644 index 48258908ce..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/PermissionGrantInfoDto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; - -namespace Volo.Abp.Permissions -{ - public class PermissionGrantInfoDto - { - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string ParentName { get; set; } - - public bool IsGranted { get; set; } - - public List Providers { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/PermissionGroupDto.cs b/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/PermissionGroupDto.cs deleted file mode 100644 index f1acf1738c..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/PermissionGroupDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; - -namespace Volo.Abp.Permissions -{ - public class PermissionGroupDto - { - public string Name { get; set; } - - public string DisplayName { get; set; } - - public List Permissions { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/ProviderInfoDto.cs b/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/ProviderInfoDto.cs deleted file mode 100644 index d66d88d1a5..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/ProviderInfoDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Permissions -{ - public class ProviderInfoDto - { - public string ProviderName { get; set; } - - public string ProviderKey { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/UpdatePermissionDto.cs b/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/UpdatePermissionDto.cs deleted file mode 100644 index 5c04577d0a..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/UpdatePermissionDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Permissions -{ - public class UpdatePermissionDto - { - public string Name { get; set; } - - public bool IsGranted { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/UpdatePermissionsDto.cs b/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/UpdatePermissionsDto.cs deleted file mode 100644 index 99cdd62e87..0000000000 --- a/src/Volo.Abp.Permissions.Application.Contracts/Volo/Abp/Permissions/UpdatePermissionsDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.Permissions -{ - public class UpdatePermissionsDto - { - public UpdatePermissionDto[] Permissions { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Application/Volo.Abp.Permissions.Application.csproj b/src/Volo.Abp.Permissions.Application/Volo.Abp.Permissions.Application.csproj deleted file mode 100644 index f520634eac..0000000000 --- a/src/Volo.Abp.Permissions.Application/Volo.Abp.Permissions.Application.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Permissions.Application - Volo.Abp.Permissions.Application - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - diff --git a/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/AbpPermissionsApplicationModule.cs b/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/AbpPermissionsApplicationModule.cs deleted file mode 100644 index 7622b7eb5d..0000000000 --- a/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/AbpPermissionsApplicationModule.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Permissions -{ - [DependsOn(typeof(AbpPermissionsDomainModule))] - [DependsOn(typeof(AbpPermissionsApplicationContractsModule))] - public class AbpPermissionsApplicationModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/IPermissionAppServiceHelper.cs b/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/IPermissionAppServiceHelper.cs deleted file mode 100644 index 2a26b00bee..0000000000 --- a/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/IPermissionAppServiceHelper.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using JetBrains.Annotations; - -namespace Volo.Abp.Permissions -{ - public interface IPermissionAppServiceHelper - { - Task GetAsync([NotNull] string providerName, [NotNull] string providerKey); - - Task UpdateAsync([NotNull] string providerName, [NotNull] string providerKey, UpdatePermissionsDto input); - } -} diff --git a/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/PermissionAppServiceHelper.cs b/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/PermissionAppServiceHelper.cs deleted file mode 100644 index f3805609e5..0000000000 --- a/src/Volo.Abp.Permissions.Application/Volo/Abp/Permissions/PermissionAppServiceHelper.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.Permissions -{ - public class PermissionAppServiceHelper : IPermissionAppServiceHelper, ITransientDependency - { - private readonly IPermissionManager _permissionManager; - private readonly IPermissionDefinitionManager _permissionDefinitionManager; - - public PermissionAppServiceHelper( - IPermissionManager permissionManager, - IPermissionDefinitionManager permissionDefinitionManager) - { - _permissionManager = permissionManager; - _permissionDefinitionManager = permissionDefinitionManager; - } - - public async Task GetAsync(string providerName, string providerKey) - { - var result = new GetPermissionListResultDto - { - Groups = new List() - }; - - foreach (var group in _permissionDefinitionManager.GetGroups()) - { - var groupDto = new PermissionGroupDto - { - Name = group.Name, - DisplayName = group.Name, //TODO: DisplayName - Permissions = new List() - }; - - foreach (var permission in group.GetPermissionsWithChildren()) - { - var grantInfoDto = new PermissionGrantInfoDto - { - Name = permission.Name, - DisplayName = permission.Name, //TODO: Add DisplayName to permission definition - ParentName = permission.Parent?.Name, - Providers = new List() - }; - - var grantInfo = await _permissionManager.GetAsync(permission.Name, providerName, providerKey); - - grantInfoDto.IsGranted = grantInfo.IsGranted; - - foreach (var provider in grantInfo.Providers) - { - grantInfoDto.Providers.Add(new ProviderInfoDto - { - ProviderName = provider.Name, - ProviderKey = provider.Key, - }); - } - - groupDto.Permissions.Add(grantInfoDto); - } - - result.Groups.Add(groupDto); - } - - return result; - } - - public async Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input) - { - foreach (var permission in input.Permissions) - { - await _permissionManager.SetAsync(permission.Name, providerName, providerKey, permission.IsGranted); - } - } - } -} diff --git a/src/Volo.Abp.Permissions.Domain.Shared/Volo.Abp.Permissions.Domain.Shared.csproj b/src/Volo.Abp.Permissions.Domain.Shared/Volo.Abp.Permissions.Domain.Shared.csproj deleted file mode 100644 index fef7b37c72..0000000000 --- a/src/Volo.Abp.Permissions.Domain.Shared/Volo.Abp.Permissions.Domain.Shared.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Permissions.Domain.Shared - Volo.Abp.Permissions.Domain.Shared - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - diff --git a/src/Volo.Abp.Permissions.Domain.Shared/Volo/Abp/Permissions/AbpPermissionsDomainSharedModule.cs b/src/Volo.Abp.Permissions.Domain.Shared/Volo/Abp/Permissions/AbpPermissionsDomainSharedModule.cs deleted file mode 100644 index b813ae517e..0000000000 --- a/src/Volo.Abp.Permissions.Domain.Shared/Volo/Abp/Permissions/AbpPermissionsDomainSharedModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Permissions -{ - public class AbpPermissionsDomainSharedModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Permissions.Domain.Shared/Volo/Abp/Permissions/PermissionGrantConsts.cs b/src/Volo.Abp.Permissions.Domain.Shared/Volo/Abp/Permissions/PermissionGrantConsts.cs deleted file mode 100644 index e6fa7b129f..0000000000 --- a/src/Volo.Abp.Permissions.Domain.Shared/Volo/Abp/Permissions/PermissionGrantConsts.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Volo.Abp.Permissions -{ - public static class PermissionGrantConsts - { - public const int MaxNameLength = 128; - - public const int MaxProviderNameLength = 64; - - public const int MaxProviderKeyLength = 64; - } -} diff --git a/src/Volo.Abp.Permissions.Domain/Volo.Abp.Permissions.Domain.csproj b/src/Volo.Abp.Permissions.Domain/Volo.Abp.Permissions.Domain.csproj deleted file mode 100644 index a17e68dfba..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo.Abp.Permissions.Domain.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Permissions.Domain - Volo.Abp.Permissions.Domain - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - - C:\Users\hikalkan\.nuget\packages\microsoft.extensions.caching.abstractions\2.0.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll - - - - diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/AbpPermissionConsts.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/AbpPermissionConsts.cs deleted file mode 100644 index ce9186f737..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/AbpPermissionConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Permissions -{ - public static class AbpPermissionConsts - { - public const string DefaultDbTablePrefix = "Abp"; - - public const string DefaultDbSchema = null; - } -} diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/AbpPermissionsDomainModule.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/AbpPermissionsDomainModule.cs deleted file mode 100644 index ea3456f41a..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/AbpPermissionsDomainModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Authorization; -using Volo.Abp.Caching; -using Volo.Abp.Domain; -using Volo.Abp.Json; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Permissions -{ - [DependsOn(typeof(AbpAuthorizationModule))] - [DependsOn(typeof(AbpDddDomainModule))] - [DependsOn(typeof(AbpPermissionsDomainSharedModule))] - [DependsOn(typeof(AbpCachingModule))] - [DependsOn(typeof(AbpJsonModule))] - public class AbpPermissionsDomainModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionGrantRepository.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionGrantRepository.cs deleted file mode 100644 index 4ec344d30a..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionGrantRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.Permissions -{ - public interface IPermissionGrantRepository : IBasicRepository - { - Task FindAsync(string name, string providerName, string providerKey); - - Task> GetListAsync(string providerName, string providerKey); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionManagementProvider.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionManagementProvider.cs deleted file mode 100644 index 6dca1385d9..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionManagementProvider.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Threading.Tasks; -using JetBrains.Annotations; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.Permissions -{ - public interface IPermissionManagementProvider : ISingletonDependency - { - string Name { get; } - - Task CheckAsync([NotNull] string name, [NotNull] string providerName, [NotNull] string providerKey); - - Task SetAsync([NotNull] string name, [NotNull] string providerKey, bool isGranted); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionManager.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionManager.cs deleted file mode 100644 index be5535519a..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/IPermissionManager.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using JetBrains.Annotations; - -namespace Volo.Abp.Permissions -{ - //TODO: Write extension methods for simple IsGranted check - - public interface IPermissionManager - { - Task GetAsync(string permissionName, string providerName, string providerKey); - - Task> GetAllAsync([NotNull] string providerName, [NotNull] string providerKey); - - Task SetAsync(string permissionName, string providerName, string providerKey, bool isGranted); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrant.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrant.cs deleted file mode 100644 index 8673bcd96c..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrant.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Permissions -{ - public class PermissionGrant : Entity, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - [NotNull] - public virtual string Name { get; protected set; } - - [NotNull] - public virtual string ProviderName { get; protected set; } - - [NotNull] - public virtual string ProviderKey { get; protected set; } - - protected PermissionGrant() - { - - } - - public PermissionGrant( - Guid id, - [NotNull] string name, - [NotNull] string providerName , - [NotNull] string providerKey, - Guid? tenantId = null) - { - Check.NotNull(name, nameof(name)); - - Id = id; - Name = name; - ProviderName = providerName; - ProviderKey = providerKey; - TenantId = tenantId; - } - } -} diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrantCacheItem.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrantCacheItem.cs deleted file mode 100644 index 9bc9c69ffd..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrantCacheItem.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace Volo.Abp.Permissions -{ - [Serializable] - public class PermissionGrantCacheItem - { - public string Name { get; set; } - - public bool IsGranted { get; set; } - - public PermissionGrantCacheItem() - { - - } - - public PermissionGrantCacheItem(string name, bool isGranted) - { - Name = name; - IsGranted = isGranted; - } - - public static string CalculateCacheKey(string name, string providerName, string providerKey) - { - return "pn:" + providerName + ",pk:" + providerKey + ",n:" + name; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrantCacheItemInvalidator.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrantCacheItemInvalidator.cs deleted file mode 100644 index 5d956735f2..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionGrantCacheItemInvalidator.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Caching; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities.Events; -using Volo.Abp.EventBus; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Permissions -{ - public class PermissionGrantCacheItemInvalidator : IAsyncEventHandler>, ITransientDependency - { - protected ICurrentTenant CurrentTenant { get; } - - protected IDistributedCache Cache { get; } - - public PermissionGrantCacheItemInvalidator(IDistributedCache cache, ICurrentTenant currentTenant) - { - Cache = cache; - CurrentTenant = currentTenant; - } - - public virtual async Task HandleEventAsync(EntityChangedEventData eventData) - { - var cacheKey = CalculateCacheKey( - eventData.Entity.Name, - eventData.Entity.ProviderName, - eventData.Entity.ProviderKey - ); - - using (CurrentTenant.Change(eventData.Entity.TenantId)) - { - await Cache.RemoveAsync(cacheKey); - } - } - - protected virtual string CalculateCacheKey(string name, string providerName, string providerKey) - { - return PermissionGrantCacheItem.CalculateCacheKey(name, providerName, providerKey); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManagementOptions.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManagementOptions.cs deleted file mode 100644 index feae64a183..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManagementOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Volo.Abp.Collections; - -namespace Volo.Abp.Permissions -{ - public class PermissionManagementOptions - { - public ITypeList ManagementProviders { get; } - - public PermissionManagementOptions() - { - ManagementProviders = new TypeList(); - } - } -} diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManagementProvider.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManagementProvider.cs deleted file mode 100644 index 1e7ec327a1..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManagementProvider.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Guids; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.Permissions -{ - public abstract class PermissionManagementProvider : IPermissionManagementProvider - { - public abstract string Name { get; } - - protected IPermissionGrantRepository PermissionGrantRepository { get; } - - protected IGuidGenerator GuidGenerator { get; } - - protected ICurrentTenant CurrentTenant { get; } - - protected PermissionManagementProvider( - IPermissionGrantRepository permissionGrantRepository, - IGuidGenerator guidGenerator, - ICurrentTenant currentTenant) - { - PermissionGrantRepository = permissionGrantRepository; - GuidGenerator = guidGenerator; - CurrentTenant = currentTenant; - } - - - public virtual async Task CheckAsync(string name, string providerName, string providerKey) - { - if (providerName != Name) - { - return PermissionValueProviderGrantInfo.NonGranted; - } - - return new PermissionValueProviderGrantInfo( - await PermissionGrantRepository.FindAsync(name, providerName, providerKey) != null, - providerKey - ); - } - - public virtual Task SetAsync(string name, string providerKey, bool isGranted) - { - return isGranted - ? GrantAsync(name, providerKey) - : RevokeAsync(name, providerKey); - } - - protected virtual async Task GrantAsync(string name, string providerKey) - { - var permissionGrant = await PermissionGrantRepository.FindAsync(name, Name, providerKey); - if (permissionGrant != null) - { - return; - } - - await PermissionGrantRepository.InsertAsync( - new PermissionGrant( - GuidGenerator.Create(), - name, - Name, - providerKey, - CurrentTenant.Id - ) - ); - } - - protected virtual async Task RevokeAsync(string name, string providerKey) - { - var permissionGrant = await PermissionGrantRepository.FindAsync(name, Name, providerKey); - if (permissionGrant == null) - { - return; - } - - await PermissionGrantRepository.DeleteAsync(permissionGrant); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManager.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManager.cs deleted file mode 100644 index 514d2bd364..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionManager.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; - -namespace Volo.Abp.Permissions -{ - public class PermissionManager : IPermissionManager, ISingletonDependency - { - protected IPermissionGrantRepository PermissionGrantRepository { get; } - - protected IPermissionDefinitionManager PermissionDefinitionManager { get; } - - protected IGuidGenerator GuidGenerator { get; } - - protected IReadOnlyList ManagementProviders => _lazyProviders.Value; - - protected PermissionManagementOptions Options { get; } - - private readonly Lazy> _lazyProviders; - - public PermissionManager( - IPermissionDefinitionManager permissionDefinitionManager, - IPermissionGrantRepository permissionGrantRepository, - IServiceProvider serviceProvider, - IGuidGenerator guidGenerator, - IOptions options) - { - GuidGenerator = guidGenerator; - PermissionGrantRepository = permissionGrantRepository; - PermissionDefinitionManager = permissionDefinitionManager; - Options = options.Value; - - _lazyProviders = new Lazy>( - () => Options - .ManagementProviders - .Select(c => serviceProvider.GetRequiredService(c) as IPermissionManagementProvider) - .ToList(), - true - ); - } - - public async Task GetAsync(string permissionName, string providerName, string providerKey) - { - return await GetInternalAsync(PermissionDefinitionManager.Get(permissionName), providerName, providerKey); - } - - public async Task> GetAllAsync(string providerName, string providerKey) - { - var results = new List(); - - foreach (var permissionDefinition in PermissionDefinitionManager.GetPermissions()) - { - results.Add(await GetInternalAsync(permissionDefinition, providerName, providerKey)); - } - - return results; - } - - public async Task SetAsync(string permissionName, string providerName, string providerKey, bool isGranted) - { - var currentGrantInfo = await GetAsync(permissionName, providerName, providerKey); - if (currentGrantInfo.IsGranted == isGranted) - { - return; - } - - var provider = ManagementProviders.FirstOrDefault(m => m.Name == providerName); - if (provider == null) - { - throw new AbpException("Unknown permission management provider: " + providerName); - } - - await provider.SetAsync(permissionName, providerKey, isGranted); - } - - public async Task GetInternalAsync(PermissionDefinition permissionDefinition, string providerName, string providerKey) - { - var result = new PermissionWithGrantedProviders(permissionDefinition.Name, false); - - foreach (var provider in ManagementProviders) - { - var providerResult = await provider.CheckAsync(permissionDefinition.Name, providerName, providerKey); - if (providerResult.IsGranted) - { - result.IsGranted = true; - result.Providers.Add(new PermissionValueProviderInfo(provider.Name, providerResult.ProviderKey)); - } - } - - return result; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionStore.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionStore.cs deleted file mode 100644 index 621b7e81e3..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionStore.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Caching; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.Permissions -{ - public class PermissionStore : IPermissionStore, ITransientDependency - { - protected IPermissionGrantRepository PermissionGrantRepository { get; } - - protected IDistributedCache Cache { get; } - - public PermissionStore( - IPermissionGrantRepository permissionGrantRepository, - IDistributedCache cache) - { - PermissionGrantRepository = permissionGrantRepository; - Cache = cache; - } - - public async Task IsGrantedAsync(string name, string providerName, string providerKey) - { - return (await GetCacheItemAsync(name, providerName, providerKey)).IsGranted; - } - - protected virtual async Task GetCacheItemAsync(string name, string providerName, string providerKey) - { - var cacheKey = CalculateCacheKey(name, providerName, providerKey); - var cacheItem = await Cache.GetAsync(cacheKey); - - if (cacheItem != null) - { - return cacheItem; - } - - cacheItem = new PermissionGrantCacheItem( - name, - await PermissionGrantRepository.FindAsync(name, providerName, providerKey) != null - ); - - await Cache.SetAsync( - cacheKey, - cacheItem - ); - - return cacheItem; - } - - protected virtual string CalculateCacheKey(string name, string providerName, string providerKey) - { - return PermissionGrantCacheItem.CalculateCacheKey(name, providerName, providerKey); - } - } -} diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionValueProviderInfo.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionValueProviderInfo.cs deleted file mode 100644 index e94ba47595..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionValueProviderInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using JetBrains.Annotations; - -namespace Volo.Abp.Permissions -{ - public class PermissionValueProviderInfo - { - public string Name { get; } - - public string Key { get; } - - public PermissionValueProviderInfo([NotNull]string name, [NotNull]string key) - { - Check.NotNull(name, nameof(name)); - Check.NotNull(key, nameof(key)); - - Name = name; - Key = key; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionWithGrantedProviders.cs b/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionWithGrantedProviders.cs deleted file mode 100644 index a196d3a987..0000000000 --- a/src/Volo.Abp.Permissions.Domain/Volo/Abp/Permissions/PermissionWithGrantedProviders.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using JetBrains.Annotations; - -namespace Volo.Abp.Permissions -{ - public class PermissionWithGrantedProviders - { - public string Name { get; } - - public bool IsGranted { get; set; } - - public List Providers { get; set; } - - public PermissionWithGrantedProviders([NotNull] string name, bool isGranted) - { - Check.NotNull(name, nameof(name)); - - Name = name; - IsGranted = isGranted; - - Providers = new List(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/20180218143233_Made_Permission_Entity_MultiTenant.Designer.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/20180218143233_Made_Permission_Entity_MultiTenant.Designer.cs deleted file mode 100644 index be6c942741..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/20180218143233_Made_Permission_Entity_MultiTenant.Designer.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.Permissions.EntityFrameworkCore; - -namespace Volo.Abp.Permissions.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(AbpPermissionsDbContext))] - [Migration("20180218143233_Made_Permission_Entity_MultiTenant")] - partial class Made_Permission_Entity_MultiTenant - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/20180218143233_Made_Permission_Entity_MultiTenant.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/20180218143233_Made_Permission_Entity_MultiTenant.cs deleted file mode 100644 index fa92148374..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/20180218143233_Made_Permission_Entity_MultiTenant.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Volo.Abp.Permissions.EntityFrameworkCore.Migrations -{ - public partial class Made_Permission_Entity_MultiTenant : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AbpPermissionGrants", - columns: table => new - { - Id = table.Column(nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - ProviderKey = table.Column(maxLength: 64, nullable: false), - ProviderName = table.Column(maxLength: 64, nullable: false), - TenantId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", - table: "AbpPermissionGrants", - columns: new[] { "Name", "ProviderName", "ProviderKey" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AbpPermissionGrants"); - } - } -} diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/AbpPermissionsDbContextModelSnapshot.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/AbpPermissionsDbContextModelSnapshot.cs deleted file mode 100644 index 4e0f1c2397..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Migrations/AbpPermissionsDbContextModelSnapshot.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using Volo.Abp.Permissions.EntityFrameworkCore; - -namespace Volo.Abp.Permissions.EntityFrameworkCore.Migrations -{ - [DbContext(typeof(AbpPermissionsDbContext))] - partial class AbpPermissionsDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo.Abp.Permissions.EntityFrameworkCore.csproj b/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo.Abp.Permissions.EntityFrameworkCore.csproj deleted file mode 100644 index fdcd856367..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo.Abp.Permissions.EntityFrameworkCore.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Permissions.EntityFrameworkCore - Volo.Abp.Permissions.EntityFrameworkCore - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContext.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContext.cs deleted file mode 100644 index 589f2d1b81..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContext.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Permissions.EntityFrameworkCore -{ - [ConnectionStringName("AbpPermissions")] - public class AbpPermissionsDbContext : AbpDbContext, IAbpPermissionsDbContext - { - public static string TablePrefix { get; set; } = AbpPermissionConsts.DefaultDbTablePrefix; - - public static string Schema { get; set; } = AbpPermissionConsts.DefaultDbSchema; - - public DbSet PermissionGrants { get; set; } - - public AbpPermissionsDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - builder.ConfigureAbpPermissions(TablePrefix, Schema); - } - } -} diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContextFactory.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContextFactory.cs deleted file mode 100644 index a551cab544..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContextFactory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace Volo.Abp.Permissions.EntityFrameworkCore -{ - /* This class is needed for EF Core command line tooling */ - - public class AbpPermissionsDbContextFactory : IDesignTimeDbContextFactory - { - public AbpPermissionsDbContext CreateDbContext(string[] args) - { - //TODO: Remove all SqlServer references from EFCore packages and find a way of creating factory inside this. - var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Server=localhost;Database=AbpDesk;Trusted_Connection=True;"); - return new AbpPermissionsDbContext(builder.Options); - } - } -} diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContextModelBuilderExtensions.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContextModelBuilderExtensions.cs deleted file mode 100644 index 2414784280..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpPermissionsDbContextModelBuilderExtensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Volo.Abp.Permissions.EntityFrameworkCore -{ - public static class AbpPermissionsDbContextModelBuilderExtensions - { - public static void ConfigureAbpPermissions( - [NotNull] this ModelBuilder builder, - [CanBeNull] string tablePrefix = AbpPermissionConsts.DefaultDbTablePrefix, - [CanBeNull] string schema = AbpPermissionConsts.DefaultDbSchema) - { - Check.NotNull(builder, nameof(builder)); - - if (tablePrefix == null) - { - tablePrefix = ""; - } - - builder.Entity(b => - { - b.ToTable(tablePrefix + "PermissionGrants", schema); - - b.Property(x => x.Name).HasMaxLength(PermissionGrantConsts.MaxNameLength).IsRequired(); - b.Property(x => x.ProviderName).HasMaxLength(PermissionGrantConsts.MaxProviderNameLength).IsRequired(); - b.Property(x => x.ProviderKey).HasMaxLength(PermissionGrantConsts.MaxProviderKeyLength).IsRequired(); - - b.HasIndex(x => new {x.Name, x.ProviderName, x.ProviderKey}); - }); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpSettingsEntityFrameworkCoreModule.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpSettingsEntityFrameworkCoreModule.cs deleted file mode 100644 index 13f7232ce4..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/AbpSettingsEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Permissions.EntityFrameworkCore -{ - [DependsOn(typeof(AbpPermissionsDomainModule))] - [DependsOn(typeof(AbpEntityFrameworkCoreModule))] - public class AbpPermissionsEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); - - options.AddRepository(); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/EfCorePermissionGrantRepository.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/EfCorePermissionGrantRepository.cs deleted file mode 100644 index e907c82ed7..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/EfCorePermissionGrantRepository.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Permissions.EntityFrameworkCore -{ - public class EfCorePermissionGrantRepository : EfCoreRepository, IPermissionGrantRepository - { - public EfCorePermissionGrantRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - - } - - public async Task FindAsync(string name, string providerName, string providerKey) - { - return await DbSet.FirstOrDefaultAsync(s => - s.Name == name && - s.ProviderName == providerName && - s.ProviderKey == providerKey - ); - } - - public async Task> GetListAsync(string providerName, string providerKey) - { - return await DbSet.Where(s => - s.ProviderName == providerName && - s.ProviderKey == providerKey - ).ToListAsync(); - } - } -} diff --git a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/IAbpPermissionsDbContext.cs b/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/IAbpPermissionsDbContext.cs deleted file mode 100644 index 2e00b30f50..0000000000 --- a/src/Volo.Abp.Permissions.EntityFrameworkCore/Volo/Abp/Permissions/EntityFrameworkCore/IAbpPermissionsDbContext.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Permissions.EntityFrameworkCore -{ - [ConnectionStringName("AbpPermissions")] - public interface IAbpPermissionsDbContext : IEfCoreDbContext - { - DbSet PermissionGrants { get; set; } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Web/AbpPermissionsWebAutoMapperProfile.cs b/src/Volo.Abp.Permissions.Web/AbpPermissionsWebAutoMapperProfile.cs deleted file mode 100644 index 7df4bbc938..0000000000 --- a/src/Volo.Abp.Permissions.Web/AbpPermissionsWebAutoMapperProfile.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AutoMapper; -using Volo.Abp.Permissions.Web.Pages.AbpPermissions; - -namespace Volo.Abp.Permissions.Web -{ - public class AbpPermissionsWebAutoMapperProfile : Profile - { - public AbpPermissionsWebAutoMapperProfile() - { - CreateMap(); - - CreateMap(); - - CreateMap(); - } - } -} diff --git a/src/Volo.Abp.Permissions.Web/AbpPermissionsWebModule.cs b/src/Volo.Abp.Permissions.Web/AbpPermissionsWebModule.cs deleted file mode 100644 index 73a7d591e9..0000000000 --- a/src/Volo.Abp.Permissions.Web/AbpPermissionsWebModule.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; -using Volo.Abp.AutoMapper; -using Volo.Abp.Localization; -using Volo.Abp.Modularity; -using Volo.Abp.Permissions.Web.Localization.Resources.AbpPermissions; -using Volo.Abp.VirtualFileSystem; - -namespace Volo.Abp.Permissions.Web -{ - [DependsOn(typeof(AbpPermissionsApplicationContractsModule))] - [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] - [DependsOn(typeof(AbpAutoMapperModule))] - public class AbpPermissionsWebModule : AbpModule - { - public override void PreConfigureServices(IServiceCollection services) - { - services.PreConfigure(options => - { - options.AddAssemblyResource(typeof(AbpPermissionsResource)); - }); - } - - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - - services.Configure(options => - { - options.FileSets.AddEmbedded("Volo.Abp.Permissions.Web"); - }); - - services.Configure(options => - { - options.Resources.AddVirtualJson("en", "/Localization/Resources/AbpPermissions"); - }); - - services.Configure(options => - { - options.AddProfile(validate: true); - }); - } - } -} diff --git a/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/IdentityResource.cs b/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/IdentityResource.cs deleted file mode 100644 index 53f714e563..0000000000 --- a/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/IdentityResource.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Localization.Resources.AbpBootstrap; -using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; - -namespace Volo.Abp.Permissions.Web.Localization.Resources.AbpPermissions -{ - [InheritResource( - typeof(AbpValidationResource), - typeof(AbpBootstrapResource))] - [ShortLocalizationResourceName("AbpPermissions")] - public class AbpPermissionsResource - { - - } -} diff --git a/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/en.json b/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/en.json deleted file mode 100644 index f12cad4212..0000000000 --- a/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/en.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "culture": "en", - "texts": { - "Users": "Users", - "NewUser": "New user", - "UserName": "User name", - "EmailAddress": "Email address", - "PhoneNumber": "Phone number", - "UserInformations": "User informations", - "Roles": "Roles", - "Password": "Password", - "UserDeletionConfirmationMessage": "User '{0}' will be deleted. Do you confirm that?", - "TwoFactorVerification": "Two factor verification", - "AccountLockoutOnFailedLoginAttempts": "Locking account after failed login attempts", - "NewRole": "New role", - "RoleName": "Role name" - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/tr.json b/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/tr.json deleted file mode 100644 index a19ffbcad8..0000000000 --- a/src/Volo.Abp.Permissions.Web/Localization/Resources/AbpPermissions/tr.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "culture": "tr", - "texts": { - "Users": "Kullanıcılar", - "NewUser": "Yeni kullanıcı", - "Actions": "İşlemler", - "UserName": "Kullanıcı adı", - "EmailAddress": "E-posta adresi", - "PhoneNumber": "Telefon numarası", - "UserInformations": "Kullanıcı bilgileri", - "Roles": "Roller", - "Close": "Kapat", - "Delete": "Sil", - "Edit": "Düzenle", - "Save": "Kaydet", - "Password": "Şifre", - "UserDeletionConfirmationMessage": "{0} kullanıcısı silinecektir. Onaylıyor musunuz?", - "TwoFactorVerification": "İki aşamalı doğrumala", - "AccountLockoutOnFailedLoginAttempts": "Başarısız giriş denemeleri sonrası hesabı kilitleme", - "NewRole": "Yeni rol", - "RoleName": "Rol adı", - "CreationTime": "Oluşturma zamanı" - - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/IPermissionAppServiceHelper.cs b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/IPermissionAppServiceHelper.cs deleted file mode 100644 index bf3c3c4105..0000000000 --- a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/IPermissionAppServiceHelper.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using JetBrains.Annotations; - -namespace Volo.Abp.Permissions.Web.Pages.AbpPermissions -{ - public interface IPermissionAppServiceGateway - { - Task GetAsync([NotNull] string providerName, [NotNull] string providerKey); - - Task UpdateAsync([NotNull] string providerName, [NotNull] string providerKey, UpdatePermissionsDto input); - } -} diff --git a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/NotImplementedPermissionAppServiceGateway.cs b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/NotImplementedPermissionAppServiceGateway.cs deleted file mode 100644 index 78abae0100..0000000000 --- a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/NotImplementedPermissionAppServiceGateway.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.Permissions.Web.Pages.AbpPermissions -{ - public class NotImplementedPermissionAppServiceGateway : IPermissionAppServiceGateway, ISingletonDependency - { - public Task GetAsync(string providerName, string providerKey) - { - throw new System.NotImplementedException(); - } - - public Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input) - { - throw new System.NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml deleted file mode 100644 index 452fc85b04..0000000000 --- a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml +++ /dev/null @@ -1,55 +0,0 @@ -@page -@using Volo.Abp.Permissions.Web.Pages.AbpPermissions -@model PermissionManagementModal -@{ - Layout = null; -} - -
    - - - - - - - - - - -
    -
    - -
    -
    -
    - @for (var i = 0; i < Model.Groups.Count; i++) - { -
    - @for (var j = 0; j < Model.Groups[i].Permissions.Count; j++) - { -
    - -
    - - } -
    - } -
    -
    -
    - -
    - - - -
    - -
    diff --git a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml.cs b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml.cs deleted file mode 100644 index 6774e8d827..0000000000 --- a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/PermissionManagementModal.cshtml.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.RazorPages; - -namespace Volo.Abp.Permissions.Web.Pages.AbpPermissions -{ - public class PermissionManagementModal : AbpPageModel - { - private readonly IPermissionAppServiceGateway _permissionAppServiceGateway; - - [Required] - [HiddenInput] - [BindProperty(SupportsGet = true)] - public string ProviderName { get; set; } - - [Required] - [HiddenInput] - [BindProperty(SupportsGet = true)] - public string ProviderKey { get; set; } - - [BindProperty] - public List Groups { get; set; } - - public PermissionManagementModal(IPermissionAppServiceGateway permissionAppServiceGateway) - { - _permissionAppServiceGateway = permissionAppServiceGateway; - } - - public async Task OnGetAsync() - { - ValidateModel(); - - var result = await _permissionAppServiceGateway.GetAsync(ProviderName, ProviderKey); - Groups = ObjectMapper.Map, List>(result.Groups); - } - - public async Task OnPostAsync() - { - ValidateModel(); - - var updatePermissionDtos = Groups - .SelectMany(g => g.Permissions) - .Select(p => new UpdatePermissionDto - { - Name = p.Name, - IsGranted = p.IsGranted - }) - .ToArray(); - - await _permissionAppServiceGateway.UpdateAsync( - ProviderName, - ProviderKey, - new UpdatePermissionsDto - { - Permissions = updatePermissionDtos - } - ); - - return NoContent(); - } - - public class PermissionGroupViewModel - { - public string Name { get; set; } - - public string DisplayName { get; set; } - - public List Permissions { get; set; } - - public string GetNormalizedGroupName() - { - return Name.Replace(".", "_"); - } - } - - public class PermissionGrantInfoViewModel - { - [Required] - [HiddenInput] - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string ParentName { get; set; } - - public bool IsGranted { get; set; } - - public List Providers { get; set; } - - public bool IsDisabled(string currentProviderName) - { - return IsGranted && Providers.All(p => p.ProviderName != currentProviderName); - } - - public string GetShownName(string currentProviderName) - { - if (!IsDisabled(currentProviderName)) - { - return DisplayName; - } - - return string.Format( - "{0} ({1})", - DisplayName, - Providers - .Where(p => p.ProviderName != currentProviderName) - .Select(p => p.ProviderName) - .JoinAsString(", ") - ); - } - } - - public class ProviderInfoViewModel - { - public string ProviderName { get; set; } - - public string ProviderKey { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/_ViewImports.cshtml b/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/_ViewImports.cshtml deleted file mode 100644 index d1ac64721f..0000000000 --- a/src/Volo.Abp.Permissions.Web/Pages/AbpPermissions/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Web/Properties/launchSettings.json b/src/Volo.Abp.Permissions.Web/Properties/launchSettings.json deleted file mode 100644 index 8a8ac869ea..0000000000 --- a/src/Volo.Abp.Permissions.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:49258/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Volo.Abp.Permissions.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:49259/" - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Permissions.Web/Volo.Abp.Permissions.Web.csproj b/src/Volo.Abp.Permissions.Web/Volo.Abp.Permissions.Web.csproj deleted file mode 100644 index c32fefc2fe..0000000000 --- a/src/Volo.Abp.Permissions.Web/Volo.Abp.Permissions.Web.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Permissions.Web - Volo.Abp.Permissions.Web - true - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - Library - - - - - - - - - - - - - - - - - - - diff --git a/src/Volo.Abp.Settings.Domain.Shared/Volo.Abp.Settings.Domain.Shared.csproj b/src/Volo.Abp.Settings.Domain.Shared/Volo.Abp.Settings.Domain.Shared.csproj deleted file mode 100644 index 1ae08840a7..0000000000 --- a/src/Volo.Abp.Settings.Domain.Shared/Volo.Abp.Settings.Domain.Shared.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Settings.Domain.Shared - Volo.Abp.Settings.Domain.Shared - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - diff --git a/src/Volo.Abp.Settings.Domain.Shared/Volo/Abp/Settings/AbpSettingsDomainSharedModule.cs b/src/Volo.Abp.Settings.Domain.Shared/Volo/Abp/Settings/AbpSettingsDomainSharedModule.cs deleted file mode 100644 index fdf5f9e41c..0000000000 --- a/src/Volo.Abp.Settings.Domain.Shared/Volo/Abp/Settings/AbpSettingsDomainSharedModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Settings -{ - public class AbpSettingsDomainSharedModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Settings.Domain.Shared/Volo/Abp/Settings/SettingsConsts.cs b/src/Volo.Abp.Settings.Domain.Shared/Volo/Abp/Settings/SettingsConsts.cs deleted file mode 100644 index 0b25a74bf8..0000000000 --- a/src/Volo.Abp.Settings.Domain.Shared/Volo/Abp/Settings/SettingsConsts.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Volo.Abp.Settings -{ - public static class SettingsConsts - { - public const int MaxNameLength = 128; - public const int MaxValueLength = 2048; - public const int MaxProviderNameLength = 64; - public const int MaxProviderKeyLength = 64; - } -} diff --git a/src/Volo.Abp.Settings.Domain/Volo.Abp.Settings.Domain.csproj b/src/Volo.Abp.Settings.Domain/Volo.Abp.Settings.Domain.csproj deleted file mode 100644 index 6d5e501a3b..0000000000 --- a/src/Volo.Abp.Settings.Domain/Volo.Abp.Settings.Domain.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Settings.Domain - Volo.Abp.Settings.Domain - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - - diff --git a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/AbpSettingsConsts.cs b/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/AbpSettingsConsts.cs deleted file mode 100644 index f3a9f4653c..0000000000 --- a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/AbpSettingsConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Volo.Abp.Settings -{ - public static class AbpSettingsConsts - { - public const string DefaultDbTablePrefix = "Abp"; - - public const string DefaultDbSchema = null; - } -} diff --git a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/AbpSettingsDomainModule.cs b/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/AbpSettingsDomainModule.cs deleted file mode 100644 index d0c765f348..0000000000 --- a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/AbpSettingsDomainModule.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Domain; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Settings -{ - [DependsOn(typeof(AbpSettingsModule))] - [DependsOn(typeof(AbpDddDomainModule))] - [DependsOn(typeof(AbpSettingsDomainSharedModule))] - public class AbpSettingsDomainModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/ISettingRepository.cs b/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/ISettingRepository.cs deleted file mode 100644 index 5084e51ec5..0000000000 --- a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/ISettingRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace Volo.Abp.Settings -{ - public interface ISettingRepository : IBasicRepository - { - Task FindAsync(string name, string providerName, string providerKey); - - Task> GetListAsync(string providerName, string providerKey); - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/Setting.cs b/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/Setting.cs deleted file mode 100644 index 9a04000f50..0000000000 --- a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/Setting.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities; - -namespace Volo.Abp.Settings -{ - public class Setting : Entity - { - [NotNull] - public virtual string Name { get; protected set; } - - [NotNull] - public virtual string Value { get; internal set; } - - [CanBeNull] - public virtual string ProviderName { get; protected set; } - - [CanBeNull] - public virtual string ProviderKey { get; protected set; } - - protected Setting() - { - - } - - public Setting( - Guid id, - [NotNull] string name, - [NotNull] string value, - [CanBeNull] string providerName = null, - [CanBeNull] string providerKey = null) - { - Check.NotNull(name, nameof(name)); - Check.NotNull(value, nameof(value)); - - Id = id; - Name = name; - Value = value; - ProviderName = providerName; - ProviderKey = providerKey; - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/SettingStore.cs b/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/SettingStore.cs deleted file mode 100644 index ab90a99f71..0000000000 --- a/src/Volo.Abp.Settings.Domain/Volo/Abp/Settings/SettingStore.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; - -namespace Volo.Abp.Settings -{ - public class SettingStore : ISettingStore, ITransientDependency - { - private readonly ISettingRepository _settingRepository; - private readonly IGuidGenerator _guidGenerator; - - public SettingStore(ISettingRepository settingRepository, IGuidGenerator guidGenerator) - { - _settingRepository = settingRepository; - _guidGenerator = guidGenerator; - } - - public async Task GetOrNullAsync(string name, string providerName, string providerKey) - { - var setting = await _settingRepository.FindAsync(name, providerName, providerKey); - return setting?.Value; - } - - public async Task SetAsync(string name, string value, string providerName, string providerKey) - { - var setting = await _settingRepository.FindAsync(name, providerName, providerKey); - if (setting == null) - { - setting = new Setting(_guidGenerator.Create(), name, value, providerName, providerKey); - await _settingRepository.InsertAsync(setting); - } - else - { - setting.Value = value; - await _settingRepository.UpdateAsync(setting); - } - } - - public async Task> GetListAsync(string providerName, string providerKey) - { - var settings = await _settingRepository.GetListAsync(providerName, providerKey); - return settings.Select(s => new SettingValue(s.Name, s.Value)).ToList(); - } - - public async Task DeleteAsync(string name, string providerName, string providerKey) - { - var setting = await _settingRepository.FindAsync(name, providerName, providerKey); - if (setting != null) - { - await _settingRepository.DeleteAsync(setting); - } - } - } -} diff --git a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo.Abp.Settings.EntityFrameworkCore.csproj b/src/Volo.Abp.Settings.EntityFrameworkCore/Volo.Abp.Settings.EntityFrameworkCore.csproj deleted file mode 100644 index 8ca5ce8156..0000000000 --- a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo.Abp.Settings.EntityFrameworkCore.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - netstandard2.0 - Volo.Abp.Settings.EntityFrameworkCore - Volo.Abp.Settings.EntityFrameworkCore - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - false - false - - - - - - - - - diff --git a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsDbContext.cs b/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsDbContext.cs deleted file mode 100644 index 0ce713d764..0000000000 --- a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsDbContext.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Settings.EntityFrameworkCore -{ - [ConnectionStringName("AbpSettings")] - public class AbpSettingsDbContext : AbpDbContext, IAbpSettingsDbContext - { - public static string TablePrefix { get; set; } = AbpSettingsConsts.DefaultDbTablePrefix; - - public static string Schema { get; set; } = AbpSettingsConsts.DefaultDbSchema; - - public DbSet Settings { get; set; } - - public AbpSettingsDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - builder.ConfigureAbpSettings(TablePrefix, Schema); - } - } -} diff --git a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsDbContextModelBuilderExtensions.cs b/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsDbContextModelBuilderExtensions.cs deleted file mode 100644 index 15b91d3cf7..0000000000 --- a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsDbContextModelBuilderExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace Volo.Abp.Settings.EntityFrameworkCore -{ - public static class AbpSettingsDbContextModelBuilderExtensions - { - public static void ConfigureAbpSettings( - [NotNull] this ModelBuilder builder, - [CanBeNull] string tablePrefix = AbpSettingsConsts.DefaultDbTablePrefix, - [CanBeNull] string schema = AbpSettingsConsts.DefaultDbSchema) - { - Check.NotNull(builder, nameof(builder)); - - if (tablePrefix == null) - { - tablePrefix = ""; - } - - builder.Entity(b => - { - b.ToTable(tablePrefix + "Settings", schema); - - b.Property(x => x.Name).HasMaxLength(SettingsConsts.MaxNameLength).IsRequired(); - b.Property(x => x.Value).HasMaxLength(SettingsConsts.MaxValueLength).IsRequired(); - b.Property(x => x.ProviderName).HasMaxLength(SettingsConsts.MaxProviderNameLength); - b.Property(x => x.ProviderKey).HasMaxLength(SettingsConsts.MaxProviderKeyLength); - - b.HasIndex(x => new {x.Name, x.ProviderName, x.ProviderKey}); - }); - } - } -} \ No newline at end of file diff --git a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsEntityFrameworkCoreModule.cs b/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsEntityFrameworkCoreModule.cs deleted file mode 100644 index 013c32d16f..0000000000 --- a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/AbpSettingsEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Settings.EntityFrameworkCore -{ - [DependsOn(typeof(AbpSettingsDomainModule))] - [DependsOn(typeof(AbpEntityFrameworkCoreModule))] - public class AbpSettingsEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); - - options.AddRepository(); - }); - - services.AddAssemblyOf(); - } - } -} diff --git a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/EfCoreSettingRepository.cs b/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/EfCoreSettingRepository.cs deleted file mode 100644 index 3f31147390..0000000000 --- a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/EfCoreSettingRepository.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Settings.EntityFrameworkCore -{ - public class EfCoreSettingRepository : EfCoreRepository, ISettingRepository - { - public EfCoreSettingRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } - - public async Task FindAsync(string name, string providerName, string providerKey) - { - return await DbSet.FirstOrDefaultAsync(s => s.Name == name && s.ProviderName == providerName && s.ProviderKey == providerKey); - } - - public async Task> GetListAsync(string providerName, string providerKey) - { - return await DbSet.Where(s => s.ProviderName == providerName && s.ProviderKey == providerKey).ToListAsync(); - } - } -} diff --git a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/IAbpSettingsDbContext.cs b/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/IAbpSettingsDbContext.cs deleted file mode 100644 index bf59970e6c..0000000000 --- a/src/Volo.Abp.Settings.EntityFrameworkCore/Volo/Abp/Settings/EntityFrameworkCore/IAbpSettingsDbContext.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace Volo.Abp.Settings.EntityFrameworkCore -{ - [ConnectionStringName("AbpSettings")] - public interface IAbpSettingsDbContext : IEfCoreDbContext - { - DbSet Settings { get; set; } - } -} \ No newline at end of file diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Abp.IdentityServer.EntityFrameworkCore.Tests.csproj b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Abp.IdentityServer.EntityFrameworkCore.Tests.csproj deleted file mode 100644 index 73a4c2ac03..0000000000 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Abp.IdentityServer.EntityFrameworkCore.Tests.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netcoreapp2.0 - Abp.IdentityServer.EntityFrameworkCore.Tests - Abp.IdentityServer.EntityFrameworkCore.Tests - true - false - false - false - - - - - - - - - - - - - - - - diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityApplicationTestBase.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityApplicationTestBase.cs deleted file mode 100644 index b102a72329..0000000000 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityApplicationTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Volo.Abp.IdentityServer -{ - public class AbpIdentityServerTestBase : AbpIntegratedTest - { - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - } -} diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs deleted file mode 100644 index 1bbeb65e07..0000000000 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ /dev/null @@ -1,129 +0,0 @@ -using IdentityServer4.Models; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; -using Volo.Abp.IdentityServer.ApiResources; -using Volo.Abp.IdentityServer.Clients; -using Volo.Abp.IdentityServer.Grants; -using Volo.Abp.IdentityServer.IdentityResources; -using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; -using Client = Volo.Abp.IdentityServer.Clients.Client; -using IdentityResource = Volo.Abp.IdentityServer.IdentityResources.IdentityResource; -using PersistedGrant = Volo.Abp.IdentityServer.Grants.PersistedGrant; - -namespace Volo.Abp.IdentityServer -{ - public class AbpIdentityServerTestDataBuilder : ITransientDependency - { - private readonly IGuidGenerator _guidGenerator; - private readonly IClientRepository _clientRepository; - private readonly IPersistentGrantRepository _persistentGrantRepository; - private readonly IApiResourceRepository _apiResourceRepository; - private readonly IIdentityResourceRepository _identityResourceRepository; - - public AbpIdentityServerTestDataBuilder( - IClientRepository clientRepository, - IGuidGenerator guidGenerator, - IPersistentGrantRepository persistentGrantRepository, - IApiResourceRepository apiResourceRepository, - IIdentityResourceRepository identityResourceRepository) - { - _clientRepository = clientRepository; - _guidGenerator = guidGenerator; - _persistentGrantRepository = persistentGrantRepository; - _apiResourceRepository = apiResourceRepository; - _identityResourceRepository = identityResourceRepository; - } - - public void Build() - { - AddClients(); - AddPersistentGrants(); - AddApiResources(); - AddIdentityResources(); - } - - private void AddClients() - { - var client42 = new Client(_guidGenerator.Create(), "42") - { - ProtocolType = "TestProtocol-42" - }; - - client42.AddCorsOrigin("Origin1"); - - client42.AddScope("api1"); - - _clientRepository.Insert(client42); - } - - private void AddPersistentGrants() - { - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) - { - Key = "38", - ClientId = "TestClientId-38", - Type = "TestType-38", - SubjectId = "TestSubject", - Data = "TestData-38" - }); - - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) - { - Key = "37", - ClientId = "TestClientId-37", - Type = "TestType-37", - SubjectId = "TestSubject", - Data = "TestData-37" - }); - - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) - { - Key = "36", - ClientId = "TestClientId-X", - Type = "TestType-36", - SubjectId = "TestSubject-X", - Data = "TestData-36" - }); - - _persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()) - { - Key = "35", - ClientId = "TestClientId-X", - Type = "TestType-35", - SubjectId = "TestSubject-X", - Data = "TestData-35" - }); - } - - private void AddApiResources() - { - var apiResource = new ApiResource(_guidGenerator.Create(), "Test-ApiResource-Name-1") - { - Enabled = true, - Description = "Test-ApiResource-Description-1", - DisplayName = "Test-ApiResource-DisplayName-1" - }; - - apiResource.AddSecret("secret".Sha256()); - apiResource.AddScope("Test-ApiResource-ApiScope-Name-1", "Test-ApiResource-ApiScope-DisplayName-1"); - apiResource.AddUserClaim("Test-ApiResource-Claim-Type-1"); - - _apiResourceRepository.Insert(apiResource); - } - - private void AddIdentityResources() - { - var identityResource = new IdentityResource(_guidGenerator.Create(), "Test-Identity-Resource-Name-1") - { - Description = "Test-Identity-Resource-Description-1", - DisplayName = "Test-Identity-Resource-DisplayName-1", - Required = true, - Emphasize = true - }; - - identityResource.AddUserClaim("Test-Identity-Resource-1-IdentityClaim-Type-1"); - - _identityResourceRepository.Insert(identityResource); - } - } -} diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs deleted file mode 100644 index 0491499be8..0000000000 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Autofac; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.IdentityServer.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.Uow; - -namespace Volo.Abp.IdentityServer -{ - [DependsOn(typeof(AbpAutofacModule))] - [DependsOn(typeof(AbpIdentityServerEntityFrameworkCoreModule))] - [DependsOn(typeof(AbpIdentityEntityFrameworkCoreModule))] - public class AbpIdentityServerTestEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - - services.AddEntityFrameworkInMemoryDatabase(); - - var databaseName = Guid.NewGuid().ToString(); - - services.Configure(options => - { - options.Configure(context => - { - context.DbContextOptions.UseInMemoryDatabase(databaseName); - }); - }); - - services.Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions - }); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - SeedTestData(context); - } - - private static void SeedTestData(ApplicationInitializationContext context) - { - using (var scope = context.ServiceProvider.CreateScope()) - { - scope.ServiceProvider - .GetRequiredService() - .Build(); - } - } - } -} \ No newline at end of file diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs deleted file mode 100644 index e89f385b57..0000000000 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/ClientStore_Tests.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Threading.Tasks; -using IdentityServer4.Stores; -using Microsoft.Extensions.DependencyInjection; -using Shouldly; -using Xunit; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class ClientStore_Tests : AbpIdentityServerTestBase - { - private readonly IClientStore _clientStore; - - public ClientStore_Tests() - { - _clientStore = ServiceProvider.GetRequiredService(); - } - - [Fact] - public async Task FindClientByIdAsync_Should_Return_Null_If_Not_Found() - { - var client = await _clientStore.FindClientByIdAsync("non-existing-id"); - client.ShouldBeNull(); - } - - [Fact] - public async Task FindClientByIdAsync_Should_Return_The_Client_If_Found() - { - //Act - var client = await _clientStore.FindClientByIdAsync("42"); - - //Assert - client.ShouldNotBeNull(); - client.ClientId.ShouldBe("42"); - client.ProtocolType.ShouldBe("TestProtocol-42"); - client.AllowedCorsOrigins.ShouldContain("Origin1"); - client.AllowedScopes.ShouldContain("api1"); - } - } -} diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs deleted file mode 100644 index 7b0c6df496..0000000000 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using Microsoft.Extensions.DependencyInjection; -using Shouldly; -using Xunit; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class IdentityResourceStore_Tests : AbpIdentityServerTestBase - { - private readonly IResourceStore _resourceStore; - - public IdentityResourceStore_Tests() - { - _resourceStore = ServiceProvider.GetRequiredService(); - } - - [Fact] - public async Task FindApiResourceAsync_Should_Return_Null_If_Not_Found() - { - //Act - var resource = await _resourceStore.FindApiResourceAsync("non-existing-name"); - - //Assert - resource.ShouldBeNull(); - } - - [Fact] - public async Task FindApiResourceAsync_Should_Return_If_Found() - { - //Act - var apiResource = await _resourceStore.FindApiResourceAsync("Test-ApiResource-Name-1"); - - //Assert - apiResource.ShouldNotBe(null); - apiResource.Name.ShouldBe("Test-ApiResource-Name-1"); - apiResource.Description.ShouldBe("Test-ApiResource-Description-1"); - apiResource.DisplayName.ShouldBe("Test-ApiResource-DisplayName-1"); - } - - [Fact] - public async Task FindApiResourcesByScopeAsync_Should_Return_If_Found() - { - //Act - var apiResourcesByScope = await _resourceStore.FindApiResourcesByScopeAsync(new List - { - "Test-ApiResource-ApiScope-Name-1" - }); - - //Assert - var apiResources = apiResourcesByScope as ApiResource[] ?? apiResourcesByScope.ToArray(); - apiResources.ShouldNotBe(null); - - apiResources[0].Scopes.GroupBy(x => x.Name).Count().ShouldBe(2); - } - - [Fact] - public async Task FindIdentityResourcesByScopeAsync_Should_Return_For_Given_Scopes() - { - //Act - var identityResourcesByScope = await _resourceStore.FindIdentityResourcesByScopeAsync(new List - { - "Test-Identity-Resource-Name-1" - }); - - //Assert - var resourcesByScope = identityResourcesByScope as IdentityResource[] ?? identityResourcesByScope.ToArray(); - resourcesByScope.Length.ShouldBe(1); - resourcesByScope.First().DisplayName.ShouldBe("Test-Identity-Resource-DisplayName-1"); - resourcesByScope.First().Description.ShouldBe("Test-Identity-Resource-Description-1"); - resourcesByScope.First().Required.ShouldBe(true); - } - - [Fact] - public async Task GetAllResourcesAsync_Should_Return() - { - //Act - var resources = await _resourceStore.GetAllResourcesAsync(); - - //Assert - resources.ShouldNotBe(null); - resources.ApiResources.Count.ShouldBe(1); - resources.ApiResources.First().Name.ShouldBe("Test-ApiResource-Name-1"); - resources.IdentityResources.First().Name.ShouldBe("Test-Identity-Resource-Name-1"); - resources.IdentityResources.First().Required.ShouldBe(true); - } - } -} diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs deleted file mode 100644 index 9a87e30d64..0000000000 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/Clients/PersistentGrant_Tests.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using IdentityServer4.Models; -using IdentityServer4.Stores; -using Microsoft.Extensions.DependencyInjection; -using Shouldly; -using Xunit; - -namespace Volo.Abp.IdentityServer.Clients -{ - public class PersistentGrantStore_Tests : AbpIdentityServerTestBase - { - private readonly IPersistedGrantStore _persistedGrantStore; - - public PersistentGrantStore_Tests() - { - _persistedGrantStore = ServiceProvider.GetRequiredService(); - } - - [Fact] - public async Task FindClientByIdAsync_Should_Return_Null_If_Not_Found() - { - var persistentGrant = await _persistedGrantStore.GetAsync("not-existing-id"); - persistentGrant.ShouldBeNull(); - } - - [Fact] - public async Task FindPersistentGrantByIdAsync_Should_Return_The_PersistentGrant_If_Found() - { - //Act - var client = await _persistedGrantStore.GetAsync("38"); - - //Assert - client.ShouldNotBeNull(); - client.ClientId.ShouldBe("TestClientId-38"); - client.SubjectId.ShouldBe("TestSubject"); - client.Data.ShouldContain("TestData-38"); - client.Type.ShouldContain("TestType-38"); - } - - [Fact] - public async Task StoreAsync_Should_Store_PersistedGrant() - { - //Act - await _persistedGrantStore.StoreAsync(new PersistedGrant - { - Key = "39", - ClientId = "TestClientId-39", - Type = "TestType-39", - SubjectId = "TestSubject", - Data = "TestData-39", - Expiration = new DateTime(2018, 1, 6, 21, 22, 23), - CreationTime = new DateTime(2018, 1, 5, 19, 20, 21) - }); - - //Assert - var persistedGrant = await _persistedGrantStore.GetAsync("39"); - persistedGrant.Key.ShouldBe("39"); - persistedGrant.ClientId.ShouldBe("TestClientId-39"); - persistedGrant.Type.ShouldBe("TestType-39"); - persistedGrant.SubjectId.ShouldBe("TestSubject"); - persistedGrant.Data.ShouldBe("TestData-39"); - - persistedGrant.Expiration.HasValue.ShouldBe(true); - persistedGrant.Expiration.Value.Year.ShouldBe(2018); - persistedGrant.Expiration.Value.Month.ShouldBe(1); - persistedGrant.Expiration.Value.Day.ShouldBe(6); - persistedGrant.Expiration.Value.Hour.ShouldBe(21); - persistedGrant.Expiration.Value.Minute.ShouldBe(22); - persistedGrant.Expiration.Value.Second.ShouldBe(23); - - persistedGrant.CreationTime.Year.ShouldBe(2018); - persistedGrant.CreationTime.Month.ShouldBe(1); - persistedGrant.CreationTime.Day.ShouldBe(5); - persistedGrant.CreationTime.Hour.ShouldBe(19); - persistedGrant.CreationTime.Minute.ShouldBe(20); - persistedGrant.CreationTime.Second.ShouldBe(21); - } - - [Fact] - public async Task GetAllAsync_Should_Get_All_PersistedGrants_For_A_Given_SubjectId() - { - //Act - var persistentGrants = await _persistedGrantStore.GetAllAsync("TestSubject"); - - //Assert - var persistedGrants = persistentGrants as PersistedGrant[] ?? persistentGrants.ToArray(); - persistedGrants.ShouldNotBe(null); - persistedGrants.Length.ShouldBe(2); - persistedGrants[0].SubjectId.ShouldBe("TestSubject"); - persistedGrants[1].SubjectId.ShouldBe("TestSubject"); - } - - [Fact] - public async Task RemoveAsync_Should_Remove_PeristedGrant() - { - //Arrange - await _persistedGrantStore.StoreAsync(new PersistedGrant - { - Key = "#1P3R" - }); - - //Act - await _persistedGrantStore.RemoveAsync("#1P3R"); - - //Assert - var persistedGrant = await _persistedGrantStore.GetAsync("#1P3R"); - persistedGrant.ShouldBe(null); - } - - [Fact] - public async Task RemoveAllAsync_Should_RemoveAll_PeristedGrants_For_A_Given_Subject_And_ClientId() - { - //Arrange - var persistedGrantsWithTestSubjectX = await _persistedGrantStore.GetAllAsync("TestSubject-X"); - var persistedGrantsWithTestSubjectXBeforeLength = persistedGrantsWithTestSubjectX.ToArray().Length; - - //Act - await _persistedGrantStore.RemoveAllAsync("TestSubject-X", "TestClientId-X"); - - //Assert - persistedGrantsWithTestSubjectXBeforeLength.ShouldBe(2); - - var persistedGrants = (await _persistedGrantStore.GetAllAsync("TestClientId-37")).ToArray(); - persistedGrants.ShouldNotBe(null); - persistedGrants.Length.ShouldBe(0); - } - } -} diff --git a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk.Application.Tests.csproj b/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk.Application.Tests.csproj deleted file mode 100644 index 185f0ec7c9..0000000000 --- a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk.Application.Tests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - netcoreapp2.0 - AbpDesk.Application.Tests - AbpDesk.Application.Tests - true - false - false - false - - - - - - - - - - - - - - - - - - - - diff --git a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/AbpDeskApplicationTestBase.cs b/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/AbpDeskApplicationTestBase.cs deleted file mode 100644 index 535fffe8bc..0000000000 --- a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/AbpDeskApplicationTestBase.cs +++ /dev/null @@ -1,34 +0,0 @@ -using AbpDesk.EntityFrameworkCore; -using AbpDesk.Tickets; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; - -namespace AbpDesk -{ - public abstract class AbpDeskApplicationTestBase : AbpIntegratedTest - { - protected AbpDeskApplicationTestBase() - { - SeedTestData(); - } - - //TODO: Make changing DI framework in unit tests easier. - - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - - protected virtual void SeedTestData() - { - using (var scope = ServiceProvider.CreateScope()) - { - var dbContext = scope.ServiceProvider.GetRequiredService(); - - dbContext.Set().Add(new Ticket("My test ticket 1 title", "My test ticket 1 body")); - - dbContext.SaveChanges(); - } - } - } -} \ No newline at end of file diff --git a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/AbpDeskApplicationTestModule.cs b/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/AbpDeskApplicationTestModule.cs deleted file mode 100644 index 9b87238610..0000000000 --- a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/AbpDeskApplicationTestModule.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using AbpDesk.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Autofac; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace AbpDesk -{ - //TODO: Remove AbpAutofacModule and add it to AbpDesk application's Core module! - [DependsOn(typeof(AbpDeskApplicationModule), typeof(AbpDeskEntityFrameworkCoreModule), typeof(AbpAutofacModule))] - public class AbpDeskApplicationTestModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddEntityFrameworkInMemoryDatabase(); - - var connStr = Guid.NewGuid().ToString(); - - services.Configure(options => - { - options.ConnectionStrings.Default = connStr; - }); - - services.Configure(options => - { - options.Configure(context => - { - context.DbContextOptions.UseInMemoryDatabase(context.ConnectionString); - }); - }); - } - } -} diff --git a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/Tickets/TicketAppService_Tests.cs b/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/Tickets/TicketAppService_Tests.cs deleted file mode 100644 index 06de028db7..0000000000 --- a/test/AbpDesk/AbpDesk.Application.Tests/AbpDesk/Tickets/TicketAppService_Tests.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Threading.Tasks; -using AbpDesk.Tickets.Dtos; -using Microsoft.Extensions.DependencyInjection; -using Shouldly; -using Xunit; - -namespace AbpDesk.Tickets -{ - public class TicketAppService_Tests : AbpDeskApplicationTestBase - { - private readonly ITicketAppService _ticketAppService; - - public TicketAppService_Tests() - { - _ticketAppService = ServiceProvider.GetRequiredService(); - } - - [Fact] - public async Task GetAll_Test() - { - //Act - - var result = await _ticketAppService.GetAll(new GetAllTicketsInput()); - - //Assert - - result.Items.Count.ShouldBe(1); - } - - [Fact] - public async Task GetAll_Filtered_Test() - { - //Act - - var result = await _ticketAppService.GetAll(new GetAllTicketsInput { Filter = "non-existing-text" }); - - //Assert - - result.Items.Count.ShouldBe(0); - } - - [Fact] - public void GetAll2_Test() - { - //Act - - var result = _ticketAppService.GetAll2(new GetAllTicketsInput()); - - //Assert - - result.Items.Count.ShouldBe(1); - } - } -} diff --git a/test/AbpDesk/AbpDesk.Application.Tests/Properties/AssemblyInfo.cs b/test/AbpDesk/AbpDesk.Application.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 8256319a0a..0000000000 --- a/test/AbpDesk/AbpDesk.Application.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AbpDesk.Application.Tests")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e6e2467c-184a-4a0a-929f-932d5097953e")] diff --git a/test/Volo.Abp.Identity.Application.Tests/Volo.Abp.Identity.Application.Tests.csproj b/test/Volo.Abp.Identity.Application.Tests/Volo.Abp.Identity.Application.Tests.csproj deleted file mode 100644 index 9bb754c33e..0000000000 --- a/test/Volo.Abp.Identity.Application.Tests/Volo.Abp.Identity.Application.Tests.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - netcoreapp2.0 - Volo.Abp.Identity.Application.Tests - Volo.Abp.Identity.Application.Tests - true - false - false - false - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestBase.cs b/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestBase.cs deleted file mode 100644 index efaa376f26..0000000000 --- a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestBase.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.Identity -{ - public class AbpIdentityApplicationTestBase : AbpIdentityCommonTestBase - { - - } -} diff --git a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestModule.cs b/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestModule.cs deleted file mode 100644 index 54763c0169..0000000000 --- a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Autofac; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Identity -{ - [DependsOn( - typeof(AbpIdentityApplicationModule), - typeof(AbpIdentityEntityFrameworkCoreModule), - typeof(AbpAutofacModule), - typeof(AbpIdentityDomainTestModule), - typeof(AbpTestBaseModule) - )] - public class AbpIdentityApplicationTestModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAlwaysAllowPermissionChecker(); - services.AddAssemblyOf(); - } - } -} diff --git a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs b/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs deleted file mode 100644 index ba6b515a74..0000000000 --- a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using Shouldly; - -namespace Volo.Abp.Identity -{ - public class IdentityRoleAppService_Tests: AbpIdentityApplicationTestBase - { - private readonly IIdentityRoleAppService _roleAppService; - private readonly IIdentityRoleRepository _roleRepository; - - public IdentityRoleAppService_Tests() - { - _roleAppService = GetRequiredService(); - _roleRepository = GetRequiredService(); - } - - [Fact] - public async Task GetAsync() - { - //Arrange - - var moderator = await GetRoleAsync("moderator"); - - //Act - - var result = await _roleAppService.GetAsync(moderator.Id); - - //Assert - - result.Id.ShouldBe(moderator.Id); - } - - [Fact] - public async Task GetListAsync() - { - //Act - - var result = await _roleAppService.GetListAsync(new GetIdentityRolesInput()); - - //Assert - - result.TotalCount.ShouldBeGreaterThan(0); - result.Items.Count.ShouldBeGreaterThan(0); - } - - [Fact] - public async Task CreateAsync() - { - //Arrange - - var input = new IdentityRoleCreateDto - { - Name = Guid.NewGuid().ToString("N").Left(8) - }; - - //Act - - var result = await _roleAppService.CreateAsync(input); - - //Assert - - result.Id.ShouldNotBe(Guid.Empty); - result.Name.ShouldBe(input.Name); - - var role = await _roleRepository.GetAsync(result.Id); - role.Name.ShouldBe(input.Name); - } - - [Fact] - public async Task UpdateAsync() - { - //Arrange - - var moderator = await GetRoleAsync("moderator"); - - var input = new IdentityRoleUpdateDto - { - Name = Guid.NewGuid().ToString("N").Left(8) - }; - - //Act - - var result = await _roleAppService.UpdateAsync(moderator.Id, input); - - //Assert - - result.Id.ShouldBe(moderator.Id); - result.Name.ShouldBe(input.Name); - - var updatedRole = await _roleRepository.GetAsync(moderator.Id); - updatedRole.Name.ShouldBe(input.Name); - } - - [Fact] - public async Task DeleteAsync() - { - //Arrange - - var moderator = await GetRoleAsync("moderator"); - - //Act - - await _roleAppService.DeleteAsync(moderator.Id); - - //Assert - - (await FindRoleAsync("moderator")).ShouldBeNull(); - } - - private async Task GetRoleAsync(string roleName) - { - return (await _roleRepository.GetListAsync()).First(u => u.Name == roleName); - } - - private async Task FindRoleAsync(string roleName) - { - return (await _roleRepository.GetListAsync()).FirstOrDefault(u => u.Name == roleName); - } - } -} diff --git a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityUserAppService_Tests.cs b/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityUserAppService_Tests.cs deleted file mode 100644 index e4538c3570..0000000000 --- a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityUserAppService_Tests.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System; -using System.Threading.Tasks; -using Shouldly; -using Volo.Abp.Domain.Entities; -using Xunit; - -namespace Volo.Abp.Identity -{ - public class IdentityUserAppService_Tests : AbpIdentityApplicationTestBase - { - private readonly IIdentityUserAppService _userAppService; - private readonly IIdentityUserRepository _userRepository; - - public IdentityUserAppService_Tests() - { - _userAppService = GetRequiredService(); - _userRepository = GetRequiredService(); - } - - [Fact] - public async Task GetAsync() - { - //Arrange - - var johnNash = await GetUserAsync("john.nash"); - - //Act - - var result = await _userAppService.GetAsync(johnNash.Id); - - //Assert - - result.Id.ShouldBe(johnNash.Id); - result.UserName.ShouldBe(johnNash.UserName); - result.Email.ShouldBe(johnNash.Email); - result.LockoutEnabled.ShouldBe(johnNash.LockoutEnabled); - result.PhoneNumber.ShouldBe(johnNash.PhoneNumber); - } - - [Fact] - public async Task GetListAsync() - { - //Act - - var result = await _userAppService.GetListAsync(new GetIdentityUsersInput()); - - //Assert - - result.TotalCount.ShouldBeGreaterThan(0); - result.Items.Count.ShouldBeGreaterThan(0); - } - - [Fact] - public async Task CreateAsync() - { - //Arrange - - var input = new IdentityUserCreateDto - { - UserName = Guid.NewGuid().ToString(), - Email = CreateRandomEmail(), - LockoutEnabled = true, - PhoneNumber = CreateRandomPhoneNumber(), - Password = "123qwE4r*", - RoleNames = new[] { "moderator" } - }; - - //Act - - var result = await _userAppService.CreateAsync(input); - - //Assert - - result.Id.ShouldNotBe(Guid.Empty); - result.UserName.ShouldBe(input.UserName); - result.Email.ShouldBe(input.Email); - result.LockoutEnabled.ShouldBe(input.LockoutEnabled); - result.PhoneNumber.ShouldBe(input.PhoneNumber); - - var user = await _userRepository.GetAsync(result.Id); - user.Id.ShouldBe(result.Id); - user.UserName.ShouldBe(input.UserName); - user.Email.ShouldBe(input.Email); - user.LockoutEnabled.ShouldBe(input.LockoutEnabled); - user.PhoneNumber.ShouldBe(input.PhoneNumber); - } - - [Fact] - public async Task UpdateAsync() - { - //Arrange - - var johnNash = await GetUserAsync("john.nash"); - - var input = new IdentityUserUpdateDto - { - UserName = johnNash.UserName, - LockoutEnabled = true, - TwoFactorEnabled = true, - PhoneNumber = CreateRandomPhoneNumber(), - Email = CreateRandomEmail() - }; - - //Act - - var result = await _userAppService.UpdateAsync(johnNash.Id, input); - - //Assert - - result.Id.ShouldBe(johnNash.Id); - result.UserName.ShouldBe(input.UserName); - result.Email.ShouldBe(input.Email); - result.LockoutEnabled.ShouldBe(input.LockoutEnabled); - result.PhoneNumber.ShouldBe(input.PhoneNumber); - - var user = await _userRepository.GetAsync(result.Id); - user.Id.ShouldBe(result.Id); - user.UserName.ShouldBe(input.UserName); - user.Email.ShouldBe(input.Email); - user.LockoutEnabled.ShouldBe(input.LockoutEnabled); - user.PhoneNumber.ShouldBe(input.PhoneNumber); - } - - [Fact] - public async Task DeleteAsync() - { - //Arrange - - var johnNash = await GetUserAsync("john.nash"); - - //Act - - await _userAppService.DeleteAsync(johnNash.Id); - - //Assert - - (await FindUserAsync("john.nash")).ShouldBeNull(); - } - - [Fact] - public async Task GetRolesAsync() - { - //Arrange - - var johnNash = await GetUserAsync("john.nash"); - - //Act - - var result = await _userAppService.GetRolesAsync(johnNash.Id); - - //Assert - - result.Items.Count.ShouldBe(2); - result.Items.ShouldContain(r => r.Name == "moderator"); - result.Items.ShouldContain(r => r.Name == "supporter"); - } - - [Fact] - public async Task UpdateRolesAsync() - { - //Arrange - - var johnNash = await GetUserAsync("john.nash"); - - //Act - - await _userAppService.UpdateRolesAsync( - johnNash.Id, - new IdentityUserUpdateRolesDto - { - RoleNames = new[] {"moderator", "admin"} - } - ); - - //Assert - - var roleNames = await _userRepository.GetRoleNamesAsync(johnNash.Id); - roleNames.Count.ShouldBe(2); - roleNames.ShouldContain("admin"); - roleNames.ShouldContain("moderator"); - } - - private async Task GetUserAsync(string userName) - { - var user = await FindUserAsync(userName); - if (user == null) - { - throw new EntityNotFoundException(); - } - - return user; - } - - private async Task FindUserAsync(string userName) - { - return await _userRepository.FindByNormalizedUserNameAsync(userName.ToUpperInvariant()); - } - - private static string CreateRandomEmail() - { - return Guid.NewGuid().ToString("N").Left(16) + "@abp.io"; - } - - private static string CreateRandomPhoneNumber() - { - return RandomHelper.GetRandom(10000000, 100000000).ToString(); - } - } -} diff --git a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/PermissionManager_Tests.cs b/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/PermissionManager_Tests.cs deleted file mode 100644 index c92bc04879..0000000000 --- a/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/PermissionManager_Tests.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Shouldly; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Permissions; -using Xunit; - -namespace Volo.Abp.Identity -{ - public class PermissionManager_Tests : AbpIdentityApplicationTestBase - { - private readonly IPermissionManager _permissionManager; - private readonly IPermissionStore _permissionStore; - - public PermissionManager_Tests() - { - _permissionManager = GetRequiredService(); - _permissionStore = GetRequiredService(); - } - - [Fact] - public async Task Roles_Should_Have_Configured_Permissions() - { - //admin - var grantInfos = await _permissionManager.GetAllForRoleAsync("admin"); - RoleShouldHavePermission(grantInfos, "admin", TestPermissionNames.MyPermission1); - RoleShouldHavePermission(grantInfos, "admin", TestPermissionNames.MyPermission2); - RoleShouldHavePermission(grantInfos, "admin", TestPermissionNames.MyPermission2_ChildPermission1); - - //moderator - grantInfos = await _permissionManager.GetAllForRoleAsync("moderator"); - RoleShouldHavePermission(grantInfos, "moderator", TestPermissionNames.MyPermission1); - RoleShouldHavePermission(grantInfos, "moderator", TestPermissionNames.MyPermission2); - ShouldNotHavePermission(grantInfos, TestPermissionNames.MyPermission2_ChildPermission1); - - //supporter - grantInfos = await _permissionManager.GetAllForRoleAsync("supporter"); - RoleShouldHavePermission(grantInfos, "supporter", TestPermissionNames.MyPermission1); - ShouldNotHavePermission(grantInfos, TestPermissionNames.MyPermission2); - ShouldNotHavePermission(grantInfos, TestPermissionNames.MyPermission2_ChildPermission1); - } - - [Fact] - public async Task Should_Grant_Permission_To_Role() - { - (await _permissionManager.GetForRoleAsync("supporter", TestPermissionNames.MyPermission2)).IsGranted.ShouldBeFalse(); - (await _permissionStore.IsGrantedAsync(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, "supporter")).ShouldBeFalse(); - - await _permissionManager.SetForRoleAsync("supporter", TestPermissionNames.MyPermission2, true); - - (await _permissionManager.GetForRoleAsync("supporter", TestPermissionNames.MyPermission2)).IsGranted.ShouldBeTrue(); - (await _permissionStore.IsGrantedAsync(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, "supporter")).ShouldBeTrue(); - } - - [Fact] - public async Task Should_Revoke_Permission_From_Role() - { - (await _permissionManager.GetForRoleAsync("moderator", TestPermissionNames.MyPermission1)).IsGranted.ShouldBeTrue(); - await _permissionManager.SetForRoleAsync("moderator", TestPermissionNames.MyPermission1, false); - (await _permissionManager.GetForRoleAsync("moderator", TestPermissionNames.MyPermission1)).IsGranted.ShouldBeFalse(); - } - - [Fact] - public async Task Users_Should_Have_Configured_Values() - { - //administrator - var user = GetUserAsync("administrator"); - var grantInfos = await _permissionManager.GetAllForUserAsync(user.Id); - UserShouldHavePermission(grantInfos, user.Id, TestPermissionNames.MyPermission1, "admin"); - UserShouldHavePermission(grantInfos, user.Id, TestPermissionNames.MyPermission2, "admin"); - UserShouldHavePermission(grantInfos, user.Id, TestPermissionNames.MyPermission2_ChildPermission1, "admin"); - - //john.nash - user = GetUserAsync("john.nash"); - grantInfos = await _permissionManager.GetAllForUserAsync(user.Id); - UserShouldHavePermission(grantInfos, user.Id, TestPermissionNames.MyPermission1, "moderator", "supporter"); - UserShouldHavePermission(grantInfos, user.Id, TestPermissionNames.MyPermission2, "moderator"); - ShouldNotHavePermission(grantInfos, TestPermissionNames.MyPermission2_ChildPermission1); - - //john.nash - user = GetUserAsync("david"); - grantInfos = await _permissionManager.GetAllForUserAsync(user.Id); - UserShouldHavePermission(grantInfos, user.Id, TestPermissionNames.MyPermission1); - ShouldNotHavePermission(grantInfos, TestPermissionNames.MyPermission2); - ShouldNotHavePermission(grantInfos, TestPermissionNames.MyPermission2_ChildPermission1); - } - - private static void RoleShouldHavePermission(List grantInfos, string roleName, string permissionName) - { - grantInfos.ShouldContain( - p => p.Name == permissionName && - p.IsGranted && - p.Providers.Count == 1 && - p.Providers.Any( - pr => pr.Name == RolePermissionValueProvider.ProviderName && - pr.Key == roleName - ) - ); - } - - private static void UserShouldHavePermission(List grantInfos, Guid userId, string permissionName, params string[] inheritedRolesForThisPermission) - { - grantInfos.ShouldContain( - p => p.Name == permissionName && - p.IsGranted - ); - } - - private static void ShouldNotHavePermission(List grantInfos, string permissionName) - { - grantInfos.ShouldContain( - p => p.Name == permissionName && - !p.IsGranted && - p.Providers.Count == 0 - ); - } - } -} diff --git a/test/Volo.Abp.Identity.Tests/Properties/AssemblyInfo.cs b/test/Volo.Abp.Identity.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 9f9974d329..0000000000 --- a/test/Volo.Abp.Identity.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Volo.Abp.Identity.Tests")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4ab91077-82dc-4335-9274-bce017bd9c8b")] diff --git a/test/Volo.Abp.Identity.Tests/Volo.Abp.Identity.Tests.csproj b/test/Volo.Abp.Identity.Tests/Volo.Abp.Identity.Tests.csproj deleted file mode 100644 index 322a11b74f..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo.Abp.Identity.Tests.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - netcoreapp2.0 - Volo.Abp.Identity.Tests - Volo.Abp.Identity.Tests - true - false - false - false - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityCommonTestBase.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityCommonTestBase.cs deleted file mode 100644 index 2be365ed52..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityCommonTestBase.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Linq; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace Volo.Abp.Identity -{ - public abstract class AbpIdentityCommonTestBase : AbpIntegratedTest - where TStartupModule : IAbpModule - { - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - - - protected virtual IdentityUser GetUserAsync(string userName) - { - return UsingDbContext(context => context.Users.FirstOrDefault(u => u.UserName == userName)); - } - - protected virtual void UsingDbContext(Action action) - { - using (var dbContext = GetRequiredService()) - { - action.Invoke(dbContext); - } - } - - protected virtual T UsingDbContext(Func action) - { - using (var dbContext = GetRequiredService()) - { - return action.Invoke(dbContext); - } - } - } -} diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityDomainTestBase.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityDomainTestBase.cs deleted file mode 100644 index 9a6f55b24d..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityDomainTestBase.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.Identity -{ - public abstract class AbpIdentityDomainTestBase : AbpIdentityCommonTestBase - { - - } -} \ No newline at end of file diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs deleted file mode 100644 index 57e81397b2..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Autofac; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.Permissions.EntityFrameworkCore; -using Volo.Abp.Uow; - -namespace Volo.Abp.Identity -{ - [DependsOn( - typeof(AbpIdentityDomainModule), - typeof(AbpIdentityEntityFrameworkCoreModule), - typeof(AbpPermissionsEntityFrameworkCoreModule), - typeof(AbpAutofacModule))] - public class AbpIdentityDomainTestModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddEntityFrameworkInMemoryDatabase(); - - var databaseName = Guid.NewGuid().ToString(); - - services.Configure(options => - { - options.Configure(context => - { - context.DbContextOptions.UseInMemoryDatabase(databaseName); - }); - }); - - services.Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions - }); - - services.Configure(options => - { - options.DefinitionProviders.Add(); - }); - - services.AddAssemblyOf(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - SeedTestData(context); - } - - private static void SeedTestData(ApplicationInitializationContext context) - { - using (var scope = context.ServiceProvider.CreateScope()) - { - scope.ServiceProvider - .GetRequiredService() - .Build(); - } - } - } -} diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityTestDataBuilder.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityTestDataBuilder.cs deleted file mode 100644 index 2b362d2f6f..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/AbpIdentityTestDataBuilder.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; -using Volo.Abp.Permissions; - -namespace Volo.Abp.Identity -{ - public class AbpIdentityTestDataBuilder : ITransientDependency - { - private readonly IGuidGenerator _guidGenerator; - private readonly IIdentityUserRepository _userRepository; - private readonly IIdentityRoleRepository _roleRepository; - private readonly IPermissionGrantRepository _permissionGrantRepository; - - private IdentityRole _adminRole; - private IdentityRole _moderator; - private IdentityRole _supporterRole; - private IdentityUser _adminUser; - private IdentityUser _john; - private IdentityUser _david; - - public AbpIdentityTestDataBuilder( - IGuidGenerator guidGenerator, - IIdentityUserRepository userRepository, - IIdentityRoleRepository roleRepository, - IPermissionGrantRepository permissionGrantRepository) - { - _guidGenerator = guidGenerator; - _userRepository = userRepository; - _roleRepository = roleRepository; - _permissionGrantRepository = permissionGrantRepository; - } - - public void Build() - { - AddRoles(); - AddRolePermissions(); - AddUsers(); - AddUserPermissions(); - } - - private void AddRoles() - { - _adminRole = new IdentityRole(_guidGenerator.Create(), "admin"); - _moderator = new IdentityRole(_guidGenerator.Create(), "moderator"); - _supporterRole = new IdentityRole(_guidGenerator.Create(), "supporter"); - - _roleRepository.Insert(_adminRole); - _roleRepository.Insert(_moderator); - _roleRepository.Insert(_supporterRole); - } - - private void AddRolePermissions() - { - AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, _adminRole.Name); - AddPermission(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, _adminRole.Name); - AddPermission(TestPermissionNames.MyPermission2_ChildPermission1, RolePermissionValueProvider.ProviderName, _adminRole.Name); - - AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, _moderator.Name); - AddPermission(TestPermissionNames.MyPermission2, RolePermissionValueProvider.ProviderName, _moderator.Name); - - AddPermission(TestPermissionNames.MyPermission1, RolePermissionValueProvider.ProviderName, _supporterRole.Name); - } - - private void AddUsers() - { - _adminUser = new IdentityUser(_guidGenerator.Create(), "administrator"); - _adminUser.AddRole(_adminRole.Id); - _userRepository.Insert(_adminUser); - - _john = new IdentityUser(_guidGenerator.Create(), "john.nash"); - _john.AddRole(_moderator.Id); - _john.AddRole(_supporterRole.Id); - _userRepository.Insert(_john); - - _david = new IdentityUser(_guidGenerator.Create(), "david"); - _userRepository.Insert(_david); - } - - private void AddUserPermissions() - { - AddPermission(TestPermissionNames.MyPermission1, UserPermissionValueProvider.ProviderName, _david.Id.ToString()); - } - - private void AddPermission(string permissionName, string providerName, string providerKey) - { - _permissionGrantRepository.Insert( - new PermissionGrant( - _guidGenerator.Create(), - permissionName, - providerName, - providerKey - ) - ); - } - } -} \ No newline at end of file diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/IdentityTestPermissionDefinitionProvider.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/IdentityTestPermissionDefinitionProvider.cs deleted file mode 100644 index 323758cd9f..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/IdentityTestPermissionDefinitionProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Volo.Abp.Authorization.Permissions; - -namespace Volo.Abp.Identity -{ - public class IdentityTestPermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var testGroup = context.AddGroup(TestPermissionNames.Groups.TestGroup); - - testGroup.AddPermission(TestPermissionNames.MyPermission1); - - var myPermission2 = testGroup.AddPermission(TestPermissionNames.MyPermission2); - myPermission2.AddChild(TestPermissionNames.MyPermission2_ChildPermission1); - } - } -} diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Identity_Repository_Resolve_Tests.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Identity_Repository_Resolve_Tests.cs deleted file mode 100644 index 7c043c0532..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Identity_Repository_Resolve_Tests.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Microsoft.Extensions.DependencyInjection; -using Shouldly; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.DynamicProxy; -using Xunit; - -namespace Volo.Abp.Identity -{ - public class Identity_Repository_Resolve_Tests : AbpIdentityDomainTestBase - { - [Fact] - public void Should_Resolve_UserManager() - { - ServiceProvider.GetRequiredService(); - } - - [Fact] - public void Should_Resolve_RoleManager() - { - ServiceProvider.GetRequiredService(); - } - - [Fact] //Move this test to Volo.Abp.EntityFrameworkCore.Tests since it's actually testing the EF Core repository registration! - public void Should_Resolve_Repositories() - { - var x = ServiceProvider.GetRequiredService(); - (ProxyHelper.UnProxy(ServiceProvider.GetRequiredService()) is EfCoreIdentityUserRepository).ShouldBeTrue(); - - (ProxyHelper.UnProxy(ServiceProvider.GetRequiredService>()) is EfCoreIdentityUserRepository).ShouldBeTrue(); - //(ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); - - (ProxyHelper.UnProxy(ServiceProvider.GetRequiredService>()) is EfCoreIdentityUserRepository).ShouldBeTrue(); - //(ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); - } - } -} diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/TestPermissionNames.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/TestPermissionNames.cs deleted file mode 100644 index 1e65171eae..0000000000 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/TestPermissionNames.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Volo.Abp.Identity -{ - public static class TestPermissionNames - { - public static class Groups - { - public const string TestGroup = "TestGroup"; - } - - public const string MyPermission1 = "MyPermission1"; - public const string MyPermission2 = "MyPermission2"; - public const string MyPermission2_ChildPermission1 = "MyPermission2.ChildPermission1"; - } -} \ No newline at end of file diff --git a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo.Abp.MultiTenancy.Application.Tests.csproj b/test/Volo.Abp.MultiTenancy.Application.Tests/Volo.Abp.MultiTenancy.Application.Tests.csproj deleted file mode 100644 index 4fd3b9cc1a..0000000000 --- a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo.Abp.MultiTenancy.Application.Tests.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netcoreapp2.0 - Volo.Abp.MultiTenancy.Application.Tests - Volo.Abp.MultiTenancy.Application.Tests - true - false - false - false - - - - - - - - - - - - - - - - diff --git a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationTestBase.cs b/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationTestBase.cs deleted file mode 100644 index 989d2932c7..0000000000 --- a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationTestBase.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; - -namespace Volo.Abp.MultiTenancy -{ - public abstract class AbpMultiTenancyApplicationTestBase : AbpIntegratedTest - { - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - - protected virtual void UsingDbContext(Action action) - { - using (var dbContext = GetRequiredService()) - { - action.Invoke(dbContext); - } - } - - protected virtual T UsingDbContext(Func action) - { - using (var dbContext = GetRequiredService()) - { - return action.Invoke(dbContext); - } - } - } -} diff --git a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationTestModule.cs b/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationTestModule.cs deleted file mode 100644 index 62e81dbb47..0000000000 --- a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyApplicationTestModule.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Autofac; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.MultiTenancy.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.Uow; - -namespace Volo.Abp.MultiTenancy -{ - [DependsOn( - typeof(AbpMultiTenancyApplicationModule), - typeof(AbpMultiTenancyEntityFrameworkCoreModule), - typeof(AbpTestBaseModule), - typeof(AbpAutofacModule))] - public class AbpMultiTenancyApplicationTestModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddEntityFrameworkInMemoryDatabase(); - - var databaseName = Guid.NewGuid().ToString(); - - services.Configure(options => - { - options.Configure(context => - { - context.DbContextOptions.UseInMemoryDatabase(databaseName); - }); - }); - - services.Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions - }); - - services.AddAlwaysAllowPermissionChecker(); - - services.AddAssemblyOf(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - SeedTestData(context); - } - - private static void SeedTestData(ApplicationInitializationContext context) - { - using (var scope = context.ServiceProvider.CreateScope()) - { - scope.ServiceProvider - .GetRequiredService() - .Build(); - } - } - } -} diff --git a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyTestDataBuilder.cs b/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyTestDataBuilder.cs deleted file mode 100644 index f55e59c855..0000000000 --- a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/AbpMultiTenancyTestDataBuilder.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Threading; - -namespace Volo.Abp.MultiTenancy -{ - public class AbpMultiTenancyTestDataBuilder : ITransientDependency - { - private readonly ITenantRepository _tenantRepository; - private readonly ITenantManager _tenantManager; - - public AbpMultiTenancyTestDataBuilder( - ITenantRepository tenantRepository, - ITenantManager tenantManager) - { - _tenantRepository = tenantRepository; - _tenantManager = tenantManager; - } - - public void Build() - { - AsyncHelper.RunSync(AddTenantsAsync); - } - - private async Task AddTenantsAsync() - { - var acme = await _tenantManager.CreateAsync("acme"); - await _tenantRepository.InsertAsync(acme); - - var volosoft = await _tenantManager.CreateAsync("volosoft"); - await _tenantRepository.InsertAsync(volosoft); - } - } -} \ No newline at end of file diff --git a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/TenantAppService_Tests.cs b/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/TenantAppService_Tests.cs deleted file mode 100644 index 7d4726e834..0000000000 --- a/test/Volo.Abp.MultiTenancy.Application.Tests/Volo/Abp/MultiTenancy/TenantAppService_Tests.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Shouldly; -using Volo.Abp.Ui; -using Xunit; - -namespace Volo.Abp.MultiTenancy -{ - public class TenantAppService_Tests : AbpMultiTenancyApplicationTestBase - { - private readonly ITenantAppService _tenantAppService; - - public TenantAppService_Tests() - { - _tenantAppService = GetRequiredService(); - } - - [Fact] - public async Task GetAsync() - { - var tenantInDb = UsingDbContext(dbContext => dbContext.Tenants.First()); - var tenant = await _tenantAppService.GetAsync(tenantInDb.Id); - tenant.Name.ShouldBe(tenantInDb.Name); - } - - [Fact] - public async Task GetListAsync() - { - var result = await _tenantAppService.GetListAsync(new GetTenantsInput()); - result.TotalCount.ShouldBeGreaterThan(0); - result.Items.ShouldContain(t => t.Name == "acme"); - result.Items.ShouldContain(t => t.Name == "volosoft"); - } - - [Fact] - public async Task GetListAsync_Filtered() - { - var result = await _tenantAppService.GetListAsync(new GetTenantsInput { Filter = "volo" }); - result.TotalCount.ShouldBeGreaterThan(0); - result.Items.ShouldNotContain(t => t.Name == "acme"); - result.Items.ShouldContain(t => t.Name == "volosoft"); - } - - [Fact] - public async Task GetListAsync_Sorted_Descending_By_Name() - { - var result = await _tenantAppService.GetListAsync(new GetTenantsInput { Sorting = "Name DESC" }); - result.TotalCount.ShouldBeGreaterThan(0); - var tenants = result.Items.ToList(); - - tenants.ShouldContain(t => t.Name == "acme"); - tenants.ShouldContain(t => t.Name == "volosoft"); - - tenants.FindIndex(t => t.Name == "acme").ShouldBeGreaterThan(tenants.FindIndex(t => t.Name == "volosoft")); - } - - [Fact] - public async Task CreateAsync() - { - var tenancyName = Guid.NewGuid().ToString("N").ToLowerInvariant(); - var tenant = await _tenantAppService.CreateAsync(new TenantCreateDto { Name = tenancyName }); - tenant.Name.ShouldBe(tenancyName); - tenant.Id.ShouldNotBe(default(Guid)); - } - - [Fact] - public async Task CreateAsync_Should_Not_Allow_Duplicate_Names() - { - await Assert.ThrowsAsync(async () => - { - await _tenantAppService.CreateAsync(new TenantCreateDto { Name = "acme" }); - }); - } - - [Fact] - public async Task UpdateAsync() - { - var acme = UsingDbContext(dbContext => dbContext.Tenants.Single(t => t.Name == "acme")); - - var result = await _tenantAppService.UpdateAsync(acme.Id, new TenantUpdateDto { Name = "acme-renamed" }); - result.Id.ShouldBe(acme.Id); - result.Name.ShouldBe("acme-renamed"); - - var acmeUpdated = UsingDbContext(dbContext => dbContext.Tenants.Single(t => t.Id == acme.Id)); - acmeUpdated.Name.ShouldBe("acme-renamed"); - } - - [Fact] - public async Task UpdateAsync_Should_Not_Allow_Duplicate_Names() - { - var acme = UsingDbContext(dbContext => dbContext.Tenants.Single(t => t.Name == "acme")); - - await Assert.ThrowsAsync(async () => - { - await _tenantAppService.UpdateAsync(acme.Id, new TenantUpdateDto { Name = "volosoft" }); - }); - } - - [Fact] - public async Task DeleteAsync() - { - var acme = UsingDbContext(dbContext => dbContext.Tenants.Single(t => t.Name == "acme")); - - await _tenantAppService.DeleteAsync(acme.Id); - - UsingDbContext(dbContext => - { - dbContext.Tenants.Any(t => t.Id == acme.Id).ShouldBeFalse(); - }); - } - } -} diff --git a/test/Volo.Abp.Permissions.Tests/Volo.Abp.Permissions.Tests.csproj b/test/Volo.Abp.Permissions.Tests/Volo.Abp.Permissions.Tests.csproj deleted file mode 100644 index b2043b55fb..0000000000 --- a/test/Volo.Abp.Permissions.Tests/Volo.Abp.Permissions.Tests.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netcoreapp2.0 - Volo.Abp.Permissions.Tests - Volo.Abp.Permissions.Tests - true - false - false - false - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/AbpPermissionTestModule.cs b/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/AbpPermissionTestModule.cs deleted file mode 100644 index a9c3759785..0000000000 --- a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/AbpPermissionTestModule.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Autofac; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.Permissions.EntityFrameworkCore; -using Volo.Abp.Uow; -using Volo.Abp.Users; - -namespace Volo.Abp.Permissions -{ - [DependsOn( - typeof(AbpPermissionsEntityFrameworkCoreModule), - typeof(AbpUsersModule), - typeof(AbpAutofacModule))] - public class AbpPermissionTestModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - - services.AddEntityFrameworkInMemoryDatabase(); - - var databaseName = Guid.NewGuid().ToString(); - - services.Configure(options => - { - options.Configure(context => - { - context.DbContextOptions.UseInMemoryDatabase(databaseName); - }); - }); - - services.Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions - }); - - services.Configure(options => - { - options.DefinitionProviders.Add(); - }); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - SeedTestData(context); - } - - private static void SeedTestData(ApplicationInitializationContext context) - { - using (var scope = context.ServiceProvider.CreateScope()) - { - scope.ServiceProvider - .GetRequiredService() - .Build(); - } - } - } -} diff --git a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionChecker_User_Tests.cs b/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionChecker_User_Tests.cs deleted file mode 100644 index 344e0401e5..0000000000 --- a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionChecker_User_Tests.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Security.Claims; -using System.Threading.Tasks; -using Shouldly; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Security.Claims; -using Xunit; - -namespace Volo.Abp.Permissions -{ - public class PermissionChecker_User_Tests : PermissionTestBase - { - private readonly IPermissionChecker _permissionChecker; - - public PermissionChecker_User_Tests() - { - _permissionChecker = GetRequiredService(); - } - - [Fact] - public async Task Should_Return_True_For_Granted_Current_User() - { - (await _permissionChecker.IsGrantedAsync( - CreatePrincipal(PermissionTestDataBuilder.User1Id), - "MyPermission1" - )).ShouldBeTrue(); - } - - [Fact] - public async Task Should_Return_False_For_Non_Granted_Current_User() - { - (await _permissionChecker.IsGrantedAsync( - CreatePrincipal(PermissionTestDataBuilder.User2Id), - "MyPermission1" - )).ShouldBeFalse(); - } - - [Fact] - public async Task Should_Return_False_For_Current_User_If_Anonymous() - { - (await _permissionChecker.IsGrantedAsync( - CreatePrincipal(null), - "MyPermission1" - )).ShouldBeFalse(); - } - - private static ClaimsPrincipal CreatePrincipal(Guid? userId) - { - var claimsIdentity = new ClaimsIdentity(); - - if (userId != null) - { - claimsIdentity.AddClaim(new Claim(AbpClaimTypes.UserId, userId.ToString())); - } - - return new ClaimsPrincipal(claimsIdentity); - } - } -} diff --git a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionManager_Basic_Tests.cs b/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionManager_Basic_Tests.cs deleted file mode 100644 index 07856c9933..0000000000 --- a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionManager_Basic_Tests.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Threading.Tasks; -using Shouldly; -using Volo.Abp.Authorization.Permissions; -using Xunit; - -namespace Volo.Abp.Permissions -{ - public class PermissionChecker_Basic_Tests : PermissionTestBase - { - private readonly IPermissionChecker _permissionChecker; - - public PermissionChecker_Basic_Tests() - { - _permissionChecker = GetRequiredService(); - } - - [Fact] - public async Task Should_Throw_Exception_If_Permission_Is_Not_Defined() - { - await Assert.ThrowsAsync(async () => - await _permissionChecker.IsGrantedAsync("UndefinedPermissionName") - ); - } - - [Fact] - public async Task Should_Return_False_As_Default_For_Any_Permission() - { - (await _permissionChecker.IsGrantedAsync("MyPermission1")).ShouldBeFalse(); - } - } -} diff --git a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionTestBase.cs b/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionTestBase.cs deleted file mode 100644 index d94784a2fc..0000000000 --- a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionTestBase.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Volo.Abp.Permissions.EntityFrameworkCore; -using Volo.Abp.Users; - -namespace Volo.Abp.Permissions -{ - public class PermissionTestBase : AbpIntegratedTest - { - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - - protected virtual void UsingDbContext(Action action) - { - using (var dbContext = GetRequiredService()) - { - action.Invoke(dbContext); - } - } - - protected virtual T UsingDbContext(Func action) - { - using (var dbContext = GetRequiredService()) - { - return action.Invoke(dbContext); - } - } - - protected List GetSettingsFromDbContext(string entityType, string entityId, string name) - { - return UsingDbContext(context => - context.PermissionGrants.Where( - s => - s.ProviderName == UserSettingValueProvider.ProviderName && - s.ProviderKey == PermissionTestDataBuilder.User1Id.ToString() && - s.Name == "MySetting2" - ).ToList() - ); - } - } -} diff --git a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionTestDataBuilder.cs b/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionTestDataBuilder.cs deleted file mode 100644 index 958bdee161..0000000000 --- a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/PermissionTestDataBuilder.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; - -namespace Volo.Abp.Permissions -{ - public class PermissionTestDataBuilder : ITransientDependency - { - public static Guid User1Id { get; } = Guid.NewGuid(); - public static Guid User2Id { get; } = Guid.NewGuid(); - - private readonly IPermissionGrantRepository _permissionGrantRepository; - private readonly IGuidGenerator _guidGenerator; - - public PermissionTestDataBuilder(IGuidGenerator guidGenerator, IPermissionGrantRepository permissionGrantRepository) - { - _guidGenerator = guidGenerator; - _permissionGrantRepository = permissionGrantRepository; - } - - public void Build() - { - _permissionGrantRepository.Insert( - new PermissionGrant( - _guidGenerator.Create(), - "MyPermission1", - UserPermissionValueProvider.ProviderName, - User1Id.ToString() - ) - ); - } - } -} \ No newline at end of file diff --git a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/TestPermissionDefinitionProvider.cs b/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/TestPermissionDefinitionProvider.cs deleted file mode 100644 index c978d71dc1..0000000000 --- a/test/Volo.Abp.Permissions.Tests/Volo/Abp/Permissions/TestPermissionDefinitionProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Volo.Abp.Authorization.Permissions; - -namespace Volo.Abp.Permissions -{ - public class TestPermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var testGroup = context.AddGroup("TestGroup"); - - testGroup.AddPermission("MyPermission1"); - - var myPermission2 = testGroup.AddPermission("MyPermission2"); - myPermission2.AddChild("MyPermission2.ChildPermission1"); - } - } -} \ No newline at end of file diff --git a/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj b/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj deleted file mode 100644 index 6a15d99742..0000000000 --- a/test/Volo.Abp.Settings.Tests/Volo.Abp.Settings.Tests.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netcoreapp2.0 - Volo.Abp.MultiTenancy.Tests - Volo.Abp.MultiTenancy.Tests - true - false - false - false - - - - - - - - - - - - - - - - diff --git a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/AbpSettingsTestModule.cs b/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/AbpSettingsTestModule.cs deleted file mode 100644 index 7fe5f0168d..0000000000 --- a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/AbpSettingsTestModule.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Autofac; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.Settings.EntityFrameworkCore; -using Volo.Abp.Uow; -using Volo.Abp.Users; - -namespace Volo.Abp.Settings -{ - [DependsOn( - typeof(AbpSettingsEntityFrameworkCoreModule), - typeof(AbpUsersModule), - typeof(AbpAutofacModule))] - public class AbpSettingsTestModule : AbpModule - { - public override void ConfigureServices(IServiceCollection services) - { - services.AddAssemblyOf(); - - services.AddEntityFrameworkInMemoryDatabase(); - - var databaseName = Guid.NewGuid().ToString(); - - services.Configure(options => - { - options.Configure(context => - { - context.DbContextOptions.UseInMemoryDatabase(databaseName); - }); - }); - - services.Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions - }); - - services.Configure(options => - { - options.DefinitionProviders.Add(); - }); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - SeedTestData(context); - } - - private static void SeedTestData(ApplicationInitializationContext context) - { - using (var scope = context.ServiceProvider.CreateScope()) - { - scope.ServiceProvider - .GetRequiredService() - .Build(); - } - } - } -} diff --git a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_Basic_Tests.cs b/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_Basic_Tests.cs deleted file mode 100644 index f874e3e878..0000000000 --- a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_Basic_Tests.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Threading.Tasks; -using Shouldly; -using Xunit; - -namespace Volo.Abp.Settings -{ - public class SettingManager_Basic_Tests : SettingsTestBase - { - private readonly ISettingManager _settingManager; - - public SettingManager_Basic_Tests() - { - _settingManager = GetRequiredService(); - } - - [Fact] - public async Task Should_Throw_Exception_When_Try_To_Get_An_Undefined_Setting() - { - await Assert.ThrowsAsync( - async () => await _settingManager.GetOrNullAsync("UndefinedSetting") - ); - } - - [Fact] - public async Task Should_Get_Default_Value_If_Not_Set_In_Store() - { - var value = await _settingManager.GetOrNullAsync("SettingNotSetInStore"); - value.ShouldBe("default-value"); - } - - [Fact] - public async Task Should_Get_Base_Store_Value() - { - (await _settingManager.GetOrNullAsync("MySetting1")).ShouldBe("42"); - } - - [Fact] - public async Task Should_Get_All_Base_Store_Values() - { - var settingValues = await _settingManager.GetAllAsync(); - settingValues.ShouldContain(sv => sv.Name == "MySetting1" && sv.Value == "42"); - settingValues.ShouldContain(sv => sv.Name == "MySetting2" && sv.Value == "default-store-value"); - settingValues.ShouldContain(sv => sv.Name == "SettingNotSetInStore" && sv.Value == "default-value"); - } - - [Fact] - public async Task Should_Set_Global_Value() - { - await _settingManager.SetGlobalAsync("MySetting1", "43"); - - (await _settingManager.GetOrNullGlobalAsync("MySetting1")).ShouldBe("43"); - (await _settingManager.GetOrNullAsync("MySetting1")).ShouldBe("43"); - } - } -} diff --git a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_User_Tests.cs b/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_User_Tests.cs deleted file mode 100644 index e8f7df0c88..0000000000 --- a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_User_Tests.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using NSubstitute; -using Shouldly; -using Volo.Abp.Users; -using Xunit; - -namespace Volo.Abp.Settings -{ - public class SettingManager_User_Tests: SettingsTestBase - { - private Guid? _currentUserId; - - private readonly ISettingManager _settingManager; - - public SettingManager_User_Tests() - { - _settingManager = GetRequiredService(); - } - - protected override void AfterAddApplication(IServiceCollection services) - { - var currentUser = Substitute.For(); - currentUser.Id.Returns(ci => _currentUserId); - services.AddSingleton(currentUser); - } - - [Fact] - public async Task Should_Get_From_Store_For_Given_User() - { - (await _settingManager.GetOrNullForUserAsync("MySetting2", SettingTestDataBuilder.User1Id)).ShouldBe("user1-store-value"); - (await _settingManager.GetOrNullForUserAsync("MySetting2", SettingTestDataBuilder.User2Id)).ShouldBe("user2-store-value"); - } - - [Fact] - public async Task Should_Fallback_To_Default_Store_Value_When_No_Value_For_Given_User() - { - (await _settingManager.GetOrNullForUserAsync("MySetting2", Guid.NewGuid())).ShouldBe("default-store-value"); - } - - [Fact] - public async Task Should_Not_Fallback_To_Default_Store_Value_When_No_Value_For_Given_User_But_Specified_Fallback_As_False() - { - (await _settingManager.GetOrNullForUserAsync("MySetting2", Guid.NewGuid(), fallback: false)).ShouldBeNull(); - } - - [Fact] - public async Task Should_Get_From_Store_For_Current_User() - { - _currentUserId = SettingTestDataBuilder.User1Id; - (await _settingManager.GetOrNullAsync("MySetting2")).ShouldBe("user1-store-value"); - - _currentUserId = SettingTestDataBuilder.User2Id; - (await _settingManager.GetOrNullAsync("MySetting2")).ShouldBe("user2-store-value"); - } - - [Fact] - public async Task Should_Fallback_To_Default_Store_Value_When_No_Value_For_Current_User() - { - _currentUserId = Guid.NewGuid(); - (await _settingManager.GetOrNullAsync("MySetting2")).ShouldBe("default-store-value"); - } - - [Fact] - public async Task Should_Get_From_Store_For_Current_User_With_GetOrNullForCurrentUserAsync() - { - _currentUserId = SettingTestDataBuilder.User1Id; - (await _settingManager.GetOrNullForCurrentUserAsync("MySetting2")).ShouldBe("user1-store-value"); - - _currentUserId = SettingTestDataBuilder.User2Id; - (await _settingManager.GetOrNullForCurrentUserAsync("MySetting2")).ShouldBe("user2-store-value"); - } - - [Fact] - public async Task Should_Fallback_To_Default_Store_Value_When_No_Value_For_Current_User_With_GetOrNullForCurrentUserAsync() - { - _currentUserId = Guid.NewGuid(); - (await _settingManager.GetOrNullAsync("MySetting2")).ShouldBe("default-store-value"); - } - - [Fact] - public async Task Should_Not_Fallback_To_Default_Store_Value_When_No_Value_For_Current_User_But_Specified_Fallback_As_False() - { - _currentUserId = Guid.NewGuid(); - (await _settingManager.GetOrNullForCurrentUserAsync("MySetting2", fallback: false)).ShouldBeNull(); - } - - [Fact] - public async Task Should_Get_All_From_Store_For_Given_User() - { - var settingValues = await _settingManager.GetAllForUserAsync(SettingTestDataBuilder.User1Id); - settingValues.ShouldContain(sv => sv.Name == "MySetting1" && sv.Value == "42"); - settingValues.ShouldContain(sv => sv.Name == "MySetting2" && sv.Value == "user1-store-value"); - settingValues.ShouldContain(sv => sv.Name == "SettingNotSetInStore" && sv.Value == "default-value"); - } - - [Fact] - public async Task Should_Get_All_From_Store_For_Given_User_Without_Fallback() - { - var settingValues = await _settingManager.GetAllForUserAsync(SettingTestDataBuilder.User1Id, fallback: false); - settingValues.ShouldContain(sv => sv.Name == "MySetting2" && sv.Value == "user1-store-value"); - settingValues.ShouldContain(sv => sv.Name == "MySettingWithoutInherit" && sv.Value == "user1-store-value"); - settingValues.ShouldNotContain(sv => sv.Name == "MySetting1"); - } - - [Fact] - public async Task Should_Delete_Setting_Record_When_Set_To_Null() - { - await _settingManager.SetForUserAsync(SettingTestDataBuilder.User1Id, "MySetting2", null); - - GetSettingsFromDbContext( - UserSettingValueProvider.ProviderName, - SettingTestDataBuilder.User1Id.ToString(), - "MySetting2" - ).Count.ShouldBe(0); - } - - [Fact] - public async Task Should_Change_User_Setting() - { - (await _settingManager.GetOrNullForUserAsync("MySetting2", SettingTestDataBuilder.User1Id)) - .ShouldBe("user1-store-value"); - - await _settingManager.SetForUserAsync(SettingTestDataBuilder.User1Id, "MySetting2", "user1-new-store-value"); - - (await _settingManager.GetOrNullForUserAsync("MySetting2", SettingTestDataBuilder.User1Id)) - .ShouldBe("user1-new-store-value"); - - GetSettingsFromDbContext( - UserSettingValueProvider.ProviderName, - SettingTestDataBuilder.User1Id.ToString(), - "MySetting2" - ).Single().Value.ShouldBe("user1-new-store-value"); - } - - [Fact] - public async Task Should_Delete_Setting_Record_When_Set_To_Fallback_Value() - { - await _settingManager.SetForUserAsync( - SettingTestDataBuilder.User1Id, - "MySetting2", - "default-store-value" - ); - - GetSettingsFromDbContext( - UserSettingValueProvider.ProviderName, - SettingTestDataBuilder.User1Id.ToString(), - "MySetting2" - ).Count.ShouldBe(0); - - (await _settingManager.GetOrNullForUserAsync("MySetting2", SettingTestDataBuilder.User1Id)) - .ShouldBe("default-store-value"); - } - - [Fact] - public async Task Should_Not_Delete_Setting_Record_When_Set_To_Fallback_Value_If_Forced() - { - await _settingManager.SetForUserAsync( - SettingTestDataBuilder.User1Id, - "MySetting2", - "default-store-value", - forceToSet: true - ); - - GetSettingsFromDbContext( - UserSettingValueProvider.ProviderName, - SettingTestDataBuilder.User1Id.ToString(), - "MySetting2" - ).Single().Value.ShouldBe("default-store-value"); - - (await _settingManager.GetOrNullForUserAsync("MySetting2", SettingTestDataBuilder.User1Id)) - .ShouldBe("default-store-value"); - } - - [Fact] - public async Task Should_Get_For_Given_User_For_Non_Inherited_Setting() - { - (await _settingManager.GetOrNullForUserAsync("MySettingWithoutInherit", SettingTestDataBuilder.User1Id)).ShouldBe("user1-store-value"); - (await _settingManager.GetOrNullForUserAsync("MySettingWithoutInherit", SettingTestDataBuilder.User2Id)).ShouldBeNull(); //Does not inherit! - (await _settingManager.GetOrNullGlobalAsync("MySettingWithoutInherit")).ShouldBe("default-store-value"); - } - } -} \ No newline at end of file diff --git a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingTestDataBuilder.cs b/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingTestDataBuilder.cs deleted file mode 100644 index aa72c65647..0000000000 --- a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingTestDataBuilder.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; -using Volo.Abp.Users; - -namespace Volo.Abp.Settings -{ - public class SettingTestDataBuilder : ITransientDependency - { - public static Guid User1Id { get; } = Guid.NewGuid(); - public static Guid User2Id { get; } = Guid.NewGuid(); - - private readonly ISettingRepository _settingRepository; - private readonly IGuidGenerator _guidGenerator; - - public SettingTestDataBuilder(ISettingRepository settingRepository, IGuidGenerator guidGenerator) - { - _settingRepository = settingRepository; - _guidGenerator = guidGenerator; - } - - public void Build() - { - _settingRepository.InsertAsync(new Setting(_guidGenerator.Create(), "MySetting1", "42", GlobalSettingValueProvider.ProviderName)); - - _settingRepository.InsertAsync(new Setting(_guidGenerator.Create(), "MySetting2", "default-store-value", GlobalSettingValueProvider.ProviderName)); - _settingRepository.InsertAsync(new Setting(_guidGenerator.Create(), "MySetting2", "user1-store-value", UserSettingValueProvider.ProviderName, User1Id.ToString())); - _settingRepository.InsertAsync(new Setting(_guidGenerator.Create(), "MySetting2", "user2-store-value", UserSettingValueProvider.ProviderName, User2Id.ToString())); - - _settingRepository.InsertAsync(new Setting(_guidGenerator.Create(), "MySettingWithoutInherit", "default-store-value", GlobalSettingValueProvider.ProviderName)); - _settingRepository.InsertAsync(new Setting(_guidGenerator.Create(), "MySettingWithoutInherit", "user1-store-value", UserSettingValueProvider.ProviderName, User1Id.ToString())); - } - } -} \ No newline at end of file diff --git a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingsTestBase.cs b/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingsTestBase.cs deleted file mode 100644 index 7e005acdb6..0000000000 --- a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingsTestBase.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Volo.Abp.Settings.EntityFrameworkCore; -using Volo.Abp.Users; - -namespace Volo.Abp.Settings -{ - public class SettingsTestBase : AbpIntegratedTest - { - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - - protected virtual void UsingDbContext(Action action) - { - using (var dbContext = GetRequiredService()) - { - action.Invoke(dbContext); - } - } - - protected virtual T UsingDbContext(Func action) - { - using (var dbContext = GetRequiredService()) - { - return action.Invoke(dbContext); - } - } - - protected List GetSettingsFromDbContext(string entityType, string entityId, string name) - { - return UsingDbContext(context => - context.Settings.Where( - s => - s.ProviderName == UserSettingValueProvider.ProviderName && - s.ProviderKey == SettingTestDataBuilder.User1Id.ToString() && - s.Name == "MySetting2" - ).ToList() - ); - } - } -} diff --git a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/TestSettingDefinitionProvider.cs b/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/TestSettingDefinitionProvider.cs deleted file mode 100644 index 761b383448..0000000000 --- a/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/TestSettingDefinitionProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Volo.Abp.Settings -{ - public class TestSettingDefinitionProvider : SettingDefinitionProvider - { - public override void Define(ISettingDefinitionContext context) - { - context.Add(new SettingDefinition("MySetting1")); - context.Add(new SettingDefinition("MySetting2")); - context.Add(new SettingDefinition("MySettingWithoutInherit", isInherited: false)); - context.Add(new SettingDefinition("SettingNotSetInStore", defaultValue: "default-value")); - } - } -} \ No newline at end of file