add some filter to see which endpoints require authorization and which not
This commit is contained in:
parent
d8968ce557
commit
bfcba0beb7
2 changed files with 39 additions and 14 deletions
|
|
@ -7,6 +7,7 @@ using SurveyBackend.Contexts;
|
|||
using SurveyBackend.Core.Contexts;
|
||||
using SurveyBackend.Core.Repositories;
|
||||
using SurveyBackend.Core.Services;
|
||||
using SurveyBackend.Filters;
|
||||
using SurveyBackend.Infrastructure.Data;
|
||||
using SurveyBackend.Infrastructure.Repositories;
|
||||
using SurveyBackend.Middlewares;
|
||||
|
|
@ -84,20 +85,8 @@ public class Program
|
|||
Name = "Authorization",
|
||||
Type = SecuritySchemeType.ApiKey
|
||||
});
|
||||
c.AddSecurityRequirement(new OpenApiSecurityRequirement
|
||||
{
|
||||
{
|
||||
new OpenApiSecurityScheme
|
||||
{
|
||||
Reference = new OpenApiReference
|
||||
{
|
||||
Type = ReferenceType.SecurityScheme,
|
||||
Id = JwtBearerDefaults.AuthenticationScheme
|
||||
}
|
||||
},
|
||||
Array.Empty<string>()
|
||||
}
|
||||
});
|
||||
|
||||
c.OperationFilter<EndpointAuthRequirementFilter>();
|
||||
|
||||
var filePath = Path.Combine(System.AppContext.BaseDirectory, "SurveyBackend.API.xml");
|
||||
c.IncludeXmlComments(filePath);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue