added auth with a simple UI

This commit is contained in:
2026-03-09 23:29:04 +01:00
parent c8347ac96b
commit 82ac241129
123 changed files with 3419 additions and 93 deletions

View File

@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.DataProtection;
namespace OED.Api.Infrastructure.Auth;
public interface ITokenEncryptor
{
string Encrypt(string plaintext);
string Decrypt(string ciphertext);
}
// Uses ASP.NET Data Protection — handles key management, rotation, and storage automatically
public class TokenEncryptor(IDataProtectionProvider provider) : ITokenEncryptor
{
private readonly IDataProtector _protector = provider.CreateProtector("Eve.RefreshToken.v1");
public string Encrypt(string plaintext) => _protector.Protect(plaintext);
public string Decrypt(string ciphertext) => _protector.Unprotect(ciphertext);
}