fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled
Some checks failed
Deploy Application / deploy (push) Has been cancelled
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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: '');
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user