|
| routing::Middleware | compress () |
| | Returns a middleware that automatically compresses the HTTP response body using GZIP.
|
| |
| routing::Middleware | cors (CorsOptions options=CorsOptions{}) |
| | Returns a middleware that handles CORS.
|
| |
| auto | csrf_protection (const std::string &cookie_name="csrf_token", const std::string &header_name="X-CSRF-Token") |
| | Helper to create a CSRF protection middleware handler.
|
| |
| auto | distributed_rate_limit (const std::string &redis_host, int redis_port, size_t max_requests, std::chrono::seconds window) |
| | Helper to create a distributed rate limiting middleware handler.
|
| |
| std::function< bool(http::HttpRequest &, std::shared_ptr< http::ResponseWriter >)> | graphql (GraphQLExecutor executor) |
| | Creates a middleware handler for GraphQL endpoints. It parses the incoming GET or POST request according to the GraphQL over HTTP spec, extracts the query, operationName, and variables, and invokes the provided executor.
|
| |
| routing::Middleware | jwt_auth (const std::string &secret_key) |
| | JWT Authentication middleware using HMAC-SHA256 (HS256).
|
| |
| routing::Middleware | proxy (ProxyOptions options) |
| | Returns a middleware that proxies requests to a single target URL (ip/hostname and port).
|
| |
| routing::Middleware | proxy (const std::string &target_host, int target_port) |
| | Returns a middleware that proxies requests to a single target URL.
|
| |
| routing::Middleware | load_balancer (LoadBalancerOptions options) |
| | Returns a middleware that load-balances requests across multiple upstream nodes.
|
| |
| routing::Middleware | load_balancer (const std::vector< TargetNode > &nodes) |
| | Returns a middleware that load-balances requests across multiple upstream nodes.
|
| |
| auto | rate_limit (size_t max_requests, std::chrono::seconds window) |
| | Helper function to easily register rate limiting middleware.
|
| |
| auto | session (const std::string &redis_host, int redis_port) |
| | Helper to create a session management middleware handler.
|
| |
| routing::Middleware | static_files (const std::string &directory) |
| | Returns a middleware that serves static files from a directory.
|
| |
| routing::Middleware | validate_json (const std::vector< SchemaField > &schema) |
| | Returns a middleware that parses and validates a JSON request body.
|
| |
| static std::string | base64url_encode (const unsigned char *input, int length) |
| |
| static std::string | base64url_decode (const std::string &input) |
| |
| static bool | verify_jwt_signature (const std::string &header_b64, const std::string &payload_b64, const std::string &provided_signature, const std::string &secret) |
| |