8.1 ApiKeyMiddleware
Enforce X-Api-Key on /api/* requests with constant-time comparison.
/i/{mac}.png and /health remain unauthenticated. No-op when the
configured key is empty.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3e01fa7980
commit
475e8988b5
3 files changed
+53
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using FrameProcessor.Configuration;
|
||||
using FrameProcessor.ImagePipeline;
|
||||
using FrameProcessor.Middleware;
|
||||
using FrameProcessor.Mqtt;
|
||||
using FrameProcessor.Storage;
|
||||
using FrameProcessor.UrlFetch;
|
||||
@@ -64,6 +65,8 @@ var app = builder.Build();
|
||||
// Eagerly resolve FramesRegistry so an invalid frames.json fails startup fast.
|
||||
_ = app.Services.GetRequiredService<FramesRegistry>();
|
||||
|
||||
app.UseMiddleware<ApiKeyMiddleware>();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
Reference in new issue
Block a user