diff --git a/docs/cs/CLI.md b/docs/cs/CLI.md index f3f2d21a96..cbf8006ad2 100644 --- a/docs/cs/CLI.md +++ b/docs/cs/CLI.md @@ -34,26 +34,32 @@ Příklad: abp new Acme.BookStore ```` -* Acme.BookStore je tady název řešení. +* `Acme.BookStore` je tady název řešení. * Běžná konvence je nazvat řešení stylem *VaseSpolecnost.VasProjekt*. Nicméně můžete použít i jiné pojmenování jako *VasProjekt* (jednostupňový jmenný prostor) nebo *VaseSpolecnost.VasProjekt.VasModul* (třístupňový jmenný prostor). #### Možnosti -* `--template` nebo `-t`: Určuje název šablony. Výchozí šablona je `mvc`. Dostupné šablony: - * `mvc` (výchozí): ASP.NET Core [MVC aplikační šablona](Startup-Templates/Mvc.md). Dodatečné možnosti: - * `--database-provider` nebo `-d`: Určuje poskytovatele databáze. Vychozí poskytovatel je `ef`. Dostupní poskytovatelé: +* `--template` nebo `-t`: Určuje název šablony. Výchozí šablona je `app`, která generuje webovou aplikaci. Dostupné šablony: + * `app` (výchozí): [Aplikační šablona](Startup-Templates/Application.md). Dodatečné možnosti: + * `--ui` nebo `-u`: Určuje UI framework. Výchozí framework je `mvc`. Dostupné frameworky: + * `mvc`: ASP.NET Core MVC. Pro tuto šablonu jsou dostupné dodatečné možnosti: + * `--tiered`: Vytvoří stupňovité řešení, kde jsou vrstvy Web a Http API fyzicky odděleny. Pokud není uvedeno, tak vytvoří vrstvené řešení, které je méně složité a vhodné pro většinu scénářů. + * `angular`: Angular. Pro tuto šablonu jsou dostupné dodatečné možnosti: + * `--separate-identity-server`: Oddělí identity server aplikaci od API host aplikace. Pokud není uvedeno, bude na straně serveru jediný koncový bod. + * `--database-provider` nebo `-d`: Určuje poskytovatele databáze. Výchozí poskytovatel je `ef`. Dostupní poskytovatelé: * `ef`: Entity Framework Core. * `mongodb`: MongoDB. - * `--tiered`: Vytvoří stupňovité řešení, kde jsou vrstvy Web a Http API fyzicky odděleny. Pokud není uvedeno tak vytvoří vrstvené řešení, které je méně složité a vhodné pro většinu scénářů. - * `mvc-module`: ASP.NET Core [MVC modulová šablona](Startup-Templates/Mvc-Module.md). Dodatečné možnosti: - * `--no-ui`: Určuje, že nebude zahrnuto uživatelské rozhraní. To umožňuje vytvářet moduly pouze pro služby (a.k.a. mikroslužby - bez UI). + * `module`: [Šablona modulu](Startup-Templates/Module.md). Dodatečné možnosti: + * `--no-ui`: Určuje nezahrnutí uživatelského rozhraní. Umožňuje vytvořit moduly pouze pro služby (a.k.a. mikroslužby - bez uživatelského rozhraní). * `--output-folder` nebo `-o`: Určuje výstupní složku. Výchozí hodnota je aktuální adresář. +* `--version` nebo `-v`: Určuje verzi ABP & šablony. Může to být [štítek vydání](https://github.com/abpframework/abp/releases) nebo [název větve](https://github.com/abpframework/abp/branches). Pokud není uvedeno, používá nejnovější vydání. Většinou budete chtít použít nejnovější verzi. + ### add-package -Přidá nový balíček ABP do projektu pomocí, +Přidá ABP balíček do projektu, -* Přidání souvisejícícho nuget balíčku jako závislost do projektu. +* Přidáním souvisejícícho nuget balíčku jako závislost do projektu. * Přidáním `[DependsOn(...)]` atributu k modulové tříde v projektu (podívejte se na [dokument vývoje modulu](Module-Development-Basics.md)). > Všimněte si, že přidaný modul může vyžadovat další konfiguraci, která je obecně uvedena v dokumentaci příslušného balíčku. @@ -78,7 +84,7 @@ abp add-package Volo.Abp.MongoDB ### add-module -Přidá více-balíčkový modul k řešení tím, že najde všechny balíčky modulu, vyhledá související projekty v řešení a přidá každý balíček do odpovídajícího projektu v řešení. +Přidá [více-balíčkový aplikační modul](Modules/Index) k řešení tím, že najde všechny balíčky modulu, vyhledá související projekty v řešení a přidá každý balíček do odpovídajícího projektu v řešení. > Modul se obecně skládá z několika balíčků (z důvodu vrstvení, různých možností poskytovatele databáze nebo jiných důvodů). Použití příkazu `add-module` dramaticky zjednodušuje přidání modulu do řešení. Každý modul však může vyžadovat další konfiguraci, která je obecně uvedena v dokumentaci příslušného modulu. @@ -100,6 +106,7 @@ abp add-module Volo.Blogging * `--solution` nebo `-s`: Určuje cestu k řešení (.sln). Pokud není zadáno, CLI se pokusí najít soubor .sln v aktuálním adresáři. * `--skip-db-migrations`: Pro poskytovatele databáze EF Core automaticky přidá nový kód první migrace (`Add-Migration`) a v případě potřeby aktualizuje databázi (`Update-Database`). Tuto možnost určete k vynechání této operace. +* `-sp` nebo `--startup-project`: Relativní cesta ke složce spouštěcího projektu. Výchozí hodnota je aktuální adresář. ### update @@ -117,6 +124,8 @@ abp update [možnosti] #### Možnosti * `--include-previews` nebo `-p`: Zahrne náhledové, beta a rc balíčky při kontrole nových verzí. +* `--npm`: Aktualizuje pouze balíčky NPM. +* `--nuget`: Aktualizuje pouze balíčky NuGet. ### help diff --git a/docs/cs/Contribution/Index.md b/docs/cs/Contribution/Index.md index 3716d8dc76..fd7f65d14e 100644 --- a/docs/cs/Contribution/Index.md +++ b/docs/cs/Contribution/Index.md @@ -35,7 +35,7 @@ Existuje několik základních dokumentů, které je třeba přeložit než bude * Tutoriály * CLI -Nový jazyk je publikován jakmile budou minimálně tyto překlady dokončeny. +Nový jazyk je publikován jakmile jsou minimálně tyto překlady dokončeny. ### Lokalizace zdrojů diff --git a/docs/cs/Getting-Started-AspNetCore-MVC-Template.md b/docs/cs/Getting-Started-AspNetCore-MVC-Template.md index 953e99b9f2..b1cb3bb57e 100644 --- a/docs/cs/Getting-Started-AspNetCore-MVC-Template.md +++ b/docs/cs/Getting-Started-AspNetCore-MVC-Template.md @@ -37,7 +37,7 @@ Otevřete řešení ve **Visual Studio**: Řešení má vrstvenou strukturu (založenou na [Domain Driven Design](Domain-Driven-Design.md)) a obsahuje projekty jednotkovových a integračních testů předkonfigurované pro práci s **EF Core** & **SQLite in-memory** databází. -> Podívejte se na [dokument šablony MVC aplikace](Startup-Templates/Mvc.md) k detailnímu pochopení struktury řešení. +> Podívejte se na [dokument šablony aplikace](Startup-Templates/Application.md) k detailnímu pochopení struktury řešení. ### Connection string databáze diff --git a/docs/cs/images/MonthlyProfitWidgetFiles.png b/docs/cs/images/MonthlyProfitWidgetFiles.png new file mode 100644 index 0000000000..e1e9d316f5 Binary files /dev/null and b/docs/cs/images/MonthlyProfitWidgetFiles.png differ diff --git a/docs/cs/images/bookstore-swagger-ui-host.png b/docs/cs/images/bookstore-swagger-ui-host.png new file mode 100644 index 0000000000..74ff73f7e3 Binary files /dev/null and b/docs/cs/images/bookstore-swagger-ui-host.png differ diff --git a/docs/cs/images/bookstore-visual-studio-solution-for-spa.png b/docs/cs/images/bookstore-visual-studio-solution-for-spa.png new file mode 100644 index 0000000000..5a5a283c7d Binary files /dev/null and b/docs/cs/images/bookstore-visual-studio-solution-for-spa.png differ diff --git a/docs/cs/images/dashboard1.png b/docs/cs/images/dashboard1.png new file mode 100644 index 0000000000..4102bbd4c1 Binary files /dev/null and b/docs/cs/images/dashboard1.png differ diff --git a/docs/en/CLI.md b/docs/en/CLI.md index f931d3688f..ced5b5817f 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -123,6 +123,8 @@ abp update [options] #### Options * `--include-previews` or `-p`: Includes preview, beta and rc packages while checking the latest versions. +* `--npm`: Only updates NPM packages. +* `--nuget`: Only updates NuGet packages. ### help diff --git a/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj b/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj index 2d003f1d48..ae6d39c61c 100644 --- a/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj +++ b/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs index d4acd5e2cd..aa1c1501b5 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -43,8 +44,21 @@ namespace Volo.Abp.Cli.Commands public async Task ExecuteAsync(CommandLineArgs commandLineArgs) { - await UpdateNugetPackages(commandLineArgs); - UpdateNpmPackages(); + var updateNpm = commandLineArgs.Options.ContainsKey(Options.Packages.Npm); + var updateNuget = commandLineArgs.Options.ContainsKey(Options.Packages.NuGet); + + var both = (updateNuget && updateNpm) || (!updateNuget && !updateNpm); + + if (updateNpm || both) + { + await UpdateNugetPackages(commandLineArgs); + } + + if (updateNpm || both) + { + UpdateNpmPackages(); + } + } private void UpdateNpmPackages() @@ -99,6 +113,8 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(""); sb.AppendLine("Options:"); sb.AppendLine("-p|--include-previews (if supported by the template)"); + sb.AppendLine("--npm (Only updates NPM packages)"); + sb.AppendLine("--nuget (Only updates Nuget packages)"); sb.AppendLine(""); sb.AppendLine("Some examples:"); sb.AppendLine(""); @@ -123,6 +139,12 @@ namespace Volo.Abp.Cli.Commands public const string Short = "p"; public const string Long = "include-previews"; } + + public static class Packages + { + public const string Npm = "npm"; + public const string NuGet = "nuget"; + } } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs index 58b88d87a3..fd6f5be5d1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs @@ -43,18 +43,31 @@ namespace Volo.Abp.Cli.ProjectModification foreach (var file in fileList) { - UpdatePackagesInFile(file, out var needsYarnAndGulp); + UpdatePackagesInFile(file, out var packagesUpdated); - if (needsYarnAndGulp) + if (packagesUpdated) { - RunYarnAndGulp(file); + var fileDirectory = Path.GetDirectoryName(file).EnsureEndsWith(Path.DirectorySeparatorChar); + + RunYarn(fileDirectory); + + if (IsAngularProject(fileDirectory) == false) + { + Thread.Sleep(500); + RunGulp(fileDirectory); + } } } } - protected virtual void UpdatePackagesInFile(string file, out bool needsYarnAndGulp) + private bool IsAngularProject(string fileDirectory) + { + return File.Exists(Path.Combine(fileDirectory, "angular.json")); + } + + protected virtual void UpdatePackagesInFile(string file, out bool packagesUpdated) { - needsYarnAndGulp = false; + packagesUpdated = false; var fileContent = File.ReadAllText(file); var packageJson = JObject.Parse(fileContent); var abpPackages = GetAbpPackagesFromPackageJson(packageJson); @@ -70,7 +83,7 @@ namespace Volo.Abp.Cli.ProjectModification if (updated) { - needsYarnAndGulp = true; + packagesUpdated = true; } } @@ -122,14 +135,6 @@ namespace Volo.Abp.Cli.ProjectModification return abpPackages; } - protected virtual void RunYarnAndGulp(string file) - { - var fileDirectory = Path.GetDirectoryName(file).EnsureEndsWith(Path.DirectorySeparatorChar); - RunYarn(fileDirectory); - Thread.Sleep(500); - RunGulp(fileDirectory); - } - protected virtual void RunGulp(string fileDirectory) { Logger.LogInformation($"Running Gulp on {fileDirectory}"); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/PackageJsonFileFinder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/PackageJsonFileFinder.cs index ff26e765bb..b3138e1f87 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/PackageJsonFileFinder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/PackageJsonFileFinder.cs @@ -27,7 +27,14 @@ namespace Volo.Abp.Cli.ProjectModification { var directory = Path.GetDirectoryName(path); - return Directory.GetFiles(directory, "*.csproj", searchOption: SearchOption.TopDirectoryOnly).Any(); + if (directory == null) + { + return false; + } + + return + Directory.GetFiles(directory, "*.csproj", searchOption: SearchOption.TopDirectoryOnly).Any() || + File.Exists(Path.Combine(directory, "angular.json")); } } } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs index 312a6d70ef..40cc90259b 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs @@ -21,5 +21,7 @@ public const int ClientClaimsPrefixMaxLength = 200; public const int PairWiseSubjectSaltMaxLength = 200; + + public const int UserCodeTypeMaxLength = 100; } } \ No newline at end of file diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj index 01b2f8da5a..f642574118 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj @@ -22,8 +22,8 @@ - - + + diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResource.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResource.cs index 12865c653d..d2b1a630d4 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResource.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/ApiResource.cs @@ -24,6 +24,8 @@ namespace Volo.Abp.IdentityServer.ApiResources public virtual List UserClaims { get; protected set; } + public virtual Dictionary Properties { get; protected set; } + protected ApiResource() { @@ -45,6 +47,7 @@ namespace Volo.Abp.IdentityServer.ApiResources Secrets = new List(); Scopes = new List(); UserClaims = new List(); + Properties = new Dictionary(); Scopes.Add(new ApiScope(id, name, displayName, description)); } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs index 35aaa20652..031aa86bfc 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/Client.cs @@ -78,6 +78,12 @@ namespace Volo.Abp.IdentityServer.Clients public virtual string PairWiseSubjectSalt { get; set; } + public virtual int? UserSsoLifetime { get; set; } + + public virtual string UserCodeType { get; set; } + + public virtual int DeviceCodeLifetime { get; set; } = 300; + public virtual List AllowedScopes { get; set; } public virtual List ClientSecrets { get; set; } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs index 574f3aa322..f5d6f6c39c 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs @@ -24,6 +24,8 @@ namespace Volo.Abp.IdentityServer.IdentityResources public virtual List UserClaims { get; set; } + public virtual Dictionary Properties { get; set; } + protected IdentityResource() { @@ -51,6 +53,7 @@ namespace Volo.Abp.IdentityServer.IdentityResources ShowInDiscoveryDocument = showInDiscoveryDocument; UserClaims = new List(); + Properties = new Dictionary(); } public IdentityResource(Guid id, IdentityServer4.Models.IdentityResource resource) @@ -64,6 +67,7 @@ namespace Volo.Abp.IdentityServer.IdentityResources Emphasize = resource.Emphasize; ShowInDiscoveryDocument = resource.ShowInDiscoveryDocument; UserClaims = resource.UserClaims.Select(claimType => new IdentityClaim(id, claimType)).ToList(); + Properties = resource.Properties.ToDictionary(x => x.Key, x => x.Value); } public virtual void AddUserClaim([NotNull] string type) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs index 67009a2deb..1c0adbc6b6 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs @@ -1,5 +1,7 @@ -using JetBrains.Annotations; +using System.Collections.Generic; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.IdentityServer.Clients; @@ -38,6 +40,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore 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.Property(x => x.UserCodeType).HasMaxLength(ClientConsts.UserCodeTypeMaxLength); client.HasMany(x => x.AllowedScopes).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); client.HasMany(x => x.ClientSecrets).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); @@ -164,6 +167,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore 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.Property(x => x.Properties) + .HasConversion( + d => JsonConvert.SerializeObject(d, Formatting.None), + s => JsonConvert.DeserializeObject>(s) + ); identityResource.HasMany(x => x.UserClaims).WithOne().HasForeignKey(x => x.IdentityResourceId).IsRequired(); }); @@ -186,6 +194,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore 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.Property(x => x.Properties) + .HasConversion( + d => JsonConvert.SerializeObject(d, Formatting.None), + s => JsonConvert.DeserializeObject>(s) + ); apiResource.HasMany(x => x.Secrets).WithOne().HasForeignKey(x => x.ApiResourceId).IsRequired(); apiResource.HasMany(x => x.Scopes).WithOne().HasForeignKey(x => x.ApiResourceId).IsRequired(); diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj index ab9f99a791..b6c251bd3f 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo.Abp.IdentityServer.Domain.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj index 5a12ee07ed..10325012d9 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests.csproj @@ -19,9 +19,9 @@ - - - + + + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj index 1c6030753c..0565ad07fc 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj index d0cb84ddba..60e1791280 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo.Abp.IdentityServer.TestBase.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index 4b657fe8bb..d967ae74c9 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -22,6 +22,7 @@ import { EllipsisDirective } from './directives/ellipsis.directive'; import { AutofocusDirective } from './directives/autofocus.directive'; import { InputEventDebounceDirective } from './directives/debounce.directive'; import { ClickEventStopPropagationDirective } from './directives/stop-propagation.directive'; +import { FormSubmitDirective } from './directives/form-submit.directive'; @NgModule({ imports: [ @@ -39,6 +40,7 @@ import { ClickEventStopPropagationDirective } from './directives/stop-propagatio DynamicLayoutComponent, AutofocusDirective, EllipsisDirective, + FormSubmitDirective, LocalizationPipe, PermissionDirective, VisibilityDirective, @@ -55,6 +57,7 @@ import { ClickEventStopPropagationDirective } from './directives/stop-propagatio DynamicLayoutComponent, AutofocusDirective, EllipsisDirective, + FormSubmitDirective, LocalizationPipe, PermissionDirective, VisibilityDirective, diff --git a/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts new file mode 100644 index 0000000000..a3ea93a753 --- /dev/null +++ b/npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts @@ -0,0 +1,74 @@ +import { + Directive, + ElementRef, + OnDestroy, + OnInit, + Self, + ChangeDetectorRef, + HostBinding, + Input, + Output, + EventEmitter, +} from '@angular/core'; +import { FormGroupDirective, FormGroup, FormControl, ɵNgNoValidate } from '@angular/forms'; +import { fromEvent } from 'rxjs'; +import { takeUntilDestroy } from '../utils'; +import { debounceTime, filter } from 'rxjs/operators'; + +type Controls = { [key: string]: FormControl } | FormGroup[]; + +@Directive({ + selector: 'form[ngSubmit][formGroup]', +}) +export class FormSubmitDirective implements OnInit, OnDestroy { + @Input() + notValidateOnSubmit: string | boolean; + + constructor( + @Self() private formGroupDirective: FormGroupDirective, + private host: ElementRef, + private cdRef: ChangeDetectorRef, + ) {} + + ngOnInit() { + fromEvent(this.host.nativeElement as HTMLElement, 'keyup') + .pipe( + debounceTime(200), + filter((key: KeyboardEvent) => key && key.key === 'Enter'), + takeUntilDestroy(this), + ) + .subscribe(() => { + this.host.nativeElement.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true })); + }); + + fromEvent(this.host.nativeElement, 'submit') + .pipe( + takeUntilDestroy(this), + filter(() => !this.notValidateOnSubmit && typeof this.notValidateOnSubmit !== 'string'), + ) + .subscribe(() => { + const { form } = this.formGroupDirective; + + setDirty(form.controls as { [key: string]: FormControl }); + form.markAsDirty(); + + this.cdRef.detectChanges(); + }); + } + + ngOnDestroy(): void {} +} + +function setDirty(controls: Controls) { + if (Array.isArray(controls)) { + controls.forEach(group => { + setDirty(group.controls as { [key: string]: FormControl }); + }); + return; + } + + Object.keys(controls).forEach(key => { + controls[key].markAsDirty(); + controls[key].updateValueAndValidity(); + }); +} diff --git a/npm/ng-packs/packages/core/src/lib/directives/index.ts b/npm/ng-packs/packages/core/src/lib/directives/index.ts index de5846382c..336b6ff5ab 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/index.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/index.ts @@ -1,4 +1,5 @@ export * from './autofocus.directive'; export * from './ellipsis.directive'; +export * from './form-submit.directive'; export * from './permission.directive'; export * from './visibility.directive'; diff --git a/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts b/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts index d4e4b80ea9..ca69eb127d 100644 --- a/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts +++ b/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts @@ -3,6 +3,8 @@ import { ActivatedRouteSnapshot, CanActivate } from '@angular/router'; import { Store } from '@ngxs/store'; import { Observable } from 'rxjs'; import { ConfigState } from '../states'; +import { tap } from 'rxjs/operators'; +import { RestOccurError } from '../actions'; @Injectable({ providedIn: 'root', @@ -12,6 +14,12 @@ export class PermissionGuard implements CanActivate { canActivate({ data }: ActivatedRouteSnapshot): Observable { const resource = data.requiredPolicy as string; - return this.store.select(ConfigState.getGrantedPolicy(resource)); + return this.store.select(ConfigState.getGrantedPolicy(resource)).pipe( + tap(access => { + if (!access) { + this.store.dispatch(new RestOccurError({ status: 403 })); + } + }), + ); } } diff --git a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html index 62fc5f8e4a..3f6a47eabd 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html +++ b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html @@ -35,7 +35,7 @@
-

{{ selectedGroup.displayName }}

+

{{ selectedGroup?.displayName }}


@@ -86,7 +86,7 @@ - {{ 'AbpIdentity::Save' | abpLocalization }} + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts index 772c1efc1a..4b83c5a5ab 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts +++ b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts @@ -183,7 +183,7 @@ export class PermissionManagementComponent implements OnInit, OnChanges { this.setTabCheckboxState(); } - onSubmit() { + submit() { this.modalBusy = true; const unchangedPermissions = getPermissions( this.store.selectSnapshot(PermissionManagementState.getPermissionGroups), diff --git a/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts b/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts index 8c1aed82c3..feb7303167 100644 --- a/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts +++ b/npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts @@ -8,12 +8,14 @@ import { TenantsComponent } from './components/tenants/tenants.component'; import { TenantManagementState } from './states/tenant-management.state'; import { TenantManagementRoutingModule } from './tenant-management-routing.module'; import { FeatureManagementModule } from '@abp/ng.feature-management'; +import { NgxValidateCoreModule } from '@ngx-validate/core'; @NgModule({ declarations: [TenantsComponent], imports: [ TenantManagementRoutingModule, NgxsModule.forFeature([TenantManagementState]), + NgxValidateCoreModule, CoreModule, TableModule, ThemeSharedModule, diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html index 3a122357c7..b0624e9d82 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.html @@ -3,7 +3,7 @@

{{ 'AbpIdentity::PersonalInfo' | abpLocalization }}

-
+
* @@ -36,6 +36,6 @@ - {{ 'AbpIdentity::Save' | abpLocalization }} + {{ 'AbpIdentity::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.ts index f2e4683239..0dc8ef2768 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/profile/profile.component.ts @@ -54,7 +54,7 @@ export class ProfileComponent implements OnChanges { }); } - onSubmit() { + submit() { if (this.form.invalid) return; this.modalBusy = true; diff --git a/npm/ng-packs/packages/theme-shared/package.json b/npm/ng-packs/packages/theme-shared/package.json index a71bc08def..6ed4fbe8eb 100644 --- a/npm/ng-packs/packages/theme-shared/package.json +++ b/npm/ng-packs/packages/theme-shared/package.json @@ -5,7 +5,7 @@ "@abp/ng.core": "^0.8.3", "@angular/cdk": "^8.0.1", "@ng-bootstrap/ng-bootstrap": "^5.1.0", - "@ngx-validate/core": "^0.0.4", + "@ngx-validate/core": "^0.0.5", "bootstrap": "^4.3.1", "font-awesome": "^4.7.0", "ngx-perfect-scrollbar": "^8.0.0", diff --git a/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts b/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts index 2604bcdaab..0baff0da8f 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts @@ -53,7 +53,7 @@ export class ErrorHandler { const { payload: err = {} as HttpErrorResponse | any } = res; const body = snq(() => (err as HttpErrorResponse).error.error, DEFAULTS.defaultError.message); - if (err.headers.get('_AbpErrorFormat')) { + if (err instanceof HttpErrorResponse && err.headers.get('_AbpErrorFormat')) { const confirmation$ = this.showError(null, null, body); if (err.status === 401) { diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/appsettings.json b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/appsettings.json index 50ff8967a2..1bca387914 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/appsettings.json +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.DbMigrator/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "Default": "mongodb://localhost:27017|BookStore" + "Default": "mongodb://localhost:27017/BookStore" }, "IdentityServer": { "Clients": { diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/appsettings.json b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/appsettings.json index 143c972ee1..e24d24c1c4 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/appsettings.json +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/appsettings.json @@ -4,7 +4,7 @@ "CorsOrigins": "https://*.BookStore.com,http://localhost:4200" }, "ConnectionStrings": { - "Default": "mongodb://localhost:27017|BookStore" + "Default": "mongodb://localhost:27017/BookStore" }, "Redis": { "Configuration": "127.0.0.1" diff --git a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/DashboardDemo.EntityFrameworkCore.DbMigrations.csproj b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/DashboardDemo.EntityFrameworkCore.DbMigrations.csproj index 4dd0478820..082b06c5d2 100644 --- a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/DashboardDemo.EntityFrameworkCore.DbMigrations.csproj +++ b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/DashboardDemo.EntityFrameworkCore.DbMigrations.csproj @@ -11,4 +11,8 @@ + + + + diff --git a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.Designer.cs b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190816095643_Initial.Designer.cs similarity index 99% rename from samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.Designer.cs rename to samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190816095643_Initial.Designer.cs index 87dda25969..7c0ee10397 100644 --- a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.Designer.cs +++ b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190816095643_Initial.Designer.cs @@ -1,23 +1,23 @@ // using System; +using DashboardDemo.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using DashboardDemo.EntityFrameworkCore; namespace DashboardDemo.Migrations { [DbContext(typeof(DashboardDemoMigrationsDbContext))] - [Migration("20190523122033_Initial")] + [Migration("20190816095643_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -636,6 +636,8 @@ namespace DashboardDemo.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -776,6 +778,8 @@ namespace DashboardDemo.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -827,6 +831,11 @@ namespace DashboardDemo.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -1056,6 +1065,8 @@ namespace DashboardDemo.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); diff --git a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.cs b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190816095643_Initial.cs similarity index 99% rename from samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.cs rename to samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190816095643_Initial.cs index ce23c6adfe..991da6ff2f 100644 --- a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.cs +++ b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20190816095643_Initial.cs @@ -218,7 +218,8 @@ namespace DashboardDemo.Migrations Name = table.Column(maxLength: 200, nullable: false), DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), - Enabled = table.Column(nullable: false) + Enabled = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { @@ -272,7 +273,10 @@ namespace DashboardDemo.Migrations IncludeJwtId = table.Column(nullable: false), AlwaysSendClientClaims = table.Column(nullable: false), ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), - PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true) + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + UserSsoLifetime = table.Column(nullable: true), + UserCodeType = table.Column(maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(nullable: false) }, constraints: table => { @@ -299,7 +303,8 @@ namespace DashboardDemo.Migrations Enabled = table.Column(nullable: false), Required = table.Column(nullable: false), Emphasize = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false) + ShowInDiscoveryDocument = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { diff --git a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs index 827e76e355..8c3b06d1c2 100644 --- a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs +++ b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs @@ -1,10 +1,10 @@ // using System; +using DashboardDemo.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using DashboardDemo.EntityFrameworkCore; namespace DashboardDemo.Migrations { @@ -15,7 +15,7 @@ namespace DashboardDemo.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -634,6 +634,8 @@ namespace DashboardDemo.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -774,6 +776,8 @@ namespace DashboardDemo.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -825,6 +829,11 @@ namespace DashboardDemo.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -1054,6 +1063,8 @@ namespace DashboardDemo.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj index df3b83834b..3ebf233694 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj @@ -19,6 +19,7 @@ + diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190408114124_Initial.Designer.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190816095916_Initial.Designer.cs similarity index 97% rename from samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190408114124_Initial.Designer.cs rename to samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190816095916_Initial.Designer.cs index dcbfde13e8..45555c790b 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190408114124_Initial.Designer.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190816095916_Initial.Designer.cs @@ -10,14 +10,14 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace AuthServer.Host.Migrations { [DbContext(typeof(AuthServerDbContext))] - [Migration("20190408114124_Initial")] + [Migration("20190816095916_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -524,7 +524,9 @@ namespace AuthServer.Host.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") .HasColumnName("CreationTime"); @@ -564,6 +566,8 @@ namespace AuthServer.Host.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -683,7 +687,9 @@ namespace AuthServer.Host.Migrations b.Property("ClientUri") .HasMaxLength(300); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp"); b.Property("ConsentLifetime"); @@ -702,6 +708,8 @@ namespace AuthServer.Host.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -753,6 +761,11 @@ namespace AuthServer.Host.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -938,7 +951,9 @@ namespace AuthServer.Host.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") .HasColumnName("CreationTime"); @@ -980,6 +995,8 @@ namespace AuthServer.Host.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190408114124_Initial.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190816095916_Initial.cs similarity index 99% rename from samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190408114124_Initial.cs rename to samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190816095916_Initial.cs index d80105e24c..27a02acde0 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190408114124_Initial.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20190816095916_Initial.cs @@ -161,7 +161,8 @@ namespace AuthServer.Host.Migrations Name = table.Column(maxLength: 200, nullable: false), DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), - Enabled = table.Column(nullable: false) + Enabled = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { @@ -215,7 +216,10 @@ namespace AuthServer.Host.Migrations IncludeJwtId = table.Column(nullable: false), AlwaysSendClientClaims = table.Column(nullable: false), ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), - PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true) + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + UserSsoLifetime = table.Column(nullable: true), + UserCodeType = table.Column(maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(nullable: false) }, constraints: table => { @@ -242,7 +246,8 @@ namespace AuthServer.Host.Migrations Enabled = table.Column(nullable: false), Required = table.Column(nullable: false), Emphasize = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false) + ShowInDiscoveryDocument = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs index 361a93da3b..113830d96d 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ namespace AuthServer.Host.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -522,7 +522,9 @@ namespace AuthServer.Host.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") .HasColumnName("CreationTime"); @@ -562,6 +564,8 @@ namespace AuthServer.Host.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -681,7 +685,9 @@ namespace AuthServer.Host.Migrations b.Property("ClientUri") .HasMaxLength(300); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp"); b.Property("ConsentLifetime"); @@ -700,6 +706,8 @@ namespace AuthServer.Host.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -751,6 +759,11 @@ namespace AuthServer.Host.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -936,7 +949,9 @@ namespace AuthServer.Host.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp"); b.Property("CreationTime") .HasColumnName("CreationTime"); @@ -978,6 +993,8 @@ namespace AuthServer.Host.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.Designer.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190816092925_Initial.Designer.cs similarity index 99% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.Designer.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190816092925_Initial.Designer.cs index 8fb23d43f7..8659b6366e 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.Designer.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190816092925_Initial.Designer.cs @@ -10,14 +10,14 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(MyProjectNameMigrationsDbContext))] - [Migration("20190523122033_Initial")] + [Migration("20190816092925_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -636,6 +636,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -776,6 +778,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -827,6 +831,11 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -1056,6 +1065,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190816092925_Initial.cs similarity index 99% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190816092925_Initial.cs index c4c347a560..187fa6f8a8 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190523122033_Initial.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20190816092925_Initial.cs @@ -218,7 +218,8 @@ namespace MyCompanyName.MyProjectName.Migrations Name = table.Column(maxLength: 200, nullable: false), DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), - Enabled = table.Column(nullable: false) + Enabled = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { @@ -272,7 +273,10 @@ namespace MyCompanyName.MyProjectName.Migrations IncludeJwtId = table.Column(nullable: false), AlwaysSendClientClaims = table.Column(nullable: false), ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), - PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true) + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + UserSsoLifetime = table.Column(nullable: true), + UserCodeType = table.Column(maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(nullable: false) }, constraints: table => { @@ -299,7 +303,8 @@ namespace MyCompanyName.MyProjectName.Migrations Enabled = table.Column(nullable: false), Required = table.Column(nullable: false), Emphasize = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false) + ShowInDiscoveryDocument = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs index 2ce1594a30..67f73bd749 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ namespace MyCompanyName.MyProjectName.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -634,6 +634,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -774,6 +776,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -825,6 +829,11 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -1054,6 +1063,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190527125607_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190816093449_Initial.Designer.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190527125607_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190816093449_Initial.Designer.cs index 0c388d5430..c0af2fdf38 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190527125607_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190816093449_Initial.Designer.cs @@ -10,14 +10,14 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(IdentityServerHostMigrationsDbContext))] - [Migration("20190527125607_Initial")] + [Migration("20190816093449_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -566,6 +566,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -706,6 +708,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -757,6 +761,11 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -986,6 +995,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190527125607_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190816093449_Initial.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190527125607_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190816093449_Initial.cs index be2770aabb..c81fbc2f22 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190527125607_Initial.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20190816093449_Initial.cs @@ -182,7 +182,8 @@ namespace MyCompanyName.MyProjectName.Migrations Name = table.Column(maxLength: 200, nullable: false), DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), - Enabled = table.Column(nullable: false) + Enabled = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { @@ -236,7 +237,10 @@ namespace MyCompanyName.MyProjectName.Migrations IncludeJwtId = table.Column(nullable: false), AlwaysSendClientClaims = table.Column(nullable: false), ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), - PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true) + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + UserSsoLifetime = table.Column(nullable: true), + UserCodeType = table.Column(maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(nullable: false) }, constraints: table => { @@ -263,7 +267,8 @@ namespace MyCompanyName.MyProjectName.Migrations Enabled = table.Column(nullable: false), Required = table.Column(nullable: false), Emphasize = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false) + ShowInDiscoveryDocument = table.Column(nullable: false), + Properties = table.Column(nullable: true) }, constraints: table => { diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs index 8eb804421d..9280659e47 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ namespace MyCompanyName.MyProjectName.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -564,6 +564,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.HasKey("Id"); b.ToTable("IdentityServerApiResources"); @@ -704,6 +706,8 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -755,6 +759,11 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -984,6 +993,8 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired() .HasMaxLength(200); + b.Property("Properties"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument");