From f27b6901cb55eb2b139c5bbfebce5c105e7de100 Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Sat, 23 Jan 2021 16:52:12 +0200 Subject: [PATCH] Revert "Fixed mc" This reverts commit 54a20aec4657300584ce9320b52f5d64e38fb3d0, reversing changes made to a84f143087a44522f524204d8805cd52d417d48a. --- src/Statistics/Http/Middleware/Authorize.php | 17 --------- .../WebSocketsStatisticsControllerTest.php | 38 ------------------- 2 files changed, 55 deletions(-) delete mode 100644 src/Statistics/Http/Middleware/Authorize.php delete mode 100644 tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php diff --git a/src/Statistics/Http/Middleware/Authorize.php b/src/Statistics/Http/Middleware/Authorize.php deleted file mode 100644 index 4611dc5..0000000 --- a/src/Statistics/Http/Middleware/Authorize.php +++ /dev/null @@ -1,17 +0,0 @@ -key); - - return is_null($app) || $app->secret !== $request->secret - ? abort(403) - : $next($request); - } -} diff --git a/tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php b/tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php deleted file mode 100644 index beede8a..0000000 --- a/tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php +++ /dev/null @@ -1,38 +0,0 @@ -post( - action([WebSocketStatisticsEntriesController::class, 'store']), - array_merge($this->payload(), [ - 'key' => config('websockets.apps.0.key'), - 'secret' => config('websockets.apps.0.secret'), - ]) - ); - - $entries = WebSocketsStatisticsEntry::get(); - - $this->assertCount(1, $entries); - - $this->assertArrayHasKey('app_id', $entries->first()->attributesToArray()); - } - - protected function payload(): array - { - return [ - 'app_id' => config('websockets.apps.0.id'), - 'peak_connection_count' => 1, - 'websocket_message_count' => 2, - 'api_message_count' => 3, - ]; - } -}