feat(core): add shared auth models for encrypted login
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace JdeScoping.Core.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// Encrypted login payload sent from client to API.
|
||||
/// </summary>
|
||||
/// <param name="EncryptedData">Base64-encoded RSA-encrypted JSON of LoginModel</param>
|
||||
public record EncryptedLoginRequest(string EncryptedData);
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace JdeScoping.Core.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// Login credentials model shared by Client and API.
|
||||
/// </summary>
|
||||
public class LoginModel
|
||||
{
|
||||
[Required(ErrorMessage = "Username is required")]
|
||||
public string Username { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Password is required")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using JdeScoping.Core.Models;
|
||||
|
||||
namespace JdeScoping.Core.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// Result returned from login API endpoint.
|
||||
/// </summary>
|
||||
/// <param name="Success">Whether authentication succeeded</param>
|
||||
/// <param name="ErrorMessage">Error message if failed</param>
|
||||
/// <param name="User">User info if successful</param>
|
||||
public record LoginResultModel(
|
||||
bool Success,
|
||||
string? ErrorMessage,
|
||||
UserInfo? User);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace JdeScoping.Core.Models.Auth;
|
||||
|
||||
/// <summary>
|
||||
/// Server's RSA public key for client-side encryption.
|
||||
/// </summary>
|
||||
/// <param name="PublicKeyPem">PEM-encoded RSA public key</param>
|
||||
public record PublicKeyResponse(string PublicKeyPem);
|
||||
Reference in New Issue
Block a user