fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled

This commit is contained in:
2025-11-24 21:28:25 +01:00
parent 4eb7134853
commit 77abc65cd7
1327 changed files with 91915 additions and 9909 deletions

View File

@@ -176,9 +176,9 @@ final readonly class ExceptionContextCache
private function getFromCache(CacheKey $cacheKey): ?ExceptionContextData
{
$result = $this->cache->get($cacheKey);
$item = $result->getFirstHit();
$item = $result->getItem($cacheKey);
if ($item === null) {
if (!$item->isHit) {
return null;
}

View File

@@ -96,9 +96,9 @@ final readonly class ExceptionCorrelationEngine
private function getCorrelation(CacheKey $cacheKey): ExceptionCorrelation
{
$result = $this->cache->get($cacheKey);
$item = $result->getFirstHit();
$item = $result->getItem($cacheKey);
if ($item === null) {
if (!$item->isHit) {
return new ExceptionCorrelation(correlationKey: '');
}

View File

@@ -61,8 +61,8 @@ final readonly class ErrorKernel
$this->auditLogger->logIfAuditable($e, $exceptionContext);
}
// Log exception if not rate limited
if (!$shouldSkipLogging) {
// Log exception if not rate limited and reporter is available
if (!$shouldSkipLogging && $this->reporter !== null) {
$this->reporter->report($e);
}
@@ -113,7 +113,9 @@ final readonly class ErrorKernel
// Create ErrorException and log
$exception = new \ErrorException($message, 0, $severity, $file, $line);
$this->reporter->report($exception);
if ($this->reporter !== null) {
$this->reporter->report($exception);
}
// Auto-trigger pattern detection if aggregator is available
if ($this->errorAggregator !== null && $this->contextProvider !== null) {
@@ -136,7 +138,9 @@ final readonly class ErrorKernel
// Create ErrorException and log
$exception = new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
$this->reporter->report($exception);
if ($this->reporter !== null) {
$this->reporter->report($exception);
}
// Auto-trigger pattern detection if aggregator is available
if ($this->errorAggregator !== null && $this->contextProvider !== null) {

View File

@@ -109,9 +109,9 @@ final readonly class ExceptionMetricsCollector
private function getMetricValue(CacheKey $cacheKey): int
{
$result = $this->cache->get($cacheKey);
$item = $result->getFirstHit();
$item = $result->getItem($cacheKey);
if ($item === null) {
if (!$item->isHit) {
return 0;
}
@@ -135,9 +135,9 @@ final readonly class ExceptionMetricsCollector
{
$cacheKey = CacheKey::fromString(self::CACHE_PREFIX . 'execution_times');
$result = $this->cache->get($cacheKey);
$item = $result->getFirstHit();
$item = $result->getItem($cacheKey);
$times = $item !== null && is_array($item->value) ? $item->value : [];
$times = $item->isHit && is_array($item->value) ? $item->value : [];
$times[] = $executionTimeMs;
// Keep only last 1000 execution times
@@ -161,9 +161,9 @@ final readonly class ExceptionMetricsCollector
{
$cacheKey = CacheKey::fromString(self::CACHE_PREFIX . 'execution_times');
$result = $this->cache->get($cacheKey);
$item = $result->getFirstHit();
$item = $result->getItem($cacheKey);
if ($item === null || !is_array($item->value)) {
if (!$item->isHit || !is_array($item->value)) {
return 0.0;
}

View File

@@ -133,9 +133,9 @@ final readonly class ExceptionRateLimiter
private function getCachedCount(CacheKey $cacheKey): int
{
$result = $this->cache->get($cacheKey);
$item = $result->getFirstHit();
$item = $result->getItem($cacheKey);
if ($item === null) {
if (!$item->isHit) {
return 0;
}

View File

@@ -202,6 +202,7 @@ final readonly class ResponseErrorRenderer implements ErrorRenderer
private function getTemplateName(int $statusCode): string
{
return match ($statusCode) {
403 => 'errors/403',
404 => 'errors/404',
500 => 'errors/500',
default => 'errors/error',
@@ -437,6 +438,14 @@ HTML;
*/
private function getHttpStatusCode(\Throwable $exception): int
{
// Map security exceptions to 403 Forbidden
// Check for specific security exceptions first
if ($exception instanceof \App\Framework\Exception\Security\CsrfValidationFailedException ||
$exception instanceof \App\Framework\Exception\Security\HoneypotTriggeredException ||
$exception instanceof \App\Framework\Exception\SecurityException) {
return 403;
}
// Use exception code if it's a valid HTTP status code
$code = $exception->getCode();
if ($code >= 400 && $code < 600) {