@@ -207,7 +207,7 @@ private function handleAllowListDecisions(array $allowlists): array
207
207
}
208
208
}
209
209
} 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 ' , [
211
211
'type ' => 'CAPI_REM_HANDLE_ALLOW_LIST_DECISIONS ' ,
212
212
'message ' => $ e ->getMessage (),
213
213
'code ' => $ e ->getCode (),
@@ -232,15 +232,19 @@ private function handleAllowListResponse(string $listResponse, array $allowDecis
232
232
{
233
233
$ decisions = [];
234
234
$ listedAllows = explode (\PHP_EOL , $ listResponse );
235
- $ this ->logger ->debug ('Handle allow list decisions ' , [
235
+ $ this ->logger ->debug ('Handle allowlists decisions ' , [
236
236
'type ' => 'CAPI_REM_HANDLE_ALLOW_LIST_DECISIONS ' ,
237
237
'list_count ' => count ($ listedAllows ),
238
238
]);
239
239
foreach ($ listedAllows as $ listedAllow ) {
240
240
$ decoded = json_decode ($ listedAllow , true );
241
241
$ allowDecision ['value ' ] = $ decoded ['value ' ];
242
242
$ 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 ' ;
244
248
$ decision = $ this ->convertRawDecision ($ allowDecision );
245
249
246
250
if ($ decision ) {
@@ -317,7 +321,7 @@ private function handleListDecisions(array $blocklists): array
317
321
}
318
322
}
319
323
} 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 ' , [
321
325
'type ' => 'CAPI_REM_HANDLE_LIST_DECISIONS ' ,
322
326
'message ' => $ e ->getMessage (),
323
327
'code ' => $ e ->getCode (),
@@ -351,7 +355,7 @@ private function handleListResponse(string $listResponse, array $blockDecision):
351
355
{
352
356
$ decisions = [];
353
357
$ listedIps = explode (\PHP_EOL , $ listResponse );
354
- $ this ->logger ->debug ('Handle list decisions ' , [
358
+ $ this ->logger ->debug ('Handle blocklist decisions ' , [
355
359
'type ' => 'CAPI_REM_HANDLE_LIST_DECISIONS ' ,
356
360
'list_count ' => count ($ listedIps ),
357
361
]);
0 commit comments