Skip to content

Commit 27abce7

Browse files
feat(*): Prepare release 4.3.0
1 parent be00db2 commit 27abce7

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ As far as possible, we try to adhere to [Symfony guidelines](https://symfony.com
1515

1616
---
1717

18-
## [4.3.0](https://github.com/crowdsecurity/php-remediation-engine/releases/tag/v4.3.0) - 2025-04-??
19-
[_Compare with previous release_](https://github.com/crowdsecurity/php-remediation-engine/compare/v4.2.0...HEAD)
18+
## [4.3.0](https://github.com/crowdsecurity/php-remediation-engine/releases/tag/v4.3.0) - 2025-04-11
19+
[_Compare with previous release_](https://github.com/crowdsecurity/php-remediation-engine/compare/v4.2.0...v4.3.0)
2020

2121

2222
### Added

src/AbstractRemediation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ private function validateRawDecision(array $rawDecision): bool
561561
&& !empty($rawDecision['duration'])
562562
) {
563563
$result = true;
564-
// We don't want blocklists decisions without a scenario
564+
// We don't want blocklists or allowlists decisions without a scenario
565565
if (
566566
Constants::ORIGIN_LISTS === $rawDecision['origin']
567567
&& empty($rawDecision['scenario'])

src/CapiRemediation.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private function handleAllowListDecisions(array $allowlists): array
207207
}
208208
}
209209
} catch (\Exception $e) {
210-
$this->logger->info('Something went wrong during list decisions process', [
210+
$this->logger->info('Something went wrong during allowlists decisions process', [
211211
'type' => 'CAPI_REM_HANDLE_ALLOW_LIST_DECISIONS',
212212
'message' => $e->getMessage(),
213213
'code' => $e->getCode(),
@@ -232,15 +232,19 @@ private function handleAllowListResponse(string $listResponse, array $allowDecis
232232
{
233233
$decisions = [];
234234
$listedAllows = explode(\PHP_EOL, $listResponse);
235-
$this->logger->debug('Handle allow list decisions', [
235+
$this->logger->debug('Handle allowlists decisions', [
236236
'type' => 'CAPI_REM_HANDLE_ALLOW_LIST_DECISIONS',
237237
'list_count' => count($listedAllows),
238238
]);
239239
foreach ($listedAllows as $listedAllow) {
240240
$decoded = json_decode($listedAllow, true);
241241
$allowDecision['value'] = $decoded['value'];
242242
$allowDecision['scope'] = $decoded['scope'];
243-
$allowDecision['duration'] = '1s'; // Will be overwritten by the duration in the allowlist
243+
/*
244+
* This hardcoded value ill be overwritten below by the duration in the allowlist.
245+
* We have to set it to avoid an exception from the convertRawDecision method.
246+
*/
247+
$allowDecision['duration'] = '1s';
244248
$decision = $this->convertRawDecision($allowDecision);
245249

246250
if ($decision) {
@@ -317,7 +321,7 @@ private function handleListDecisions(array $blocklists): array
317321
}
318322
}
319323
} catch (\Exception $e) {
320-
$this->logger->info('Something went wrong during list decisions process', [
324+
$this->logger->info('Something went wrong during blocklists decisions process', [
321325
'type' => 'CAPI_REM_HANDLE_LIST_DECISIONS',
322326
'message' => $e->getMessage(),
323327
'code' => $e->getCode(),
@@ -351,7 +355,7 @@ private function handleListResponse(string $listResponse, array $blockDecision):
351355
{
352356
$decisions = [];
353357
$listedIps = explode(\PHP_EOL, $listResponse);
354-
$this->logger->debug('Handle list decisions', [
358+
$this->logger->debug('Handle blocklist decisions', [
355359
'type' => 'CAPI_REM_HANDLE_LIST_DECISIONS',
356360
'list_count' => count($listedIps),
357361
]);

src/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ class Constants extends CommonConstants
9898
/**
9999
* @var string The current version of this library
100100
*/
101-
public const VERSION = 'v4.2.0';
101+
public const VERSION = 'v4.3.0';
102102
}

0 commit comments

Comments
 (0)