Merge pull request #143 from aaronpo97/service-refactor

Refactor auth/user services
This commit is contained in:
Aaron Po
2026-02-12 19:29:56 -05:00
committed by GitHub
18 changed files with 98 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
namespace Infrastructure.Jwt;
public interface IJwtService
public interface ITokenInfrastructure
{
string GenerateJwt(Guid userId, string username, DateTime expiry);
}

View File

@@ -6,7 +6,7 @@ using JwtRegisteredClaimNames = System.IdentityModel.Tokens.Jwt.JwtRegisteredCla
namespace Infrastructure.Jwt;
public class JwtService : IJwtService
public class JwtInfrastructure : ITokenInfrastructure
{
private readonly string? _secret = Environment.GetEnvironmentVariable(
"JWT_SECRET"

View File

@@ -4,7 +4,7 @@ using Konscious.Security.Cryptography;
namespace Infrastructure.PasswordHashing;
public class Argon2Infrastructure : IPasswordInfra
public class Argon2Infrastructure : IPasswordInfrastructure
{
private const int SaltSize = 16; // 128-bit
private const int HashSize = 32; // 256-bit

View File

@@ -1,6 +1,6 @@
namespace Infrastructure.PasswordHashing;
public interface IPasswordInfra
public interface IPasswordInfrastructure
{
public string Hash(string password);
public bool Verify(string password, string stored);