From ae8c9ba7bc3f9b7bf438e035b2baddc4648734f8 Mon Sep 17 00:00:00 2001 From: mitirazvan Date: Wed, 28 Apr 2021 11:47:14 +0300 Subject: [PATCH 01/26] Update PersistedGrant.cshtml Fixed columns order to match with the table headers. --- .../Areas/AdminUI/Views/Grant/PersistedGrant.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Grant/PersistedGrant.cshtml b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Grant/PersistedGrant.cshtml index 9275eee36..4080b716f 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Grant/PersistedGrant.cshtml +++ b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Grant/PersistedGrant.cshtml @@ -63,9 +63,9 @@ @persistedGrant.Data @persistedGrant.ClientId @persistedGrant.Description - @persistedGrant.SessionId - @persistedGrant.ConsumedTime + @persistedGrant.SessionId @persistedGrant.CreationTime + @persistedGrant.ConsumedTime } From bf10a24f51835b1bc5bcca79218b02229257f4f6 Mon Sep 17 00:00:00 2001 From: "Carlos J. Aliaga" Date: Sun, 2 May 2021 15:39:02 +0200 Subject: [PATCH 02/26] Allowing default behavior for OpenId redirect uri if there's no redirect uri defined on configuration --- .../Helpers/StartupHelpers.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Helpers/StartupHelpers.cs b/src/Skoruba.IdentityServer4.Admin.UI/Helpers/StartupHelpers.cs index fa9ea7772..d554cd1d0 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Helpers/StartupHelpers.cs +++ b/src/Skoruba.IdentityServer4.Admin.UI/Helpers/StartupHelpers.cs @@ -414,14 +414,17 @@ private static Task OnMessageReceived(MessageReceivedContext context, AdminConfi context.Properties.IsPersistent = true; context.Properties.ExpiresUtc = new DateTimeOffset(DateTime.Now.AddHours(adminConfiguration.IdentityAdminCookieExpiresUtcHours)); - return Task.FromResult(0); + return Task.CompletedTask; } - private static Task OnRedirectToIdentityProvider(RedirectContext n, AdminConfiguration adminConfiguration) + private static Task OnRedirectToIdentityProvider(RedirectContext context, AdminConfiguration adminConfiguration) { - n.ProtocolMessage.RedirectUri = adminConfiguration.IdentityAdminRedirectUri; - - return Task.FromResult(0); + if (!string.IsNullOrEmpty(adminConfiguration.IdentityAdminRedirectUri)) + { + context.ProtocolMessage.RedirectUri = adminConfiguration.IdentityAdminRedirectUri; + } + + return Task.CompletedTask; } public static void AddIdSHealthChecks Date: Mon, 10 May 2021 14:39:06 -0800 Subject: [PATCH 03/26] Spelling: ressources => resources --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bee87d135..7fa2ceca7 100644 --- a/README.md +++ b/README.md @@ -391,7 +391,7 @@ By default, configuration value is null to use default theme. if you want to use You can also use your custom theme by integrating it in your project or hosting css on your place to pass the url in `CustomThemeCss` key. (Note that custom theme override standard theme) -- Important Note: Theme can use external ressources which caused errors due to CSP. If you get errors, please make sure that you configured correctly CSP section in your `appsettings.json` with thrusted domains for ressources. +- Important Note: Theme can use external resources which caused errors due to CSP. If you get errors, please make sure that you configured correctly CSP section in your `appsettings.json` with thrusted domains for resources. ```json "AdminConfiguration": { @@ -530,7 +530,7 @@ In STS project - in `appsettings.json`: ## CSP - Content Security Policy -- If you want to use favicon or logo not included/hosted on the same place, you need to declare trusted domain where ressources are hosted in appsettings.json. +- If you want to use favicon or logo not included/hosted on the same place, you need to declare trusted domain where resources are hosted in appsettings.json. ``` "CspTrustedDomains": [ From 01be5c5e319fabb4b17b2cd1c38cdd376e446d29 Mon Sep 17 00:00:00 2001 From: Jason Ng Date: Wed, 9 Jun 2021 13:45:12 +0800 Subject: [PATCH 04/26] Make correction towards the EF Core section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bee87d135..0a182ff3b 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ The following Gulp commands are available: - `AdminLogDbContext`: for logging - `IdentityServerConfigurationDbContext`: for IdentityServer configuration store - `IdentityServerPersistedGrantDbContext`: for IdentityServer operational store - - `AuditLoggingDbContext`: for Audit Logging + - `AdminAuditLogDbContext`: for Audit Logging - `IdentityServerDataProtectionDbContext`: for dataprotection ### Run entity framework migrations: From 78d304a39094b8e1cd10fc822c5c40097913becb Mon Sep 17 00:00:00 2001 From: Brave Cobra Date: Sat, 14 Aug 2021 11:18:27 +0200 Subject: [PATCH 05/26] Added option to exit after migrating the database --- src/Skoruba.IdentityServer4.Admin/Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Skoruba.IdentityServer4.Admin/Program.cs b/src/Skoruba.IdentityServer4.Admin/Program.cs index 5f1a754bf..78acae7a1 100644 --- a/src/Skoruba.IdentityServer4.Admin/Program.cs +++ b/src/Skoruba.IdentityServer4.Admin/Program.cs @@ -17,6 +17,7 @@ namespace Skoruba.IdentityServer4.Admin public class Program { private const string SeedArgs = "/seed"; + private const string MigrateOnlyArgs = "/migrateonly"; public static async Task Main(string[] args) { @@ -33,8 +34,12 @@ public static async Task Main(string[] args) var host = CreateHostBuilder(args).Build(); await ApplyDbMigrationsWithDataSeedAsync(args, configuration, host); - - host.Run(); + if (args.Any(x => x == MigrateOnlyArgs)) + { + await host.StopAsync(); + return; + } + await host.RunAsync(); } catch (Exception ex) { From 43398375e52f13f789154ea6cc2685a16dc67956 Mon Sep 17 00:00:00 2001 From: Brave Cobra Date: Tue, 17 Aug 2021 03:53:25 +0200 Subject: [PATCH 06/26] Setting the exitcode correctly if migrations fail --- .../Helpers/DbMigrationHelpers.cs | 24 +++++++++++++++---- src/Skoruba.IdentityServer4.Admin/Program.cs | 11 +++++---- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Helpers/DbMigrationHelpers.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Helpers/DbMigrationHelpers.cs index b7f417d3a..a7bffa2fb 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Helpers/DbMigrationHelpers.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Helpers/DbMigrationHelpers.cs @@ -26,7 +26,7 @@ public static class DbMigrationHelpers /// /// /// - public static async Task ApplyDbMigrationsWithDataSeedAsync ApplyDbMigrationsWithDataSeedAsync( IHost host, bool applyDbMigrationWithDataSeedFromProgramArguments, SeedConfiguration seedConfiguration, DatabaseMigrationsConfiguration databaseMigrationsConfiguration) @@ -39,6 +39,7 @@ public static class DbMigrationHelpers where TUser : IdentityUser, new() where TRole : IdentityRole, new() { + bool migrationComplete = false; using (var serviceScope = host.Services.CreateScope()) { var services = serviceScope.ServiceProvider; @@ -46,18 +47,21 @@ public static class DbMigrationHelpers if ((databaseMigrationsConfiguration != null && databaseMigrationsConfiguration.ApplyDatabaseMigrations) || (applyDbMigrationWithDataSeedFromProgramArguments)) { - await EnsureDatabasesMigratedAsync(services); + migrationComplete = await EnsureDatabasesMigratedAsync(services); } if ((seedConfiguration != null && seedConfiguration.ApplySeed) || (applyDbMigrationWithDataSeedFromProgramArguments)) { - await EnsureSeedDataAsync(services); + var seedComplete = await EnsureSeedDataAsync(services); + return migrationComplete && seedComplete; } + } + return migrationComplete; } - public static async Task EnsureDatabasesMigratedAsync(IServiceProvider services) + public static async Task EnsureDatabasesMigratedAsync(IServiceProvider services) where TIdentityDbContext : DbContext where TPersistedGrantDbContext : DbContext where TConfigurationDbContext : DbContext @@ -65,41 +69,50 @@ public static async Task EnsureDatabasesMigratedAsync().CreateScope()) { using (var context = scope.ServiceProvider.GetRequiredService()) { await context.Database.MigrateAsync(); + pendingMigrationCount += (await context.Database.GetPendingMigrationsAsync()).Count(); } using (var context = scope.ServiceProvider.GetRequiredService()) { await context.Database.MigrateAsync(); + pendingMigrationCount += (await context.Database.GetPendingMigrationsAsync()).Count(); } using (var context = scope.ServiceProvider.GetRequiredService()) { await context.Database.MigrateAsync(); + pendingMigrationCount += (await context.Database.GetPendingMigrationsAsync()).Count(); } using (var context = scope.ServiceProvider.GetRequiredService()) { await context.Database.MigrateAsync(); + pendingMigrationCount += (await context.Database.GetPendingMigrationsAsync()).Count(); } using (var context = scope.ServiceProvider.GetRequiredService()) { await context.Database.MigrateAsync(); + pendingMigrationCount += (await context.Database.GetPendingMigrationsAsync()).Count(); } using (var context = scope.ServiceProvider.GetRequiredService()) { await context.Database.MigrateAsync(); + pendingMigrationCount += (await context.Database.GetPendingMigrationsAsync()).Count(); } } + + return pendingMigrationCount == 0; } - public static async Task EnsureSeedDataAsync(IServiceProvider serviceProvider) + public static async Task EnsureSeedDataAsync(IServiceProvider serviceProvider) where TIdentityServerDbContext : DbContext, IAdminConfigurationDbContext where TUser : IdentityUser, new() where TRole : IdentityRole, new() @@ -114,6 +127,7 @@ public static async Task EnsureSeedDataAsync x == MigrateOnlyArgs)) { await host.StopAsync(); - return; + if (!migrationComplete) { + Environment.ExitCode = -1; + } + return ; } await host.RunAsync(); } @@ -51,7 +54,7 @@ public static async Task Main(string[] args) } } - private static async Task ApplyDbMigrationsWithDataSeedAsync(string[] args, IConfiguration configuration, IHost host) + private static async Task ApplyDbMigrationsWithDataSeedAsync(string[] args, IConfiguration configuration, IHost host) { var applyDbMigrationWithDataSeedFromProgramArguments = args.Any(x => x == SeedArgs); if (applyDbMigrationWithDataSeedFromProgramArguments) args = args.Except(new[] { SeedArgs }).ToArray(); @@ -60,7 +63,7 @@ private static async Task ApplyDbMigrationsWithDataSeedAsync(string[] args, ICon var databaseMigrationsConfiguration = configuration.GetSection(nameof(DatabaseMigrationsConfiguration)) .Get(); - await DbMigrationHelpers + return await DbMigrationHelpers .ApplyDbMigrationsWithDataSeedAsync(host, From d7c9cc30b055fcdb2c8675a394c822c394072a12 Mon Sep 17 00:00:00 2001 From: ahmadmolaie Date: Fri, 20 Aug 2021 15:43:23 +0430 Subject: [PATCH 07/26] Added farsi localiztion in ForgotPassword --- .../Resources/Views/Account/ForgotPassword.fa.resx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Resources/Views/Account/ForgotPassword.fa.resx b/src/Skoruba.IdentityServer4.STS.Identity/Resources/Views/Account/ForgotPassword.fa.resx index 3148f3e8f..9feca1a58 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Resources/Views/Account/ForgotPassword.fa.resx +++ b/src/Skoruba.IdentityServer4.STS.Identity/Resources/Views/Account/ForgotPassword.fa.resx @@ -129,4 +129,10 @@ ایمیل + + نحوه بازیابی را انتخاب کنید + + + نام کاربری + \ No newline at end of file From bfb329cf87383c48269f2aa1108a0d2ca79d1314 Mon Sep 17 00:00:00 2001 From: Hamza Rhaiem Date: Thu, 23 Sep 2021 09:37:56 +0200 Subject: [PATCH 08/26] Fixing typo ALTER postgres not postgre --- docs/Configure-Ubuntu-PostgreSQL-Tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Configure-Ubuntu-PostgreSQL-Tutorial.md b/docs/Configure-Ubuntu-PostgreSQL-Tutorial.md index c634a019f..0fedd8626 100644 --- a/docs/Configure-Ubuntu-PostgreSQL-Tutorial.md +++ b/docs/Configure-Ubuntu-PostgreSQL-Tutorial.md @@ -31,7 +31,7 @@ Throughout tutorial we will use PostgreSQL running on localhost and default port ``` sudo -u postgres psql -ALTER USER postgre WITH PASSWORD 'postgres'; +ALTER USER postgres WITH PASSWORD 'postgres'; ``` ## IDE From a301eb57b5f118406d95f83b7416397d0d7f3bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Elcoro?= Date: Tue, 28 Sep 2021 18:31:21 +0200 Subject: [PATCH 09/26] Fix Azure AAD external authentication not working since change to .net 5 Instructs Microsoft Identity Web library to not create it's own cookie scheme handler by setting cookieScheme parameter to null --- .../Helpers/StartupHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs b/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs index 5ce704fa7..be09f3fe8 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs +++ b/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs @@ -381,7 +381,7 @@ private static void AddExternalProviders(AuthenticationBuilder authenticationBui options.Instance = externalProviderConfiguration.AzureInstance; options.Domain = externalProviderConfiguration.AzureDomain; options.CallbackPath = externalProviderConfiguration.AzureAdCallbackPath; - }); + }, cookieScheme: null); } } From 5c88450f7169f640bc1c84e329e2a8c96fc04992 Mon Sep 17 00:00:00 2001 From: "Jonas B. Rasmussen" <19553047+JonasBRasmussen@users.noreply.github.com> Date: Mon, 15 Nov 2021 07:05:58 +0100 Subject: [PATCH 10/26] Update target framework to net6.0 --- .../Skoruba.IdentityServer4.Admin.Api.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.BusinessLogic.csproj | 2 +- ...a.IdentityServer4.Admin.EntityFramework.Configuration.csproj | 2 +- ...ruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj | 2 +- ...koruba.IdentityServer4.Admin.EntityFramework.Identity.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj | 2 +- ...ruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj | 2 +- ...oruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.EntityFramework.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.UI.csproj | 2 +- .../Skoruba.IdentityServer4.Shared.Configuration.csproj | 2 +- .../Skoruba.IdentityServer4.Shared.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj | 2 +- .../Skoruba.IdentityServer4.Admin.IntegrationTests.csproj | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj index 9cf7aea0f..11e4bdc84 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj +++ b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba InProcess @@ -72,6 +71,7 @@ ApiErrorResource.Designer.cs + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj index a1f0239cd..0d860885e 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba Business Logic layer for the administration of the Asp.Net Core Identity and IdentityServer4 @@ -27,6 +26,7 @@ + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj index b9fca0cca..eb8abd766 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj index 743876ef3..5bd814cb9 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 2.0.1 Jan Škoruba Business Logic layer for the administration of the IdentityServer4 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj index 2c219a2e1..8fd5a9021 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -24,6 +23,7 @@ + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj index 95f9be516..c0bdfaab1 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -10,6 +9,7 @@ https://github.com/skoruba/IdentityServer4.Admin https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj index 12dbfa243..a8d042ef3 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba Entity Framework layer for the administration of the Asp.Net Core Identity and IdentityServer4 @@ -19,6 +18,7 @@ + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj index 8d5c38505..f29bbd1ad 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -22,6 +21,7 @@ + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj index 8f786c03a..e95ff3f63 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -21,6 +20,7 @@ + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj index b71834599..cfa3a858d 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -21,6 +20,7 @@ + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj index 7f85f3c04..1c78b1e50 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -9,6 +8,7 @@ https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md https://github.com/skoruba/IdentityServer4.Admin https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + net6.0 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj index 169ccde2b..95cbb698c 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj b/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj index a0c8f6d74..1fe459293 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj +++ b/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba The package with UI for the administration of the IdentityServer4 @@ -13,6 +12,7 @@ true / + net6.0 diff --git a/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj b/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj index 8a11d3f0c..6e3ca474a 100644 --- a/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj +++ b/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -20,6 +19,7 @@ + net6.0 diff --git a/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj b/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj index c5baf7e19..ccbcb945f 100644 --- a/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj @@ -1,7 +1,6 @@  - net5.0 2.0.1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -9,6 +8,7 @@ https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md https://github.com/skoruba/IdentityServer4.Admin https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + net6.0 diff --git a/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj index e92edfa9b..824088fc2 100644 --- a/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj @@ -1,11 +1,11 @@  - net5.0 true false Full + net6.0 diff --git a/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj index f13b6c118..8f38937a8 100644 --- a/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj @@ -1,11 +1,11 @@  - net5.0 true false Full + net6.0 From d0f78b55050278cdd1efd4f8ef851f1b8eb19ef9 Mon Sep 17 00:00:00 2001 From: "Jonas B. Rasmussen" <19553047+JonasBRasmussen@users.noreply.github.com> Date: Mon, 15 Nov 2021 07:06:36 +0100 Subject: [PATCH 11/26] Update Docker files to use .NET 6 --- docker-compose.vs.debug.yml | 2 +- docker-compose.vs.release.yml | 2 +- src/Skoruba.IdentityServer4.Admin.Api/Dockerfile | 4 ++-- src/Skoruba.IdentityServer4.Admin/Dockerfile | 4 ++-- src/Skoruba.IdentityServer4.STS.Identity/Dockerfile | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker-compose.vs.debug.yml b/docker-compose.vs.debug.yml index bb47f4fc1..031443c82 100644 --- a/docker-compose.vs.debug.yml +++ b/docker-compose.vs.debug.yml @@ -5,7 +5,7 @@ services: volumes: - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro labels: - com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath /root/.nuget/packages --additionalProbingPath /root/.nuget/fallbackpackages "bin/Debug/net5.0/Skoruba.IdentityServer4.Admin.dll" /seed' + com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath /root/.nuget/packages --additionalProbingPath /root/.nuget/fallbackpackages "bin/Debug/net6.0/Skoruba.IdentityServer4.Admin.dll" /seed' skoruba.identityserver4.admin.api: volumes: diff --git a/docker-compose.vs.release.yml b/docker-compose.vs.release.yml index bb47f4fc1..031443c82 100644 --- a/docker-compose.vs.release.yml +++ b/docker-compose.vs.release.yml @@ -5,7 +5,7 @@ services: volumes: - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro labels: - com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath /root/.nuget/packages --additionalProbingPath /root/.nuget/fallbackpackages "bin/Debug/net5.0/Skoruba.IdentityServer4.Admin.dll" /seed' + com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath /root/.nuget/packages --additionalProbingPath /root/.nuget/fallbackpackages "bin/Debug/net6.0/Skoruba.IdentityServer4.Admin.dll" /seed' skoruba.identityserver4.admin.api: volumes: diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dockerfile b/src/Skoruba.IdentityServer4.Admin.Api/Dockerfile index d672e29de..a01946d88 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dockerfile +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj", "src/Skoruba.IdentityServer4.Admin.Api/"] COPY ["src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj", "src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/"] diff --git a/src/Skoruba.IdentityServer4.Admin/Dockerfile b/src/Skoruba.IdentityServer4.Admin/Dockerfile index 8aedef0d5..d002d5c96 100644 --- a/src/Skoruba.IdentityServer4.Admin/Dockerfile +++ b/src/Skoruba.IdentityServer4.Admin/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj", "src/Skoruba.IdentityServer4.Admin/"] COPY ["src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj", "src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/"] diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Dockerfile b/src/Skoruba.IdentityServer4.STS.Identity/Dockerfile index 963bb6b2d..b824baf3f 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Dockerfile +++ b/src/Skoruba.IdentityServer4.STS.Identity/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj", "src/Skoruba.IdentityServer4.STS.Identity/"] COPY ["src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj", "src/Skoruba.IdentityServer4.Shared.Configuration/"] From 2ec88f8721e9428b022b6e4cd3ec58731b9ee041 Mon Sep 17 00:00:00 2001 From: "Jonas B. Rasmussen" <19553047+JonasBRasmussen@users.noreply.github.com> Date: Mon, 15 Nov 2021 07:08:20 +0100 Subject: [PATCH 12/26] Update to latest version of all NuGet dependencies plus cleanup and fix unit tests --- .../Skoruba.IdentityServer4.Admin.Api.csproj | 149 ++++++------ ...erver4.Admin.BusinessLogic.Identity.csproj | 64 ++--- ...yServer4.Admin.BusinessLogic.Shared.csproj | 13 - ...IdentityServer4.Admin.BusinessLogic.csproj | 13 - ...Admin.EntityFramework.Configuration.csproj | 51 ++-- ...r4.Admin.EntityFramework.Extensions.csproj | 31 +-- ...ver4.Admin.EntityFramework.Identity.csproj | 49 ++-- ...Server4.Admin.EntityFramework.MySql.csproj | 52 ++-- ...r4.Admin.EntityFramework.PostgreSQL.csproj | 50 ++-- ...erver4.Admin.EntityFramework.Shared.csproj | 51 ++-- ...er4.Admin.EntityFramework.SqlServer.csproj | 42 +--- ...entityServer4.Admin.EntityFramework.csproj | 14 +- .../Skoruba.IdentityServer4.Admin.UI.csproj | 227 +++++++++--------- .../Skoruba.IdentityServer4.Admin.csproj | 132 +++++----- ...koruba.IdentityServer4.STS.Identity.csproj | 184 +++++++------- ...dentityServer4.Shared.Configuration.csproj | 44 ++-- .../Skoruba.IdentityServer4.Shared.csproj | 45 ++-- ...yServer4.Admin.Api.IntegrationTests.csproj | 44 ++-- ...ntityServer4.Admin.IntegrationTests.csproj | 51 ++-- .../ConfigurationControllerTests.cs | 34 ++- .../Controllers/IdentityControllerTests.cs | 18 +- .../Mappers/ApiResourceMappers.cs | 28 +-- .../Mappers/ClientMappers.cs | 44 ++-- .../Mappers/IdentityResourceMappers.cs | 8 +- .../Mappers/LogMappers.cs | 4 +- .../Mappers/PersistedGrantMappers.cs | 2 +- .../Mocks/ClientDtoMock.cs | 2 + .../ApiResourceRepositoryTests.cs | 52 ++-- .../Repositories/ApiScopeRepositoryTests.cs | 14 +- .../Repositories/ClientRepositoryTests.cs | 134 +++++------ .../IdentityResourceRepositoryTests.cs | 46 ++-- .../PersistedGrantRepositoryTests.cs | 2 +- .../Services/ApiResourceServiceTests.cs | 30 +-- .../Services/ApiScopeServiceTests.cs | 10 +- .../Services/ClientServiceTests.cs | 102 ++++---- .../Services/IdentityResourceServiceTests.cs | 22 +- .../Services/IdentityServiceTests.cs | 42 ++-- .../Services/PersistedGrantServiceTests.cs | 2 +- ...uba.IdentityServer4.Admin.UnitTests.csproj | 51 ++-- ...rver4.STS.Identity.IntegrationTests.csproj | 49 ++-- 40 files changed, 896 insertions(+), 1106 deletions(-) diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj index 11e4bdc84..e06e728b7 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj +++ b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj @@ -1,87 +1,72 @@  - - 2.0.1 - Jan Škoruba - InProcess - 1cc472a2-4e4b-48ce-846b-5219f71fc643 - ..\..\docker-compose.dcproj - Linux - ..\.. - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - ApiErrorResource.resx - - - - - - ResXFileCodeGenerator - ApiErrorResource.Designer.cs - - + net6.0 + 2.0.1 + Jan Škoruba + InProcess + 1cc472a2-4e4b-48ce-846b-5219f71fc643 + ..\..\docker-compose.dcproj + Linux + ..\.. + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + ApiErrorResource.resx + + + + + + ResXFileCodeGenerator + ApiErrorResource.Designer.cs + + - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj index 0d860885e..2e8138a06 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj @@ -1,44 +1,30 @@  - - 2.0.1 - Jan Škoruba - Business Logic layer for the administration of the Asp.Net Core Identity and IdentityServer4 - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - - - - - - - - - - + net6.0 + 2.0.1 + Jan Škoruba + Business Logic layer for the administration of the Asp.Net Core Identity and IdentityServer4 + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj index eb8abd766..6bbb1ae73 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj @@ -12,16 +12,3 @@ - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj index 5bd814cb9..7af1f2b95 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj @@ -59,16 +59,3 @@ - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj index 8fd5a9021..34f44c408 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj @@ -1,34 +1,27 @@  - - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - Entity Framework configuration for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - - - - - - - + net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + Entity Framework configuration for the administration of the IdentityServer4 and Asp.Net Core Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + + + + + + + + + + + + - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj index c0bdfaab1..0d2b1da03 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj @@ -1,27 +1,14 @@  - - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - EntityFramework extensions for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - + net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + EntityFramework extensions for the administration of the IdentityServer4 and Asp.Net Core Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj index a8d042ef3..6abd58c5e 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj @@ -1,36 +1,23 @@  - - 2.0.1 - Jan Škoruba - Entity Framework layer for the administration of the Asp.Net Core Identity and IdentityServer4 - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - - + net6.0 + 2.0.1 + Jan Škoruba + Entity Framework layer for the administration of the Asp.Net Core Identity and IdentityServer4 + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + + + + + + + + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj index f29bbd1ad..32c55c7b7 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj @@ -1,39 +1,23 @@  - - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with MySql support - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - - - - - + net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with MySql support + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + + + + + + + + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj index e95ff3f63..2a7972493 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj @@ -1,38 +1,22 @@  - - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with PostrgreSQL support - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - - - - + net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with PostrgreSQL support + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + + + + + + + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj index cfa3a858d..7723f124a 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj @@ -1,37 +1,22 @@  - - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - DbContexts and Identity entities for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - - - - + net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + DbContexts and Identity entities for the administration of the IdentityServer4 and Asp.Net Core Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + + + + + + + + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj index 1c78b1e50..0b61b571e 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj @@ -1,38 +1,22 @@  - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with SqlServer support - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with SqlServer support + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - + + + - - - - - + + + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj index 95cbb698c..e04d0d77f 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj @@ -13,6 +13,7 @@ + @@ -20,16 +21,3 @@ - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj b/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj index 1fe459293..b915f6e3f 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj +++ b/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj @@ -1,127 +1,118 @@  - - 2.0.1 - Jan Škoruba - The package with UI for the administration of the IdentityServer4 - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - latest - true - / - + net6.0 + 2.0.1 + Jan Škoruba + The package with UI for the administration of the IdentityServer4 + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + latest + true + / + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj b/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj index 87be493eb..3263b783f 100644 --- a/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj +++ b/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj @@ -1,82 +1,58 @@  - - net5.0 - 2.0.1 - Jan Škoruba - latest - 8fe260ca-ef4c-4fa3-9364-029146f8d339 - ..\..\docker-compose.dcproj - Linux - ..\.. - - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net6.0 + 2.0.1 + Jan Škoruba + latest + 8fe260ca-ef4c-4fa3-9364-029146f8d339 + ..\..\docker-compose.dcproj + Linux + ..\.. + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj b/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj index de45350a6..dc292f740 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj +++ b/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj @@ -1,103 +1,89 @@  - - net5.0 - 2.0.1 - Jan Škoruba - 9c91d295-54c5-4d09-9bd6-fa56fb74011b - ..\..\docker-compose.dcproj - Linux - ..\.. - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - - ResXFileCodeGenerator - - + + net6.0 + 2.0.1 + Jan Škoruba + 9c91d295-54c5-4d09-9bd6-fa56fb74011b + ..\..\docker-compose.dcproj + Linux + ..\.. + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + + ResXFileCodeGenerator + + - - - - - - - - - - - - - diff --git a/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj b/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj index 6e3ca474a..0297eba77 100644 --- a/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj +++ b/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj @@ -1,30 +1,24 @@  - - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - - - + net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + + + + + + + + + - - - - - - diff --git a/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj b/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj index ccbcb945f..a69035de1 100644 --- a/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj @@ -1,41 +1,28 @@  - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png net6.0 + 2.0.1 + Jan Škoruba + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - diff --git a/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj index 824088fc2..7d1e01273 100644 --- a/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj @@ -1,29 +1,29 @@  - - true - false - Full - + net6.0 + true + false + Full + - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - + + + diff --git a/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj index 8f38937a8..4ce3acb30 100644 --- a/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj @@ -1,31 +1,34 @@  - - true - false - Full - + net6.0 + true + false + Full + - - - all - runtime; build; native; contentfiles; analyzers - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - + + + + + + + diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/ConfigurationControllerTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/ConfigurationControllerTests.cs index c4e7a5a9f..c49fe7f30 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/ConfigurationControllerTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/ConfigurationControllerTests.cs @@ -82,7 +82,7 @@ public async Task AddClient() var client = await dbContext.Clients.Where(x => x.ClientId == clientDto.ClientId).SingleOrDefaultAsync(); var adddedClient = await clientService.GetClientAsync(client.Id); - clientDto.ShouldBeEquivalentTo(adddedClient, opts => opts.Excluding(x => x.Id) + clientDto.Should().BeEquivalentTo(adddedClient, opts => opts.Excluding(x => x.Id) .Excluding(x => x.AccessTokenTypes) .Excluding(x => x.ProtocolTypes) .Excluding(x => x.RefreshTokenExpirations) @@ -115,7 +115,7 @@ public async Task UpdateClient() var client = await dbContext.Clients.Where(x => x.ClientId == clientDto.ClientId).SingleOrDefaultAsync(); var adddedClient = await clientService.GetClientAsync(client.Id); - clientDto.ShouldBeEquivalentTo(adddedClient, opts => opts.Excluding(x => x.Id) + clientDto.Should().BeEquivalentTo(adddedClient, opts => opts.Excluding(x => x.Id) .Excluding(x => x.AccessTokenTypes) .Excluding(x => x.ProtocolTypes) .Excluding(x => x.RefreshTokenExpirations) @@ -170,7 +170,7 @@ public async Task AddClientClaim() var clientClaimAdded = await dbContext.ClientClaims.Where(x => x.Client.Id == clientId).SingleOrDefaultAsync(); var adddedClientClaim = await clientService.GetClientClaimAsync(clientClaimAdded.Id); - clientClaim.ShouldBeEquivalentTo(adddedClientClaim, opts => opts.Excluding(x => x.ClientClaimId) + clientClaim.Should().BeEquivalentTo(adddedClientClaim, opts => opts.Excluding(x => x.ClientClaimId) .Excluding(x => x.ClientClaims) .Excluding(x => x.ClientName)); } @@ -201,7 +201,8 @@ public async Task GetClientClaim() var viewModel = Assert.IsType(viewResult.ViewData.Model); viewModel.ClientClaims.Count.Should().Be(1); - viewModel.ClientClaims[0].ShouldBeEquivalentTo(clientClaimAdded); + viewModel.ClientClaims[0].Should().BeEquivalentTo(clientClaimAdded, options => options.Excluding(x => x.ClientId) + .Excluding(x => x.Client)); } [Fact] @@ -257,7 +258,7 @@ public async Task AddClientSecret() clientSecret.Value.Should().Be(clientSecretAdded.Value); - clientSecret.ShouldBeEquivalentTo(newClientSecret, opts => opts.Excluding(x => x.ClientSecretId) + clientSecret.Should().BeEquivalentTo(newClientSecret, opts => opts.Excluding(x => x.ClientSecretId) .Excluding(x => x.ClientSecrets) .Excluding(x => x.ClientName) .Excluding(x => x.Value)); @@ -291,7 +292,9 @@ public async Task GetClientSecret() var viewModel = Assert.IsType(viewResult.ViewData.Model); viewModel.ClientSecrets.Count.Should().Be(1); - viewModel.ClientSecrets[0].ShouldBeEquivalentTo(clientSecretAdded, opts => opts.Excluding(x => x.Value)); + viewModel.ClientSecrets[0].Should().BeEquivalentTo(clientSecretAdded, opts => opts.Excluding(x => x.Value) + .Excluding(x => x.ClientId) + .Excluding(x => x.Client)); } [Fact] @@ -345,7 +348,7 @@ public async Task AddClientProperty() var clientPropertyAdded = await dbContext.ClientProperties.Where(x => x.Client.Id == clientId).SingleOrDefaultAsync(); var newClientProperty = await clientService.GetClientPropertyAsync(clientPropertyAdded.Id); - clientProperty.ShouldBeEquivalentTo(newClientProperty, opts => opts.Excluding(x => x.ClientPropertyId) + clientProperty.Should().BeEquivalentTo(newClientProperty, opts => opts.Excluding(x => x.ClientPropertyId) .Excluding(x => x.ClientProperties) .Excluding(x => x.ClientName)); } @@ -376,7 +379,12 @@ public async Task GetClientProperty() var viewModel = Assert.IsType(viewResult.ViewData.Model); viewModel.ClientProperties.Count.Should().Be(1); - viewModel.ClientProperties[0].ShouldBeEquivalentTo(clientPropertyAdded); + viewModel.ClientProperties[0].Should().BeEquivalentTo(clientProperty, options => options.Excluding(x => x.ClientPropertyId) + .Excluding(x => x.ClientId) + .Excluding(x => x.ClientName) + .Excluding(x => x.ClientProperties) + .Excluding(x => x.TotalCount) + .Excluding(x => x.PageSize)); } [Fact] @@ -450,7 +458,7 @@ public async Task AddIdentityResource() var identityResource = await dbContext.IdentityResources.Where(x => x.Name == identityResourceDto.Name).SingleOrDefaultAsync(); var addedIdentityResource = await identityResourceService.GetIdentityResourceAsync(identityResource.Id); - identityResourceDto.ShouldBeEquivalentTo(addedIdentityResource, opts => opts.Excluding(x => x.Id)); + identityResourceDto.Should().BeEquivalentTo(addedIdentityResource, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -502,7 +510,7 @@ public async Task AddApiResource() var apiResource = await dbContext.ApiResources.Where(x => x.Name == apiResourceDto.Name).SingleOrDefaultAsync(); var addedApiResource = await apiResourceService.GetApiResourceAsync(apiResource.Id); - apiResourceDto.ShouldBeEquivalentTo(addedApiResource, opts => opts.Excluding(x => x.Id)); + apiResourceDto.Should().BeEquivalentTo(addedApiResource, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -553,7 +561,7 @@ public async Task AddApiScope() var apiScope = await dbContext.ApiScopes.Where(x => x.Name == apiScopeDto.Name).SingleOrDefaultAsync(); var addedApiScope = await apiScopeService.GetApiScopeAsync(apiScope.Id); - apiScopeDto.ShouldBeEquivalentTo(addedApiScope, opts => opts.Excluding(x => x.Id)); + apiScopeDto.Should().BeEquivalentTo(addedApiScope, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -615,7 +623,7 @@ public async Task UpdateApiScope() var apiScope = await dbContext.ApiScopes.Where(x => x.Id == apiScopeAdded.Id).SingleOrDefaultAsync(); var addedApiScope = await apiScopeService.GetApiScopeAsync(apiScope.Id); - updatedApiScopeDto.ShouldBeEquivalentTo(addedApiScope, opts => opts.Excluding(x => x.Id)); + updatedApiScopeDto.Should().BeEquivalentTo(addedApiScope, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -706,7 +714,7 @@ public async Task AddApiSecret() apiSecretsDto.Value.Should().Be(apiSecret.Value); - apiSecretsDto.ShouldBeEquivalentTo(addedApiScope, opts => opts.Excluding(x => x.ApiResourceId).Excluding(x => x.ApiResourceName).Excluding(x => x.ApiSecretId).Excluding(x => x.Value)); + apiSecretsDto.Should().BeEquivalentTo(addedApiScope, opts => opts.Excluding(x => x.ApiResourceId).Excluding(x => x.ApiResourceName).Excluding(x => x.ApiSecretId).Excluding(x => x.Value)); } [Fact] diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/IdentityControllerTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/IdentityControllerTests.cs index 74fee3ae9..987a6d9a5 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/IdentityControllerTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Controllers/IdentityControllerTests.cs @@ -73,7 +73,7 @@ public async Task AddUser() var addedUser = await identityService.GetUserAsync(userDto.Id); - userDto.ShouldBeEquivalentTo(addedUser, opts => opts.Excluding(x => x.Id)); + userDto.Should().BeEquivalentTo(addedUser, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -144,7 +144,7 @@ public async Task UpdateUser() var updatedUser = await identityService.GetUserAsync(updatedUserDto.Id.ToString()); - updatedUserDto.ShouldBeEquivalentTo(updatedUser, opts => opts.Excluding(x => x.Id)); + updatedUserDto.Should().BeEquivalentTo(updatedUser, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -177,7 +177,7 @@ public async Task GetUser() userDto.Id = userId; var addedUser = await identityService.GetUserAsync(userDto.Id.ToString()); - viewModel.ShouldBeEquivalentTo(addedUser); + viewModel.Should().BeEquivalentTo(addedUser); } [Fact] @@ -202,7 +202,7 @@ public async Task AddRole() var addedRole = await identityService.GetRoleAsync(roleDto.Id.ToString()); - roleDto.ShouldBeEquivalentTo(addedRole, opts => opts.Excluding(x => x.Id)); + roleDto.Should().BeEquivalentTo(addedRole, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -230,7 +230,7 @@ public async Task GetRole() roleDto.Id = roleId; var addedRole = await identityService.GetRoleAsync(roleDto.Id.ToString()); - viewModel.ShouldBeEquivalentTo(addedRole); + viewModel.Should().BeEquivalentTo(addedRole); } [Fact] @@ -285,7 +285,7 @@ public async Task UpdateRole() var updatedRole = await identityService.GetRoleAsync(updatedRoleDto.Id.ToString()); - updatedRoleDto.ShouldBeEquivalentTo(updatedRole, opts => opts.Excluding(x => x.Id)); + updatedRoleDto.Should().BeEquivalentTo(updatedRole, opts => opts.Excluding(x => x.Id)); } [Fact] @@ -315,7 +315,7 @@ public async Task AddUserClaim() var addedUserClaim = await identityService.GetUserClaimAsync(user.Id.ToString(), userClaim.Id); - userClaimsDto.ShouldBeEquivalentTo(addedUserClaim, opts => opts.Excluding(x => x.ClaimId)); + userClaimsDto.Should().BeEquivalentTo(addedUserClaim, opts => opts.Excluding(x => x.ClaimId)); } [Fact] @@ -349,7 +349,7 @@ public async Task AddUserRole() var userRole = await dbContext.UserRoles.Where(x => x.RoleId == roleDto.Id && x.UserId == userDto.Id).SingleOrDefaultAsync(); - userRoleDto.ShouldBeEquivalentTo(userRole, opts => opts.Excluding(x => x.Roles) + userRole.Should().BeEquivalentTo(userRoleDto, opts => opts.Excluding(x => x.Roles) .Excluding(x => x.RolesList) .Excluding(x => x.PageSize) .Excluding(x => x.TotalCount) @@ -452,7 +452,7 @@ public async Task AddRoleClaim() var addedRoleClaim = await identityService.GetRoleClaimAsync(role.Id.ToString(), roleClaim.Id); - roleClaimsDto.ShouldBeEquivalentTo(addedRoleClaim, opts => opts.Excluding(x => x.ClaimId) + roleClaimsDto.Should().BeEquivalentTo(addedRoleClaim, opts => opts.Excluding(x => x.ClaimId) .Excluding(x => x.RoleName)); } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ApiResourceMappers.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ApiResourceMappers.cs index 4f3ea0c24..5d5ab2b02 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ApiResourceMappers.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ApiResourceMappers.cs @@ -21,7 +21,7 @@ public void CanMapApiResourceToModel() //Assert apiResourceDto.Should().NotBeNull(); - apiResource.ShouldBeEquivalentTo(apiResourceDto, options => + apiResourceDto.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Secrets) .Excluding(o => o.Scopes) .Excluding(o => o.Properties) @@ -33,10 +33,10 @@ public void CanMapApiResourceToModel() .Excluding(o => o.UserClaims)); //Assert collection - apiResource.UserClaims.Select(x => x.Type).ShouldBeEquivalentTo(apiResourceDto.UserClaims); + apiResource.UserClaims.Select(x => x.Type).Should().BeEquivalentTo(apiResourceDto.UserClaims); var allowedAlgList = AllowedSigningAlgorithmsConverter.Converter.Convert(apiResource.AllowedAccessTokenSigningAlgorithms, null); - allowedAlgList.ShouldBeEquivalentTo(apiResourceDto.AllowedAccessTokenSigningAlgorithms); + allowedAlgList.Should().BeEquivalentTo(apiResourceDto.AllowedAccessTokenSigningAlgorithms); } [Fact] @@ -50,7 +50,7 @@ public void CanMapApiResourceDtoToEntity() apiResource.Should().NotBeNull(); - apiResource.ShouldBeEquivalentTo(apiResourceDto, options => + apiResourceDto.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Secrets) .Excluding(o => o.Scopes) .Excluding(o => o.Properties) @@ -62,9 +62,9 @@ public void CanMapApiResourceDtoToEntity() .Excluding(o => o.UserClaims)); //Assert collection - apiResource.UserClaims.Select(x => x.Type).ShouldBeEquivalentTo(apiResourceDto.UserClaims); + apiResource.UserClaims.Select(x => x.Type).Should().BeEquivalentTo(apiResourceDto.UserClaims); var allowedAlgList = AllowedSigningAlgorithmsConverter.Converter.Convert(apiResource.AllowedAccessTokenSigningAlgorithms, null); - allowedAlgList.ShouldBeEquivalentTo(apiResourceDto.AllowedAccessTokenSigningAlgorithms); + allowedAlgList.Should().BeEquivalentTo(apiResourceDto.AllowedAccessTokenSigningAlgorithms); } [Fact] @@ -73,18 +73,18 @@ public void CanMapApiScopeToModel() //Generate DTO var apiScopeDto = ApiScopeMock.GenerateRandomApiScope(1); - //Try map to entity - var apiScope = apiScopeDto.ToModel(); + //Try map to entity + var apiScope = apiScopeDto.ToModel(); apiScope.Should().NotBeNull(); - apiScope.ShouldBeEquivalentTo(apiScopeDto, options => + apiScopeDto.Should().BeEquivalentTo(apiScope, options => options.Excluding(o => o.UserClaims) .Excluding(o => o.ApiScopeProperties) .Excluding(o => o.UserClaimsItems)); //Assert collection - apiScopeDto.UserClaims.Select(x => x.Type).ShouldBeEquivalentTo(apiScope.UserClaims); + apiScopeDto.UserClaims.Select(x => x.Type).Should().BeEquivalentTo(apiScope.UserClaims); apiScope.Id.Should().Be(apiScopeDto.Id); } @@ -99,13 +99,13 @@ public void CanMapApiScopeDtoToEntity() apiScope.Should().NotBeNull(); - apiScope.ShouldBeEquivalentTo(apiScopeDto, options => + apiScopeDto.Should().BeEquivalentTo(apiScope, options => options.Excluding(o => o.UserClaims) .Excluding(o => o.Properties) .Excluding(o => o.Id)); //Assert collection - apiScope.UserClaims.Select(x => x.Type).ShouldBeEquivalentTo(apiScopeDto.UserClaims); + apiScope.UserClaims.Select(x => x.Type).Should().BeEquivalentTo(apiScopeDto.UserClaims); apiScope.Id.Should().Be(apiScopeDto.Id); } @@ -121,7 +121,7 @@ public void CanMapApiSecretToModel() //Assert apiSecretsDto.Should().NotBeNull(); - apiSecret.ShouldBeEquivalentTo(apiSecretsDto, options => + apiSecretsDto.Should().BeEquivalentTo(apiSecret, options => options.Excluding(o => o.ApiResource) .Excluding(o => o.Created) .Excluding(o => o.Id)); @@ -140,7 +140,7 @@ public void CanMapApiSecretDtoToEntity() apiSecret.Should().NotBeNull(); - apiSecret.ShouldBeEquivalentTo(apiSecretsDto, options => + apiSecretsDto.Should().BeEquivalentTo(apiSecret, options => options.Excluding(o => o.ApiResource) .Excluding(o => o.Created) .Excluding(o => o.Id)); diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ClientMappers.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ClientMappers.cs index 08b5716e8..6fc3cdd98 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ClientMappers.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/ClientMappers.cs @@ -21,7 +21,7 @@ public void CanMapClientToModel() //Asert clientDto.Should().NotBeNull(); - client.ShouldBeEquivalentTo(clientDto, options => + clientDto.Should().BeEquivalentTo(client, options => options.Excluding(o => o.AllowedCorsOrigins) .Excluding(o => o.RedirectUris) .Excluding(o => o.PostLogoutRedirectUris) @@ -32,14 +32,14 @@ public void CanMapClientToModel() .Excluding(o => o.IdentityProviderRestrictions)); //Assert collection - client.AllowedCorsOrigins.Select(x => x.Origin).ShouldBeEquivalentTo(clientDto.AllowedCorsOrigins); - client.RedirectUris.Select(x => x.RedirectUri).ShouldBeEquivalentTo(clientDto.RedirectUris); - client.PostLogoutRedirectUris.Select(x => x.PostLogoutRedirectUri).ShouldBeEquivalentTo(clientDto.PostLogoutRedirectUris); - client.AllowedGrantTypes.Select(x => x.GrantType).ShouldBeEquivalentTo(clientDto.AllowedGrantTypes); - client.AllowedScopes.Select(x => x.Scope).ShouldBeEquivalentTo(clientDto.AllowedScopes); - client.IdentityProviderRestrictions.Select(x => x.Provider).ShouldBeEquivalentTo(clientDto.IdentityProviderRestrictions); + client.AllowedCorsOrigins.Select(x => x.Origin).Should().BeEquivalentTo(clientDto.AllowedCorsOrigins); + client.RedirectUris.Select(x => x.RedirectUri).Should().BeEquivalentTo(clientDto.RedirectUris); + client.PostLogoutRedirectUris.Select(x => x.PostLogoutRedirectUri).Should().BeEquivalentTo(clientDto.PostLogoutRedirectUris); + client.AllowedGrantTypes.Select(x => x.GrantType).Should().BeEquivalentTo(clientDto.AllowedGrantTypes); + client.AllowedScopes.Select(x => x.Scope).Should().BeEquivalentTo(clientDto.AllowedScopes); + client.IdentityProviderRestrictions.Select(x => x.Provider).Should().BeEquivalentTo(clientDto.IdentityProviderRestrictions); var allowedAlgList = AllowedSigningAlgorithmsConverter.Converter.Convert(client.AllowedIdentityTokenSigningAlgorithms, null); - allowedAlgList.ShouldBeEquivalentTo(clientDto.AllowedIdentityTokenSigningAlgorithms); + allowedAlgList.Should().BeEquivalentTo(clientDto.AllowedIdentityTokenSigningAlgorithms); } [Fact] @@ -53,7 +53,7 @@ public void CanMapClientDtoToEntity() client.Should().NotBeNull(); - client.ShouldBeEquivalentTo(clientDto, options => + clientDto.Should().BeEquivalentTo(client, options => options.Excluding(o => o.AllowedCorsOrigins) .Excluding(o => o.RedirectUris) .Excluding(o => o.PostLogoutRedirectUris) @@ -64,14 +64,14 @@ public void CanMapClientDtoToEntity() .Excluding(o => o.IdentityProviderRestrictions)); //Assert collection - client.AllowedCorsOrigins.Select(x => x.Origin).ShouldBeEquivalentTo(clientDto.AllowedCorsOrigins); - client.RedirectUris.Select(x => x.RedirectUri).ShouldBeEquivalentTo(clientDto.RedirectUris); - client.PostLogoutRedirectUris.Select(x => x.PostLogoutRedirectUri).ShouldBeEquivalentTo(clientDto.PostLogoutRedirectUris); - client.AllowedGrantTypes.Select(x => x.GrantType).ShouldBeEquivalentTo(clientDto.AllowedGrantTypes); - client.AllowedScopes.Select(x => x.Scope).ShouldBeEquivalentTo(clientDto.AllowedScopes); - client.IdentityProviderRestrictions.Select(x => x.Provider).ShouldBeEquivalentTo(clientDto.IdentityProviderRestrictions); + client.AllowedCorsOrigins.Select(x => x.Origin).Should().BeEquivalentTo(clientDto.AllowedCorsOrigins); + client.RedirectUris.Select(x => x.RedirectUri).Should().BeEquivalentTo(clientDto.RedirectUris); + client.PostLogoutRedirectUris.Select(x => x.PostLogoutRedirectUri).Should().BeEquivalentTo(clientDto.PostLogoutRedirectUris); + client.AllowedGrantTypes.Select(x => x.GrantType).Should().BeEquivalentTo(clientDto.AllowedGrantTypes); + client.AllowedScopes.Select(x => x.Scope).Should().BeEquivalentTo(clientDto.AllowedScopes); + client.IdentityProviderRestrictions.Select(x => x.Provider).Should().BeEquivalentTo(clientDto.IdentityProviderRestrictions); var allowedAlgList = AllowedSigningAlgorithmsConverter.Converter.Convert(client.AllowedIdentityTokenSigningAlgorithms, null); - allowedAlgList.ShouldBeEquivalentTo(clientDto.AllowedIdentityTokenSigningAlgorithms); + allowedAlgList.Should().BeEquivalentTo(clientDto.AllowedIdentityTokenSigningAlgorithms); } [Fact] @@ -84,7 +84,7 @@ public void CanMapClientClaimToModel() //Assert clientClaimsDto.Should().NotBeNull(); - clientClaim.ShouldBeEquivalentTo(clientClaimsDto, options => + clientClaimsDto.Should().BeEquivalentTo(clientClaim, options => options.Excluding(o => o.Id) .Excluding(o => o.Client)); } @@ -99,7 +99,7 @@ public void CanMapClientClaimToEntity() //Assert clientClaim.Should().NotBeNull(); - clientClaim.ShouldBeEquivalentTo(clientClaimDto, options => + clientClaimDto.Should().BeEquivalentTo(clientClaim, options => options.Excluding(o => o.Id) .Excluding(o => o.Client)); } @@ -114,7 +114,7 @@ public void CanMapClientSecretToModel() //Assert clientSecretsDto.Should().NotBeNull(); - clientSecret.ShouldBeEquivalentTo(clientSecretsDto, options => + clientSecretsDto.Should().BeEquivalentTo(clientSecret, options => options.Excluding(o => o.Id) .Excluding(o => o.Created) .Excluding(o => o.Client)); @@ -130,7 +130,7 @@ public void CanMapClientSecretToEntity() //Assert clientSecret.Should().NotBeNull(); - clientSecret.ShouldBeEquivalentTo(clientSecretsDto, options => + clientSecretsDto.Should().BeEquivalentTo(clientSecret, options => options.Excluding(o => o.Id) .Excluding(o => o.Created) .Excluding(o => o.Client)); @@ -146,7 +146,7 @@ public void CanMapClientPropertyToModel() //Assert clientPropertiesDto.Should().NotBeNull(); - clientProperty.ShouldBeEquivalentTo(clientPropertiesDto, options => + clientPropertiesDto.Should().BeEquivalentTo(clientProperty, options => options.Excluding(o => o.Id) .Excluding(o => o.Client)); } @@ -161,7 +161,7 @@ public void CanMapClientPropertyToEntity() //Assert clientProperty.Should().NotBeNull(); - clientProperty.ShouldBeEquivalentTo(clientPropertiesDto, options => + clientPropertiesDto.Should().BeEquivalentTo(clientProperty, options => options.Excluding(o => o.Id) .Excluding(o => o.Client)); } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/IdentityResourceMappers.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/IdentityResourceMappers.cs index 91e1b5d57..0656ffd67 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/IdentityResourceMappers.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/IdentityResourceMappers.cs @@ -20,7 +20,7 @@ public void CanMapIdentityResourceToModel() //Assert identityResourceDto.Should().NotBeNull(); - identityResource.ShouldBeEquivalentTo(identityResourceDto, options => + identityResourceDto.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.UserClaims) .Excluding(o => o.Properties) .Excluding(o => o.Created) @@ -28,7 +28,7 @@ public void CanMapIdentityResourceToModel() .Excluding(o => o.NonEditable)); //Assert collection - identityResource.UserClaims.Select(x => x.Type).ShouldBeEquivalentTo(identityResourceDto.UserClaims); + identityResource.UserClaims.Select(x => x.Type).Should().BeEquivalentTo(identityResourceDto.UserClaims); } [Fact] @@ -42,7 +42,7 @@ public void CanMapIdentityResourceDtoToEntity() identityResource.Should().NotBeNull(); - identityResource.ShouldBeEquivalentTo(identityResourceDto, options => + identityResourceDto.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.UserClaims) .Excluding(o => o.Properties) .Excluding(o => o.Created) @@ -50,7 +50,7 @@ public void CanMapIdentityResourceDtoToEntity() .Excluding(o => o.NonEditable)); //Assert collection - identityResource.UserClaims.Select(x => x.Type).ShouldBeEquivalentTo(identityResourceDto.UserClaims); + identityResource.UserClaims.Select(x => x.Type).Should().BeEquivalentTo(identityResourceDto.UserClaims); } } } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/LogMappers.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/LogMappers.cs index 32a1def0e..3b62b04f1 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/LogMappers.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/LogMappers.cs @@ -19,7 +19,7 @@ public void CanMapIdentityResourceToModel() //Asert logDto.Should().NotBeNull(); - log.ShouldBeEquivalentTo(logDto, options => + log.Should().BeEquivalentTo(logDto, options => options.Excluding(o => o.PropertiesXml)); } @@ -34,7 +34,7 @@ public void CanMapIdentityResourceDtoToEntity() log.Should().NotBeNull(); - log.ShouldBeEquivalentTo(logDto, options => + log.Should().BeEquivalentTo(logDto, options => options.Excluding(o => o.PropertiesXml)); } } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/PersistedGrantMappers.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/PersistedGrantMappers.cs index bc91a25af..d304de13b 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/PersistedGrantMappers.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mappers/PersistedGrantMappers.cs @@ -22,7 +22,7 @@ public void CanMapPersistedGrantToModel() //Asert persistedGrantDto.Should().NotBeNull(); - persistedGrant.ShouldBeEquivalentTo(persistedGrantDto); + persistedGrant.Should().BeEquivalentTo(persistedGrantDto, options => options.Excluding(x => x.SubjectName)); } } } \ No newline at end of file diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mocks/ClientDtoMock.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mocks/ClientDtoMock.cs index 95755f851..3d64661ee 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mocks/ClientDtoMock.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Mocks/ClientDtoMock.cs @@ -163,6 +163,8 @@ public static Faker ClientCloneFaker(int id, bool cloneClientCla var clientCloneDto = new Faker() .StrictMode(false) .RuleFor(o => o.Id, id) + .RuleFor(o => o.ClientId, f => Guid.NewGuid().ToString()) + .RuleFor(o => o.ClientName, f => Guid.NewGuid().ToString()) .RuleFor(o => o.CloneClientClaims, cloneClientClaims) .RuleFor(o => o.CloneClientCorsOrigins, cloneClientCorsOrigins) .RuleFor(o => o.CloneClientGrantTypes, cloneClientGrantTypes) diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiResourceRepositoryTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiResourceRepositoryTests.cs index f698005ef..a540e6fd5 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiResourceRepositoryTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiResourceRepositoryTests.cs @@ -55,7 +55,7 @@ public async Task AddApiResourceAsync() var newApiResource = await context.ApiResources.Where(x => x.Id == apiResource.Id).SingleAsync(); //Assert new api resource - newApiResource.ShouldBeEquivalentTo(apiResource, options => options.Excluding(o => o.Id)); + newApiResource.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Id)); } } @@ -76,13 +76,13 @@ public async Task GetApiResourceAsync() var newApiResource = await apiResourceRepository.GetApiResourceAsync(apiResource.Id); //Assert new api resource - newApiResource.ShouldBeEquivalentTo(apiResource, options => options.Excluding(o => o.Id).Excluding(o => o.Secrets) + newApiResource.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Id).Excluding(o => o.Secrets) .Excluding(o => o.Scopes) .Excluding(o => o.UserClaims)); - newApiResource.UserClaims.ShouldBeEquivalentTo(apiResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("ApiResource"))); + newApiResource.UserClaims.Should().BeEquivalentTo(apiResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("ApiResource"))); } } @@ -103,7 +103,7 @@ public async Task DeleteApiResourceAsync() var newApiResource = await context.ApiResources.Where(x => x.Id == apiResource.Id).SingleAsync(); //Assert new api resource - newApiResource.ShouldBeEquivalentTo(apiResource, options => options.Excluding(o => o.Id)); + newApiResource.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Id)); //Delete api resource await apiResourceRepository.DeleteApiResourceAsync(newApiResource); @@ -133,7 +133,7 @@ public async Task UpdateApiResourceAsync() var newApiResource = await context.ApiResources.Where(x => x.Id == apiResource.Id).SingleOrDefaultAsync(); //Assert new api resource - newApiResource.ShouldBeEquivalentTo(apiResource, options => options.Excluding(o => o.Id)); + newApiResource.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(newApiResource).State = EntityState.Detached; @@ -148,7 +148,7 @@ public async Task UpdateApiResourceAsync() var updatedApiResourceEntity = await context.ApiResources.Where(x => x.Id == updatedApiResource.Id).SingleAsync(); //Assert updated api resource - updatedApiResource.ShouldBeEquivalentTo(updatedApiResourceEntity); + updatedApiResource.Should().BeEquivalentTo(updatedApiResourceEntity); } } @@ -175,7 +175,7 @@ public async Task AddApiSecretAsync() var newApiSecret = await context.ApiSecrets.Where(x => x.Id == apiSecret.Id).SingleAsync(); //Assert new api secret - newApiSecret.ShouldBeEquivalentTo(apiSecret, options => options.Excluding(o => o.Id)); + newApiSecret.Should().BeEquivalentTo(apiSecret, options => options.Excluding(o => o.Id)); } } @@ -202,7 +202,7 @@ public async Task DeleteApiSecretAsync() var newApiSecret = await context.ApiSecrets.Where(x => x.Id == apiSecret.Id).SingleOrDefaultAsync(); //Assert new api resource - newApiSecret.ShouldBeEquivalentTo(apiSecret, options => options.Excluding(o => o.Id)); + newApiSecret.Should().BeEquivalentTo(apiSecret, options => options.Excluding(o => o.Id)); //Try delete it await apiResourceRepository.DeleteApiSecretAsync(newApiSecret); @@ -238,7 +238,7 @@ public async Task GetApiSecretAsync() var newApiSecret = await apiResourceRepository.GetApiSecretAsync(apiSecret.Id); //Assert new api secret - newApiSecret.ShouldBeEquivalentTo(apiSecret, options => options.Excluding(o => o.Id) + newApiSecret.Should().BeEquivalentTo(apiSecret, options => options.Excluding(o => o.Id) .Excluding(o => o.ApiResource.Secrets) .Excluding(o => o.ApiResource.UserClaims) .Excluding(o => o.ApiResource.Scopes)); @@ -262,14 +262,14 @@ public async Task AddApiResourcePropertyAsync() var resource = await apiResourceRepository.GetApiResourceAsync(apiResource.Id); //Assert new api resource - resource.ShouldBeEquivalentTo(apiResource, options => options.Excluding(o => o.Id) + resource.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Id) .Excluding(o => o.Secrets) .Excluding(o => o.Scopes) .Excluding(o => o.UserClaims)); - resource.UserClaims.ShouldBeEquivalentTo(apiResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("ApiResource"))); + resource.UserClaims.Should().BeEquivalentTo(apiResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("ApiResource"))); //Generate random new api resource property var apiResourceProperty = ApiResourceMock.GenerateRandomApiResourceProperty(0); @@ -281,7 +281,7 @@ public async Task AddApiResourcePropertyAsync() var resourceProperty = await context.ApiResourceProperties.Where(x => x.Id == apiResourceProperty.Id) .SingleOrDefaultAsync(); - resourceProperty.ShouldBeEquivalentTo(apiResourceProperty, + resourceProperty.Should().BeEquivalentTo(apiResourceProperty, options => options.Excluding(o => o.Id).Excluding(x => x.ApiResource)); } } @@ -303,14 +303,14 @@ public async Task DeleteApiResourcePropertyAsync() var resource = await apiResourceRepository.GetApiResourceAsync(apiResource.Id); //Assert new api resource - resource.ShouldBeEquivalentTo(apiResource, options => options.Excluding(o => o.Id) + resource.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Id) .Excluding(o => o.Secrets) .Excluding(o => o.Scopes) .Excluding(o => o.UserClaims)); - resource.UserClaims.ShouldBeEquivalentTo(apiResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("ApiResource"))); + resource.UserClaims.Should().BeEquivalentTo(apiResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("ApiResource"))); //Generate random new api resource property var apiResourceProperty = ApiResourceMock.GenerateRandomApiResourceProperty(0); @@ -323,7 +323,7 @@ public async Task DeleteApiResourcePropertyAsync() .SingleOrDefaultAsync(); //Assert - property.ShouldBeEquivalentTo(apiResourceProperty, + property.Should().BeEquivalentTo(apiResourceProperty, options => options.Excluding(o => o.Id).Excluding(x => x.ApiResource)); //Try delete it @@ -355,14 +355,14 @@ public async Task GetApiResourcePropertyAsync() var resource = await apiResourceRepository.GetApiResourceAsync(apiResource.Id); //Assert new api resource - resource.ShouldBeEquivalentTo(apiResource, options => options.Excluding(o => o.Id) + resource.Should().BeEquivalentTo(apiResource, options => options.Excluding(o => o.Id) .Excluding(o => o.Secrets) .Excluding(o => o.Scopes) .Excluding(o => o.UserClaims)); - resource.UserClaims.ShouldBeEquivalentTo(apiResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("ApiResource"))); + resource.UserClaims.Should().BeEquivalentTo(apiResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("ApiResource"))); //Generate random new api resource property var apiResourceProperty = ApiResourceMock.GenerateRandomApiResourceProperty(0); @@ -373,7 +373,7 @@ public async Task GetApiResourcePropertyAsync() //Get new api resource property var resourceProperty = await apiResourceRepository.GetApiResourcePropertyAsync(apiResourceProperty.Id); - resourceProperty.ShouldBeEquivalentTo(apiResourceProperty, + resourceProperty.Should().BeEquivalentTo(apiResourceProperty, options => options.Excluding(o => o.Id).Excluding(x => x.ApiResource)); } } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiScopeRepositoryTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiScopeRepositoryTests.cs index 07ba11e39..b352b3672 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiScopeRepositoryTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ApiScopeRepositoryTests.cs @@ -52,7 +52,7 @@ public async Task AddApiScopeAsync() var newApiScopes = await context.ApiScopes.Where(x => x.Id == apiScope.Id).SingleAsync(); //Assert new api scope - newApiScopes.ShouldBeEquivalentTo(apiScope, options => options.Excluding(o => o.Id)); + newApiScopes.Should().BeEquivalentTo(apiScope, options => options.Excluding(o => o.Id)); } } @@ -82,7 +82,7 @@ public async Task UpdateApiScopeAsync() var updatedApiScopeEntity = await context.ApiScopes.Where(x => x.Id == updatedApiScope.Id).SingleAsync(); //Assert updated api scope - updatedApiScope.ShouldBeEquivalentTo(updatedApiScopeEntity); + updatedApiScope.Should().BeEquivalentTo(updatedApiScopeEntity); } } @@ -103,7 +103,7 @@ public async Task DeleteApiScopeAsync() var newApiScopes = await context.ApiScopes.Where(x => x.Id == apiScope.Id).SingleOrDefaultAsync(); //Assert new api resource - newApiScopes.ShouldBeEquivalentTo(apiScope, options => options.Excluding(o => o.Id)); + newApiScopes.Should().BeEquivalentTo(apiScope, options => options.Excluding(o => o.Id)); //Try delete it await apiResourceRepository.DeleteApiScopeAsync(newApiScopes); @@ -133,12 +133,12 @@ public async Task GetApiScopeAsync() var newApiScopes = await apiResourceRepository.GetApiScopeAsync(apiScope.Id); //Assert new api resource - newApiScopes.ShouldBeEquivalentTo(apiScope, options => options.Excluding(o => o.Id) + newApiScopes.Should().BeEquivalentTo(apiScope, options => options.Excluding(o => o.Id) .Excluding(o => o.UserClaims)); - newApiScopes.UserClaims.ShouldBeEquivalentTo(apiScope.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Scope"))); + newApiScopes.UserClaims.Should().BeEquivalentTo(apiScope.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Scope"))); } } } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ClientRepositoryTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ClientRepositoryTests.cs index 46086f160..00a013925 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ClientRepositoryTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/ClientRepositoryTests.cs @@ -76,7 +76,7 @@ public async Task AddClientAsync() var clientEntity = await context.Clients.Where(x => x.Id == client.Id).SingleAsync(); //Assert new client - clientEntity.ShouldBeEquivalentTo(client, options => options.Excluding(o => o.Id)); + clientEntity.Should().BeEquivalentTo(client, options => options.Excluding(o => o.Id)); } } @@ -109,7 +109,7 @@ public async Task AddClientClaimAsync() var newClientClaim = await context.ClientClaims.Where(x => x.Id == clientClaim.Id).SingleOrDefaultAsync(); - newClientClaim.ShouldBeEquivalentTo(clientClaim, + newClientClaim.Should().BeEquivalentTo(clientClaim, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); } } @@ -143,7 +143,7 @@ public async Task AddClientPropertyAsync() var newClientProperty = await context.ClientProperties.Where(x => x.Id == clientProperty.Id) .SingleOrDefaultAsync(); - newClientProperty.ShouldBeEquivalentTo(clientProperty, + newClientProperty.Should().BeEquivalentTo(clientProperty, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); } } @@ -176,7 +176,7 @@ public async Task AddClientSecretAsync() //Get new client secret var newSecret = await context.ClientSecrets.Where(x => x.Id == clientSecret.Id).SingleOrDefaultAsync(); - newSecret.ShouldBeEquivalentTo(clientSecret, + newSecret.Should().BeEquivalentTo(clientSecret, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); } } @@ -436,7 +436,7 @@ public async Task DeleteClientClaimAsync() await context.ClientClaims.Where(x => x.Id == clientClaim.Id).SingleOrDefaultAsync(); //Assert - newClientClaim.ShouldBeEquivalentTo(clientClaim, + newClientClaim.Should().BeEquivalentTo(clientClaim, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); //Try delete it @@ -481,7 +481,7 @@ public async Task DeleteClientPropertyAsync() .SingleOrDefaultAsync(); //Assert - newClientProperties.ShouldBeEquivalentTo(clientProperty, + newClientProperties.Should().BeEquivalentTo(clientProperty, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); //Try delete it @@ -525,7 +525,7 @@ public async Task DeleteClientSecretAsync() var newSecret = await context.ClientSecrets.Where(x => x.Id == clientSecret.Id).SingleOrDefaultAsync(); //Assert - newSecret.ShouldBeEquivalentTo(clientSecret, + newSecret.Should().BeEquivalentTo(clientSecret, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); //Try delete it @@ -589,7 +589,7 @@ public async Task GetClientClaimAsync() //Get new client claim var newClientClaim = await clientRepository.GetClientClaimAsync(clientClaim.Id); - newClientClaim.ShouldBeEquivalentTo(clientClaim, + newClientClaim.Should().BeEquivalentTo(clientClaim, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); } } @@ -622,7 +622,7 @@ public async Task GetClientPropertyAsync() //Get new client Property var newClientProperty = await clientRepository.GetClientPropertyAsync(clientProperty.Id); - newClientProperty.ShouldBeEquivalentTo(clientProperty, + newClientProperty.Should().BeEquivalentTo(clientProperty, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); } } @@ -650,7 +650,7 @@ public async Task GetClientsAsync() clients.Data.Count.Should().Be(randomClients.Count); //Assert that clients are same - clients.Data.ShouldBeEquivalentTo(randomClients); + clients.Data.Should().BeEquivalentTo(randomClients); } } @@ -682,7 +682,7 @@ public async Task GetClientSecretAsync() //Get new client secret var newSecret = await clientRepository.GetClientSecretAsync(clientSecret.Id); - newSecret.ShouldBeEquivalentTo(clientSecret, + newSecret.Should().BeEquivalentTo(clientSecret, options => options.Excluding(o => o.Id).Excluding(x => x.Client)); } } @@ -704,7 +704,7 @@ public async Task RemoveClientAsync() var clientEntity = await context.Clients.Where(x => x.Id == client.Id).SingleAsync(); //Assert new client - clientEntity.ShouldBeEquivalentTo(client, options => options.Excluding(o => o.Id)); + clientEntity.Should().BeEquivalentTo(client, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(clientEntity).State = EntityState.Detached; @@ -738,7 +738,7 @@ public async Task UpdateClientAsync() var clientEntity = await context.Clients.Where(x => x.Id == client.Id).SingleAsync(); //Assert new client - clientEntity.ShouldBeEquivalentTo(client, options => options.Excluding(o => o.Id)); + clientEntity.Should().BeEquivalentTo(client, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(clientEntity).State = EntityState.Detached; @@ -754,7 +754,7 @@ public async Task UpdateClientAsync() await context.Clients.Where(x => x.Id == updatedClient.Id).SingleAsync(); //Assert updated client - updatedClientEntity.ShouldBeEquivalentTo(updatedClient); + updatedClientEntity.Should().BeEquivalentTo(updatedClient); } } @@ -825,7 +825,7 @@ public async Task GetScopesApiResourceAsync() private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare, bool cloneClientCorsOrigins = true, bool cloneClientGrantTypes = true, bool cloneClientIdPRestrictions = true, bool cloneClientPostLogoutRedirectUris = true, bool cloneClientScopes = true, bool cloneClientRedirectUris = true, bool cloneClientClaims = true, bool cloneClientProperties = true) { //Assert cloned client - cloneClientEntity.ShouldBeEquivalentTo(clientToCompare, + cloneClientEntity.Should().BeEquivalentTo(clientToCompare, options => options.Excluding(o => o.Id) .Excluding(o => o.ClientSecrets) .Excluding(o => o.ClientId) @@ -848,9 +848,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare //New client relations have new id's and client relations therefore is required ignore them if (cloneClientGrantTypes) { - cloneClientEntity.AllowedGrantTypes.ShouldBeEquivalentTo(clientToCompare.AllowedGrantTypes, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.AllowedGrantTypes.Should().BeEquivalentTo(clientToCompare.AllowedGrantTypes, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -859,9 +859,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare if (cloneClientCorsOrigins) { - cloneClientEntity.AllowedCorsOrigins.ShouldBeEquivalentTo(clientToCompare.AllowedCorsOrigins, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.AllowedCorsOrigins.Should().BeEquivalentTo(clientToCompare.AllowedCorsOrigins, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -870,9 +870,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare if (cloneClientRedirectUris) { - cloneClientEntity.RedirectUris.ShouldBeEquivalentTo(clientToCompare.RedirectUris, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.RedirectUris.Should().BeEquivalentTo(clientToCompare.RedirectUris, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -881,9 +881,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare if (cloneClientPostLogoutRedirectUris) { - cloneClientEntity.PostLogoutRedirectUris.ShouldBeEquivalentTo(clientToCompare.PostLogoutRedirectUris, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.PostLogoutRedirectUris.Should().BeEquivalentTo(clientToCompare.PostLogoutRedirectUris, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -892,9 +892,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare if (cloneClientScopes) { - cloneClientEntity.AllowedScopes.ShouldBeEquivalentTo(clientToCompare.AllowedScopes, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.AllowedScopes.Should().BeEquivalentTo(clientToCompare.AllowedScopes, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -903,9 +903,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare if (cloneClientClaims) { - cloneClientEntity.Claims.ShouldBeEquivalentTo(clientToCompare.Claims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.Claims.Should().BeEquivalentTo(clientToCompare.Claims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -914,9 +914,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare if (cloneClientIdPRestrictions) { - cloneClientEntity.IdentityProviderRestrictions.ShouldBeEquivalentTo(clientToCompare.IdentityProviderRestrictions, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.IdentityProviderRestrictions.Should().BeEquivalentTo(clientToCompare.IdentityProviderRestrictions, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -925,9 +925,9 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare if (cloneClientProperties) { - cloneClientEntity.Properties.ShouldBeEquivalentTo(clientToCompare.Properties, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.Properties.Should().BeEquivalentTo(clientToCompare.Properties, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } else { @@ -939,7 +939,7 @@ private void ClientCloneCompare(Client cloneClientEntity, Client clientToCompare private void ClientAssert(Client client, Client clientToCompare) { - client.ShouldBeEquivalentTo(clientToCompare, + client.Should().BeEquivalentTo(clientToCompare, options => options.Excluding(o => o.Id) .Excluding(o => o.ClientSecrets) .Excluding(o => o.ClientId) @@ -958,42 +958,42 @@ private void ClientAssert(Client client, Client clientToCompare) .Excluding(o => o.Properties) ); - client.AllowedGrantTypes.ShouldBeEquivalentTo(clientToCompare.AllowedGrantTypes, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.AllowedGrantTypes.Should().BeEquivalentTo(clientToCompare.AllowedGrantTypes, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.AllowedCorsOrigins.ShouldBeEquivalentTo(clientToCompare.AllowedCorsOrigins, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.AllowedCorsOrigins.Should().BeEquivalentTo(clientToCompare.AllowedCorsOrigins, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.RedirectUris.ShouldBeEquivalentTo(clientToCompare.RedirectUris, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.RedirectUris.Should().BeEquivalentTo(clientToCompare.RedirectUris, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.PostLogoutRedirectUris.ShouldBeEquivalentTo(clientToCompare.PostLogoutRedirectUris, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.PostLogoutRedirectUris.Should().BeEquivalentTo(clientToCompare.PostLogoutRedirectUris, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.AllowedScopes.ShouldBeEquivalentTo(clientToCompare.AllowedScopes, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.AllowedScopes.Should().BeEquivalentTo(clientToCompare.AllowedScopes, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.ClientSecrets.ShouldBeEquivalentTo(clientToCompare.ClientSecrets, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.ClientSecrets.Should().BeEquivalentTo(clientToCompare.ClientSecrets, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.Claims.ShouldBeEquivalentTo(clientToCompare.Claims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.Claims.Should().BeEquivalentTo(clientToCompare.Claims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.IdentityProviderRestrictions.ShouldBeEquivalentTo( + client.IdentityProviderRestrictions.Should().BeEquivalentTo( clientToCompare.IdentityProviderRestrictions, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - client.Properties.ShouldBeEquivalentTo(clientToCompare.Properties, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + client.Properties.Should().BeEquivalentTo(clientToCompare.Properties, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } } } \ No newline at end of file diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/IdentityResourceRepositoryTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/IdentityResourceRepositoryTests.cs index 0bac60822..493b739ad 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/IdentityResourceRepositoryTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/IdentityResourceRepositoryTests.cs @@ -54,7 +54,7 @@ public async Task AddIdentityResourceAsync() var newIdentityResource = await context.IdentityResources.Where(x => x.Id == identityResource.Id).SingleAsync(); //Assert new identity resource - newIdentityResource.ShouldBeEquivalentTo(identityResource, options => options.Excluding(o => o.Id)); + newIdentityResource.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.Id)); } } @@ -75,11 +75,11 @@ public async Task GetIdentityResourceAsync() var newIdentityResource = await identityResourceRepository.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - newIdentityResource.ShouldBeEquivalentTo(identityResource, options => options.Excluding(o => o.Id).Excluding(o => o.UserClaims)); + newIdentityResource.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.Id).Excluding(o => o.UserClaims)); - newIdentityResource.UserClaims.ShouldBeEquivalentTo(identityResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("IdentityResource"))); + newIdentityResource.UserClaims.Should().BeEquivalentTo(identityResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("IdentityResource"))); } } @@ -100,7 +100,7 @@ public async Task DeleteIdentityResourceAsync() var newIdentityResource = await context.IdentityResources.Where(x => x.Id == identityResource.Id).SingleAsync(); //Assert new identity resource - newIdentityResource.ShouldBeEquivalentTo(identityResource, options => options.Excluding(o => o.Id)); + newIdentityResource.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.Id)); //Delete identity resource await identityResourceRepository.DeleteIdentityResourceAsync(newIdentityResource); @@ -130,7 +130,7 @@ public async Task UpdateIdentityResourceAsync() var newIdentityResource = await context.IdentityResources.Where(x => x.Id == identityResource.Id).SingleOrDefaultAsync(); //Assert new identity resource - newIdentityResource.ShouldBeEquivalentTo(identityResource, options => options.Excluding(o => o.Id)); + newIdentityResource.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(newIdentityResource).State = EntityState.Detached; @@ -145,7 +145,7 @@ public async Task UpdateIdentityResourceAsync() var updatedIdentityResourceEntity = await context.IdentityResources.Where(x => x.Id == updatedIdentityResource.Id).SingleAsync(); //Assert updated identity resource - updatedIdentityResource.ShouldBeEquivalentTo(updatedIdentityResourceEntity); + updatedIdentityResource.Should().BeEquivalentTo(updatedIdentityResourceEntity); } } @@ -166,12 +166,12 @@ public async Task AddIdentityResourcePropertyAsync() var resource = await identityResourceRepository.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - resource.ShouldBeEquivalentTo(identityResource, options => options.Excluding(o => o.Id) + resource.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.Id) .Excluding(o => o.UserClaims)); - resource.UserClaims.ShouldBeEquivalentTo(identityResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("IdentityResource"))); + resource.UserClaims.Should().BeEquivalentTo(identityResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("IdentityResource"))); //Generate random new identity resource property var identityResourceProperty = IdentityResourceMock.GenerateRandomIdentityResourceProperty(0); @@ -183,7 +183,7 @@ public async Task AddIdentityResourcePropertyAsync() var resourceProperty = await context.IdentityResourceProperties.Where(x => x.Id == identityResourceProperty.Id) .SingleOrDefaultAsync(); - resourceProperty.ShouldBeEquivalentTo(identityResourceProperty, + resourceProperty.Should().BeEquivalentTo(identityResourceProperty, options => options.Excluding(o => o.Id).Excluding(x => x.IdentityResource)); } } @@ -205,11 +205,11 @@ public async Task DeleteIdentityResourcePropertyAsync() var resource = await identityResourceRepository.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - resource.ShouldBeEquivalentTo(identityResource, options => options.Excluding(o => o.Id).Excluding(o => o.UserClaims)); + resource.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.Id).Excluding(o => o.UserClaims)); - resource.UserClaims.ShouldBeEquivalentTo(identityResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("IdentityResource"))); + resource.UserClaims.Should().BeEquivalentTo(identityResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("IdentityResource"))); //Generate random new identity resource property var identityResourceProperty = IdentityResourceMock.GenerateRandomIdentityResourceProperty(0); @@ -222,7 +222,7 @@ public async Task DeleteIdentityResourcePropertyAsync() .SingleOrDefaultAsync(); //Assert - property.ShouldBeEquivalentTo(identityResourceProperty, + property.Should().BeEquivalentTo(identityResourceProperty, options => options.Excluding(o => o.Id).Excluding(x => x.IdentityResource)); //Try delete it @@ -254,11 +254,11 @@ public async Task GetIdentityResourcePropertyAsync() var resource = await identityResourceRepository.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - resource.ShouldBeEquivalentTo(identityResource, options => options.Excluding(o => o.Id).Excluding(o => o.UserClaims)); + resource.Should().BeEquivalentTo(identityResource, options => options.Excluding(o => o.Id).Excluding(o => o.UserClaims)); - resource.UserClaims.ShouldBeEquivalentTo(identityResource.UserClaims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("IdentityResource"))); + resource.UserClaims.Should().BeEquivalentTo(identityResource.UserClaims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("IdentityResource"))); //Generate random new identity resource property var identityResourceProperty = IdentityResourceMock.GenerateRandomIdentityResourceProperty(0); @@ -269,7 +269,7 @@ public async Task GetIdentityResourcePropertyAsync() //Get new identity resource property var resourceProperty = await identityResourceRepository.GetIdentityResourcePropertyAsync(identityResourceProperty.Id); - resourceProperty.ShouldBeEquivalentTo(identityResourceProperty, + resourceProperty.Should().BeEquivalentTo(identityResourceProperty, options => options.Excluding(o => o.Id).Excluding(x => x.IdentityResource)); } } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/PersistedGrantRepositoryTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/PersistedGrantRepositoryTests.cs index ffeefe734..5d4b5f6c8 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/PersistedGrantRepositoryTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Repositories/PersistedGrantRepositoryTests.cs @@ -64,7 +64,7 @@ public async Task GetPersistedGrantAsync() var persistedGrantAdded = await persistedGrantRepository.GetPersistedGrantAsync(persistedGrantKey); //Assert - persistedGrant.ShouldBeEquivalentTo(persistedGrantAdded, opt => opt.Excluding(x => x.Key)); + persistedGrant.Should().BeEquivalentTo(persistedGrantAdded, opt => opt.Excluding(x => x.Key)); } } } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiResourceServiceTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiResourceServiceTests.cs index 4fe92796a..b75bc34be 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiResourceServiceTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiResourceServiceTests.cs @@ -102,7 +102,7 @@ public async Task AddApiResourceAsync() var newApiResourceDto = await apiResourceService.GetApiResourceAsync(apiResource.Id); //Assert new api resource - apiResourceDto.ShouldBeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); + apiResourceDto.Should().BeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); } } @@ -124,7 +124,7 @@ public async Task GetApiResourceAsync() var newApiResourceDto = await apiResourceService.GetApiResourceAsync(apiResource.Id); //Assert new api resource - apiResourceDto.ShouldBeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); + apiResourceDto.Should().BeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); } } @@ -146,7 +146,7 @@ public async Task RemoveApiResourceAsync() var newApiResourceDto = await apiResourceService.GetApiResourceAsync(apiResource.Id); //Assert new api resource - apiResourceDto.ShouldBeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); + apiResourceDto.Should().BeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); //Remove api resource await apiResourceService.DeleteApiResourceAsync(newApiResourceDto); @@ -178,7 +178,7 @@ public async Task UpdateApiResourceAsync() var newApiResourceDto = await apiResourceService.GetApiResourceAsync(apiResource.Id); //Assert new api resource - apiResourceDto.ShouldBeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); + apiResourceDto.Should().BeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(apiResource).State = EntityState.Detached; @@ -192,7 +192,7 @@ public async Task UpdateApiResourceAsync() var updatedApiResourceDto = await apiResourceService.GetApiResourceAsync(apiResource.Id); //Assert updated api resuorce - updatedApiResource.ShouldBeEquivalentTo(updatedApiResourceDto, options => options.Excluding(o => o.Id)); + updatedApiResource.Should().BeEquivalentTo(updatedApiResourceDto, options => options.Excluding(o => o.Id)); } } @@ -214,7 +214,7 @@ public async Task AddApiSecretAsync() var newApiResourceDto = await apiResourceService.GetApiResourceAsync(apiResource.Id); //Assert new api resource - apiResourceDto.ShouldBeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); + apiResourceDto.Should().BeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); //Generate random new api secret var apiSecretsDto = ApiResourceDtoMock.GenerateRandomApiSecret(0, newApiResourceDto.Id); @@ -236,7 +236,7 @@ public async Task AddApiSecretAsync() secretsDto.Value.Should().Be(apiSecretsDto.Value); //Assert - newApiSecret.ShouldBeEquivalentTo(secretsDto, o => o.Excluding(x => x.ApiResourceName).Excluding(x => x.Value)); + newApiSecret.Should().BeEquivalentTo(secretsDto, o => o.Excluding(x => x.ApiResourceName).Excluding(x => x.Value)); } } @@ -258,7 +258,7 @@ public async Task DeleteApiSecretAsync() var newApiResourceDto = await apiResourceService.GetApiResourceAsync(apiResource.Id); //Assert new api resource - apiResourceDto.ShouldBeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); + apiResourceDto.Should().BeEquivalentTo(newApiResourceDto, options => options.Excluding(o => o.Id)); //Generate random new api secret var apiSecretsDtoMock = ApiResourceDtoMock.GenerateRandomApiSecret(0, newApiResourceDto.Id); @@ -277,7 +277,7 @@ public async Task DeleteApiSecretAsync() var newApiSecret = await apiResourceService.GetApiSecretAsync(apiSecretsDto.ApiSecretId); // Assert - newApiSecret.ShouldBeEquivalentTo(apiSecretsDto, o => o.Excluding(x => x.ApiResourceName).Excluding(x => x.Value)); + newApiSecret.Should().BeEquivalentTo(apiSecretsDto, o => o.Excluding(x => x.ApiResourceName).Excluding(x => x.Value)); apiSecretsDto.Value.Should().Be(apiSecretsDtoMock.Value); @@ -310,7 +310,7 @@ public async Task AddApiResourcePropertyAsync() var apiResourceDto = await apiResourceService.GetApiResourceAsync(resource.Id); //Assert new api resource - apiResource.ShouldBeEquivalentTo(apiResourceDto, options => options.Excluding(o => o.Id)); + apiResource.Should().BeEquivalentTo(apiResourceDto, options => options.Excluding(o => o.Id)); //Generate random new api resource property var apiResourceProperty = ApiResourceDtoMock.GenerateRandomApiResourceProperty(0, resource.Id); @@ -329,7 +329,7 @@ public async Task AddApiResourcePropertyAsync() var resourcePropertiesDto = await apiResourceService.GetApiResourcePropertyAsync(property.Id); //Assert - resourcePropertiesDto.ShouldBeEquivalentTo(propertyDto, options => + resourcePropertiesDto.Should().BeEquivalentTo(propertyDto, options => options.Excluding(o => o.ApiResourcePropertyId) .Excluding(o => o.ApiResourceName)); } @@ -353,7 +353,7 @@ public async Task GetApiResourcePropertyAsync() var apiResourceDto = await apiResourceService.GetApiResourceAsync(resource.Id); //Assert new api resource - apiResource.ShouldBeEquivalentTo(apiResourceDto, options => options.Excluding(o => o.Id)); + apiResource.Should().BeEquivalentTo(apiResourceDto, options => options.Excluding(o => o.Id)); //Generate random new api resource property var apiResourceProperty = ApiResourceDtoMock.GenerateRandomApiResourceProperty(0, resource.Id); @@ -372,7 +372,7 @@ public async Task GetApiResourcePropertyAsync() var apiResourcePropertiesDto = await apiResourceService.GetApiResourcePropertyAsync(property.Id); //Assert - apiResourcePropertiesDto.ShouldBeEquivalentTo(propertyDto, options => + apiResourcePropertiesDto.Should().BeEquivalentTo(propertyDto, options => options.Excluding(o => o.ApiResourcePropertyId) .Excluding(o => o.ApiResourceName)); } @@ -396,7 +396,7 @@ public async Task DeleteApiResourcePropertyAsync() var apiResourceDto = await apiResourceService.GetApiResourceAsync(resource.Id); //Assert new api resource - apiResource.ShouldBeEquivalentTo(apiResourceDto, options => options.Excluding(o => o.Id)); + apiResource.Should().BeEquivalentTo(apiResourceDto, options => options.Excluding(o => o.Id)); //Generate random new api resource Property var apiResourcePropertiesDto = ApiResourceDtoMock.GenerateRandomApiResourceProperty(0, resource.Id); @@ -415,7 +415,7 @@ public async Task DeleteApiResourcePropertyAsync() var resourcePropertiesDto = await apiResourceService.GetApiResourcePropertyAsync(property.Id); //Assert - resourcePropertiesDto.ShouldBeEquivalentTo(propertiesDto, options => + resourcePropertiesDto.Should().BeEquivalentTo(propertiesDto, options => options.Excluding(o => o.ApiResourcePropertyId) .Excluding(o => o.ApiResourceName)); diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiScopeServiceTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiScopeServiceTests.cs index 7510db242..d26c557f2 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiScopeServiceTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ApiScopeServiceTests.cs @@ -90,7 +90,7 @@ public async Task AddApiScopeAsync() var newApiScope = await apiScopeService.GetApiScopeAsync(apiScopesDto.Id); //Assert - newApiScope.ShouldBeEquivalentTo(apiScopesDto); + newApiScope.Should().BeEquivalentTo(apiScopesDto); } } @@ -118,7 +118,7 @@ public async Task GetApiScopeAsync() var newApiScope = await apiScopeService.GetApiScopeAsync(apiScopesDto.Id); //Assert - newApiScope.ShouldBeEquivalentTo(apiScopesDto); + newApiScope.Should().BeEquivalentTo(apiScopesDto); } } @@ -146,7 +146,7 @@ public async Task UpdateApiScopeAsync() var newApiScope = await apiScopeService.GetApiScopeAsync(apiScopesDto.Id); //Assert - newApiScope.ShouldBeEquivalentTo(apiScopesDto); + newApiScope.Should().BeEquivalentTo(apiScopesDto); //Detached the added item context.Entry(apiScope).State = EntityState.Detached; @@ -159,7 +159,7 @@ public async Task UpdateApiScopeAsync() var updatedApiScopeDto = await apiScopeService.GetApiScopeAsync(apiScopesDto.Id); //Assert updated api scope - updatedApiScope.ShouldBeEquivalentTo(updatedApiScopeDto); + updatedApiScope.Should().BeEquivalentTo(updatedApiScopeDto); } } @@ -187,7 +187,7 @@ public async Task DeleteApiScopeAsync() var newApiScope = await apiScopeService.GetApiScopeAsync(apiScopeDto.Id); //Assert - newApiScope.ShouldBeEquivalentTo(apiScopeDto); + newApiScope.Should().BeEquivalentTo(apiScopeDto); //Delete it await apiScopeService.DeleteApiScopeAsync(newApiScope); diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ClientServiceTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ClientServiceTests.cs index 1f0cb00e2..1d4821f4b 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ClientServiceTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/ClientServiceTests.cs @@ -84,7 +84,7 @@ public async Task AddClientAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); } } @@ -138,7 +138,7 @@ public async Task CloneClientAsync() .Where(x => x.Id == clientDtoToClone.Id).SingleOrDefaultAsync(); //Assert cloned client - cloneClientEntity.ShouldBeEquivalentTo(clientToCompare, + cloneClientEntity.Should().BeEquivalentTo(clientToCompare, options => options.Excluding(o => o.Id) .Excluding(o => o.ClientSecrets) .Excluding(o => o.ClientId) @@ -159,42 +159,42 @@ public async Task CloneClientAsync() //New client relations have new id's and client relations therefore is required ignore them - cloneClientEntity.AllowedGrantTypes.ShouldBeEquivalentTo(clientToCompare.AllowedGrantTypes, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.AllowedGrantTypes.Should().BeEquivalentTo(clientToCompare.AllowedGrantTypes, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.AllowedCorsOrigins.ShouldBeEquivalentTo(clientToCompare.AllowedCorsOrigins, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.AllowedCorsOrigins.Should().BeEquivalentTo(clientToCompare.AllowedCorsOrigins, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.RedirectUris.ShouldBeEquivalentTo(clientToCompare.RedirectUris, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.RedirectUris.Should().BeEquivalentTo(clientToCompare.RedirectUris, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.PostLogoutRedirectUris.ShouldBeEquivalentTo(clientToCompare.PostLogoutRedirectUris, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.PostLogoutRedirectUris.Should().BeEquivalentTo(clientToCompare.PostLogoutRedirectUris, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.AllowedScopes.ShouldBeEquivalentTo(clientToCompare.AllowedScopes, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.AllowedScopes.Should().BeEquivalentTo(clientToCompare.AllowedScopes, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.ClientSecrets.ShouldBeEquivalentTo(clientToCompare.ClientSecrets, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.ClientSecrets.Should().BeEquivalentTo(clientToCompare.ClientSecrets, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.Claims.ShouldBeEquivalentTo(clientToCompare.Claims, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.Claims.Should().BeEquivalentTo(clientToCompare.Claims, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.IdentityProviderRestrictions.ShouldBeEquivalentTo( + cloneClientEntity.IdentityProviderRestrictions.Should().BeEquivalentTo( clientToCompare.IdentityProviderRestrictions, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); - cloneClientEntity.Properties.ShouldBeEquivalentTo(clientToCompare.Properties, - option => option.Excluding(x => x.SelectedMemberPath.EndsWith("Id")) - .Excluding(x => x.SelectedMemberPath.EndsWith("Client"))); + cloneClientEntity.Properties.Should().BeEquivalentTo(clientToCompare.Properties, + option => option.Excluding(x => x.Path.EndsWith("Id")) + .Excluding(x => x.Path.EndsWith("Client"))); } } @@ -218,7 +218,7 @@ public async Task UpdateClientAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(clientEntity).State = EntityState.Detached; @@ -235,7 +235,7 @@ public async Task UpdateClientAsync() var updatedClientDto = await clientService.GetClientAsync(updatedClientEntity.Id); //Assert updated client - updatedClient.ShouldBeEquivalentTo(updatedClientDto, options => options.Excluding(o => o.Id)); + updatedClient.Should().BeEquivalentTo(updatedClientDto, options => options.Excluding(o => o.Id)); } } @@ -259,7 +259,7 @@ public async Task RemoveClientAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(clientEntity).State = EntityState.Detached; @@ -295,7 +295,7 @@ public async Task GetClientAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); } } @@ -318,7 +318,7 @@ public async Task AddClientClaimAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client Claim var clientClaim = ClientDtoMock.GenerateRandomClientClaim(0, clientEntity.Id); @@ -337,7 +337,7 @@ public async Task AddClientClaimAsync() var clientClaimsDto = await clientService.GetClientClaimAsync(claim.Id); //Assert - clientClaimsDto.ShouldBeEquivalentTo(claimsDto, options => + clientClaimsDto.Should().BeEquivalentTo(claimsDto, options => options.Excluding(o => o.ClientClaimId) .Excluding(o => o.ClientName)); } @@ -362,7 +362,7 @@ public async Task DeleteClientClaimAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client Claim var clientClaim = ClientDtoMock.GenerateRandomClientClaim(0, clientEntity.Id); @@ -381,7 +381,7 @@ public async Task DeleteClientClaimAsync() var clientClaimsDto = await clientService.GetClientClaimAsync(claim.Id); //Assert - clientClaimsDto.ShouldBeEquivalentTo(claimsDto, options => options.Excluding(o => o.ClientClaimId) + clientClaimsDto.Should().BeEquivalentTo(claimsDto, options => options.Excluding(o => o.ClientClaimId) .Excluding(o => o.ClientName)); //Delete client claim @@ -414,7 +414,7 @@ public async Task GetClientClaimAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client Claim var clientClaim = ClientDtoMock.GenerateRandomClientClaim(0, clientEntity.Id); @@ -433,7 +433,7 @@ public async Task GetClientClaimAsync() var clientClaimsDto = await clientService.GetClientClaimAsync(claim.Id); //Assert - clientClaimsDto.ShouldBeEquivalentTo(claimsDto, options => options.Excluding(o => o.ClientClaimId) + clientClaimsDto.Should().BeEquivalentTo(claimsDto, options => options.Excluding(o => o.ClientClaimId) .Excluding(o => o.ClientName)); } } @@ -457,7 +457,7 @@ public async Task AddClientPropertyAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client property var clicentProperty = ClientDtoMock.GenerateRandomClientProperty(0, clientEntity.Id); @@ -476,7 +476,7 @@ public async Task AddClientPropertyAsync() var clientPropertiesDto = await clientService.GetClientPropertyAsync(property.Id); //Assert - clientPropertiesDto.ShouldBeEquivalentTo(propertyDto, options => + clientPropertiesDto.Should().BeEquivalentTo(propertyDto, options => options.Excluding(o => o.ClientPropertyId) .Excluding(o => o.ClientName)); } @@ -501,7 +501,7 @@ public async Task GetClientPropertyAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client property var clicentProperty = ClientDtoMock.GenerateRandomClientProperty(0, clientEntity.Id); @@ -520,7 +520,7 @@ public async Task GetClientPropertyAsync() var clientPropertiesDto = await clientService.GetClientPropertyAsync(property.Id); //Assert - clientPropertiesDto.ShouldBeEquivalentTo(propertyDto, options => options.Excluding(o => o.ClientPropertyId) + clientPropertiesDto.Should().BeEquivalentTo(propertyDto, options => options.Excluding(o => o.ClientPropertyId) .Excluding(o => o.ClientName)); } } @@ -544,7 +544,7 @@ public async Task DeleteClientPropertyAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client Property var clientProperty = ClientDtoMock.GenerateRandomClientProperty(0, clientEntity.Id); @@ -563,7 +563,7 @@ public async Task DeleteClientPropertyAsync() var clientPropertiesDto = await clientService.GetClientPropertyAsync(property.Id); //Assert - clientPropertiesDto.ShouldBeEquivalentTo(propertiesDto, options => options.Excluding(o => o.ClientPropertyId) + clientPropertiesDto.Should().BeEquivalentTo(propertiesDto, options => options.Excluding(o => o.ClientPropertyId) .Excluding(o => o.ClientName)); //Delete client Property @@ -596,7 +596,7 @@ public async Task AddClientSecretAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client secret var clientSecret = ClientDtoMock.GenerateRandomClientSecret(0, clientEntity.Id); @@ -617,7 +617,7 @@ public async Task AddClientSecretAsync() clientSecretsDto.Value.Should().Be(clientSecret.Value); //Assert - secretsDto.ShouldBeEquivalentTo(clientSecretsDto, options => + secretsDto.Should().BeEquivalentTo(clientSecretsDto, options => options.Excluding(o => o.ClientSecretId) .Excluding(o => o.ClientName) .Excluding(o => o.Value)); @@ -643,7 +643,7 @@ public async Task GetClientSecretAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client secret var clientSecret = ClientDtoMock.GenerateRandomClientSecret(0, clientEntity.Id); @@ -664,7 +664,7 @@ public async Task GetClientSecretAsync() clientSecretsDto.Value.Should().Be(clientSecret.Value); //Assert - secretsDto.ShouldBeEquivalentTo(clientSecretsDto, options => options.Excluding(o => o.ClientSecretId) + secretsDto.Should().BeEquivalentTo(clientSecretsDto, options => options.Excluding(o => o.ClientSecretId) .Excluding(o => o.ClientName) .Excluding(o => o.Value)); } @@ -689,7 +689,7 @@ public async Task DeleteClientSecretAsync() var clientDto = await clientService.GetClientAsync(clientEntity.Id); //Assert new client - client.ShouldBeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); + client.Should().BeEquivalentTo(clientDto, options => options.Excluding(o => o.Id)); //Generate random new Client secret var clientSecret = ClientDtoMock.GenerateRandomClientSecret(0, clientEntity.Id); @@ -708,7 +708,7 @@ public async Task DeleteClientSecretAsync() var clientSecretsDto = await clientService.GetClientSecretAsync(secret.Id); //Assert - clientSecretsDto.ShouldBeEquivalentTo(secretsDto, options => options.Excluding(o => o.ClientSecretId) + clientSecretsDto.Should().BeEquivalentTo(secretsDto, options => options.Excluding(o => o.ClientSecretId) .Excluding(o => o.ClientName) .Excluding(o => o.Value)); diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityResourceServiceTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityResourceServiceTests.cs index 1b3dddbbd..bb0b7ad7b 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityResourceServiceTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityResourceServiceTests.cs @@ -83,7 +83,7 @@ public async Task AddIdentityResourceAsync() var newIdentityResourceDto = await identityResourceService.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - identityResourceDto.ShouldBeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); + identityResourceDto.Should().BeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); } } @@ -105,7 +105,7 @@ public async Task GetIdentityResourceAsync() var newIdentityResourceDto = await identityResourceService.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - identityResourceDto.ShouldBeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); + identityResourceDto.Should().BeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); } } @@ -127,7 +127,7 @@ public async Task RemoveIdentityResourceAsync() var newIdentityResourceDto = await identityResourceService.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - identityResourceDto.ShouldBeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); + identityResourceDto.Should().BeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); //Remove identity resource await identityResourceService.DeleteIdentityResourceAsync(newIdentityResourceDto); @@ -159,7 +159,7 @@ public async Task UpdateIdentityResourceAsync() var newIdentityResourceDto = await identityResourceService.GetIdentityResourceAsync(identityResource.Id); //Assert new identity resource - identityResourceDto.ShouldBeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); + identityResourceDto.Should().BeEquivalentTo(newIdentityResourceDto, options => options.Excluding(o => o.Id)); //Detached the added item context.Entry(identityResource).State = EntityState.Detached; @@ -173,7 +173,7 @@ public async Task UpdateIdentityResourceAsync() var updatedIdentityResourceDto = await identityResourceService.GetIdentityResourceAsync(identityResource.Id); //Assert updated identity resuorce - updatedIdentityResource.ShouldBeEquivalentTo(updatedIdentityResourceDto, options => options.Excluding(o => o.Id)); + updatedIdentityResource.Should().BeEquivalentTo(updatedIdentityResourceDto, options => options.Excluding(o => o.Id)); } } @@ -195,7 +195,7 @@ public async Task AddIdentityResourcePropertyAsync() var identityResourceDto = await identityResourceService.GetIdentityResourceAsync(resource.Id); //Assert new identity resource - identityResource.ShouldBeEquivalentTo(identityResourceDto, options => options.Excluding(o => o.Id)); + identityResource.Should().BeEquivalentTo(identityResourceDto, options => options.Excluding(o => o.Id)); //Generate random new identity resource property var resourceProperty = IdentityResourceDtoMock.GenerateRandomIdentityResourceProperty(0, resource.Id); @@ -214,7 +214,7 @@ public async Task AddIdentityResourcePropertyAsync() var resourcePropertiesDto = await identityResourceService.GetIdentityResourcePropertyAsync(property.Id); //Assert - resourcePropertiesDto.ShouldBeEquivalentTo(propertyDto, options => + resourcePropertiesDto.Should().BeEquivalentTo(propertyDto, options => options.Excluding(o => o.IdentityResourcePropertyId) .Excluding(o => o.IdentityResourceName)); } @@ -238,7 +238,7 @@ public async Task GetIdentityResourcePropertyAsync() var identityResourceDto = await identityResourceService.GetIdentityResourceAsync(resource.Id); //Assert new identity resource - identityResource.ShouldBeEquivalentTo(identityResourceDto, options => options.Excluding(o => o.Id)); + identityResource.Should().BeEquivalentTo(identityResourceDto, options => options.Excluding(o => o.Id)); //Generate random new identity resource property var identityResourceProperty = IdentityResourceDtoMock.GenerateRandomIdentityResourceProperty(0, resource.Id); @@ -257,7 +257,7 @@ public async Task GetIdentityResourcePropertyAsync() var resourcePropertiesDto = await identityResourceService.GetIdentityResourcePropertyAsync(property.Id); //Assert - resourcePropertiesDto.ShouldBeEquivalentTo(propertyDto, options => + resourcePropertiesDto.Should().BeEquivalentTo(propertyDto, options => options.Excluding(o => o.IdentityResourcePropertyId) .Excluding(o => o.IdentityResourceName)); } @@ -281,7 +281,7 @@ public async Task DeleteIdentityResourcePropertyAsync() var identityResourceDto = await identityResourceService.GetIdentityResourceAsync(resource.Id); //Assert new identity resource - resourceDto.ShouldBeEquivalentTo(identityResourceDto, options => options.Excluding(o => o.Id)); + resourceDto.Should().BeEquivalentTo(identityResourceDto, options => options.Excluding(o => o.Id)); //Generate random new identity resource Property var identityResourcePropertiesDto = IdentityResourceDtoMock.GenerateRandomIdentityResourceProperty(0, resource.Id); @@ -300,7 +300,7 @@ public async Task DeleteIdentityResourcePropertyAsync() var resourcePropertiesDto = await identityResourceService.GetIdentityResourcePropertyAsync(property.Id); //Assert - resourcePropertiesDto.ShouldBeEquivalentTo(propertiesDto, options => + resourcePropertiesDto.Should().BeEquivalentTo(propertiesDto, options => options.Excluding(o => o.IdentityResourcePropertyId) .Excluding(o => o.IdentityResourceName)); diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityServiceTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityServiceTests.cs index 47baf66b0..bc9df7f8c 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityServiceTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/IdentityServiceTests.cs @@ -140,7 +140,7 @@ public async Task AddUserAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); } } @@ -163,7 +163,7 @@ public async Task DeleteUserProviderAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); var userProvider = IdentityMock.GenerateRandomUserProviders(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), newUserDto.Id); @@ -206,7 +206,7 @@ public async Task AddUserRoleAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); //Generate random new role var roleDto = IdentityDtoMock.GenerateRandomRole(); @@ -220,7 +220,7 @@ public async Task AddUserRoleAsync() var newRoleDto = await identityService.GetRoleAsync(roleDto.Id.ToString()); //Assert new role - roleDto.ShouldBeEquivalentTo(newRoleDto); + roleDto.Should().BeEquivalentTo(newRoleDto); var userRoleDto = IdentityDtoMock.GenerateRandomUserRole>(roleDto.Id, userDto.Id); @@ -252,7 +252,7 @@ public async Task DeleteUserRoleAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); //Generate random new role var roleDto = IdentityDtoMock.GenerateRandomRole(); @@ -266,7 +266,7 @@ public async Task DeleteUserRoleAsync() var newRoleDto = await identityService.GetRoleAsync(roleDto.Id.ToString()); //Assert new role - roleDto.ShouldBeEquivalentTo(newRoleDto); + roleDto.Should().BeEquivalentTo(newRoleDto); var userRoleDto = IdentityDtoMock.GenerateRandomUserRole>(roleDto.Id, userDto.Id); @@ -303,7 +303,7 @@ public async Task AddUserClaimAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); //Generate random new user claim var userClaimDto = IdentityDtoMock.GenerateRandomUserClaim(0, userDto.Id); @@ -317,7 +317,7 @@ public async Task AddUserClaimAsync() var newUserClaim = await identityService.GetUserClaimAsync(userDto.Id.ToString(), claim.Id); //Assert new user claim - userClaimDto.ShouldBeEquivalentTo(newUserClaim); + userClaimDto.Should().BeEquivalentTo(newUserClaim); } } @@ -340,7 +340,7 @@ public async Task DeleteUserClaimAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); //Generate random new user claim var userClaimDto = IdentityDtoMock.GenerateRandomUserClaim(0, userDto.Id); @@ -354,7 +354,7 @@ public async Task DeleteUserClaimAsync() var newUserClaim = await identityService.GetUserClaimAsync(userDto.Id.ToString(), claim.Id); //Assert new user claim - userClaimDto.ShouldBeEquivalentTo(newUserClaim); + userClaimDto.Should().BeEquivalentTo(newUserClaim); await identityService.DeleteUserClaimAsync(userClaimDto); @@ -383,7 +383,7 @@ public async Task UpdateUserAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); //Detached the added item context.Entry(user).State = EntityState.Detached; @@ -397,7 +397,7 @@ public async Task UpdateUserAsync() var updatedUser = await identityService.GetUserAsync(userDtoForUpdate.Id.ToString()); //Assert updated user - userDtoForUpdate.ShouldBeEquivalentTo(updatedUser); + userDtoForUpdate.Should().BeEquivalentTo(updatedUser); } } @@ -420,7 +420,7 @@ public async Task DeleteUserAsync() var newUserDto = await identityService.GetUserAsync(userDto.Id.ToString()); //Assert new user - userDto.ShouldBeEquivalentTo(newUserDto); + userDto.Should().BeEquivalentTo(newUserDto); //Remove user await identityService.DeleteUserAsync(newUserDto.Id.ToString(), newUserDto); @@ -453,7 +453,7 @@ public async Task AddRoleAsync() var newRoleDto = await identityService.GetRoleAsync(roleDto.Id.ToString()); //Assert new role - roleDto.ShouldBeEquivalentTo(newRoleDto); + roleDto.Should().BeEquivalentTo(newRoleDto); } } @@ -476,7 +476,7 @@ public async Task UpdateRoleAsync() var newRoleDto = await identityService.GetRoleAsync(roleDto.Id.ToString()); //Assert new role - roleDto.ShouldBeEquivalentTo(newRoleDto); + roleDto.Should().BeEquivalentTo(newRoleDto); //Detached the added item context.Entry(role).State = EntityState.Detached; @@ -490,7 +490,7 @@ public async Task UpdateRoleAsync() var updatedRole = await identityService.GetRoleAsync(roleDtoForUpdate.Id.ToString()); //Assert updated role - roleDtoForUpdate.ShouldBeEquivalentTo(updatedRole); + roleDtoForUpdate.Should().BeEquivalentTo(updatedRole); } } @@ -513,7 +513,7 @@ public async Task DeleteRoleAsync() var newRoleDto = await identityService.GetRoleAsync(roleDto.Id.ToString()); //Assert new role - roleDto.ShouldBeEquivalentTo(newRoleDto); + roleDto.Should().BeEquivalentTo(newRoleDto); //Remove role await identityService.DeleteRoleAsync(newRoleDto); @@ -546,7 +546,7 @@ public async Task AddRoleClaimAsync() var newRoleDto = await identityService.GetRoleAsync(roleDto.Id.ToString()); //Assert new role - roleDto.ShouldBeEquivalentTo(newRoleDto); + roleDto.Should().BeEquivalentTo(newRoleDto); //Generate random new role claim var roleClaimDto = IdentityDtoMock.GenerateRandomRoleClaim(0, roleDto.Id); @@ -560,7 +560,7 @@ public async Task AddRoleClaimAsync() var newRoleClaimDto = await identityService.GetRoleClaimAsync(roleDto.Id.ToString(), roleClaimDto.ClaimId); //Assert new role - roleClaimDto.ShouldBeEquivalentTo(newRoleClaimDto, options => options.Excluding(o => o.RoleName)); + roleClaimDto.Should().BeEquivalentTo(newRoleClaimDto, options => options.Excluding(o => o.RoleName)); } } @@ -583,7 +583,7 @@ public async Task RemoveRoleClaimAsync() var newRoleDto = await identityService.GetRoleAsync(roleDto.Id.ToString()); //Assert new role - roleDto.ShouldBeEquivalentTo(newRoleDto); + roleDto.Should().BeEquivalentTo(newRoleDto); //Generate random new role claim var roleClaimDto = IdentityDtoMock.GenerateRandomRoleClaim(0, roleDto.Id); @@ -597,7 +597,7 @@ public async Task RemoveRoleClaimAsync() var newRoleClaimDto = await identityService.GetRoleClaimAsync(roleDto.Id.ToString(), roleClaimDto.ClaimId); //Assert new role - roleClaimDto.ShouldBeEquivalentTo(newRoleClaimDto, options => options.Excluding(o => o.RoleName)); + roleClaimDto.Should().BeEquivalentTo(newRoleClaimDto, options => options.Excluding(o => o.RoleName)); await identityService.DeleteRoleClaimAsync(roleClaimDto); diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/PersistedGrantServiceTests.cs b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/PersistedGrantServiceTests.cs index eee4645c5..a94f0c776 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/PersistedGrantServiceTests.cs +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Services/PersistedGrantServiceTests.cs @@ -86,7 +86,7 @@ public async Task GetPersistedGrantAsync() var persistedGrantAdded = await persistedGrantService.GetPersistedGrantAsync(persistedGrantKey); //Assert - persistedGrant.ShouldBeEquivalentTo(persistedGrantAdded); + persistedGrant.Should().BeEquivalentTo(persistedGrantAdded, options => options.Excluding(x => x.SubjectName)); } } } diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj index 5ebbd534f..d9f5d8c1c 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj @@ -1,30 +1,33 @@  - - net5.0 - Full - false - + + net6.0 + Full + false + - - - all - runtime; build; native; contentfiles; analyzers - - - - all - runtime; build; native; contentfiles; analyzers - - - - - - - + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - + + + + + + + diff --git a/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj index d834f8dd4..f7ffa75d6 100644 --- a/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj @@ -1,29 +1,32 @@  - - net5.0 - true - false - Full - + + net6.0 + true + false + Full + - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + - - - + + + + + + + From 2134680d3c9883fb5a3c9009f3059c85300d49e0 Mon Sep 17 00:00:00 2001 From: "Jonas B. Rasmussen" <19553047+JonasBRasmussen@users.noreply.github.com> Date: Mon, 15 Nov 2021 07:22:27 +0100 Subject: [PATCH 13/26] Make use of Directory.Build.props to simplify project files --- Directory.Build.props | 14 +++++++++++++ .../Skoruba.IdentityServer4.Admin.Api.csproj | 3 --- ...erver4.Admin.BusinessLogic.Identity.csproj | 7 ------- ...yServer4.Admin.BusinessLogic.Shared.csproj | 7 ------- ...IdentityServer4.Admin.BusinessLogic.csproj | 7 ------- ...Admin.EntityFramework.Configuration.csproj | 7 ------- ...r4.Admin.EntityFramework.Extensions.csproj | 7 ------- ...ver4.Admin.EntityFramework.Identity.csproj | 7 ------- ...Server4.Admin.EntityFramework.MySql.csproj | 7 ------- ...r4.Admin.EntityFramework.PostgreSQL.csproj | 7 ------- ...erver4.Admin.EntityFramework.Shared.csproj | 7 ------- ...er4.Admin.EntityFramework.SqlServer.csproj | 7 ------- ...entityServer4.Admin.EntityFramework.csproj | 7 ------- .../Skoruba.IdentityServer4.Admin.UI.csproj | 8 ------- .../Skoruba.IdentityServer4.Admin.csproj | 4 ---- ...koruba.IdentityServer4.STS.Identity.csproj | 3 --- ...dentityServer4.Shared.Configuration.csproj | 7 ------- .../Skoruba.IdentityServer4.Shared.csproj | 7 ------- tests/Directory.Build.props | 21 +++++++++++++++++++ ...yServer4.Admin.Api.IntegrationTests.csproj | 14 ------------- ...ntityServer4.Admin.IntegrationTests.csproj | 14 ------------- ...uba.IdentityServer4.Admin.UnitTests.csproj | 13 ------------ ...rver4.STS.Identity.IntegrationTests.csproj | 14 ------------- 23 files changed, 35 insertions(+), 164 deletions(-) create mode 100644 Directory.Build.props create mode 100644 tests/Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..57dba60be --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,14 @@ + + + + net6.0 + 2.0.1 + Jan Škoruba + latest + IdentityServer4 Admin OpenIDConnect OAuth2 Identity + https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md + https://github.com/skoruba/IdentityServer4.Admin + https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png + + + diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj index e06e728b7..d30080b65 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj +++ b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj @@ -1,9 +1,6 @@  - net6.0 - 2.0.1 - Jan Škoruba InProcess 1cc472a2-4e4b-48ce-846b-5219f71fc643 ..\..\docker-compose.dcproj diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj index 2e8138a06..9f994bf40 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba Business Logic layer for the administration of the Asp.Net Core Identity and IdentityServer4 - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj index 6bbb1ae73..d6fed97c0 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Shared Business Logic layer for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj index 7af1f2b95..8a8d6ae4d 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba Business Logic layer for the administration of the IdentityServer4 - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj index 34f44c408..0d52d2b38 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework configuration for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj index 0d2b1da03..dcbd1e880 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity EntityFramework extensions for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj index 6abd58c5e..38f973cc2 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba Entity Framework layer for the administration of the Asp.Net Core Identity and IdentityServer4 - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj index 32c55c7b7..32689404a 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with MySql support - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj index 2a7972493..76ca2fa14 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with PostrgreSQL support - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj index 7723f124a..ffecead18 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity DbContexts and Identity entities for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj index 0b61b571e..8ccfdec84 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with SqlServer support - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj index e04d0d77f..2c528fd8a 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj b/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj index b915f6e3f..615a282e9 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj +++ b/src/Skoruba.IdentityServer4.Admin.UI/Skoruba.IdentityServer4.Admin.UI.csproj @@ -1,15 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba The package with UI for the administration of the IdentityServer4 - IdentityServer4 Admin OpenIDConnect OAuth2 Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png - latest true / diff --git a/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj b/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj index 3263b783f..009918313 100644 --- a/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj +++ b/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj @@ -1,10 +1,6 @@  - net6.0 - 2.0.1 - Jan Škoruba - latest 8fe260ca-ef4c-4fa3-9364-029146f8d339 ..\..\docker-compose.dcproj Linux diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj b/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj index dc292f740..17b6feb2c 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj +++ b/src/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj @@ -1,9 +1,6 @@  - net6.0 - 2.0.1 - Jan Škoruba 9c91d295-54c5-4d09-9bd6-fa56fb74011b ..\..\docker-compose.dcproj Linux diff --git a/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj b/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj index 0297eba77..86423c178 100644 --- a/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj +++ b/src/Skoruba.IdentityServer4.Shared.Configuration/Skoruba.IdentityServer4.Shared.Configuration.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj b/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj index a69035de1..eb1169846 100644 --- a/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj @@ -1,14 +1,7 @@  - net6.0 - 2.0.1 - Jan Škoruba - IdentityServer4 Admin OpenIDConnect OAuth2 Identity Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity - https://github.com/skoruba/IdentityServer4.Admin/blob/master/LICENSE.md - https://github.com/skoruba/IdentityServer4.Admin - https://raw.githubusercontent.com/skoruba/IdentityServer4.Admin/master/docs/Images/Skoruba.IdentityServer4.Admin-Logo-Nuget.png diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props new file mode 100644 index 000000000..ae519026f --- /dev/null +++ b/tests/Directory.Build.props @@ -0,0 +1,21 @@ + + + + + + true + false + Full + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + \ No newline at end of file diff --git a/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj index 7d1e01273..a19ddcf80 100644 --- a/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests/Skoruba.IdentityServer4.Admin.Api.IntegrationTests.csproj @@ -1,25 +1,11 @@  - - net6.0 - true - false - Full - - all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj index 4ce3acb30..fc3ae1f3e 100644 --- a/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.IntegrationTests/Skoruba.IdentityServer4.Admin.IntegrationTests.csproj @@ -1,26 +1,12 @@  - - net6.0 - true - false - Full - - all runtime; build; native; contentfiles; analyzers - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj index d9f5d8c1c..8049765bb 100644 --- a/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj +++ b/tests/Skoruba.IdentityServer4.Admin.UnitTests/Skoruba.IdentityServer4.Admin.UnitTests.csproj @@ -1,25 +1,12 @@  - - net6.0 - Full - false - - all runtime; build; native; contentfiles; analyzers - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj b/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj index f7ffa75d6..cd962f120 100644 --- a/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj +++ b/tests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests/Skoruba.IdentityServer4.STS.Identity.IntegrationTests.csproj @@ -1,24 +1,10 @@  - - net6.0 - true - false - Full - - - - - - - all - runtime; build; native; contentfiles; analyzers - From d54cdb5e9cb2e87b3dbd9577a0475f8ac4b679b7 Mon Sep 17 00:00:00 2001 From: "Jonas B. Rasmussen" <19553047+JonasBRasmussen@users.noreply.github.com> Date: Mon, 15 Nov 2021 07:58:31 +0100 Subject: [PATCH 14/26] Update template builder to match cleaned dependencies --- templates/0-build-template.ps1 | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/templates/0-build-template.ps1 b/templates/0-build-template.ps1 index 6baf0b5e9..8e8c802d4 100644 --- a/templates/0-build-template.ps1 +++ b/templates/0-build-template.ps1 @@ -54,13 +54,10 @@ CleanBinObjFolders # API dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj reference ..\Skoruba.IdentityServer4.Admin.BusinessLogic.Identity\Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj reference ..\Skoruba.IdentityServer4.Admin.BusinessLogic.Shared\Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj reference ..\Skoruba.IdentityServer4.Admin.BusinessLogic\Skoruba.IdentityServer4.Admin.BusinessLogic.csproj dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj reference ..\Skoruba.IdentityServer4.Shared.Configuration\Skoruba.IdentityServer4.Shared.Configuration.csproj # Admin -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj reference ..\Skoruba.IdentityServer4.Admin.BusinessLogic.Identity\Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj reference ..\Skoruba.IdentityServer4.Admin.BusinessLogic.Shared\Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj reference ..\Skoruba.IdentityServer4.Admin.BusinessLogic\Skoruba.IdentityServer4.Admin.BusinessLogic.csproj dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj reference ..\Skoruba.IdentityServer4.Admin.UI\Skoruba.IdentityServer4.Admin.UI.csproj @@ -69,22 +66,8 @@ dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.STS.Identity/Skoruba.Id dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework.Configuration\Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj # EF Shared -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework\Skoruba.IdentityServer4.Admin.EntityFramework.csproj -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework.Identity\Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework.Configuration\Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj -# EF MySql -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework\Skoruba.IdentityServer4.Admin.EntityFramework.csproj -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework.Identity\Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj - -# EF PostgreSQL -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework\Skoruba.IdentityServer4.Admin.EntityFramework.csproj -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework.Identity\Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj - -# EF SqlServer -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework\Skoruba.IdentityServer4.Admin.EntityFramework.csproj -dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj reference ..\Skoruba.IdentityServer4.Admin.EntityFramework.Identity\Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj - # Shared dotnet.exe remove ./$templateSrc/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj reference ..\Skoruba.IdentityServer4.Admin.BusinessLogic.Identity\Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj @@ -96,6 +79,7 @@ dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServ # STS dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj package Skoruba.IdentityServer4.Shared.Configuration -v $packagesVersions +dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.STS.Identity/Skoruba.IdentityServer4.STS.Identity.csproj package Skoruba.IdentityServer4.Admin.EntityFramework.Configuration -v $packagesVersions # API dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj package Skoruba.IdentityServer4.Admin.BusinessLogic -v $packagesVersions @@ -103,22 +87,8 @@ dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.Api/Skoruba.Identity dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj package Skoruba.IdentityServer4.Shared.Configuration -v $packagesVersions # EF Shared -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj package Skoruba.IdentityServer4.Admin.EntityFramework -v $packagesVersions -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj package Skoruba.IdentityServer4.Admin.EntityFramework.Identity -v $packagesVersions dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj package Skoruba.IdentityServer4.Admin.EntityFramework.Configuration -v $packagesVersions -# EF MySql -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj package Skoruba.IdentityServer4.Admin.EntityFramework -v $packagesVersions -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj package Skoruba.IdentityServer4.Admin.EntityFramework.Identity -v $packagesVersions - -# EF PostgreSQL -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj package Skoruba.IdentityServer4.Admin.EntityFramework -v $packagesVersions -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj package Skoruba.IdentityServer4.Admin.EntityFramework.Identity -v $packagesVersions - -# EF SqlServer -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj package Skoruba.IdentityServer4.Admin.EntityFramework -v $packagesVersions -dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj package Skoruba.IdentityServer4.Admin.EntityFramework.Identity -v $packagesVersions - # Shared dotnet.exe add ./$templateSrc/Skoruba.IdentityServer4.Shared/Skoruba.IdentityServer4.Shared.csproj package Skoruba.IdentityServer4.Admin.BusinessLogic.Identity -v $packagesVersions From 786c55aa40e4fd1cb9acb9a19a2589b4e698db4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E6=99=BA=E8=BF=9C?= Date: Mon, 22 Nov 2021 00:09:35 +0800 Subject: [PATCH 15/26] fix mysql migrations error --- .../20191120085701_DbInit.Designer.cs | 6 ++---- ...0201108173253_UpdateIdentityServerToVersion4.Designer.cs | 6 ++---- .../IdentityServerConfigurationDbContextModelSnapshot.cs | 6 ++---- .../IdentityServerGrants/20191120085729_DbInit.Designer.cs | 6 ++---- ...0201108173143_UpdateIdentityServerToVersion4.Designer.cs | 6 ++---- .../IdentityServerPersistedGrantDbContextModelSnapshot.cs | 6 ++---- 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20191120085701_DbInit.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20191120085701_DbInit.Designer.cs index 264f80a80..93b1f0d95 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20191120085701_DbInit.Designer.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20191120085701_DbInit.Designer.cs @@ -196,8 +196,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Value") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); @@ -560,8 +559,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Value") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.Designer.cs index 7ff4424d6..6cfa2e0fe 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.Designer.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.Designer.cs @@ -162,8 +162,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Value") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); @@ -619,8 +618,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Value") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs index 1a34d9277..f17f054a2 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs @@ -160,8 +160,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Value") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); @@ -617,8 +616,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Value") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20191120085729_DbInit.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20191120085729_DbInit.Designer.cs index 2ead83cef..dc09cf4c7 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20191120085729_DbInit.Designer.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20191120085729_DbInit.Designer.cs @@ -35,8 +35,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(50000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("DeviceCode") .IsRequired() @@ -77,8 +76,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(50000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Expiration") .HasColumnType("datetime(6)"); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.Designer.cs index d16660f09..5a40b00dc 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.Designer.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.Designer.cs @@ -35,8 +35,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(50000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") @@ -88,8 +87,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(50000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs index 6dbaed38e..77666a90d 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs @@ -33,8 +33,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(50000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") @@ -86,8 +85,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Data") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(50000); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") From 027f0ddc274ee56d6ef258bd9ba37cef0322b7d3 Mon Sep 17 00:00:00 2001 From: janskoruba Date: Wed, 26 Jan 2022 16:34:24 +0100 Subject: [PATCH 16/26] Fix #942; Add monitoring of UI changes in Admin project; Fix updating client claims and properties in API; Fix loading secrets as optional; --- Directory.Build.props | 3 +- docker-compose.yml | 6 +- .../Controllers/ClientsController.cs | 2 +- .../Dtos/ApiScopes/ApiScopeApiDto.cs | 2 + .../Dtos/Clients/ClientApiDto.cs | 2 + .../PersistedGrantSubjectApiDto.cs | 13 +- .../Program.cs | 4 +- .../Skoruba.IdentityServer4.Admin.Api.csproj | 3 +- ...erver4.Admin.BusinessLogic.Identity.csproj | 3 +- ...yServer4.Admin.BusinessLogic.Shared.csproj | 1 + .../Configuration/ApiResourcePropertiesDto.cs | 5 +- .../Services/ClientService.cs | 2 +- .../Services/Interfaces/IClientService.cs | 2 +- ...IdentityServer4.Admin.BusinessLogic.csproj | 3 +- ...Admin.EntityFramework.Configuration.csproj | 3 +- ...r4.Admin.EntityFramework.Extensions.csproj | 3 +- ...ver4.Admin.EntityFramework.Identity.csproj | 3 +- ...Server4.Admin.EntityFramework.MySql.csproj | 3 +- ...r4.Admin.EntityFramework.PostgreSQL.csproj | 3 +- ...erver4.Admin.EntityFramework.Shared.csproj | 3 +- ...er4.Admin.EntityFramework.SqlServer.csproj | 3 +- .../Constants/ClientConsts.cs | 3 +- .../Repositories/ApiResourceRepository.cs | 8 +- .../Repositories/ApiScopeRepository.cs | 1 + .../Repositories/ClientRepository.cs | 21 +- .../Interfaces/IClientRepository.cs | 2 +- ...entityServer4.Admin.EntityFramework.csproj | 1 + .../AdminUI/Controllers/GrantController.cs | 2 +- .../AdminUI/Controllers/IdentityController.cs | 6 +- .../Areas/AdminUI/Views/Identity/Roles.cshtml | 2 +- .../Views/Identity/UserRolesDelete.cshtml | 11 +- .../Skoruba.IdentityServer4.Admin.UI.csproj | 3 +- .../Helpers/StartupHelpers.cs | 34 +++ src/Skoruba.IdentityServer4.Admin/Program.cs | 7 +- .../Skoruba.IdentityServer4.Admin.csproj | 4 +- src/Skoruba.IdentityServer4.Admin/Startup.cs | 4 + .../Configuration/AdvancedConfiguration.cs | 7 - .../Controllers/AccountController.cs | 10 +- .../Helpers/StartupHelpers.cs | 47 ++-- .../Program.cs | 4 +- ...koruba.IdentityServer4.STS.Identity.csproj | 159 +++++++------- .../Startup.cs | 5 +- .../appsettings.json | 203 +++++++++--------- ...dentityServer4.Shared.Configuration.csproj | 3 +- .../Skoruba.IdentityServer4.Shared.csproj | 3 +- templates/.gitignore | 2 + ...yServer4.Admin.Api.IntegrationTests.csproj | 27 ++- ...ntityServer4.Admin.IntegrationTests.csproj | 32 +-- ...uba.IdentityServer4.Admin.UnitTests.csproj | 32 +-- ...rver4.STS.Identity.IntegrationTests.csproj | 28 +-- 50 files changed, 444 insertions(+), 299 deletions(-) create mode 100644 src/Skoruba.IdentityServer4.Admin/Helpers/StartupHelpers.cs delete mode 100644 src/Skoruba.IdentityServer4.STS.Identity/Configuration/AdvancedConfiguration.cs diff --git a/Directory.Build.props b/Directory.Build.props index 57dba60be..4c422648a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,7 @@ - net6.0 - 2.0.1 + 2.1.0 Jan Škoruba latest IdentityServer4 Admin OpenIDConnect OAuth2 Identity diff --git a/docker-compose.yml b/docker-compose.yml index 2d8991a87..b3cf0677a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -93,7 +93,11 @@ services: - 'ConnectionStrings__IdentityDbConnection=Server=db;Database=IdentityServer4Admin;User Id=sa;Password=${DB_PASSWORD:-Password_123};MultipleActiveResultSets=true' - 'ConnectionStrings__DataProtectionDbConnection=Server=db;Database=IdentityServer4Admin;User Id=sa;Password=${DB_PASSWORD:-Password_123};MultipleActiveResultSets=true' - 'AdminConfiguration__IdentityAdminBaseUrl=https://admin.skoruba.local' - - 'AdvancedConfiguration__IssuerUri=https://sts.skoruba.local' + - 'IdentityServerOptions__IssuerUri=https://sts.skoruba.local' + - IdentityServerOptions__Events__RaiseErrorEvents=true + - IdentityServerOptions__Events__RaiseInformationEvents=true + - IdentityServerOptions__Events__RaiseFailureEvents=true + - IdentityServerOptions__Events__RaiseSuccessEvents=true - DockerConfiguration__UpdateCaCertificate=true - ASPNETCORE_ENVIRONMENT=Development depends_on: diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ClientsController.cs b/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ClientsController.cs index b39580852..e48273029 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ClientsController.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ClientsController.cs @@ -69,7 +69,7 @@ public async Task Put([FromBody]ClientApiDto client) var clientDto = client.ToClientApiModel(); await _clientService.GetClientAsync(clientDto.Id); - await _clientService.UpdateClientAsync(clientDto); + await _clientService.UpdateClientAsync(clientDto, true, true); return Ok(); } diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopeApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopeApiDto.cs index f2e5a341f..0c95a9819 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopeApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopeApiDto.cs @@ -28,5 +28,7 @@ public ApiScopeApiDto() public bool Enabled { get; set; } = true; public List UserClaims { get; set; } + + public List ApiScopeProperties { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs index 34d56c39a..f7e9b841f 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs @@ -98,5 +98,7 @@ public ClientApiDto() public bool RequireRequestObject { get; set; } public List AllowedIdentityTokenSigningAlgorithms { get; set; } + + public bool NonEditable { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantSubjectApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantSubjectApiDto.cs index c2e8f3dec..639a7c331 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantSubjectApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantSubjectApiDto.cs @@ -1,8 +1,19 @@ -namespace Skoruba.IdentityServer4.Admin.Api.Dtos.PersistedGrants +using System; + +namespace Skoruba.IdentityServer4.Admin.Api.Dtos.PersistedGrants { public class PersistedGrantSubjectApiDto { + public string Key { get; set; } + public string Type { get; set; } public string SubjectId { get; set; } public string SubjectName { get; set; } + public string ClientId { get; set; } + public DateTime CreationTime { get; set; } + public DateTime? Expiration { get; set; } + public string Data { get; set; } + public DateTime? ConsumedTime { get; set; } + public string SessionId { get; set; } + public string Description { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Program.cs b/src/Skoruba.IdentityServer4.Admin.Api/Program.cs index 02db2e76b..0fc24f3e6 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Program.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Program.cs @@ -47,7 +47,7 @@ private static IConfiguration GetConfiguration(string[] args) if (isDevelopment) { - configurationBuilder.AddUserSecrets(); + configurationBuilder.AddUserSecrets(true); } var configuration = configurationBuilder.Build(); @@ -74,7 +74,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) => if (env.IsDevelopment()) { - configApp.AddUserSecrets(); + configApp.AddUserSecrets(true); } configurationRoot.AddAzureKeyVaultConfiguration(configApp); diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj index d30080b65..495580527 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj +++ b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj @@ -1,7 +1,8 @@  - InProcess + net6.0 + InProcess 1cc472a2-4e4b-48ce-846b-5219f71fc643 ..\..\docker-compose.dcproj Linux diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj index 9f994bf40..96f95288f 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj @@ -1,7 +1,8 @@  - Business Logic layer for the administration of the Asp.Net Core Identity and IdentityServer4 + net6.0 + Business Logic layer for the administration of the Asp.Net Core Identity and IdentityServer4 diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj index d6fed97c0..21076d774 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj @@ -1,6 +1,7 @@  + net6.0 Shared Business Logic layer for the administration of the IdentityServer4 and Asp.Net Core Identity diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourcePropertiesDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourcePropertiesDto.cs index 69a4f45d9..b2dffa9ea 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourcePropertiesDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourcePropertiesDto.cs @@ -17,10 +17,11 @@ public class ApiResourcePropertiesDto [Required] public string Value { get; set; } - public List ApiResourceProperties { get; set; } = new List(); - + public int TotalCount { get; set; } public int PageSize { get; set; } + + public List ApiResourceProperties { get; set; } = new(); } } diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs index fbae49651..7f847d0a0 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs @@ -168,7 +168,7 @@ public virtual async Task AddClientAsync(ClientDto client) return added; } - public virtual async Task UpdateClientAsync(ClientDto client) + public virtual async Task UpdateClientAsync(ClientDto client, bool updateClientClaims = false, bool updateClientProperties = false) { var canInsert = await CanInsertClientAsync(client); if (!canInsert) diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs index 5accdf139..6d7debad9 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs @@ -15,7 +15,7 @@ public interface IClientService Task AddClientAsync(ClientDto client); - Task UpdateClientAsync(ClientDto client); + Task UpdateClientAsync(ClientDto client, bool updateClientClaims = false, bool updateClientProperties = false); Task RemoveClientAsync(ClientDto client); diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj index 8a8d6ae4d..5bc2e1dae 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj @@ -1,7 +1,8 @@  - Business Logic layer for the administration of the IdentityServer4 + net6.0 + Business Logic layer for the administration of the IdentityServer4 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj index 0d52d2b38..4448ece66 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration/Skoruba.IdentityServer4.Admin.EntityFramework.Configuration.csproj @@ -1,7 +1,8 @@  - Entity Framework configuration for the administration of the IdentityServer4 and Asp.Net Core Identity + net6.0 + Entity Framework configuration for the administration of the IdentityServer4 and Asp.Net Core Identity diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj index dcbd1e880..931621216 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj @@ -1,7 +1,8 @@  - EntityFramework extensions for the administration of the IdentityServer4 and Asp.Net Core Identity + net6.0 + EntityFramework extensions for the administration of the IdentityServer4 and Asp.Net Core Identity diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj index 38f973cc2..c00960ac9 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj @@ -1,7 +1,8 @@  - Entity Framework layer for the administration of the Asp.Net Core Identity and IdentityServer4 + net6.0 + Entity Framework layer for the administration of the Asp.Net Core Identity and IdentityServer4 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj index 32689404a..9a5d38b24 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj @@ -1,7 +1,8 @@  - Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with MySql support + net6.0 + Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with MySql support diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj index 76ca2fa14..913fd291d 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj @@ -1,7 +1,8 @@  - Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with PostrgreSQL support + net6.0 + Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with PostrgreSQL support diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj index ffecead18..a66185afd 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj @@ -1,7 +1,8 @@  - DbContexts and Identity entities for the administration of the IdentityServer4 and Asp.Net Core Identity + net6.0 + DbContexts and Identity entities for the administration of the IdentityServer4 and Asp.Net Core Identity diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj index 8ccfdec84..a4a84c58d 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj @@ -1,7 +1,8 @@  - Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with SqlServer support + net6.0 + Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with SqlServer support diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs index db8b5a26f..6bed34105 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs @@ -12,7 +12,8 @@ public static List GetSecretTypes() "SharedSecret", "X509Thumbprint", "X509Name", - "X509CertificateBase64" + "X509CertificateBase64", + "JWK" }; return secretTypes; diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs index 6d090cc1c..1114430bf 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs @@ -124,17 +124,17 @@ public virtual async Task AddApiResourceAsync(ApiResource apiResource) return apiResource.Id; } - private async Task RemoveApiResourceClaimsAsync(ApiResource identityResource) + private async Task RemoveApiResourceClaimsAsync(ApiResource apiResource) { //Remove old api resource claims - var apiResourceClaims = await DbContext.ApiResourceClaims.Where(x => x.ApiResource.Id == identityResource.Id).ToListAsync(); + var apiResourceClaims = await DbContext.ApiResourceClaims.Where(x => x.ApiResource.Id == apiResource.Id).ToListAsync(); DbContext.ApiResourceClaims.RemoveRange(apiResourceClaims); } - private async Task RemoveApiResourceScopesAsync(ApiResource identityResource) + private async Task RemoveApiResourceScopesAsync(ApiResource apiResource) { //Remove old api resource scopes - var apiResourceScopes = await DbContext.ApiResourceScopes.Where(x => x.ApiResource.Id == identityResource.Id).ToListAsync(); + var apiResourceScopes = await DbContext.ApiResourceScopes.Where(x => x.ApiResource.Id == apiResource.Id).ToListAsync(); DbContext.ApiResourceScopes.RemoveRange(apiResourceScopes); } diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiScopeRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiScopeRepository.cs index 1730594f4..1c74fe073 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiScopeRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiScopeRepository.cs @@ -129,6 +129,7 @@ public virtual Task GetApiScopeAsync(int apiScopeId) { return DbContext.ApiScopes .Include(x => x.UserClaims) + .Include(x => x.Properties) .Where(x => x.Id == apiScopeId) .AsNoTracking() .SingleOrDefaultAsync(); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs index 7fc060587..d91ddf6e0 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs @@ -408,7 +408,8 @@ public virtual async Task CloneClientAsync(Client client, return id; } - private async Task RemoveClientRelationsAsync(Client client) + private async Task RemoveClientRelationsAsync(Client client, bool updateClientClaims, + bool updateClientProperties) { //Remove old allowed scopes var clientScopes = await DbContext.ClientScopes.Where(x => x.Client.Id == client.Id).ToListAsync(); @@ -433,12 +434,26 @@ private async Task RemoveClientRelationsAsync(Client client) //Remove old client post logout redirect var clientPostLogoutRedirectUris = await DbContext.ClientPostLogoutRedirectUris.Where(x => x.Client.Id == client.Id).ToListAsync(); DbContext.ClientPostLogoutRedirectUris.RemoveRange(clientPostLogoutRedirectUris); + + //Remove old client claims + if (updateClientClaims) + { + var clientClaims = await DbContext.ClientClaims.Where(x => x.Client.Id == client.Id).ToListAsync(); + DbContext.ClientClaims.RemoveRange(clientClaims); + } + + //Remove old client properties + if (updateClientProperties) + { + var clientProperties = await DbContext.ClientProperties.Where(x => x.Client.Id == client.Id).ToListAsync(); + DbContext.ClientProperties.RemoveRange(clientProperties); + } } - public virtual async Task UpdateClientAsync(Client client) + public virtual async Task UpdateClientAsync(Client client, bool updateClientClaims = false, bool updateClientProperties = false) { //Remove old relations - await RemoveClientRelationsAsync(client); + await RemoveClientRelationsAsync(client, updateClientClaims, updateClientProperties); //Update with new data DbContext.Clients.Update(client); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs index 677d62c8d..8c30fe6d4 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs @@ -9,7 +9,7 @@ public interface IClientRepository { Task AddClientAsync(Client client); - Task UpdateClientAsync(Client client); + Task UpdateClientAsync(Client client, bool updateClientClaims = false, bool updateClientProperties = false)); Task RemoveClientAsync(Client client); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj index 2c528fd8a..e31c4be0e 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj @@ -1,6 +1,7 @@  + net6.0 Entity Framework layer for the administration of the IdentityServer4 diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/GrantController.cs b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/GrantController.cs index fae54e5aa..c3e65a70c 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/GrantController.cs +++ b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/GrantController.cs @@ -20,7 +20,7 @@ public class GrantController : BaseController private readonly IStringLocalizer _localizer; public GrantController(IPersistedGrantAspNetIdentityService persistedGrantService, - ILogger logger, + ILogger logger, IStringLocalizer localizer) : base(logger) { _persistedGrantService = persistedGrantService; diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/IdentityController.cs b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/IdentityController.cs index 6353a0755..59dae925e 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/IdentityController.cs +++ b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Controllers/IdentityController.cs @@ -121,12 +121,12 @@ public async Task Users(int? page, string search) } [HttpGet] - public async Task RoleUsers(string id, int? page, string search) + public async Task RoleUsers(string roleId, int? page, string search) { ViewBag.Search = search; - var roleUsers = await _identityService.GetRoleUsersAsync(id, search, page ?? 1); + var roleUsers = await _identityService.GetRoleUsersAsync(roleId, search, page ?? 1); - var roleDto = await _identityService.GetRoleAsync(id); + var roleDto = await _identityService.GetRoleAsync(roleId); ViewData["RoleName"] = roleDto.Name; return View(roleUsers); diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/Roles.cshtml b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/Roles.cshtml index c62291282..1b3e7b103 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/Roles.cshtml +++ b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/Roles.cshtml @@ -44,7 +44,7 @@ @Localizer["TableButtonEdit"] - @Localizer["TableButtonUsers"] + @Localizer["TableButtonUsers"] @role.Name diff --git a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/UserRolesDelete.cshtml b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/UserRolesDelete.cshtml index 38046eb2e..976ac6aa2 100644 --- a/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/UserRolesDelete.cshtml +++ b/src/Skoruba.IdentityServer4.Admin.UI/Areas/AdminUI/Views/Identity/UserRolesDelete.cshtml @@ -36,8 +36,17 @@
@Localizer["SubTitle"]
+ +
+ +
+ +
+
- +