Primo Committ
This commit is contained in:
26
vendor/facade/flare-client-php/src/Middleware/AddGlows.php
vendored
Normal file
26
vendor/facade/flare-client-php/src/Middleware/AddGlows.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\FlareClient\Middleware;
|
||||
|
||||
use Facade\FlareClient\Glows\Recorder;
|
||||
use Facade\FlareClient\Report;
|
||||
|
||||
class AddGlows
|
||||
{
|
||||
/** @var Recorder */
|
||||
private $recorder;
|
||||
|
||||
public function __construct(Recorder $recorder)
|
||||
{
|
||||
$this->recorder = $recorder;
|
||||
}
|
||||
|
||||
public function handle(Report $report, $next)
|
||||
{
|
||||
foreach ($this->recorder->glows() as $glow) {
|
||||
$report->addGlow($glow);
|
||||
}
|
||||
|
||||
return $next($report);
|
||||
}
|
||||
}
|
||||
19
vendor/facade/flare-client-php/src/Middleware/AnonymizeIp.php
vendored
Normal file
19
vendor/facade/flare-client-php/src/Middleware/AnonymizeIp.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\FlareClient\Middleware;
|
||||
|
||||
use Facade\FlareClient\Report;
|
||||
|
||||
class AnonymizeIp
|
||||
{
|
||||
public function handle(Report $report, $next)
|
||||
{
|
||||
$context = $report->allContext();
|
||||
|
||||
$context['request']['ip'] = null;
|
||||
|
||||
$report->userProvidedContext($context);
|
||||
|
||||
return $next($report);
|
||||
}
|
||||
}
|
||||
30
vendor/facade/flare-client-php/src/Middleware/CensorRequestBodyFields.php
vendored
Normal file
30
vendor/facade/flare-client-php/src/Middleware/CensorRequestBodyFields.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\FlareClient\Middleware;
|
||||
|
||||
use Facade\FlareClient\Report;
|
||||
|
||||
class CensorRequestBodyFields
|
||||
{
|
||||
protected $fieldNames = [];
|
||||
|
||||
public function __construct(array $fieldNames)
|
||||
{
|
||||
$this->fieldNames = $fieldNames;
|
||||
}
|
||||
|
||||
public function handle(Report $report, $next)
|
||||
{
|
||||
$context = $report->allContext();
|
||||
|
||||
foreach ($this->fieldNames as $fieldName) {
|
||||
if (isset($context['request_data']['body'][$fieldName])) {
|
||||
$context['request_data']['body'][$fieldName] = '<CENSORED>';
|
||||
}
|
||||
}
|
||||
|
||||
$report->userProvidedContext($context);
|
||||
|
||||
return $next($report);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user