@@ -84,6 +84,9 @@ public function bounceCurrentIp(): void
84
84
$ forcedTestIp = $ this ->getConfig ('forced_test_ip ' );
85
85
$ ip = $ forcedTestIp ?: $ this ->getRemoteIp ();
86
86
$ ip = $ this ->handleForwardedFor ($ ip , $ this ->configs );
87
+ $ this ->logger ->info ('Bouncing current IP ' , [
88
+ 'ip ' => $ ip ,
89
+ ]);
87
90
$ remediation = $ this ->getRemediationForIp ($ ip );
88
91
$ this ->handleRemediation ($ remediation , $ ip );
89
92
}
@@ -356,9 +359,15 @@ protected function handleRemediation(string $remediation, string $ip): void
356
359
{
357
360
switch ($ remediation ) {
358
361
case Constants::REMEDIATION_CAPTCHA :
362
+ $ this ->logger ->debug ('Will display a captcha wall ' , [
363
+ 'ip ' => $ ip ,
364
+ ]);
359
365
$ this ->handleCaptchaRemediation ($ ip );
360
366
break ;
361
367
case Constants::REMEDIATION_BAN :
368
+ $ this ->logger ->debug ('Will display a ban wall ' , [
369
+ 'ip ' => $ ip ,
370
+ ]);
362
371
$ this ->handleBanRemediation ();
363
372
break ;
364
373
case Constants::REMEDIATION_BYPASS :
@@ -454,11 +463,19 @@ private function capRemediationLevel(string $remediation): string
454
463
$ maxRemediationLevel ,
455
464
$ orderedRemediations
456
465
);
466
+ $ finalRemediation = $ remediation ;
457
467
if ($ currentIndex < $ maxIndex ) {
458
- return $ orderedRemediations [$ maxIndex ];
468
+ $ finalRemediation = $ orderedRemediations [$ maxIndex ];
469
+ $ this ->logger ->debug ('Original remediation has been capped ' , [
470
+ 'origin ' => $ remediation ,
471
+ 'final ' => $ finalRemediation
472
+ ]);
459
473
}
474
+ $ this ->logger ->info ('Final remediation ' , [
475
+ 'remediation ' => $ finalRemediation ,
476
+ ]);
460
477
461
- return $ remediation ;
478
+ return $ finalRemediation ;
462
479
}
463
480
464
481
/**
@@ -614,6 +631,9 @@ private function handleCaptchaRemediation(string $ip): void
614
631
if (null === $ cachedCaptchaVariables ['has_to_be_resolved ' ]) {
615
632
// Set up the first captcha remediation.
616
633
$ mustResolve = true ;
634
+ $ this ->logger ->debug ('First captcha resolution ' , [
635
+ 'ip ' => $ ip ,
636
+ ]);
617
637
$ this ->initCaptchaResolution ($ ip );
618
638
}
619
639
0 commit comments