UDT-001: Login (scaffolding + JWT RS256 end-to-end) #1

Merged
dmolinari merged 14 commits from feature/UDT-001 into main 2026-04-14 14:44:28 +00:00
3 changed files with 57 additions and 0 deletions
Showing only changes of commit 2111070c77 - Show all commits

View File

@@ -0,0 +1,36 @@
namespace SIGCM2.Domain.Entities;
public sealed class Usuario
{
public int Id { get; }
public string Username { get; }
public string PasswordHash { get; }
public string Nombre { get; }
public string Apellido { get; }
public string? Email { get; }
public string Rol { get; }
public string PermisosJson { get; }
public bool Activo { get; }
public Usuario(
int id,
string username,
string passwordHash,
string nombre,
string apellido,
string? email,
string rol,
string permisosJson,
bool activo)
{
Id = id;
Username = username;
PasswordHash = passwordHash;
Nombre = nombre;
Apellido = apellido;
Email = email;
Rol = rol;
PermisosJson = permisosJson;
Activo = activo;
}
}

View File

@@ -0,0 +1,11 @@
namespace SIGCM2.Domain.Exceptions;
/// <summary>
/// Thrown when login credentials are invalid (user not found, wrong password, or inactive).
/// Deliberately vague to prevent user enumeration.
/// </summary>
public sealed class InvalidCredentialsException : Exception
{
public InvalidCredentialsException()
: base("Credenciales inválidas") { }
}

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SIGCM2.Domain</RootNamespace>
</PropertyGroup>
</Project>