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/DirectiveFactory.hpp> // for DirectiveFactory
#include <webserv/config/directive/BoolDirective.hpp> // for BoolDirective
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective #include <webserv/config/directive/IntDirective.hpp> // for IntDirective
#include <webserv/config/directive/IntStringDirective.hpp> // for IntStringDirective #include <webserv/config/directive/IntStringDirective.hpp> // for IntStringDirective
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective #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/ConfigValidator.hpp>
#include <webserv/config/validation/directive_rules/CgiExtValidationRule.hpp>
#include <webserv/config/validation/ValidationEngine.hpp> // for ValidationEngine #include <webserv/config/validation/ValidationEngine.hpp> // for ValidationEngine
#include <webserv/config/validation/directive_rules/AValidationRule.hpp> // for AValidationRule #include <webserv/config/validation/directive_rules/AValidationRule.hpp> // for AValidationRule
#include <webserv/config/validation/directive_rules/AllowedValuesRule.hpp> // for AllowedValuesRule #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/AConfig.hpp> // for AConfig
#include <webserv/config/GlobalConfig.hpp> // for GlobalConfig #include <webserv/config/GlobalConfig.hpp> // for GlobalConfig
#include <webserv/config/LocationConfig.hpp> // for LocationConfig #include <webserv/config/LocationConfig.hpp> // for LocationConfig
#include <webserv/config/ServerConfig.hpp> // for ServerConfig #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/ValidationResult.hpp> // for ValidationResult
#include <webserv/config/validation/directive_rules/AValidationRule.hpp> // for AValidationRule #include <webserv/config/validation/directive_rules/AValidationRule.hpp> // for AValidationRule
#include <webserv/log/Log.hpp> // for Log, LOCATION #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/validation/directive_rules/CgiExtValidationRule.hpp>
#include <webserv/config/AConfig.hpp>
#include <webserv/config/validation/ValidationResult.hpp>
#include <webserv/utils/FileUtils.hpp>
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>

View File

@ -1,6 +1,6 @@
#pragma once #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 #include <webserv/config/validation/ValidationResult.hpp> // for ValidationResult
class CgiExtValidationRule : public AValidationRule 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/AllowedValuesRule.hpp>
#include "webserv/config/validation/directive_rules/PortValidationRule.hpp" #include <webserv/config/validation/directive_rules/PortValidationRule.hpp>
#include "webserv/config/validation/directive_rules/RequiredDirectiveRule.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/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) FolderExistsRule::FolderExistsRule(bool requiresValue)
: AValidationRule("FolderExists", "Ensures the specified folder exists", requiresValue) : AValidationRule("FolderExists", "Ensures the specified folder exists", requiresValue)
{ {

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
#include "webserv/config/AConfig.hpp" #include <webserv/config/AConfig.hpp>
#include "webserv/config/validation/ValidationResult.hpp" #include <webserv/config/validation/ValidationResult.hpp>
#include "webserv/config/validation/directive_rules/AValidationRule.hpp" #include <webserv/config/validation/directive_rules/AValidationRule.hpp>
class FolderExistsRule : public AValidationRule 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/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 <cctype>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "webserv/config/validation/ValidationResult.hpp" #include <webserv/config/validation/ValidationResult.hpp>
#include <string> #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/config/GlobalConfig.hpp>
#include "webserv/log/Log.hpp" #include <webserv/log/Log.hpp>
#include <string> #include <string>

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "webserv/config/validation/structural_rules/AStructuralValidationRule.hpp" #include <webserv/config/validation/structural_rules/AStructuralValidationRule.hpp>
#include <cstddef> #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/config/ServerConfig.hpp>
#include "webserv/log/Log.hpp" #include <webserv/log/Log.hpp>
#include <string> #include <string>

View File

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

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
// Base class // Base class
#include "webserv/config/validation/structural_rules/AStructuralValidationRule.hpp" #include <webserv/config/validation/structural_rules/AStructuralValidationRule.hpp>
// Concrete structural validation rules // Concrete structural validation rules
#include "webserv/config/validation/structural_rules/MinimumServerBlocksRule.hpp" #include <webserv/config/validation/structural_rules/MinimumServerBlocksRule.hpp>
#include "webserv/config/validation/structural_rules/RequiredLocationBlocksRule.hpp" #include <webserv/config/validation/structural_rules/RequiredLocationBlocksRule.hpp>
#include "webserv/config/validation/structural_rules/UniqueServerNamesRule.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/GlobalConfig.hpp>
#include "webserv/config/ServerConfig.hpp" #include <webserv/config/ServerConfig.hpp>
#include "webserv/log/Log.hpp" #include <webserv/log/Log.hpp>
#include <optional> #include <optional>
#include <set> #include <set>

View File

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

View File

@ -4,7 +4,6 @@
#include <webserv/config/ServerConfig.hpp> // for ServerConfig #include <webserv/config/ServerConfig.hpp> // for ServerConfig
#include <optional> // for optional #include <optional> // for optional
#include <vector> // for vector
#include <stddef.h> // for size_t #include <stddef.h> // for size_t
#include <sys/stat.h> // for stat, S_ISDIR, S_ISREG #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/ConfigManager.hpp> // for ConfigManager
#include <webserv/config/ServerConfig.hpp> // for ServerConfig #include <webserv/config/ServerConfig.hpp> // for ServerConfig
@ -7,7 +9,6 @@
#include <webserv/handler/URIParser.hpp> // for URIParser #include <webserv/handler/URIParser.hpp> // for URIParser
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders #include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
#include <webserv/log/Log.hpp> // for LOCATION, Log #include <webserv/log/Log.hpp> // for LOCATION, Log
#include <webserv/router/Router.hpp>
#include <algorithm> #include <algorithm>
#include <memory> // for unique_ptr #include <memory> // for unique_ptr