Issue #7: implement local api key admin cli

This commit is contained in:
Joseph Doherty
2026-04-26 16:56:00 -04:00
parent 9cb2f1c5cd
commit da9ffe0e11
18 changed files with 951 additions and 22 deletions
@@ -0,0 +1,17 @@
using System.Security.Cryptography;
namespace MxGateway.Server.Security.Authentication;
public static class ApiKeySecretGenerator
{
public static string Generate()
{
Span<byte> bytes = stackalloc byte[32];
RandomNumberGenerator.Fill(bytes);
return Convert.ToBase64String(bytes)
.TrimEnd('=')
.Replace('+', '-')
.Replace('/', '_');
}
}