From 18de6d599bcd84daf46263029384d5cdd81d5a7a Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 27 Aug 2024 14:44:54 -0500 Subject: [PATCH] cleaned up a few comments --- Entities/EntitySwaggerFilter.cs | 6 ++++-- Program.cs | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Entities/EntitySwaggerFilter.cs b/Entities/EntitySwaggerFilter.cs index 319de27..4103882 100644 --- a/Entities/EntitySwaggerFilter.cs +++ b/Entities/EntitySwaggerFilter.cs @@ -6,7 +6,7 @@ namespace ComiServ.Entities { /// /// 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. /// @@ -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) { diff --git a/Program.cs b/Program.cs index 62d8c97..304d6cb 100644 --- a/Program.cs +++ b/Program.cs @@ -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]);