From 405c52b3887eccc1efd7dde6b6a18fa27cdda0a8 Mon Sep 17 00:00:00 2001 From: Soonil Hong Date: Sat, 28 Sep 2024 10:51:38 -0400 Subject: [PATCH] Rename variable to reflect the context better --- .../src/IdentityServer/Startup.cs | 6 +++--- .../IdentityServerHost/SeedData.cs | 4 ++-- .../Permissions/IdentityServer/SeedData.cs | 4 ++-- .../IdentityServer/SeedData.cs | 8 ++++---- .../SimpleDcr/IdentityServer/SeedData.cs | 4 ++-- .../SoftwareStatement/IdentityServer/SeedData.cs | 4 ++-- .../src/IdentityServer/HostingExtensions.cs | 10 +++++----- .../IdentityServerHost/SeedData.cs | 4 ++-- .../IdentityServerHost/SeedData.cs | 4 ++-- .../Permissions/IdentityServer/SeedData.cs | 4 ++-- .../IdentityServer/SeedData.cs | 4 ++-- .../SimpleDcr/IdentityServer/SeedData.cs | 4 ++-- .../SoftwareStatement/IdentityServer/SeedData.cs | 4 ++-- .../src/IdentityServer/HostingExtensions.cs | 14 +++++++------- .../IdentityServerHost/SeedData.cs | 4 ++-- .../IdentityServerHost/SeedData.cs | 4 ++-- 16 files changed, 43 insertions(+), 43 deletions(-) diff --git a/IdentityServer/v5/Quickstarts/4_EntityFramework/src/IdentityServer/Startup.cs b/IdentityServer/v5/Quickstarts/4_EntityFramework/src/IdentityServer/Startup.cs index 7d68dbb8..7e86437e 100755 --- a/IdentityServer/v5/Quickstarts/4_EntityFramework/src/IdentityServer/Startup.cs +++ b/IdentityServer/v5/Quickstarts/4_EntityFramework/src/IdentityServer/Startup.cs @@ -25,7 +25,7 @@ public void ConfigureServices(IServiceCollection services) var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name; const string connectionString = @"Data Source=Duende.IdentityServer.Quickstart.EntityFramework-5.0.0.db"; - + var builder = services.AddIdentityServer() .AddTestUsers(TestUsers.Users) .AddConfigurationStore(options => @@ -116,9 +116,9 @@ private void InitializeDatabase(IApplicationBuilder app) if (!context.ApiScopes.Any()) { - foreach (var resource in Config.ApiScopes) + foreach (var apiScope in Config.ApiScopes) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v5/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs b/IdentityServer/v5/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs index 42615341..d0d822ee 100755 --- a/IdentityServer/v5/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs +++ b/IdentityServer/v5/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs @@ -73,9 +73,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v6/Configuration/Permissions/IdentityServer/SeedData.cs b/IdentityServer/v6/Configuration/Permissions/IdentityServer/SeedData.cs index 2a50f8b3..c16480c6 100644 --- a/IdentityServer/v6/Configuration/Permissions/IdentityServer/SeedData.cs +++ b/IdentityServer/v6/Configuration/Permissions/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v6/Configuration/PipelineRegistration/IdentityServer/SeedData.cs b/IdentityServer/v6/Configuration/PipelineRegistration/IdentityServer/SeedData.cs index 9be69c9a..eeeb7ada 100644 --- a/IdentityServer/v6/Configuration/PipelineRegistration/IdentityServer/SeedData.cs +++ b/IdentityServer/v6/Configuration/PipelineRegistration/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } @@ -67,9 +67,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiResources.Any()) { Log.Debug("ApiResources being populated"); - foreach (var resource in Config.ApiResources.ToList()) + foreach (var apiScope in Config.ApiResources.ToList()) { - context.ApiResources.Add(resource.ToEntity()); + context.ApiResources.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v6/Configuration/SimpleDcr/IdentityServer/SeedData.cs b/IdentityServer/v6/Configuration/SimpleDcr/IdentityServer/SeedData.cs index 2a50f8b3..c16480c6 100644 --- a/IdentityServer/v6/Configuration/SimpleDcr/IdentityServer/SeedData.cs +++ b/IdentityServer/v6/Configuration/SimpleDcr/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v6/Configuration/SoftwareStatement/IdentityServer/SeedData.cs b/IdentityServer/v6/Configuration/SoftwareStatement/IdentityServer/SeedData.cs index 2a50f8b3..c16480c6 100644 --- a/IdentityServer/v6/Configuration/SoftwareStatement/IdentityServer/SeedData.cs +++ b/IdentityServer/v6/Configuration/SoftwareStatement/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v6/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs b/IdentityServer/v6/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs index 8168c708..710fd406 100644 --- a/IdentityServer/v6/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs +++ b/IdentityServer/v6/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs @@ -38,9 +38,9 @@ private static void InitializeDatabase(IApplicationBuilder app) if (!context.ApiScopes.Any()) { - foreach (var resource in Config.ApiScopes) + foreach (var apiScope in Config.ApiScopes) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } @@ -95,9 +95,9 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde return builder.Build(); } - + public static WebApplication ConfigurePipeline(this WebApplication app) - { + { app.UseSerilogRequestLogging(); if (app.Environment.IsDevelopment()) { @@ -108,7 +108,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app) app.UseStaticFiles(); app.UseRouting(); - + app.UseIdentityServer(); app.UseAuthorization(); diff --git a/IdentityServer/v6/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs b/IdentityServer/v6/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs index d9eb7793..844b99da 100644 --- a/IdentityServer/v6/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs +++ b/IdentityServer/v6/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs @@ -72,9 +72,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v6/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs b/IdentityServer/v6/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs index 42615341..d0d822ee 100755 --- a/IdentityServer/v6/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs +++ b/IdentityServer/v6/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs @@ -73,9 +73,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v7/Configuration/Permissions/IdentityServer/SeedData.cs b/IdentityServer/v7/Configuration/Permissions/IdentityServer/SeedData.cs index 2a50f8b3..c16480c6 100644 --- a/IdentityServer/v7/Configuration/Permissions/IdentityServer/SeedData.cs +++ b/IdentityServer/v7/Configuration/Permissions/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v7/Configuration/PipelineRegistration/IdentityServer/SeedData.cs b/IdentityServer/v7/Configuration/PipelineRegistration/IdentityServer/SeedData.cs index 9be69c9a..e51aff14 100644 --- a/IdentityServer/v7/Configuration/PipelineRegistration/IdentityServer/SeedData.cs +++ b/IdentityServer/v7/Configuration/PipelineRegistration/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v7/Configuration/SimpleDcr/IdentityServer/SeedData.cs b/IdentityServer/v7/Configuration/SimpleDcr/IdentityServer/SeedData.cs index 2a50f8b3..c16480c6 100644 --- a/IdentityServer/v7/Configuration/SimpleDcr/IdentityServer/SeedData.cs +++ b/IdentityServer/v7/Configuration/SimpleDcr/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v7/Configuration/SoftwareStatement/IdentityServer/SeedData.cs b/IdentityServer/v7/Configuration/SoftwareStatement/IdentityServer/SeedData.cs index 2a50f8b3..c16480c6 100644 --- a/IdentityServer/v7/Configuration/SoftwareStatement/IdentityServer/SeedData.cs +++ b/IdentityServer/v7/Configuration/SoftwareStatement/IdentityServer/SeedData.cs @@ -53,9 +53,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs b/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs index bc8d9756..cb781301 100644 --- a/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs +++ b/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/HostingExtensions.cs @@ -41,9 +41,9 @@ private static void InitializeDatabase(IApplicationBuilder app) if (!context.ApiScopes.Any()) { - foreach (var resource in Config.ApiScopes) + foreach (var apiScope in Config.ApiScopes) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } @@ -84,7 +84,7 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde options.ClientSecret = googleClientSecret; }); } - + authenticationBuilder.AddOpenIdConnect("oidc", "Demo IdentityServer", options => { options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme; @@ -105,11 +105,11 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde return builder.Build(); } - + public static WebApplication ConfigurePipeline(this WebApplication app) - { + { app.UseSerilogRequestLogging(); - + if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); @@ -119,7 +119,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app) app.UseStaticFiles(); app.UseRouting(); - + app.UseIdentityServer(); app.UseAuthorization(); diff --git a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs index 19fd106e..070a2afc 100644 --- a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs +++ b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/SeedData.cs @@ -72,9 +72,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); } diff --git a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs index 35681a14..86d72ff9 100755 --- a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs +++ b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/SeedData.cs @@ -73,9 +73,9 @@ private static void EnsureSeedData(ConfigurationDbContext context) if (!context.ApiScopes.Any()) { Log.Debug("ApiScopes being populated"); - foreach (var resource in Config.ApiScopes.ToList()) + foreach (var apiScope in Config.ApiScopes.ToList()) { - context.ApiScopes.Add(resource.ToEntity()); + context.ApiScopes.Add(apiScope.ToEntity()); } context.SaveChanges(); }