fix(Middleware): Disable RateLimitMiddleware temporarily
- Commented out RateLimitMiddleware in MiddlewareManager - RateLimit system not fully implemented yet (missing Storage, Initializer) - Added ENV_SETUP.md documentation for .env file structure - Website was returning HTTP 500 due to missing StorageInterface binding TODO: Implement complete RateLimit system with Storage interface and DI bindings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,9 @@ declare(strict_types=1);
|
||||
namespace App\Framework\Http;
|
||||
|
||||
use App\Framework\Cache\Cache;
|
||||
use App\Framework\Cache\CacheKey;
|
||||
use App\Framework\Core\ValueObjects\ClassName;
|
||||
use App\Framework\Core\ValueObjects\Duration;
|
||||
use App\Framework\DI\Container;
|
||||
use App\Framework\Discovery\Results\DiscoveryRegistry;
|
||||
use App\Framework\Http\Middlewares\DDoSProtectionMiddleware;
|
||||
@@ -72,7 +74,7 @@ final readonly class MiddlewareManager implements MiddlewareManagerInterface
|
||||
\App\Framework\Http\Session\SessionMiddleware::class,
|
||||
|
||||
// 5. Security und Rate Limiting
|
||||
RateLimitMiddleware::class,
|
||||
//RateLimitMiddleware::class,
|
||||
#\App\Application\Security\Middleware\SecurityEventMiddleware::class,
|
||||
|
||||
// 6. Headers und CORS
|
||||
@@ -248,11 +250,11 @@ final readonly class MiddlewareManager implements MiddlewareManagerInterface
|
||||
$className = is_string($middlewareClass) ? $middlewareClass : $middlewareClass::class;
|
||||
$className = ltrim($className, '\\');
|
||||
|
||||
$cacheKey = "middleware_priority:{$className}";
|
||||
$cacheKey = CacheKey::fromString("middleware_priority:{$className}");
|
||||
|
||||
$cacheItem = $this->cache->remember($cacheKey, function () use ($className) {
|
||||
return $this->resolvePriorityFromReflection($className);
|
||||
}, 3600);
|
||||
}, Duration::fromSeconds(3600));
|
||||
|
||||
return is_int($cacheItem->value) ? $cacheItem->value : MiddlewarePriority::BUSINESS_LOGIC->value;
|
||||
}
|
||||
@@ -330,7 +332,7 @@ final readonly class MiddlewareManager implements MiddlewareManagerInterface
|
||||
$className = is_string($middlewareClass) ? $middlewareClass : $middlewareClass::class;
|
||||
$className = ltrim($className, '\\');
|
||||
|
||||
$cacheKey = "middleware_priority_discovery:{$className}";
|
||||
$cacheKey = CacheKey::fromString("middleware_priority_discovery:{$className}");
|
||||
|
||||
$cacheItem = $this->cache->remember($cacheKey, function () use ($className) {
|
||||
// Use discovery registry to find priority
|
||||
@@ -350,7 +352,7 @@ final readonly class MiddlewareManager implements MiddlewareManagerInterface
|
||||
|
||||
// Default priority
|
||||
return MiddlewarePriority::BUSINESS_LOGIC->value;
|
||||
}, 3600);
|
||||
}, Duration::fromSeconds(3600));
|
||||
|
||||
return is_int($cacheItem->value) ? $cacheItem->value : MiddlewarePriority::BUSINESS_LOGIC->value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user