basic admin panel stuff

This commit is contained in:
Lapis
2026-06-17 13:39:28 -04:00
parent c20d215ee0
commit 004f1921a6
44 changed files with 3432 additions and 315 deletions
@@ -0,0 +1,21 @@
namespace CannedNet.Admin.Services;
public class AdminApiKeyHandler : DelegatingHandler
{
private readonly string _apiKey;
public AdminApiKeyHandler(IConfiguration config)
{
_apiKey = config.GetValue<string>("Admin:ApiKey")
?? config.GetValue<string>("AdminApiKey")
?? "";
}
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
if (!string.IsNullOrEmpty(_apiKey))
request.Headers.Add("X-Admin-Api-Key", _apiKey);
return await base.SendAsync(request, cancellationToken);
}
}