Skip to content

Commit 536180e

Browse files
committed
Return Http test cases to a passing state
1 parent eaae74f commit 536180e

26 files changed

+140
-1113
lines changed

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

app/Http/Kernel.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
use Pterodactyl\Http\Middleware\Server\AccessingValidServer;
3131
use Pterodactyl\Http\Middleware\Server\AuthenticateAsSubuser;
3232
use Pterodactyl\Http\Middleware\Api\Daemon\DaemonAuthenticate;
33-
use Pterodactyl\Http\Middleware\Server\SubuserBelongsToServer;
3433
use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication;
35-
use Pterodactyl\Http\Middleware\Server\DatabaseBelongsToServer;
36-
use Pterodactyl\Http\Middleware\Server\ScheduleBelongsToServer;
3734
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
3835
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
3936
use Pterodactyl\Http\Middleware\Api\Client\SubstituteClientApiBindings;
@@ -113,14 +110,6 @@ class Kernel extends HttpKernel
113110
'recaptcha' => VerifyReCaptcha::class,
114111
'node.maintenance' => MaintenanceMiddleware::class,
115112

116-
// Server specific middleware (used for authenticating access to resources)
117-
//
118-
// These are only used for individual server authentication, and not global
119-
// actions from other resources. They are defined in the route files.
120-
'server..database' => DatabaseBelongsToServer::class,
121-
'server..subuser' => SubuserBelongsToServer::class,
122-
'server..schedule' => ScheduleBelongsToServer::class,
123-
124113
// API Specific Middleware
125114
'api..key' => AuthenticateKey::class,
126115
];

app/Http/Middleware/Api/Daemon/DaemonAuthenticate.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,24 @@
55
use Closure;
66
use Illuminate\Http\Request;
77
use Illuminate\Contracts\Encryption\Encrypter;
8+
use Pterodactyl\Repositories\Eloquent\NodeRepository;
89
use Symfony\Component\HttpKernel\Exception\HttpException;
9-
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
1010
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
1111
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1212
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
1313

1414
class DaemonAuthenticate
1515
{
1616
/**
17-
* @var \Pterodactyl\Contracts\Repository\NodeRepositoryInterface
17+
* @var \Pterodactyl\Repositories\Eloquent\NodeRepository
1818
*/
1919
private $repository;
2020

21+
/**
22+
* @var \Illuminate\Contracts\Encryption\Encrypter
23+
*/
24+
private $encrypter;
25+
2126
/**
2227
* Daemon routes that this middleware should be skipped on.
2328
*
@@ -27,18 +32,13 @@ class DaemonAuthenticate
2732
'daemon.configuration',
2833
];
2934

30-
/**
31-
* @var \Illuminate\Contracts\Encryption\Encrypter
32-
*/
33-
private $encrypter;
34-
3535
/**
3636
* DaemonAuthenticate constructor.
3737
*
3838
* @param \Illuminate\Contracts\Encryption\Encrypter $encrypter
39-
* @param \Pterodactyl\Contracts\Repository\NodeRepositoryInterface $repository
39+
* @param \Pterodactyl\Repositories\Eloquent\NodeRepository $repository
4040
*/
41-
public function __construct(Encrypter $encrypter, NodeRepositoryInterface $repository)
41+
public function __construct(Encrypter $encrypter, NodeRepository $repository)
4242
{
4343
$this->repository = $repository;
4444
$this->encrypter = $encrypter;

app/Http/Middleware/Server/DatabaseBelongsToServer.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

app/Http/Middleware/Server/ScheduleBelongsToServer.php

Lines changed: 0 additions & 60 deletions
This file was deleted.

app/Http/Middleware/Server/SubuserBelongsToServer.php

Lines changed: 0 additions & 67 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"require-dev": {
4545
"barryvdh/laravel-debugbar": "^3.3",
4646
"barryvdh/laravel-ide-helper": "^2.7",
47-
"codedungeon/phpunit-result-printer": "0.25.1",
47+
"codedungeon/phpunit-result-printer": "^0.28.0",
4848
"friendsofphp/php-cs-fixer": "2.16.1",
4949
"fzaninotto/faker": "^1.9",
5050
"laravel/dusk": "^6.3",

composer.lock

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

database/factories/ModelFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
'disk_overallocate' => 0,
9696
'upload_size' => 100,
9797
'daemon_token_id' => Str::random(Node::DAEMON_TOKEN_ID_LENGTH),
98-
'daemon_token' => Str::random(Node::DAEMON_TOKEN_LENGTH),
98+
'daemon_token' => encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH)),
9999
'daemonListen' => 8080,
100100
'daemonSFTP' => 2022,
101101
'daemonBase' => '/var/lib/pterodactyl/volumes',

0 commit comments

Comments
 (0)