feat: added secure headers middleware

Signed-off-by: Jean Gatto <jean_gatto@hotmail.com>
This commit is contained in:
Jean Gatto
2024-08-28 14:15:11 -03:00
parent a28c36c9d8
commit 62efc4917f
4 changed files with 6 additions and 2 deletions
+1
View File
@@ -54,6 +54,7 @@
<PackageVersion Include="MongoDB.Driver" Version="2.27.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="OwaspHeaders.Core" Version="8.1.0" />
<PackageVersion Include="Polly" Version="8.4.1" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4" />
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.4" />
+2 -2
View File
@@ -1,6 +1,6 @@
### Register a new customer
POST http://localhost:56344/api/customers HTTP/1.1
POST http://localhost:56570/api/customers HTTP/1.1
content-type: application/json
{
@@ -13,5 +13,5 @@ content-type: application/json
### Gets a list of all customers
GET http://localhost:56344/api/customers HTTP/1.1
GET http://localhost:56570/api/customers HTTP/1.1
content-type: application/json
+2
View File
@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using OwaspHeaders.Core.Extensions;
using Shop.Application;
using Shop.Core;
using Shop.Core.Extensions;
@@ -116,6 +117,7 @@ app.UseSwagger();
app.UseSwaggerUI();
app.UseResponseCompression();
app.UseHttpsRedirection();
app.UseSecureHeadersMiddleware();
app.UseMiniProfiler();
app.UseCorrelationId();
app.UseAuthentication();
+1
View File
@@ -39,6 +39,7 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" />
<PackageReference Include="OwaspHeaders.Core" />
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>