mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 16:11:10 +00:00
Names the rate limiting policies with constants
Replaces the literal authentication rate limiting policy name with a constant on PresentationApiLayerServices, adds the track stream policy constant next to it, and uses both from the endpoints that register them.
This commit is contained in:
1 parent
eecf4315c6
commit
0ad6e1307b
4 files changed
+25
-4
No files matched your search
+2
-1
@@ -6,6 +6,7 @@ using Lumina.Application.Core.UsersManagement.Authentication.Queries.LoginUser;
|
||||
using Lumina.Contracts.Requests.Authentication;
|
||||
using Lumina.Contracts.Responses.Authentication;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Presentation.Api.Common.DependencyInjection;
|
||||
using Lumina.Presentation.Api.Common.Routes.UsersManagement;
|
||||
using Lumina.Presentation.Api.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
@@ -42,7 +43,7 @@ public class LoginEndpoint : BaseEndpoint<LoginRequest, IResult>
|
||||
Version(1);
|
||||
AllowAnonymous();
|
||||
DontCatchExceptions();
|
||||
Options(x => x.RequireRateLimiting("authenticationPolicy"));
|
||||
Options(x => x.RequireRateLimiting(PresentationApiLayerServices.AUTHENTICATION_RATE_LIMIT_POLICY));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ using Lumina.Application.Core.UsersManagement.Authentication.Commands.RecoverPas
|
||||
using Lumina.Contracts.Requests.Authentication;
|
||||
using Lumina.Contracts.Responses.Authentication;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Presentation.Api.Common.DependencyInjection;
|
||||
using Lumina.Presentation.Api.Common.Routes.UsersManagement;
|
||||
using Lumina.Presentation.Api.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
@@ -41,7 +42,7 @@ public class RecoverPasswordEndpoint : BaseEndpoint<RecoverPasswordRequest, IRes
|
||||
Version(1);
|
||||
AllowAnonymous();
|
||||
DontCatchExceptions();
|
||||
Options(x => x.RequireRateLimiting("authenticationPolicy"));
|
||||
Options(x => x.RequireRateLimiting(PresentationApiLayerServices.AUTHENTICATION_RATE_LIMIT_POLICY));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ using Lumina.Application.Core.UsersManagement.Authentication.Commands.RegisterUs
|
||||
using Lumina.Contracts.Requests.Authentication;
|
||||
using Lumina.Contracts.Responses.Authentication;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Presentation.Api.Common.DependencyInjection;
|
||||
using Lumina.Presentation.Api.Common.Routes.UsersManagement;
|
||||
using Lumina.Presentation.Api.Core.Endpoints.Common;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
@@ -41,7 +42,7 @@ public class RegisterEndpoint : BaseEndpoint<RegistrationRequest, IResult>
|
||||
Version(1);
|
||||
AllowAnonymous();
|
||||
DontCatchExceptions();
|
||||
Options(x => x.RequireRateLimiting("authenticationPolicy"));
|
||||
Options(x => x.RequireRateLimiting(PresentationApiLayerServices.AUTHENTICATION_RATE_LIMIT_POLICY));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user