Files
DarkflameServer/dWeb/IHTTPMiddleware.h
Aaron Kimbrell e213a7aeff feat: web dashboard and playground work
The NexusDashboard-parity dashboard (dDashboardServer) and everything built on it on the experimental branch:
accounts, characters, properties and moderation tools, permissions shared with in-game slash commands, economy
reports, World 3D and property 3D views with client scenery, scheduled events (features, vanity changes, live
events, announcements, restarts), vanity files and events, the CDClient browser, the message inspector with saved
captures, chat filter tools, community challenges, live ops, the AI moderator helper, and the server-side changes
they need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:30:43 -05:00

39 lines
1013 B
C++

#pragma once
#include <memory>
#include "HTTPContext.h"
// Forward declaration
struct HTTPReply;
/**
* Middleware Interface
*
* All middleware implements this interface and is called in order during request processing.
* Middleware can:
* - Inspect and modify the request (HTTPContext)
* - Populate authentication/authorization info
* - Short-circuit the chain by setting a reply and returning false
* - Pass to the next middleware by returning true
*/
class IHTTPMiddleware {
public:
virtual ~IHTTPMiddleware() = default;
/**
* Process the request through this middleware
*
* @param context The HTTP request context
* @param reply The HTTP reply (can be populated to short-circuit)
* @return true to continue to next middleware, false to stop processing
*/
virtual bool Process(HTTPContext& context, HTTPReply& reply) = 0;
/**
* Get a friendly name for this middleware
*/
virtual std::string GetName() const = 0;
};
using MiddlewarePtr = std::shared_ptr<IHTTPMiddleware>;