WIP: basic server, no features

This commit is contained in:
Aaron Kimbrell
2026-01-25 22:33:51 -06:00
parent c723ce2588
commit f1847d1f20
67 changed files with 7655 additions and 37 deletions

View File

@@ -0,0 +1,33 @@
#pragma once
#include "IHTTPMiddleware.h"
#include "eHTTPStatusCode.h"
/**
* Require Authentication Middleware
*
* Verifies that the request has been authenticated.
* Must be placed AFTER AuthMiddleware in the chain.
*
* Fails with 401 Unauthorized if not authenticated.
* Optionally checks for minimum GM level.
*/
class RequireAuthMiddleware : public IHTTPMiddleware {
public:
/**
* Create a require auth middleware
*
* @param minGmLevel Minimum GM level required (0 = any authenticated user)
*/
explicit RequireAuthMiddleware(uint8_t minGmLevel = 0)
: minGmLevel(minGmLevel) {}
bool Process(HTTPContext& context, HTTPReply& reply) override;
std::string GetName() const override {
return "RequireAuthMiddleware(minGM=" + std::to_string(minGmLevel) + ")";
}
private:
uint8_t minGmLevel{};
};