style updates
This commit is contained in:
@@ -13,7 +13,7 @@ class InternalApiServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Route::middleware('api')->prefix('api/internal')->group(__DIR__.'/../routes/api.php');
|
||||
Route::middleware('api')->prefix('api/internal')->group(__DIR__ . '/../routes/api.php');
|
||||
app('router')->aliasMiddleware('internal.signed', VerifyInternalApiSignature::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ class VerifyInternalApiSignature
|
||||
|
||||
$body = $request->getContent();
|
||||
$payloads = array_unique([
|
||||
$timestamp.'.'.$body,
|
||||
$timestamp.'.',
|
||||
$timestamp.'.[]',
|
||||
$timestamp . '.' . $body,
|
||||
$timestamp . '.',
|
||||
$timestamp . '.[]',
|
||||
]);
|
||||
|
||||
foreach ($payloads as $payload) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class InternalApiSignatureTest extends TestCase
|
||||
config(['platform.internal_api_key' => 'testing-secret']);
|
||||
$timestamp = now()->toIso8601String();
|
||||
$body = '';
|
||||
$signature = hash_hmac('sha256', $timestamp.'.'.$body, 'testing-secret');
|
||||
$signature = hash_hmac('sha256', $timestamp . '.' . $body, 'testing-secret');
|
||||
|
||||
$this->withHeaders([
|
||||
'X-WMS-Timestamp' => $timestamp,
|
||||
|
||||
Reference in New Issue
Block a user