Browse Source

Merge branch 'dev' into CmsKit-Editor-Issue-10970

pull/13279/head
malik masis 4 years ago
parent
commit
adc51305ea
  1. 24
      docs/en/Community-Articles/2022-02-06-How-to-Hide-ABP-Related-Endpoints-on-Swagger-UI/POST.md
  2. 6
      docs/en/Getting-Started-AspNetCore-Application.md
  3. 6
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css
  4. 3
      modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs
  5. 16
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs
  6. 2
      modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs
  7. 2
      modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs
  8. 1
      modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs

24
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.

6
docs/en/Getting-Started-AspNetCore-Application.md

@ -77,7 +77,7 @@ using BasicAspNetCoreApplication;
var builder = WebApplication.CreateBuilder(args);
await builder.Services.AddApplicationAsync<AppModule>();
await builder.AddApplicationAsync<AppModule>();
var app = builder.Build();
@ -85,7 +85,7 @@ await app.InitializeApplicationAsync();
await app.RunAsync();
````
``builder.Services.AddApplicationAsync<AppModule>();`` adds all services defined in all modules starting from the ``AppModule``.
``builder.AddApplicationAsync<AppModule>();`` 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<AppModule>();
await builder.AddApplicationAsync<AppModule>();
var app = builder.Build();

6
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;
}

3
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);

16
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs

@ -61,14 +61,14 @@ public class ResourceStore : IResourceStore
/// </summary>
public virtual async Task<IEnumerable<IdentityServer4.Models.IdentityResource>> FindIdentityResourcesByScopeNameAsync(IEnumerable<string> scopeNames)
{
return await GetCacheItemsAsync(
return (await GetCacheItemsAsync(
IdentityResourceCache,
scopeNames,
async keys => await IdentityResourceRepository.GetListByScopeNameAsync(keys, includeDetails: true),
(models, cacheKeyPrefix) => new List<IEnumerable<KeyValuePair<string, IdentityServer4.Models.IdentityResource>>>
{
models.Select(x => new KeyValuePair<string, IdentityServer4.Models.IdentityResource>(AddCachePrefix(x.Name, cacheKeyPrefix), x))
});
})).DistinctBy(x => x.Name);
}
/// <summary>
@ -76,14 +76,14 @@ public class ResourceStore : IResourceStore
/// </summary>
public virtual async Task<IEnumerable<IdentityServer4.Models.ApiScope>> FindApiScopesByNameAsync(IEnumerable<string> scopeNames)
{
return await GetCacheItemsAsync(
return (await GetCacheItemsAsync(
ApiScopeCache,
scopeNames,
async keys => await ApiScopeRepository.GetListByNameAsync(keys, includeDetails: true),
(models, cacheKeyPrefix) => new List<IEnumerable<KeyValuePair<string, IdentityServer4.Models.ApiScope>>>
{
models.Select(x => new KeyValuePair<string, IdentityServer4.Models.ApiScope>(AddCachePrefix(x.Name, cacheKeyPrefix), x))
});
})).DistinctBy(x => x.Name);
}
/// <summary>
@ -91,7 +91,7 @@ public class ResourceStore : IResourceStore
/// </summary>
public virtual async Task<IEnumerable<IdentityServer4.Models.ApiResource>> FindApiResourcesByScopeNameAsync(IEnumerable<string> scopeNames)
{
return await GetCacheItemsAsync<ApiResource, IdentityServer4.Models.ApiResource>(
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<string, IdentityServer4.Models.ApiResource>(AddCachePrefix(scope, cacheKeyPrefix), model)).ToList())
.Where(scopes => scopes.Any()).Cast<IEnumerable<KeyValuePair<string, IdentityServer4.Models.ApiResource>>>().ToList();
}, ApiResourceScopeNameCacheKeyPrefix);
}, ApiResourceScopeNameCacheKeyPrefix)).DistinctBy(x => x.Name);
}
/// <summary>
@ -108,14 +108,14 @@ public class ResourceStore : IResourceStore
/// </summary>
public virtual async Task<IEnumerable<IdentityServer4.Models.ApiResource>> FindApiResourcesByNameAsync(IEnumerable<string> apiResourceNames)
{
return await GetCacheItemsAsync(
return (await GetCacheItemsAsync(
ApiResourceCache,
apiResourceNames,
async keys => await ApiResourceRepository.FindByNameAsync(keys, includeDetails: true),
(models, cacheKeyPrefix) => new List<IEnumerable<KeyValuePair<string, IdentityServer4.Models.ApiResource>>>
{
models.Select(x => new KeyValuePair<string, IdentityServer4.Models.ApiResource>(AddCachePrefix(x.Name, cacheKeyPrefix), x))
}, ApiResourceNameCacheKeyPrefix);
}, ApiResourceNameCacheKeyPrefix)).DistinctBy(x => x.Name);
}
/// <summary>

2
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]

2
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");

1
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");

Loading…
Cancel
Save