From 13e9e4fc65322f3615c17bb9cdff5655030eb00c Mon Sep 17 00:00:00 2001 From: kirill <44907112+polferov@users.noreply.github.com> Date: Mon, 13 Nov 2023 20:40:01 +0100 Subject: [PATCH] Add Input Validation for Elsa.Identity Login Endpoint (#4601) * add validator for login request * login request: only require parameters to be not null (allow empty/whitespace) --- .../Endpoints/Login/RequestValidator.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/modules/Elsa.Identity/Endpoints/Login/RequestValidator.cs diff --git a/src/modules/Elsa.Identity/Endpoints/Login/RequestValidator.cs b/src/modules/Elsa.Identity/Endpoints/Login/RequestValidator.cs new file mode 100644 index 000000000..a652384d5 --- /dev/null +++ b/src/modules/Elsa.Identity/Endpoints/Login/RequestValidator.cs @@ -0,0 +1,15 @@ +using FastEndpoints; +using FluentValidation; +using JetBrains.Annotations; + +namespace Elsa.Identity.Endpoints.Login; + +[PublicAPI] +internal class RequestValidator : Validator +{ + public RequestValidator() + { + RuleFor(x => x.Username).NotNull(); + RuleFor(x => x.Password).NotNull(); + } +} \ No newline at end of file