Apply strict rate limiting to /api/v1/apps endpoint

This commit is contained in:
Laura Hausmann 2024-01-29 04:12:03 +01:00
parent cec4abd841
commit 61e8d7f640
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -15,8 +15,8 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
[Produces("application/json")]
[Route("/api/v1")]
public class MastodonAuthController(DatabaseContext db) : Controller {
[AuthenticateOauth]
[HttpGet("verify_credentials")]
[AuthenticateOauth]
[Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(MastodonAuth.VerifyCredentialsResponse))]
[ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(MastodonErrorResponse))]
@ -33,6 +33,7 @@ public class MastodonAuthController(DatabaseContext db) : Controller {
}
[HttpPost("apps")]
[EnableRateLimiting("strict")]
[Consumes("application/json", "application/x-www-form-urlencoded", "multipart/form-data")]
[Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(MastodonAuth.RegisterAppResponse))]