This commit is contained in:
Quinten 2025-10-07 17:11:17 +02:00
parent e0efb0192c
commit 91879d2638
19 changed files with 49 additions and 46 deletions

View File

@ -1,5 +1,6 @@
#include <webserv/config/directive/BoolDirective.hpp> // for BoolDirective
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
#include <webserv/config/directive/BoolDirective.hpp> // for BoolDirective
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
#include <webserv/config/directive/IntStringDirective.hpp> // for IntStringDirective
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective

View File

@ -1,5 +1,6 @@
#include "webserv/config/validation/directive_rules/CgiExtValidationRule.hpp"
#include <webserv/config/validation/ConfigValidator.hpp>
#include <webserv/config/validation/directive_rules/CgiExtValidationRule.hpp>
#include <webserv/config/validation/ValidationEngine.hpp> // for ValidationEngine
#include <webserv/config/validation/directive_rules/AValidationRule.hpp> // for AValidationRule
#include <webserv/config/validation/directive_rules/AllowedValuesRule.hpp> // for AllowedValuesRule

View File

@ -1,8 +1,9 @@
#include <webserv/config/validation/ValidationEngine.hpp>
#include <webserv/config/AConfig.hpp> // for AConfig
#include <webserv/config/GlobalConfig.hpp> // for GlobalConfig
#include <webserv/config/LocationConfig.hpp> // for LocationConfig
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
#include <webserv/config/validation/ValidationEngine.hpp>
#include <webserv/config/validation/ValidationResult.hpp> // for ValidationResult
#include <webserv/config/validation/directive_rules/AValidationRule.hpp> // for AValidationRule
#include <webserv/log/Log.hpp> // for Log, LOCATION

View File

@ -1,9 +1,9 @@
#include "webserv/config/AConfig.hpp"
#include "webserv/config/validation/ValidationResult.hpp"
#include "webserv/utils/FileUtils.hpp"
#include <webserv/config/validation/directive_rules/CgiExtValidationRule.hpp>
#include <webserv/config/AConfig.hpp>
#include <webserv/config/validation/ValidationResult.hpp>
#include <webserv/utils/FileUtils.hpp>
#include <algorithm>
#include <vector>

View File

@ -1,6 +1,6 @@
#pragma once
#include "webserv/config/validation/directive_rules/AValidationRule.hpp"
#include <webserv/config/validation/directive_rules/AValidationRule.hpp>
#include <webserv/config/validation/ValidationResult.hpp> // for ValidationResult
class CgiExtValidationRule : public AValidationRule

View File

@ -1,5 +1,5 @@
#include "webserv/config/validation/directive_rules/AValidationRule.hpp"
#include <webserv/config/validation/directive_rules/AValidationRule.hpp>
#include "webserv/config/validation/directive_rules/AllowedValuesRule.hpp"
#include "webserv/config/validation/directive_rules/PortValidationRule.hpp"
#include "webserv/config/validation/directive_rules/RequiredDirectiveRule.hpp"
#include <webserv/config/validation/directive_rules/AllowedValuesRule.hpp>
#include <webserv/config/validation/directive_rules/PortValidationRule.hpp>
#include <webserv/config/validation/directive_rules/RequiredDirectiveRule.hpp>

View File

@ -1,10 +1,10 @@
#include "webserv/config/directive/ADirective.hpp"
#include "webserv/config/validation/ValidationResult.hpp"
#include "webserv/log/Log.hpp"
#include "webserv/utils/FileUtils.hpp"
#include <webserv/config/validation/directive_rules/FolderExistsRule.hpp>
#include <webserv/config/directive/ADirective.hpp>
#include <webserv/config/validation/ValidationResult.hpp>
#include <webserv/log/Log.hpp>
#include <webserv/utils/FileUtils.hpp>
FolderExistsRule::FolderExistsRule(bool requiresValue)
: AValidationRule("FolderExists", "Ensures the specified folder exists", requiresValue)
{

View File

@ -1,8 +1,8 @@
#pragma once
#include "webserv/config/AConfig.hpp"
#include "webserv/config/validation/ValidationResult.hpp"
#include "webserv/config/validation/directive_rules/AValidationRule.hpp"
#include <webserv/config/AConfig.hpp>
#include <webserv/config/validation/ValidationResult.hpp>
#include <webserv/config/validation/directive_rules/AValidationRule.hpp>
class FolderExistsRule : public AValidationRule
{

View File

@ -1,10 +1,10 @@
#include "webserv/config/AConfig.hpp"
#include "webserv/config/directive/ADirective.hpp"
#include "webserv/config/validation/ValidationResult.hpp"
#include "webserv/utils/utils.hpp"
#include <webserv/config/validation/directive_rules/HostValidationRule.hpp>
#include <webserv/config/AConfig.hpp>
#include <webserv/config/directive/ADirective.hpp>
#include <webserv/config/validation/ValidationResult.hpp>
#include <webserv/utils/utils.hpp>
#include <cctype>
#include <string>
#include <vector>

View File

@ -1,6 +1,6 @@
#pragma once
#include "webserv/config/validation/ValidationResult.hpp"
#include <webserv/config/validation/ValidationResult.hpp>
#include <string>

View File

@ -1,7 +1,7 @@
#include "webserv/config/validation/structural_rules/MinimumServerBlocksRule.hpp"
#include <webserv/config/validation/structural_rules/MinimumServerBlocksRule.hpp>
#include "webserv/config/GlobalConfig.hpp"
#include "webserv/log/Log.hpp"
#include <webserv/config/GlobalConfig.hpp>
#include <webserv/log/Log.hpp>
#include <string>

View File

@ -1,6 +1,6 @@
#pragma once
#include "webserv/config/validation/structural_rules/AStructuralValidationRule.hpp"
#include <webserv/config/validation/structural_rules/AStructuralValidationRule.hpp>
#include <cstddef>

View File

@ -1,7 +1,7 @@
#include "webserv/config/validation/structural_rules/RequiredLocationBlocksRule.hpp"
#include <webserv/config/validation/structural_rules/RequiredLocationBlocksRule.hpp>
#include "webserv/config/ServerConfig.hpp"
#include "webserv/log/Log.hpp"
#include <webserv/config/ServerConfig.hpp>
#include <webserv/log/Log.hpp>
#include <string>

View File

@ -1,6 +1,6 @@
#pragma once
#include "webserv/config/validation/structural_rules/AStructuralValidationRule.hpp"
#include <webserv/config/validation/structural_rules/AStructuralValidationRule.hpp>
#include <cstddef>

View File

@ -1,9 +1,9 @@
#pragma once
// Base class
#include "webserv/config/validation/structural_rules/AStructuralValidationRule.hpp"
#include <webserv/config/validation/structural_rules/AStructuralValidationRule.hpp>
// Concrete structural validation rules
#include "webserv/config/validation/structural_rules/MinimumServerBlocksRule.hpp"
#include "webserv/config/validation/structural_rules/RequiredLocationBlocksRule.hpp"
#include "webserv/config/validation/structural_rules/UniqueServerNamesRule.hpp"
#include <webserv/config/validation/structural_rules/MinimumServerBlocksRule.hpp>
#include <webserv/config/validation/structural_rules/RequiredLocationBlocksRule.hpp>
#include <webserv/config/validation/structural_rules/UniqueServerNamesRule.hpp>

View File

@ -1,8 +1,8 @@
#include "webserv/config/validation/structural_rules/UniqueServerNamesRule.hpp"
#include <webserv/config/validation/structural_rules/UniqueServerNamesRule.hpp>
#include "webserv/config/GlobalConfig.hpp"
#include "webserv/config/ServerConfig.hpp"
#include "webserv/log/Log.hpp"
#include <webserv/config/GlobalConfig.hpp>
#include <webserv/config/ServerConfig.hpp>
#include <webserv/log/Log.hpp>
#include <optional>
#include <set>

View File

@ -1,6 +1,6 @@
#pragma once
#include "webserv/config/validation/structural_rules/AStructuralValidationRule.hpp"
#include <webserv/config/validation/structural_rules/AStructuralValidationRule.hpp>
class GlobalConfig;

View File

@ -4,7 +4,6 @@
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
#include <optional> // for optional
#include <vector> // for vector
#include <stddef.h> // for size_t
#include <sys/stat.h> // for stat, S_ISDIR, S_ISREG

View File

@ -1,4 +1,6 @@
#include "webserv/config/directive/ADirective.hpp"
#include <webserv/router/Router.hpp>
#include <webserv/config/directive/ADirective.hpp>
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
@ -7,7 +9,6 @@
#include <webserv/handler/URIParser.hpp> // for URIParser
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
#include <webserv/log/Log.hpp> // for LOCATION, Log
#include <webserv/router/Router.hpp>
#include <algorithm>
#include <memory> // for unique_ptr