update to .net 9 and add new OpenAPI packages

This commit is contained in:
sam 2024-12-10 15:28:44 +01:00
parent 80b7f192f1
commit 7e6698c3fb
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
17 changed files with 451 additions and 1001 deletions

View file

@ -26,6 +26,7 @@ using Microsoft.EntityFrameworkCore;
namespace Foxnouns.Backend.Controllers.Authentication;
[Route("/api/internal/auth")]
[ApiExplorerSettings(IgnoreApi = true)]
public class AuthController(
Config config,
DatabaseContext db,

View file

@ -31,6 +31,7 @@ using NodaTime;
namespace Foxnouns.Backend.Controllers.Authentication;
[Route("/api/internal/auth/discord")]
[ApiExplorerSettings(IgnoreApi = true)]
public class DiscordAuthController(
[UsedImplicitly] Config config,
ILogger logger,

View file

@ -30,6 +30,7 @@ using NodaTime;
namespace Foxnouns.Backend.Controllers.Authentication;
[Route("/api/internal/auth/email")]
[ApiExplorerSettings(IgnoreApi = true)]
public class EmailAuthController(
[UsedImplicitly] Config config,
DatabaseContext db,

View file

@ -28,6 +28,7 @@ using NodaTime;
namespace Foxnouns.Backend.Controllers.Authentication;
[Route("/api/internal/auth/fediverse")]
[ApiExplorerSettings(IgnoreApi = true)]
public class FediverseAuthController(
ILogger logger,
DatabaseContext db,

View file

@ -31,6 +31,7 @@ using NodaTime;
namespace Foxnouns.Backend.Controllers.Authentication;
[Route("/api/internal/auth/google")]
[ApiExplorerSettings(IgnoreApi = true)]
public class GoogleAuthController(
[UsedImplicitly] Config config,
ILogger logger,

View file

@ -17,6 +17,7 @@ using NodaTime;
namespace Foxnouns.Backend.Controllers.Authentication;
[Route("/api/internal/auth/tumblr")]
[ApiExplorerSettings(IgnoreApi = true)]
public class TumblrAuthController(
[UsedImplicitly] Config config,
ILogger logger,

View file

@ -26,6 +26,7 @@ namespace Foxnouns.Backend.Controllers;
[Route("/api/internal/data-exports")]
[Authorize("identify")]
[ApiExplorerSettings(IgnoreApi = true)]
public class ExportsController(
ILogger logger,
Config config,

View file

@ -80,6 +80,7 @@ public class FlagsController(
[HttpPatch("{id}")]
[Authorize("user.update")]
[ProducesResponseType<PrideFlagResponse>(statusCode: StatusCodes.Status200OK)]
public async Task<IActionResult> UpdateFlagAsync(Snowflake id, [FromBody] UpdateFlagRequest req)
{
ValidationUtils.Validate(ValidateFlag(req.Name, req.Description, null));

View file

@ -25,6 +25,7 @@ namespace Foxnouns.Backend.Controllers;
[ApiController]
[Route("/api/internal")]
[ApiExplorerSettings(IgnoreApi = true)]
public partial class InternalController(DatabaseContext db) : ControllerBase
{
[GeneratedRegex(@"(\{\w+\})")]

View file

@ -144,6 +144,7 @@ public class MembersController(
}
[HttpPatch("/api/v2/users/@me/members/{memberRef}")]
[ProducesResponseType<MemberResponse>(statusCode: StatusCodes.Status200OK)]
[Authorize("member.update")]
public async Task<IActionResult> UpdateMemberAsync(
string memberRef,

View file

@ -25,6 +25,7 @@ namespace Foxnouns.Backend.Controllers;
"CA1862:Use the \'StringComparison\' method overloads to perform case-insensitive string comparisons",
Justification = "Not usable with EFCore"
)]
[ApiExplorerSettings(IgnoreApi = true)]
public class SidController(Config config, DatabaseContext db) : ApiControllerBase
{
[HttpGet("{**id}")]