cleaned up a few comments

This commit is contained in:
Cameron
2024-08-27 14:44:54 -05:00
parent ceb35690bc
commit 18de6d599b
2 changed files with 5 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ namespace ComiServ.Entities
{
/// <summary>
/// This was originally made to remove Entity types that were being added to the Swagger schema.
/// I found that there was a bug a `ProducesResponseTypeAttribute` that caused it, and this is
/// I found that there was a bug in `ProducesResponseTypeAttribute` that caused it, and this is
/// no longer necessary. I changed Apply to a nop but am keeping this around as an example and
/// in case I actually need something like this in the future.
/// </summary>
@@ -18,7 +18,9 @@ namespace ComiServ.Entities
nameof(ComicAuthor),
nameof(ComicTag),
nameof(Cover),
nameof(Tag)
nameof(Tag),
nameof(User),
nameof(UserType)
];
public void Apply(OpenApiSchema schema, SchemaFilterContext context)
{

View File

@@ -83,7 +83,6 @@ var app = builder.Build();
app.UseHttpLogging();
app.UseHttpsRedirection();
app.UseStaticFiles();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
@@ -107,7 +106,7 @@ app.UseHttpsRedirection();
//ensures that the user is authenticated (if auth is provided) but does not restrict access to any routes
app.UseBasicAuthentication([]);
//require user or admin account to access any comic resource (uses the authentication
//require user or admin account to access any comic resource
app.UseWhen(context => context.Request.Path.StartsWithSegments(ComicController.ROUTE), appBuilder =>
{
appBuilder.UseBasicAuthentication([UserTypeEnum.User, UserTypeEnum.Administrator]);