diff --git a/app/Contracts/Repository/DaemonKeyRepositoryInterface.php b/app/Contracts/Repository/DaemonKeyRepositoryInterface.php deleted file mode 100644 index e1f18b502..000000000 --- a/app/Contracts/Repository/DaemonKeyRepositoryInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - 'integer', - 'server_id' => 'integer', - ]; - - /** - * @var array - */ - protected $dates = [ - self::CREATED_AT, - self::UPDATED_AT, - 'expires_at', - ]; - - /** - * @var array - */ - protected $fillable = ['user_id', 'server_id', 'secret', 'expires_at']; - - /** - * @var array - */ - public static $validationRules = [ - 'user_id' => 'required|numeric|exists:users,id', - 'server_id' => 'required|numeric|exists:servers,id', - 'secret' => 'required|string|min:20', - 'expires_at' => 'required|date', - ]; - - /** - * Return the server relation. - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function server() - { - return $this->belongsTo(Server::class); - } - - /** - * Return the node relation. - * - * @return \Znck\Eloquent\Relations\BelongsToThrough - * @throws \Exception - */ - public function node() - { - return $this->belongsToThrough(Node::class, Server::class); - } - - /** - * Return the user relation. - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function user() - { - return $this->belongsTo(User::class); - } -} diff --git a/app/Models/Server.php b/app/Models/Server.php index 3ccf9eadb..f6de3516c 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -47,8 +47,6 @@ use Znck\Eloquent\Traits\BelongsToThrough; * @property \Pterodactyl\Models\Schedule[]|\Illuminate\Database\Eloquent\Collection $schedule * @property \Pterodactyl\Models\Database[]|\Illuminate\Database\Eloquent\Collection $databases * @property \Pterodactyl\Models\Location $location - * @property \Pterodactyl\Models\DaemonKey $key - * @property \Pterodactyl\Models\DaemonKey[]|\Illuminate\Database\Eloquent\Collection $keys * @property \Pterodactyl\Models\ServerTransfer $transfer * @property \Pterodactyl\Models\Backup[]|\Illuminate\Database\Eloquent\Collection $backups * @property \Pterodactyl\Models\Mount[]|\Illuminate\Database\Eloquent\Collection $mounts @@ -294,26 +292,6 @@ class Server extends Model return $this->belongsToThrough(Location::class, Node::class); } - /** - * Return the key belonging to the server owner. - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function key() - { - return $this->hasOne(DaemonKey::class, 'user_id', 'owner_id'); - } - - /** - * Returns all of the daemon keys belonging to this server. - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function keys() - { - return $this->hasMany(DaemonKey::class); - } - /** * Returns the associated server transfer. * diff --git a/app/Models/Subuser.php b/app/Models/Subuser.php index d75bbe9ab..ab85b85dd 100644 --- a/app/Models/Subuser.php +++ b/app/Models/Subuser.php @@ -99,14 +99,4 @@ class Subuser extends Model { return $this->hasMany(Permission::class); } - - /** - * Return the key that belongs to this subuser for the server. - * - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function key() - { - return $this->hasOne(DaemonKey::class, 'server_id', 'server_id')->where('daemon_keys.user_id', '=', $this->user_id); - } } diff --git a/app/Models/User.php b/app/Models/User.php index d8b0cc0eb..d2761bd72 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -38,7 +38,6 @@ use Pterodactyl\Notifications\SendPasswordReset as ResetPasswordNotification; * @property string $name * @property \Pterodactyl\Models\ApiKey[]|\Illuminate\Database\Eloquent\Collection $apiKeys * @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers - * @property \Pterodactyl\Models\DaemonKey[]|\Illuminate\Database\Eloquent\Collection $keys * @property \Pterodactyl\Models\RecoveryToken[]|\Illuminate\Database\Eloquent\Collection $recoveryTokens */ class User extends Model implements @@ -214,16 +213,6 @@ class User extends Model implements return $this->hasMany(Server::class, 'owner_id'); } - /** - * Return all of the daemon keys that a user belongs to. - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function keys() - { - return $this->hasMany(DaemonKey::class); - } - /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Providers/RepositoryServiceProvider.php b/app/Providers/RepositoryServiceProvider.php index 4f1797edc..8a0434f52 100644 --- a/app/Providers/RepositoryServiceProvider.php +++ b/app/Providers/RepositoryServiceProvider.php @@ -16,7 +16,6 @@ use Pterodactyl\Repositories\Eloquent\DatabaseRepository; use Pterodactyl\Repositories\Eloquent\LocationRepository; use Pterodactyl\Repositories\Eloquent\ScheduleRepository; use Pterodactyl\Repositories\Eloquent\SettingsRepository; -use Pterodactyl\Repositories\Eloquent\DaemonKeyRepository; use Pterodactyl\Repositories\Eloquent\AllocationRepository; use Pterodactyl\Contracts\Repository\EggRepositoryInterface; use Pterodactyl\Repositories\Eloquent\EggVariableRepository; @@ -34,7 +33,6 @@ use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface; use Pterodactyl\Contracts\Repository\LocationRepositoryInterface; use Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface; use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface; -use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; use Pterodactyl\Contracts\Repository\EggVariableRepositoryInterface; use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface; @@ -50,7 +48,6 @@ class RepositoryServiceProvider extends ServiceProvider // Eloquent Repositories $this->app->bind(AllocationRepositoryInterface::class, AllocationRepository::class); $this->app->bind(ApiKeyRepositoryInterface::class, ApiKeyRepository::class); - $this->app->bind(DaemonKeyRepositoryInterface::class, DaemonKeyRepository::class); $this->app->bind(DatabaseRepositoryInterface::class, DatabaseRepository::class); $this->app->bind(DatabaseHostRepositoryInterface::class, DatabaseHostRepository::class); $this->app->bind(EggRepositoryInterface::class, EggRepository::class); diff --git a/app/Repositories/Eloquent/DaemonKeyRepository.php b/app/Repositories/Eloquent/DaemonKeyRepository.php deleted file mode 100644 index 2f11ff962..000000000 --- a/app/Repositories/Eloquent/DaemonKeyRepository.php +++ /dev/null @@ -1,87 +0,0 @@ -relationLoaded('server') || $refresh) { - $key->load('server'); - } - - if (! $key->relationLoaded('user') || $refresh) { - $key->load('user'); - } - - return $key; - } - - /** - * Return a daemon key with the associated server relation attached. - * - * @param string $key - * @return \Pterodactyl\Models\DaemonKey - * - * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException - */ - public function getKeyWithServer(string $key): DaemonKey - { - Assert::notEmpty($key, 'Expected non-empty string as first argument passed to ' . __METHOD__); - - try { - return $this->getBuilder()->with('server')->where('secret', '=', $key)->firstOrFail($this->getColumns()); - } catch (ModelNotFoundException $exception) { - throw new RecordNotFoundException; - } - } - - /** - * Get all of the keys for a specific user including the information needed - * from their server relation for revocation on the daemon. - * - * @param \Pterodactyl\Models\User $user - * @return \Illuminate\Support\Collection - */ - public function getKeysForRevocation(User $user): Collection - { - return $this->getBuilder()->with('node')->where('user_id', $user->id)->get($this->getColumns()); - } - - /** - * Delete an array of daemon keys from the database. Used primarily in - * conjunction with getKeysForRevocation. - * - * @param array $ids - * @return bool|int - */ - public function deleteKeys(array $ids) - { - return $this->getBuilder()->whereIn('id', $ids)->delete(); - } -} diff --git a/app/Transformers/Daemon/ApiKeyTransformer.php b/app/Transformers/Daemon/ApiKeyTransformer.php deleted file mode 100644 index 292cd6fcf..000000000 --- a/app/Transformers/Daemon/ApiKeyTransformer.php +++ /dev/null @@ -1,76 +0,0 @@ -repository = $repository; - $this->keyRepository = $keyRepository; - } - - /** - * Return a listing of servers that a daemon key can access. - * - * @param \Pterodactyl\Models\DaemonKey $key - * @return array - * - * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException - */ - public function transform(DaemonKey $key) - { - $this->keyRepository->loadServerAndUserRelations($key); - - if ($key->user_id === $key->getRelation('server')->owner_id || $key->getRelation('user')->root_admin) { - return [ - 'id' => $key->getRelation('server')->uuid, - 'is_temporary' => true, - 'expires_in' => max(Carbon::now()->diffInSeconds($key->expires_at, false), 0), - 'permissions' => ['s:*'], - ]; - } - - $subuser = $this->repository->getWithPermissionsUsingUserAndServer($key->user_id, $key->server_id); - - $permissions = $subuser->getRelation('permissions')->pluck('permission')->toArray(); - $mappings = Permission::getPermissions(true); - $daemonPermissions = ['s:console']; - - foreach ($permissions as $permission) { - if (! is_null(array_get($mappings, $permission))) { - $daemonPermissions[] = array_get($mappings, $permission); - } - } - - return [ - 'id' => $key->getRelation('server')->uuid, - 'is_temporary' => true, - 'expires_in' => max(Carbon::now()->diffInSeconds($key->expires_at, false), 0), - 'permissions' => $daemonPermissions, - ]; - } -} diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 60e068941..0525c30be 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -181,13 +181,6 @@ $factory->define(Pterodactyl\Models\Task::class, function (Faker $faker) { ]; }); -$factory->define(Pterodactyl\Models\DaemonKey::class, function (Faker $faker) { - return [ - 'secret' => 'i_' . str_random(40), - 'expires_at' => \Carbon\Carbon::now()->addMinutes(10)->toDateTimeString(), - ]; -}); - $factory->define(Pterodactyl\Models\ApiKey::class, function (Faker $faker) { static $token; diff --git a/database/migrations/2020_09_13_113503_drop_daemon_key_table.php b/database/migrations/2020_09_13_113503_drop_daemon_key_table.php new file mode 100644 index 000000000..e418a85e9 --- /dev/null +++ b/database/migrations/2020_09_13_113503_drop_daemon_key_table.php @@ -0,0 +1,40 @@ +increments('id'); + $table->unsignedInteger('server_id'); + $table->unsignedInteger('user_id'); + $table->string('secret')->unique(); + $table->timestamp('expires_at'); + $table->timestamps(); + }); + + Schema::table('daemon_keys', function (Blueprint $table) { + $table->foreign('server_id')->references('id')->on('servers')->cascadeOnDelete(); + $table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete(); + }); + } +} diff --git a/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php b/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php index 4a331c04f..c8a71577e 100644 --- a/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php +++ b/tests/Unit/Services/Subusers/SubuserCreationServiceTest.php @@ -11,9 +11,7 @@ use Illuminate\Database\ConnectionInterface; use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Services\Users\UserCreationService; use Pterodactyl\Services\Subusers\SubuserCreationService; -use Pterodactyl\Services\Subusers\PermissionCreationService; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService; use Pterodactyl\Exceptions\Repository\RecordNotFoundException; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; @@ -28,17 +26,7 @@ class SubuserCreationServiceTest extends TestCase protected $connection; /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService|\Mockery\Mock - */ - protected $keyCreationService; - - /** - * @var \Pterodactyl\Services\Subusers\PermissionCreationService|\Mockery\Mock - */ - protected $permissionService; - - /** - * @var \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface|\Mockery\Mock + * @var \Pterodactyl\Repositories\Eloquent\SubuserRepository|\Mockery\Mock */ protected $subuserRepository; @@ -70,8 +58,6 @@ class SubuserCreationServiceTest extends TestCase parent::setUp(); $this->connection = m::mock(ConnectionInterface::class); - $this->keyCreationService = m::mock(DaemonKeyCreationService::class); - $this->permissionService = m::mock(PermissionCreationService::class); $this->subuserRepository = m::mock(SubuserRepositoryInterface::class); $this->serverRepository = m::mock(ServerRepositoryInterface::class); $this->userCreationService = m::mock(UserCreationService::class); @@ -107,8 +93,6 @@ class SubuserCreationServiceTest extends TestCase $this->subuserRepository->shouldReceive('create')->with(['user_id' => $user->id, 'server_id' => $server->id]) ->once()->andReturn($subuser); - $this->keyCreationService->shouldReceive('handle')->with($server->id, $user->id)->once()->andReturnNull(); - $this->permissionService->shouldReceive('handle')->with($subuser->id, array_keys($permissions))->once()->andReturnNull(); $this->connection->shouldReceive('commit')->withNoArgs()->once()->andReturnNull(); $response = $this->getService()->handle($server, $user->email, array_keys($permissions)); @@ -136,8 +120,6 @@ class SubuserCreationServiceTest extends TestCase $this->subuserRepository->shouldReceive('create')->with(['user_id' => $user->id, 'server_id' => $server->id]) ->once()->andReturn($subuser); - $this->keyCreationService->shouldReceive('handle')->with($server->id, $user->id)->once()->andReturnNull(); - $this->permissionService->shouldReceive('handle')->with($subuser->id, $permissions)->once()->andReturnNull(); $this->connection->shouldReceive('commit')->withNoArgs()->once()->andReturnNull(); $response = $this->getService()->handle($server->id, $user->email, $permissions); @@ -196,9 +178,6 @@ class SubuserCreationServiceTest extends TestCase { return new SubuserCreationService( $this->connection, - $this->keyCreationService, - $this->permissionService, - $this->serverRepository, $this->subuserRepository, $this->userCreationService, $this->userRepository diff --git a/tests/Unit/Services/Subusers/SubuserUpdateServiceTest.php b/tests/Unit/Services/Subusers/SubuserUpdateServiceTest.php deleted file mode 100644 index dd599c2d6..000000000 --- a/tests/Unit/Services/Subusers/SubuserUpdateServiceTest.php +++ /dev/null @@ -1,147 +0,0 @@ -. - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ - -namespace Tests\Unit\Services\Subusers; - -use Mockery as m; -use Tests\TestCase; -use Pterodactyl\Models\User; -use GuzzleHttp\Psr7\Response; -use Pterodactyl\Models\Server; -use Pterodactyl\Models\Subuser; -use Tests\Traits\MocksRequestException; -use GuzzleHttp\Exception\RequestException; -use Illuminate\Database\ConnectionInterface; -use Pterodactyl\Exceptions\PterodactylException; -use Pterodactyl\Services\Subusers\SubuserUpdateService; -use Pterodactyl\Services\Subusers\PermissionCreationService; -use Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Contracts\Repository\PermissionRepositoryInterface; -use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException; -use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface; - -class SubuserUpdateServiceTest extends TestCase -{ - use MocksRequestException; - - /** - * @var \Illuminate\Database\ConnectionInterface|\Mockery\Mock - */ - private $connection; - - /** - * @var \Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface|\Mockery\Mock - */ - private $daemonRepository; - - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService|\Mockery\Mock - */ - private $keyProviderService; - - /** - * @var \Pterodactyl\Contracts\Repository\PermissionRepositoryInterface|\Mockery\Mock - */ - private $permissionRepository; - - /** - * @var \Pterodactyl\Services\Subusers\PermissionCreationService|\Mockery\Mock - */ - private $permissionService; - - /** - * @var \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface|\Mockery\Mock - */ - private $repository; - - /** - * Setup tests. - */ - public function setUp(): void - { - parent::setUp(); - - $this->connection = m::mock(ConnectionInterface::class); - $this->daemonRepository = m::mock(DaemonServerRepositoryInterface::class); - $this->keyProviderService = m::mock(DaemonKeyProviderService::class); - $this->permissionRepository = m::mock(PermissionRepositoryInterface::class); - $this->permissionService = m::mock(PermissionCreationService::class); - $this->repository = m::mock(SubuserRepositoryInterface::class); - } - - /** - * Test that permissions are updated in the database. - */ - public function testPermissionsAreUpdated() - { - $subuser = factory(Subuser::class)->make(); - $subuser->setRelation('server', factory(Server::class)->make()); - $subuser->setRelation('user', factory(User::class)->make()); - - $this->repository->shouldReceive('loadServerAndUserRelations')->with($subuser)->once()->andReturn($subuser); - $this->connection->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->permissionRepository->shouldReceive('deleteWhere')->with([['subuser_id', '=', $subuser->id]])->once()->andReturn(1); - $this->permissionService->shouldReceive('handle')->with($subuser->id, ['some-permission'])->once()->andReturnNull(); - - $this->keyProviderService->shouldReceive('handle')->with($subuser->server, $subuser->user, false)->once()->andReturn('test123'); - $this->daemonRepository->shouldReceive('setServer')->with($subuser->server)->once()->andReturnSelf(); - $this->daemonRepository->shouldReceive('revokeAccessKey')->with('test123')->once()->andReturn(new Response); - - $this->connection->shouldReceive('commit')->withNoArgs()->once()->andReturnNull(); - - $this->getService()->handle($subuser, ['some-permission']); - $this->assertTrue(true); - } - - /** - * Test that an exception is thrown if the daemon connection fails. - */ - public function testExceptionIsThrownIfDaemonConnectionFails() - { - $this->configureExceptionMock(); - - $subuser = factory(Subuser::class)->make(); - $subuser->setRelation('server', factory(Server::class)->make()); - $subuser->setRelation('user', factory(User::class)->make()); - - $this->repository->shouldReceive('loadServerAndUserRelations')->with($subuser)->once()->andReturn($subuser); - $this->connection->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->permissionRepository->shouldReceive('deleteWhere')->with([['subuser_id', '=', $subuser->id]])->once()->andReturn(1); - $this->permissionService->shouldReceive('handle')->with($subuser->id, [])->once()->andReturnNull(); - - $this->keyProviderService->shouldReceive('handle')->with($subuser->server, $subuser->user, false)->once()->andReturn('test123'); - $this->daemonRepository->shouldReceive('setServer')->with($subuser->server)->once()->andThrow($this->getExceptionMock()); - $this->connection->shouldReceive('rollBack')->withNoArgs()->once()->andReturnNull(); - - try { - $this->getService()->handle($subuser, []); - } catch (PterodactylException $exception) { - $this->assertInstanceOf(DaemonConnectionException::class, $exception); - $this->assertInstanceOf(RequestException::class, $exception->getPrevious()); - } - } - - /** - * Return an instance of the service with mocked dependencies for testing. - * - * @return \Pterodactyl\Services\Subusers\SubuserUpdateService - */ - private function getService(): SubuserUpdateService - { - return new SubuserUpdateService( - $this->connection, - $this->keyProviderService, - $this->daemonRepository, - $this->permissionService, - $this->permissionRepository, - $this->repository - ); - } -} diff --git a/tests/Unit/Services/Users/UserUpdateServiceTest.php b/tests/Unit/Services/Users/UserUpdateServiceTest.php index 8435115b9..dd4eca36e 100644 --- a/tests/Unit/Services/Users/UserUpdateServiceTest.php +++ b/tests/Unit/Services/Users/UserUpdateServiceTest.php @@ -9,7 +9,6 @@ use Illuminate\Support\Collection; use Illuminate\Contracts\Hashing\Hasher; use Pterodactyl\Services\Users\UserUpdateService; use Pterodactyl\Contracts\Repository\UserRepositoryInterface; -use Pterodactyl\Services\DaemonKeys\RevokeMultipleDaemonKeysService; class UserUpdateServiceTest extends TestCase { @@ -19,15 +18,10 @@ class UserUpdateServiceTest extends TestCase private $hasher; /** - * @var \Pterodactyl\Contracts\Repository\UserRepositoryInterface|\Mockery\Mock + * @var \Pterodactyl\Repositories\Eloquent\UserRepository|\Mockery\Mock */ private $repository; - /** - * @var \Pterodactyl\Services\DaemonKeys\RevokeMultipleDaemonKeysService|\Mockery\Mock - */ - private $revocationService; - /** * Setup tests. */ @@ -37,7 +31,6 @@ class UserUpdateServiceTest extends TestCase $this->hasher = m::mock(Hasher::class); $this->repository = m::mock(UserRepositoryInterface::class); - $this->revocationService = m::mock(RevokeMultipleDaemonKeysService::class); } /** @@ -49,7 +42,6 @@ class UserUpdateServiceTest extends TestCase public function testUpdateUserWithoutTouchingHasherIfNoPasswordPassed(array $data) { $user = factory(User::class)->make(); - $this->revocationService->shouldReceive('getExceptions')->withNoArgs()->once()->andReturn([]); $this->repository->shouldReceive('update')->with($user->id, ['test-data' => 'value'])->once()->andReturnNull(); $response = $this->getService()->handle($user, $data); @@ -80,7 +72,6 @@ class UserUpdateServiceTest extends TestCase { $user = factory(User::class)->make(); $this->hasher->shouldReceive('make')->with('raw_pass')->once()->andReturn('enc_pass'); - $this->revocationService->shouldReceive('getExceptions')->withNoArgs()->once()->andReturn([]); $this->repository->shouldReceive('update')->with($user->id, ['password' => 'enc_pass'])->once()->andReturnNull(); $response = $this->getService()->handle($user, ['password' => 'raw_pass']); @@ -98,8 +89,6 @@ class UserUpdateServiceTest extends TestCase $service = $this->getService(); $service->setUserLevel(User::USER_LEVEL_ADMIN); - $this->revocationService->shouldReceive('handle')->with($user, false)->once()->andReturnNull(); - $this->revocationService->shouldReceive('getExceptions')->withNoArgs()->once()->andReturn([]); $this->repository->shouldReceive('update')->with($user->id, ['root_admin' => false])->once()->andReturnNull(); $response = $service->handle($user, ['root_admin' => false]); @@ -117,7 +106,6 @@ class UserUpdateServiceTest extends TestCase $service = $this->getService(); $service->setUserLevel(User::USER_LEVEL_USER); - $this->revocationService->shouldReceive('getExceptions')->withNoArgs()->once()->andReturn([]); $this->repository->shouldReceive('update')->with($user->id, [])->once()->andReturnNull(); $response = $service->handle($user, ['root_admin' => true]); @@ -133,6 +121,6 @@ class UserUpdateServiceTest extends TestCase */ private function getService(): UserUpdateService { - return new UserUpdateService($this->hasher, $this->revocationService, $this->repository); + return new UserUpdateService($this->hasher, $this->repository); } }