diff --git a/docs/en/Community-Articles/2022-02-06-How-to-Hide-ABP-Related-Endpoints-on-Swagger-UI/POST.md b/docs/en/Community-Articles/2022-02-06-How-to-Hide-ABP-Related-Endpoints-on-Swagger-UI/POST.md index 056c14c6e7..a6ad7596d4 100644 --- a/docs/en/Community-Articles/2022-02-06-How-to-Hide-ABP-Related-Endpoints-on-Swagger-UI/POST.md +++ b/docs/en/Community-Articles/2022-02-06-How-to-Hide-ABP-Related-Endpoints-on-Swagger-UI/POST.md @@ -425,4 +425,26 @@ That's it. Now we can open the Setting Management page and enable/disable the sw ![](./swagger-hide-endpoints.gif) -Thanks for reading. +--- + +## July 2022 Update + +With ABP v5.2+, there is a built-in option to hide/show ABP related endpoints on runtime. To hide ABP's default endpoints, call the `HideAbpEndpoints` method in your Swagger configuration as below: + +```csharp +services.AddAbpSwaggerGen( + options => + { + //... other options + + //Hides ABP Related endpoints on Swagger UI + options.HideAbpEndpoints(); + } +) +``` + +> For more info, please see the [Swagger Integration](https://docs.abp.io/en/abp/latest/API/Swagger-Integration#hide-abp-endpoints-on-swagger-ui) docs. + +--- + +Thanks for reading. \ No newline at end of file diff --git a/docs/en/Getting-Started-AspNetCore-Application.md b/docs/en/Getting-Started-AspNetCore-Application.md index 0ccd900b1f..c7f329878c 100644 --- a/docs/en/Getting-Started-AspNetCore-Application.md +++ b/docs/en/Getting-Started-AspNetCore-Application.md @@ -77,7 +77,7 @@ using BasicAspNetCoreApplication; var builder = WebApplication.CreateBuilder(args); -await builder.Services.AddApplicationAsync(); +await builder.AddApplicationAsync(); var app = builder.Build(); @@ -85,7 +85,7 @@ await app.InitializeApplicationAsync(); await app.RunAsync(); ```` -``builder.Services.AddApplicationAsync();`` adds all services defined in all modules starting from the ``AppModule``. +``builder.AddApplicationAsync();`` adds all services defined in all modules starting from the ``AppModule``. ``app.InitializeApplicationAsync()`` initializes and starts the application. @@ -125,7 +125,7 @@ var builder = WebApplication.CreateBuilder(args); builder.Host.UseAutofac(); //Add this line -await builder.Services.AddApplicationAsync(); +await builder.AddApplicationAsync(); var app = builder.Build(); diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css index 6aee7a5ba7..c10092d28f 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css @@ -169,4 +169,10 @@ div.dataTables_wrapper div.dataTables_length label { } } +h1.content-header-title{ + font-size: 1.5em; +} +.b-table h4.h4 { + text-align: center; +} diff --git a/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs b/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs index adfe196723..f6435b81aa 100644 --- a/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs +++ b/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; +using System.Web; using Volo.Docs.Utils; namespace Volo.Docs.HtmlConverting @@ -26,7 +27,7 @@ namespace Volo.Docs.HtmlConverting (localDirectory.IsNullOrEmpty() ? "" : localDirectory.TrimStart('/').EnsureEndsWith('/')) + match.Groups[2].Value.TrimStart('/'); - return match.Groups[1] + " src=\"" + newImageSource + "\" " + match.Groups[3]; + return match.Groups[1] + " src=\"" + HttpUtility.HtmlEncode(newImageSource) + "\" " + match.Groups[3]; }, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Multiline); diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs index d24d7e31c9..51862d7597 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs @@ -61,14 +61,14 @@ public class ResourceStore : IResourceStore /// public virtual async Task> FindIdentityResourcesByScopeNameAsync(IEnumerable scopeNames) { - return await GetCacheItemsAsync( + return (await GetCacheItemsAsync( IdentityResourceCache, scopeNames, async keys => await IdentityResourceRepository.GetListByScopeNameAsync(keys, includeDetails: true), (models, cacheKeyPrefix) => new List>> { models.Select(x => new KeyValuePair(AddCachePrefix(x.Name, cacheKeyPrefix), x)) - }); + })).DistinctBy(x => x.Name); } /// @@ -76,14 +76,14 @@ public class ResourceStore : IResourceStore /// public virtual async Task> FindApiScopesByNameAsync(IEnumerable scopeNames) { - return await GetCacheItemsAsync( + return (await GetCacheItemsAsync( ApiScopeCache, scopeNames, async keys => await ApiScopeRepository.GetListByNameAsync(keys, includeDetails: true), (models, cacheKeyPrefix) => new List>> { models.Select(x => new KeyValuePair(AddCachePrefix(x.Name, cacheKeyPrefix), x)) - }); + })).DistinctBy(x => x.Name); } /// @@ -91,7 +91,7 @@ public class ResourceStore : IResourceStore /// public virtual async Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames) { - return await GetCacheItemsAsync( + return (await GetCacheItemsAsync( ApiResourceCache, scopeNames, async keys => await ApiResourceRepository.GetListByScopesAsync(keys, includeDetails: true), @@ -100,7 +100,7 @@ public class ResourceStore : IResourceStore return models .Select(model => model.Scopes.Select(scope => new KeyValuePair(AddCachePrefix(scope, cacheKeyPrefix), model)).ToList()) .Where(scopes => scopes.Any()).Cast>>().ToList(); - }, ApiResourceScopeNameCacheKeyPrefix); + }, ApiResourceScopeNameCacheKeyPrefix)).DistinctBy(x => x.Name); } /// @@ -108,14 +108,14 @@ public class ResourceStore : IResourceStore /// public virtual async Task> FindApiResourcesByNameAsync(IEnumerable apiResourceNames) { - return await GetCacheItemsAsync( + return (await GetCacheItemsAsync( ApiResourceCache, apiResourceNames, async keys => await ApiResourceRepository.FindByNameAsync(keys, includeDetails: true), (models, cacheKeyPrefix) => new List>> { models.Select(x => new KeyValuePair(AddCachePrefix(x.Name, cacheKeyPrefix), x)) - }, ApiResourceNameCacheKeyPrefix); + }, ApiResourceNameCacheKeyPrefix)).DistinctBy(x => x.Name); } /// diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs index 7d946b012c..c54c99e88d 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs @@ -53,7 +53,7 @@ public class IdentityResourceStore_Tests : AbpIdentityServerTestBase //Assert apiResources.ShouldNotBe(null); - apiResources[0].Scopes.Count.ShouldBe(3); + apiResources[0].Scopes.Count.ShouldBe(4); } [Fact] diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs index dbc77425af..b33b8aa580 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs @@ -54,7 +54,7 @@ public class ResourceStore_Cache_Tests : AbpIdentityServerDomainTestBase apiResources1.Count.ShouldBe(1); apiResources1.First().Name.ShouldBe("Test-ApiResource-Name-1"); - var apiResources2 = (await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { "Test-ApiResource-ApiScope-Name-1", nameof(ApiResourceScope.Scope) })).ToList(); + var apiResources2 = (await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { "Test-ApiResource-ApiScope-Name-1", "Test-ApiResource-ApiScope-Name-2", nameof(ApiResourceScope.Scope) })).ToList(); apiResources2.ShouldNotBeEmpty(); apiResources2.Count.ShouldBe(2); apiResources2.ShouldContain(x => x.Name == "Test-ApiResource-Name-1"); diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs index 64c6f09209..eaf8aabf58 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs @@ -103,6 +103,7 @@ public class AbpIdentityServerTestDataBuilder : ITransientDependency apiResource2.AddSecret("secret".Sha256()); apiResource2.AddScope("Test-ApiResource-ApiScope-Name-1"); + apiResource2.AddScope("Test-ApiResource-ApiScope-Name-2"); apiResource2.AddScope("Test-ApiResource-ApiScope-DisplayName-1"); apiResource2.AddUserClaim("Test-ApiResource-Claim-Type-1");