for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Lyal\Checkr\Laravel\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Log;
class Webhook
{
public function handle($request, Closure $next)
if (stripos($request->header('User-Agent'), 'Checkr-Webhook') === false) {
Log::alert('Invalid user agent for Checkr webhook');
abort(404);
abort
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
}
if (hash_hmac('SHA256', $request->getContent(), env('checkr_api_key')) !== $request->header('X-Checkr-Signature')) {
Log::alert('Checkr signature does not match request.');
return $next($request);